diff --git a/includes/functions.php b/includes/functions.php
index bbf133d5d0..36128e051f 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -1282,16 +1282,7 @@ function set_curl_proxy($curl)
{
global $config;
- $proxy = '';
- if (getenv('http_proxy')) {
- $proxy = getenv('http_proxy');
- } elseif (getenv('https_proxy')) {
- $proxy = getenv('https_proxy');
- } elseif (isset($config['callback_proxy'])) {
- $proxy = $config['callback_proxy'];
- } elseif (isset($config['http_proxy'])) {
- $proxy = $config['http_proxy'];
- }
+ $proxy = get_proxy();
$tmp = rtrim($proxy, "/");
$proxy = str_replace(array("http://", "https://"), "", $tmp);
@@ -1300,6 +1291,25 @@ function set_curl_proxy($curl)
}
}
+/**
+ * Return the proxy url
+ *
+ * @return array|bool|false|string
+ */
+function get_proxy()
+{
+ if (getenv('http_proxy')) {
+ return getenv('http_proxy');
+ } elseif (getenv('https_proxy')) {
+ return getenv('https_proxy');
+ } elseif (isset($config['callback_proxy'])) {
+ return $config['callback_proxy'];
+ } elseif (isset($config['http_proxy'])) {
+ return $config['http_proxy'];
+ }
+ return false;
+}
+
function target_to_id($target)
{
if ($target[0].$target[1] == "g:") {
@@ -2092,3 +2102,83 @@ function update_device_logo(&$device)
echo "Changed Icon! : $icon\n";
}
}
+
+/**
+ * Function to generate PeeringDB Cache
+ */
+function cache_peeringdb()
+{
+ global $config;
+ if ($config['peeringdb']['enabled'] === true) {
+ $peeringdb_url = 'https://peeringdb.com/api';
+ // We cache for 71 hours
+ $cached = dbFetchCell("SELECT count(*) FROM `pdb_ix` WHERE (UNIX_TIMESTAMP() - timestamp) < 255600");
+ if ($cached == 0) {
+ $rand = rand(30, 600);
+ echo "No cached PeeringDB data found, sleeping for $rand seconds" . PHP_EOL;
+ sleep($rand);
+ foreach (dbFetchRows("SELECT `bgpLocalAs` FROM `devices` WHERE `disabled` = 0 AND `ignore` = 0 AND `bgpLocalAs` > 0 AND (`bgpLocalAs` < 64512 OR `bgpLocalAs` > 65535) AND `bgpLocalAs` < 4200000000 GROUP BY `bgpLocalAs`") as $as) {
+ $asn = $as['bgpLocalAs'];
+ $get = Requests::get($peeringdb_url . '/net?depth=2&asn=' . $asn, array(), array('proxy' => get_proxy()));
+ $json_data = $get->body;
+ $data = json_decode($json_data);
+ $ixs = $data->{'data'}{0}->{'netixlan_set'};
+ foreach ($ixs as $ix) {
+ $ixid = $ix->{'ix_id'};
+ $tmp_ix = dbFetchRow("SELECT * FROM `pdb_ix` WHERE `ix_id` = ? AND asn = ?", array($ixid, $asn));
+ if ($tmp_ix) {
+ $pdb_ix_id = $tmp_ix['pdb_ix_id'];
+ $update = array('name' => $ix->{'name'}, 'timestamp' => time());
+ dbUpdate($update, 'pdb_ix', 'ix_id` = ? AND asn = ?', array($ixid, $asn));
+ } else {
+ $insert = array(
+ 'ix_id' => $ixid,
+ 'name' => $ix->{'name'},
+ 'asn' => $asn,
+ 'timestamp' => time()
+ );
+ $pdb_ix_id = dbInsert($insert, 'pdb_ix');
+ }
+ $keep = $pdb_ix_id;
+ $get_ix = Requests::get("$peeringdb_url/netixlan?ix_id=$ixid", array(), array('proxy' => get_proxy()));
+ $ix_json = $get_ix->body;
+ $ix_data = json_decode($ix_json);
+ $peers = $ix_data->{'data'};
+ foreach ($peers as $index => $peer) {
+ $peer_name = get_astext($peer->{'asn'});
+ $tmp_peer = dbFetchRow("SELECT * FROM `pdb_ix_peers` WHERE `peer_id` = ? AND `ix_id` = ?", array($peer->{'id'}, $ixid));
+ if ($tmp_peer) {
+ $peer_keep[] = $tmp_peer['pdb_ix_peers_id'];
+ $update = array(
+ 'remote_asn' => $peer->{'asn'},
+ 'remote_ipaddr4' => $peer->{'ipaddr4'},
+ 'remote_ipaddr6' => $peer->{'ipaddr6'},
+ 'name' => $peer_name,
+ );
+ dbUpdate($update, 'pdb_ix_peers', '`pdb_ix_peers_id` = ?', array($tmp_peer['pdb_ix_peers_id']));
+ } else {
+ $peer_insert = array(
+ 'ix_id' => $ixid,
+ 'peer_id' => $peer->{'id'},
+ 'remote_asn' => $peer->{'asn'},
+ 'remote_ipaddr4' => $peer->{'ipaddr4'},
+ 'remote_ipaddr6' => $peer->{'ipaddr6'},
+ 'name' => $peer_name,
+ 'timestamp' => time()
+ );
+ $peer_keep[] = dbInsert($peer_insert, 'pdb_ix_peers');
+ }
+ }
+ $pdb_ix_peers_ids = implode(',', $peer_keep);
+ dbDelete('pdb_ix_peers', "`pdb_ix_peers_id` NOT IN ($pdb_ix_peers_ids)");
+ }
+ $pdb_ix_ids = implode(',', $keep);
+ dbDelete('pdb_ix', "`pdb_ix_id` NOT IN ($pdb_ix_ids)");
+ }
+ } else {
+ echo "Cached PeeringDB data found....." . PHP_EOL;
+ }
+ } else {
+ echo 'Peering DB integration disabled' . PHP_EOL;
+ }
+}
diff --git a/sql-schema/180.sql b/sql-schema/180.sql
new file mode 100644
index 0000000000..033c612a01
--- /dev/null
+++ b/sql-schema/180.sql
@@ -0,0 +1,3 @@
+INSERT INTO config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('peeringdb.enabled','false','false','Enable PeeringDB lookup (data is downloaded with daily.sh)','external',0,'peeringdb',0,'0','0');
+CREATE TABLE `pdb_ix` ( `pdb_ix_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ix_id` int(10) unsigned NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `asn` int(10) unsigned NOT NULL, `timestamp` int(10) unsigned NOT NULL, PRIMARY KEY (`pdb_ix_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE TABLE `pdb_ix_peers` ( `pdb_ix_peers_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ix_id` int(10) unsigned NOT NULL, `peer_id` int(10) unsigned NOT NULL, `remote_asn` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `remote_ipaddr4` VARCHAR(15) COLLATE utf8_unicode_ci NULL, `remote_ipaddr6` VARCHAR(128) COLLATE utf8_unicode_ci NULL, `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `timestamp` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`pdb_ix_peers_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 196ea7ac36..ab80a025b5 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -2,6 +2,6 @@
// autoload.php @generated by Composer
-require_once __DIR__ . '/composer/autoload_real.php';
+require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit272059f49825f0adab6de160cf59ca72::getLoader();
diff --git a/vendor/bin/parallel-lint b/vendor/bin/parallel-lint
new file mode 120000
index 0000000000..902305e2f8
--- /dev/null
+++ b/vendor/bin/parallel-lint
@@ -0,0 +1 @@
+../jakub-onderka/php-parallel-lint/parallel-lint
\ No newline at end of file
diff --git a/vendor/bin/phpcbf b/vendor/bin/phpcbf
new file mode 120000
index 0000000000..9506967668
--- /dev/null
+++ b/vendor/bin/phpcbf
@@ -0,0 +1 @@
+../squizlabs/php_codesniffer/scripts/phpcbf
\ No newline at end of file
diff --git a/vendor/bin/phpcs b/vendor/bin/phpcs
new file mode 120000
index 0000000000..1be0fae2c2
--- /dev/null
+++ b/vendor/bin/phpcs
@@ -0,0 +1 @@
+../squizlabs/php_codesniffer/scripts/phpcs
\ No newline at end of file
diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit
new file mode 120000
index 0000000000..2c48930310
--- /dev/null
+++ b/vendor/bin/phpunit
@@ -0,0 +1 @@
+../phpunit/phpunit/phpunit
\ No newline at end of file
diff --git a/vendor/bin/readmegen b/vendor/bin/readmegen
new file mode 120000
index 0000000000..df62eb74f4
--- /dev/null
+++ b/vendor/bin/readmegen
@@ -0,0 +1 @@
+../fojuth/readmegen/readmegen
\ No newline at end of file
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index 4626994fd4..ff6ecfb822 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/composer/ClassLoader.php
@@ -53,9 +53,8 @@ class ClassLoader
private $useIncludePath = false;
private $classMap = array();
+
private $classMapAuthoritative = false;
- private $missingClasses = array();
- private $apcuPrefix;
public function getPrefixes()
{
@@ -272,26 +271,6 @@ class ClassLoader
return $this->classMapAuthoritative;
}
- /**
- * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
- *
- * @param string|null $apcuPrefix
- */
- public function setApcuPrefix($apcuPrefix)
- {
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
- }
-
- /**
- * The APCu prefix in use, or null if APCu caching is not enabled.
- *
- * @return string|null
- */
- public function getApcuPrefix()
- {
- return $this->apcuPrefix;
- }
-
/**
* Registers this instance as an autoloader.
*
@@ -334,34 +313,29 @@ class ClassLoader
*/
public function findFile($class)
{
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
+ if ('\\' == $class[0]) {
+ $class = substr($class, 1);
+ }
+
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
- if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ if ($this->classMapAuthoritative) {
return false;
}
- if (null !== $this->apcuPrefix) {
- $file = apcu_fetch($this->apcuPrefix.$class, $hit);
- if ($hit) {
- return $file;
- }
- }
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
- if (false === $file && defined('HHVM_VERSION')) {
+ if ($file === null && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
- if (null !== $this->apcuPrefix) {
- apcu_add($this->apcuPrefix.$class, $file);
- }
-
- if (false === $file) {
+ if ($file === null) {
// Remember that this class does not exist.
- $this->missingClasses[$class] = true;
+ return $this->classMap[$class] = false;
}
return $file;
@@ -425,8 +399,6 @@ class ClassLoader
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
-
- return false;
}
}
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index b37786656a..73a6733334 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -395,16 +395,22 @@ return array(
'LibreNMS\\Exceptions\\HostUnreachablePingException' => $baseDir . '/LibreNMS/Exceptions/HostUnreachablePingException.php',
'LibreNMS\\Exceptions\\HostUnreachableSnmpException' => $baseDir . '/LibreNMS/Exceptions/HostUnreachableSnmpException.php',
'LibreNMS\\Exceptions\\InvalidPortAssocModeException' => $baseDir . '/LibreNMS/Exceptions/InvalidPortAssocModeException.php',
+ 'LibreNMS\\Exceptions\\InvalidRrdTypeException' => $baseDir . '/LibreNMS/Exceptions/InvalidRrdTypeException.php',
'LibreNMS\\Exceptions\\SnmpVersionUnsupportedException' => $baseDir . '/LibreNMS/Exceptions/SnmpVersionUnsupportedException.php',
'LibreNMS\\IRCBot' => $baseDir . '/LibreNMS/IRCBot.php',
'LibreNMS\\ObjectCache' => $baseDir . '/LibreNMS/ObjectCache.php',
'LibreNMS\\Plugins' => $baseDir . '/LibreNMS/Plugins.php',
'LibreNMS\\Proc' => $baseDir . '/LibreNMS/Proc.php',
'LibreNMS\\RRDRecursiveFilterIterator' => $baseDir . '/LibreNMS/RRDRecursiveFilterIterator.php',
+ 'LibreNMS\\RRD\\RrdDefinition' => $baseDir . '/LibreNMS/RRD/RrdDefinition.php',
'LibreNMS\\Tests\\AlertTest' => $baseDir . '/tests/AlertingTest.php',
'LibreNMS\\Tests\\CommonFunctionsTest' => $baseDir . '/tests/CommonFunctionsTest.php',
+ 'LibreNMS\\Tests\\DBSetupTest' => $baseDir . '/tests/DBSetupTest.php',
'LibreNMS\\Tests\\DiscoveryTest' => $baseDir . '/tests/OSDiscoveryTest.php',
+ 'LibreNMS\\Tests\\FunctionsTest' => $baseDir . '/tests/FunctionsTest.php',
+ 'LibreNMS\\Tests\\RrdDefinitionTest' => $baseDir . '/tests/RrdDefinitionTest.php',
'LibreNMS\\Tests\\RrdtoolTest' => $baseDir . '/tests/RrdtoolTest.php',
+ 'LibreNMS\\Tests\\SVGTest' => $baseDir . '/tests/SVGTest.php',
'LibreNMS\\Tests\\SyslogTest' => $baseDir . '/tests/SyslogTest.php',
'LibreNMS\\Tests\\YamlTest' => $baseDir . '/tests/YamlTest.php',
'PDF417' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
@@ -457,6 +463,64 @@ return array(
'PhpAmqpLib\\Wire\\IO\\StreamIO' => $vendorDir . '/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php',
'Phpass\\PasswordHash' => $vendorDir . '/xjtuwangke/passwordhash/src/Phpass/PasswordHash.php',
'QRcode' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
+ 'Requests' => $vendorDir . '/rmccue/requests/library/Requests.php',
+ 'Requests_Auth' => $vendorDir . '/rmccue/requests/library/Requests/Auth.php',
+ 'Requests_Auth_Basic' => $vendorDir . '/rmccue/requests/library/Requests/Auth/Basic.php',
+ 'Requests_Cookie' => $vendorDir . '/rmccue/requests/library/Requests/Cookie.php',
+ 'Requests_Cookie_Jar' => $vendorDir . '/rmccue/requests/library/Requests/Cookie/Jar.php',
+ 'Requests_Exception' => $vendorDir . '/rmccue/requests/library/Requests/Exception.php',
+ 'Requests_Exception_HTTP' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP.php',
+ 'Requests_Exception_HTTP_304' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/304.php',
+ 'Requests_Exception_HTTP_305' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/305.php',
+ 'Requests_Exception_HTTP_306' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/306.php',
+ 'Requests_Exception_HTTP_400' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/400.php',
+ 'Requests_Exception_HTTP_401' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/401.php',
+ 'Requests_Exception_HTTP_402' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/402.php',
+ 'Requests_Exception_HTTP_403' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/403.php',
+ 'Requests_Exception_HTTP_404' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/404.php',
+ 'Requests_Exception_HTTP_405' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/405.php',
+ 'Requests_Exception_HTTP_406' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/406.php',
+ 'Requests_Exception_HTTP_407' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/407.php',
+ 'Requests_Exception_HTTP_408' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/408.php',
+ 'Requests_Exception_HTTP_409' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/409.php',
+ 'Requests_Exception_HTTP_410' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/410.php',
+ 'Requests_Exception_HTTP_411' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/411.php',
+ 'Requests_Exception_HTTP_412' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/412.php',
+ 'Requests_Exception_HTTP_413' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/413.php',
+ 'Requests_Exception_HTTP_414' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/414.php',
+ 'Requests_Exception_HTTP_415' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/415.php',
+ 'Requests_Exception_HTTP_416' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/416.php',
+ 'Requests_Exception_HTTP_417' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/417.php',
+ 'Requests_Exception_HTTP_418' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/418.php',
+ 'Requests_Exception_HTTP_428' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/428.php',
+ 'Requests_Exception_HTTP_429' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/429.php',
+ 'Requests_Exception_HTTP_431' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/431.php',
+ 'Requests_Exception_HTTP_500' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/500.php',
+ 'Requests_Exception_HTTP_501' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/501.php',
+ 'Requests_Exception_HTTP_502' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/502.php',
+ 'Requests_Exception_HTTP_503' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/503.php',
+ 'Requests_Exception_HTTP_504' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/504.php',
+ 'Requests_Exception_HTTP_505' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/505.php',
+ 'Requests_Exception_HTTP_511' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/511.php',
+ 'Requests_Exception_HTTP_Unknown' => $vendorDir . '/rmccue/requests/library/Requests/Exception/HTTP/Unknown.php',
+ 'Requests_Exception_Transport' => $vendorDir . '/rmccue/requests/library/Requests/Exception/Transport.php',
+ 'Requests_Exception_Transport_cURL' => $vendorDir . '/rmccue/requests/library/Requests/Exception/Transport/cURL.php',
+ 'Requests_Hooker' => $vendorDir . '/rmccue/requests/library/Requests/Hooker.php',
+ 'Requests_Hooks' => $vendorDir . '/rmccue/requests/library/Requests/Hooks.php',
+ 'Requests_IDNAEncoder' => $vendorDir . '/rmccue/requests/library/Requests/IDNAEncoder.php',
+ 'Requests_IPv6' => $vendorDir . '/rmccue/requests/library/Requests/IPv6.php',
+ 'Requests_IRI' => $vendorDir . '/rmccue/requests/library/Requests/IRI.php',
+ 'Requests_Proxy' => $vendorDir . '/rmccue/requests/library/Requests/Proxy.php',
+ 'Requests_Proxy_HTTP' => $vendorDir . '/rmccue/requests/library/Requests/Proxy/HTTP.php',
+ 'Requests_Response' => $vendorDir . '/rmccue/requests/library/Requests/Response.php',
+ 'Requests_Response_Headers' => $vendorDir . '/rmccue/requests/library/Requests/Response/Headers.php',
+ 'Requests_SSL' => $vendorDir . '/rmccue/requests/library/Requests/SSL.php',
+ 'Requests_Session' => $vendorDir . '/rmccue/requests/library/Requests/Session.php',
+ 'Requests_Transport' => $vendorDir . '/rmccue/requests/library/Requests/Transport.php',
+ 'Requests_Transport_cURL' => $vendorDir . '/rmccue/requests/library/Requests/Transport/cURL.php',
+ 'Requests_Transport_fsockopen' => $vendorDir . '/rmccue/requests/library/Requests/Transport/fsockopen.php',
+ 'Requests_Utility_CaseInsensitiveDictionary' => $vendorDir . '/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php',
+ 'Requests_Utility_FilteredIterator' => $vendorDir . '/rmccue/requests/library/Requests/Utility/FilteredIterator.php',
'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php',
'SlimFlashTest' => $vendorDir . '/slim/slim/tests/Middleware/FlashTest.php',
'SlimHttpUtilTest' => $vendorDir . '/slim/slim/tests/Http/UtilTest.php',
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
index f15785747c..d75f1eb87c 100644
--- a/vendor/composer/autoload_namespaces.php
+++ b/vendor/composer/autoload_namespaces.php
@@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
return array(
'Slim' => array($vendorDir . '/slim/slim'),
+ 'Requests' => array($vendorDir . '/rmccue/requests/library'),
'Phpass' => array($vendorDir . '/xjtuwangke/passwordhash/src'),
'PhpAmqpLib' => array($vendorDir . '/php-amqplib/php-amqplib'),
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 1477e16b46..a7310a3aed 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -23,7 +23,7 @@ class ComposerAutoloaderInit272059f49825f0adab6de160cf59ca72
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit272059f49825f0adab6de160cf59ca72', 'loadClassLoader'));
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
index f5ce88204c..515775ac76 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -91,6 +91,13 @@ class ComposerStaticInit272059f49825f0adab6de160cf59ca72
0 => __DIR__ . '/..' . '/slim/slim',
),
),
+ 'R' =>
+ array (
+ 'Requests' =>
+ array (
+ 0 => __DIR__ . '/..' . '/rmccue/requests/library',
+ ),
+ ),
'P' =>
array (
'Phpass' =>
@@ -508,16 +515,22 @@ class ComposerStaticInit272059f49825f0adab6de160cf59ca72
'LibreNMS\\Exceptions\\HostUnreachablePingException' => __DIR__ . '/../..' . '/LibreNMS/Exceptions/HostUnreachablePingException.php',
'LibreNMS\\Exceptions\\HostUnreachableSnmpException' => __DIR__ . '/../..' . '/LibreNMS/Exceptions/HostUnreachableSnmpException.php',
'LibreNMS\\Exceptions\\InvalidPortAssocModeException' => __DIR__ . '/../..' . '/LibreNMS/Exceptions/InvalidPortAssocModeException.php',
+ 'LibreNMS\\Exceptions\\InvalidRrdTypeException' => __DIR__ . '/../..' . '/LibreNMS/Exceptions/InvalidRrdTypeException.php',
'LibreNMS\\Exceptions\\SnmpVersionUnsupportedException' => __DIR__ . '/../..' . '/LibreNMS/Exceptions/SnmpVersionUnsupportedException.php',
'LibreNMS\\IRCBot' => __DIR__ . '/../..' . '/LibreNMS/IRCBot.php',
'LibreNMS\\ObjectCache' => __DIR__ . '/../..' . '/LibreNMS/ObjectCache.php',
'LibreNMS\\Plugins' => __DIR__ . '/../..' . '/LibreNMS/Plugins.php',
'LibreNMS\\Proc' => __DIR__ . '/../..' . '/LibreNMS/Proc.php',
'LibreNMS\\RRDRecursiveFilterIterator' => __DIR__ . '/../..' . '/LibreNMS/RRDRecursiveFilterIterator.php',
+ 'LibreNMS\\RRD\\RrdDefinition' => __DIR__ . '/../..' . '/LibreNMS/RRD/RrdDefinition.php',
'LibreNMS\\Tests\\AlertTest' => __DIR__ . '/../..' . '/tests/AlertingTest.php',
'LibreNMS\\Tests\\CommonFunctionsTest' => __DIR__ . '/../..' . '/tests/CommonFunctionsTest.php',
+ 'LibreNMS\\Tests\\DBSetupTest' => __DIR__ . '/../..' . '/tests/DBSetupTest.php',
'LibreNMS\\Tests\\DiscoveryTest' => __DIR__ . '/../..' . '/tests/OSDiscoveryTest.php',
+ 'LibreNMS\\Tests\\FunctionsTest' => __DIR__ . '/../..' . '/tests/FunctionsTest.php',
+ 'LibreNMS\\Tests\\RrdDefinitionTest' => __DIR__ . '/../..' . '/tests/RrdDefinitionTest.php',
'LibreNMS\\Tests\\RrdtoolTest' => __DIR__ . '/../..' . '/tests/RrdtoolTest.php',
+ 'LibreNMS\\Tests\\SVGTest' => __DIR__ . '/../..' . '/tests/SVGTest.php',
'LibreNMS\\Tests\\SyslogTest' => __DIR__ . '/../..' . '/tests/SyslogTest.php',
'LibreNMS\\Tests\\YamlTest' => __DIR__ . '/../..' . '/tests/YamlTest.php',
'PDF417' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
@@ -570,6 +583,64 @@ class ComposerStaticInit272059f49825f0adab6de160cf59ca72
'PhpAmqpLib\\Wire\\IO\\StreamIO' => __DIR__ . '/..' . '/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php',
'Phpass\\PasswordHash' => __DIR__ . '/..' . '/xjtuwangke/passwordhash/src/Phpass/PasswordHash.php',
'QRcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
+ 'Requests' => __DIR__ . '/..' . '/rmccue/requests/library/Requests.php',
+ 'Requests_Auth' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Auth.php',
+ 'Requests_Auth_Basic' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Auth/Basic.php',
+ 'Requests_Cookie' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Cookie.php',
+ 'Requests_Cookie_Jar' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Cookie/Jar.php',
+ 'Requests_Exception' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception.php',
+ 'Requests_Exception_HTTP' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP.php',
+ 'Requests_Exception_HTTP_304' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/304.php',
+ 'Requests_Exception_HTTP_305' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/305.php',
+ 'Requests_Exception_HTTP_306' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/306.php',
+ 'Requests_Exception_HTTP_400' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/400.php',
+ 'Requests_Exception_HTTP_401' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/401.php',
+ 'Requests_Exception_HTTP_402' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/402.php',
+ 'Requests_Exception_HTTP_403' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/403.php',
+ 'Requests_Exception_HTTP_404' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/404.php',
+ 'Requests_Exception_HTTP_405' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/405.php',
+ 'Requests_Exception_HTTP_406' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/406.php',
+ 'Requests_Exception_HTTP_407' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/407.php',
+ 'Requests_Exception_HTTP_408' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/408.php',
+ 'Requests_Exception_HTTP_409' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/409.php',
+ 'Requests_Exception_HTTP_410' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/410.php',
+ 'Requests_Exception_HTTP_411' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/411.php',
+ 'Requests_Exception_HTTP_412' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/412.php',
+ 'Requests_Exception_HTTP_413' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/413.php',
+ 'Requests_Exception_HTTP_414' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/414.php',
+ 'Requests_Exception_HTTP_415' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/415.php',
+ 'Requests_Exception_HTTP_416' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/416.php',
+ 'Requests_Exception_HTTP_417' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/417.php',
+ 'Requests_Exception_HTTP_418' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/418.php',
+ 'Requests_Exception_HTTP_428' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/428.php',
+ 'Requests_Exception_HTTP_429' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/429.php',
+ 'Requests_Exception_HTTP_431' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/431.php',
+ 'Requests_Exception_HTTP_500' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/500.php',
+ 'Requests_Exception_HTTP_501' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/501.php',
+ 'Requests_Exception_HTTP_502' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/502.php',
+ 'Requests_Exception_HTTP_503' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/503.php',
+ 'Requests_Exception_HTTP_504' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/504.php',
+ 'Requests_Exception_HTTP_505' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/505.php',
+ 'Requests_Exception_HTTP_511' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/511.php',
+ 'Requests_Exception_HTTP_Unknown' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/HTTP/Unknown.php',
+ 'Requests_Exception_Transport' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/Transport.php',
+ 'Requests_Exception_Transport_cURL' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Exception/Transport/cURL.php',
+ 'Requests_Hooker' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Hooker.php',
+ 'Requests_Hooks' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Hooks.php',
+ 'Requests_IDNAEncoder' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/IDNAEncoder.php',
+ 'Requests_IPv6' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/IPv6.php',
+ 'Requests_IRI' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/IRI.php',
+ 'Requests_Proxy' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Proxy.php',
+ 'Requests_Proxy_HTTP' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Proxy/HTTP.php',
+ 'Requests_Response' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Response.php',
+ 'Requests_Response_Headers' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Response/Headers.php',
+ 'Requests_SSL' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/SSL.php',
+ 'Requests_Session' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Session.php',
+ 'Requests_Transport' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Transport.php',
+ 'Requests_Transport_cURL' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Transport/cURL.php',
+ 'Requests_Transport_fsockopen' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Transport/fsockopen.php',
+ 'Requests_Utility_CaseInsensitiveDictionary' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Utility/CaseInsensitiveDictionary.php',
+ 'Requests_Utility_FilteredIterator' => __DIR__ . '/..' . '/rmccue/requests/library/Requests/Utility/FilteredIterator.php',
'SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.smtp.php',
'SlimFlashTest' => __DIR__ . '/..' . '/slim/slim/tests/Middleware/FlashTest.php',
'SlimHttpUtilTest' => __DIR__ . '/..' . '/slim/slim/tests/Http/UtilTest.php',
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 3bfd8067a5..8b08800713 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1,50 +1,4 @@
[
- {
- "name": "ezyang/htmlpurifier",
- "version": "v4.8.0",
- "version_normalized": "4.8.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/ezyang/htmlpurifier.git",
- "reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2",
- "reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2",
- "shasum": ""
- },
- "require": {
- "php": ">=5.2"
- },
- "time": "2016-07-16T12:58:58+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "HTMLPurifier": "library/"
- },
- "files": [
- "library/HTMLPurifier.composer.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL"
- ],
- "authors": [
- {
- "name": "Edward Z. Yang",
- "email": "admin@htmlpurifier.org",
- "homepage": "http://ezyang.com"
- }
- ],
- "description": "Standards compliant HTML filter written in PHP",
- "homepage": "http://htmlpurifier.org/",
- "keywords": [
- "html"
- ]
- },
{
"name": "xjtuwangke/passwordhash",
"version": "dev-master",
@@ -63,7 +17,7 @@
"require": {
"php": ">=5.3.3"
},
- "time": "2012-08-31T00:00:00+00:00",
+ "time": "2012-08-31 00:00:00",
"type": "library",
"installation-source": "source",
"autoload": {
@@ -109,7 +63,7 @@
"require": {
"php": ">=5.0.0"
},
- "time": "2012-10-23T11:52:18+00:00",
+ "time": "2012-10-23 11:52:18",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -163,7 +117,7 @@
"suggest": {
"pear/Console_Color2": ">=0.1.2"
},
- "time": "2016-01-21T16:14:31+00:00",
+ "time": "2016-01-21 16:14:31",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -199,54 +153,6 @@
"console"
]
},
- {
- "name": "slim/slim",
- "version": "2.6.2",
- "version_normalized": "2.6.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/slimphp/Slim.git",
- "reference": "20a02782f76830b67ae56a5c08eb1f563c351a37"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/slimphp/Slim/zipball/20a02782f76830b67ae56a5c08eb1f563c351a37",
- "reference": "20a02782f76830b67ae56a5c08eb1f563c351a37",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "suggest": {
- "ext-mcrypt": "Required for HTTP cookie encryption"
- },
- "time": "2015-03-08T18:41:17+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Slim": "."
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Josh Lockhart",
- "email": "info@joshlockhart.com",
- "homepage": "http://www.joshlockhart.com/"
- }
- ],
- "description": "Slim Framework, a PHP micro framework",
- "homepage": "http://github.com/codeguy/Slim",
- "keywords": [
- "microframework",
- "rest",
- "router"
- ]
- },
{
"name": "easybook/geshi",
"version": "v1.0.8.18",
@@ -265,7 +171,7 @@
"require": {
"php": ">4.3.0"
},
- "time": "2016-10-05T07:15:42+00:00",
+ "time": "2016-10-05 07:15:42",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -314,7 +220,7 @@
"ext-gd": "*",
"php": ">=5.3.0"
},
- "time": "2016-03-11T13:58:40+00:00",
+ "time": "2016-03-11 13:58:40",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -360,7 +266,7 @@
"require": {
"php": ">=5.3.0"
},
- "time": "2015-09-12T10:08:34+00:00",
+ "time": "2015-09-12 10:08:34",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -407,58 +313,6 @@
"qrcode"
]
},
- {
- "name": "dapphp/radius",
- "version": "2.5.0",
- "version_normalized": "2.5.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/dapphp/radius.git",
- "reference": "72df4f8dc82281e7364b23212bbf16df6232151e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/dapphp/radius/zipball/72df4f8dc82281e7364b23212bbf16df6232151e",
- "reference": "72df4f8dc82281e7364b23212bbf16df6232151e",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "require-dev": {
- "phpunit/phpunit": "dev-master"
- },
- "time": "2016-08-01T23:26:47+00:00",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Dapphp\\Radius\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-3.0"
- ],
- "authors": [
- {
- "name": "Drew Phillips",
- "email": "drew@drew-phillips.com",
- "homepage": "https://drew-phillips.com/"
- },
- {
- "name": "SysCo/al",
- "homepage": "http://developer.sysco.ch/php/"
- }
- ],
- "description": "A pure PHP RADIUS client based on the SysCo/al implementation",
- "homepage": "https://github.com/dapphp/radius",
- "keywords": [
- "Authentication",
- "authorization",
- "radius"
- ]
- },
{
"name": "php-amqplib/php-amqplib",
"version": "v2.0.2",
@@ -477,7 +331,7 @@
"require": {
"php": ">=5.3.0"
},
- "time": "2013-02-13T19:43:51+00:00",
+ "time": "2013-02-13 19:43:51",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -503,69 +357,67 @@
]
},
{
- "name": "symfony/yaml",
- "version": "v2.8.15",
- "version_normalized": "2.8.15.0",
+ "name": "ezyang/htmlpurifier",
+ "version": "v4.9.2",
+ "version_normalized": "4.9.2.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/yaml.git",
- "reference": "befb26a3713c97af90d25dd12e75621ef14d91ff"
+ "url": "https://github.com/ezyang/htmlpurifier.git",
+ "reference": "6d50e5282afdfdfc3e0ff6d192aff56c5629b3d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/befb26a3713c97af90d25dd12e75621ef14d91ff",
- "reference": "befb26a3713c97af90d25dd12e75621ef14d91ff",
+ "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6d50e5282afdfdfc3e0ff6d192aff56c5629b3d4",
+ "reference": "6d50e5282afdfdfc3e0ff6d192aff56c5629b3d4",
"shasum": ""
},
"require": {
- "php": ">=5.3.9"
+ "php": ">=5.2"
},
- "time": "2016-11-14T16:15:57+00:00",
+ "require-dev": {
+ "simpletest/simpletest": "^1.1"
+ },
+ "time": "2017-03-13 06:30:53",
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.8-dev"
- }
- },
"installation-source": "dist",
"autoload": {
- "psr-4": {
- "Symfony\\Component\\Yaml\\": ""
+ "psr-0": {
+ "HTMLPurifier": "library/"
},
- "exclude-from-classmap": [
- "/Tests/"
+ "files": [
+ "library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
+ "LGPL"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
+ "name": "Edward Z. Yang",
+ "email": "admin@htmlpurifier.org",
+ "homepage": "http://ezyang.com"
}
],
- "description": "Symfony Yaml Component",
- "homepage": "https://symfony.com"
+ "description": "Standards compliant HTML filter written in PHP",
+ "homepage": "http://htmlpurifier.org/",
+ "keywords": [
+ "html"
+ ]
},
{
"name": "phpmailer/phpmailer",
- "version": "v5.2.21",
- "version_normalized": "5.2.21.0",
+ "version": "v5.2.22",
+ "version_normalized": "5.2.22.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
- "reference": "1d51856b76c06fc687fcd9180efa7a0bed0d761e"
+ "reference": "b18cb98131bd83103ccb26a888fdfe3177b8a663"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/1d51856b76c06fc687fcd9180efa7a0bed0d761e",
- "reference": "1d51856b76c06fc687fcd9180efa7a0bed0d761e",
+ "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/b18cb98131bd83103ccb26a888fdfe3177b8a663",
+ "reference": "b18cb98131bd83103ccb26a888fdfe3177b8a663",
"shasum": ""
},
"require": {
@@ -578,7 +430,7 @@
"suggest": {
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
},
- "time": "2016-12-28T15:35:48+00:00",
+ "time": "2017-01-09 09:33:47",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -614,5 +466,220 @@
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP"
+ },
+ {
+ "name": "slim/slim",
+ "version": "2.6.3",
+ "version_normalized": "2.6.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/slimphp/Slim.git",
+ "reference": "9224ed81ac1c412881e8d762755e3d76ebf580c0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/slimphp/Slim/zipball/9224ed81ac1c412881e8d762755e3d76ebf580c0",
+ "reference": "9224ed81ac1c412881e8d762755e3d76ebf580c0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "suggest": {
+ "ext-mcrypt": "Required for HTTP cookie encryption",
+ "phpseclib/mcrypt_compat": "Polyfil for mcrypt extension"
+ },
+ "time": "2017-01-07 12:21:41",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Slim": "."
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Josh Lockhart",
+ "email": "info@joshlockhart.com",
+ "homepage": "http://www.joshlockhart.com/"
+ }
+ ],
+ "description": "Slim Framework, a PHP micro framework",
+ "homepage": "http://github.com/codeguy/Slim",
+ "keywords": [
+ "microframework",
+ "rest",
+ "router"
+ ]
+ },
+ {
+ "name": "dapphp/radius",
+ "version": "2.5.1",
+ "version_normalized": "2.5.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dapphp/radius.git",
+ "reference": "ede9a0a63dc806eca63d3b166f3897bfdf53a026"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dapphp/radius/zipball/ede9a0a63dc806eca63d3b166f3897bfdf53a026",
+ "reference": "ede9a0a63dc806eca63d3b166f3897bfdf53a026",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "dev-master"
+ },
+ "suggest": {
+ "ext-mcrypt": "*"
+ },
+ "time": "2017-02-02 00:42:55",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Dapphp\\Radius\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Drew Phillips",
+ "email": "drew@drew-phillips.com",
+ "homepage": "https://drew-phillips.com/"
+ },
+ {
+ "name": "SysCo/al",
+ "homepage": "http://developer.sysco.ch/php/"
+ }
+ ],
+ "description": "A pure PHP RADIUS client based on the SysCo/al implementation",
+ "homepage": "https://github.com/dapphp/radius",
+ "keywords": [
+ "Authentication",
+ "authorization",
+ "chap",
+ "ms-chap",
+ "ms-chap v2",
+ "pap",
+ "radius",
+ "rfc1994",
+ "rfc2284",
+ "rfc2759",
+ "rfc2865",
+ "rfc2869"
+ ]
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v2.8.18",
+ "version_normalized": "2.8.18.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d",
+ "reference": "2a7bab3c16f6f452c47818fdd08f3b1e49ffcf7d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "time": "2017-03-01 18:13:50",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com"
+ },
+ {
+ "name": "rmccue/requests",
+ "version": "v1.7.0",
+ "version_normalized": "1.7.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/rmccue/Requests.git",
+ "reference": "87932f52ffad70504d93f04f15690cf16a089546"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546",
+ "reference": "87932f52ffad70504d93f04f15690cf16a089546",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2"
+ },
+ "require-dev": {
+ "requests/test-server": "dev-master"
+ },
+ "time": "2016-10-13 00:11:37",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Requests": "library/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "ISC"
+ ],
+ "authors": [
+ {
+ "name": "Ryan McCue",
+ "homepage": "http://ryanmccue.info"
+ }
+ ],
+ "description": "A HTTP library written in PHP, for human beings.",
+ "homepage": "http://github.com/rmccue/Requests",
+ "keywords": [
+ "curl",
+ "fsockopen",
+ "http",
+ "idna",
+ "ipv6",
+ "iri",
+ "sockets"
+ ]
}
]
diff --git a/vendor/doctrine/instantiator/.gitignore b/vendor/doctrine/instantiator/.gitignore
new file mode 100644
index 0000000000..e3e368dd9d
--- /dev/null
+++ b/vendor/doctrine/instantiator/.gitignore
@@ -0,0 +1,5 @@
+phpunit.xml
+composer.lock
+build
+vendor
+coverage.clover
diff --git a/vendor/doctrine/instantiator/.scrutinizer.yml b/vendor/doctrine/instantiator/.scrutinizer.yml
new file mode 100644
index 0000000000..aad5e40391
--- /dev/null
+++ b/vendor/doctrine/instantiator/.scrutinizer.yml
@@ -0,0 +1,46 @@
+before_commands:
+ - "composer install --prefer-source"
+
+tools:
+ external_code_coverage:
+ timeout: 600
+ php_code_coverage:
+ enabled: true
+ test_command: ./vendor/bin/phpunit
+ php_code_sniffer:
+ enabled: true
+ config:
+ standard: PSR2
+ filter:
+ paths: ["src/*", "tests/*"]
+ php_cpd:
+ enabled: true
+ excluded_dirs: ["build/*", "tests", "vendor"]
+ php_cs_fixer:
+ enabled: true
+ config:
+ level: all
+ filter:
+ paths: ["src/*", "tests/*"]
+ php_loc:
+ enabled: true
+ excluded_dirs: ["build", "tests", "vendor"]
+ php_mess_detector:
+ enabled: true
+ config:
+ ruleset: phpmd.xml.dist
+ design_rules: { eval_expression: false }
+ filter:
+ paths: ["src/*"]
+ php_pdepend:
+ enabled: true
+ excluded_dirs: ["build", "tests", "vendor"]
+ php_analyzer:
+ enabled: true
+ filter:
+ paths: ["src/*", "tests/*"]
+ php_hhvm:
+ enabled: true
+ filter:
+ paths: ["src/*", "tests/*"]
+ sensiolabs_security_checker: true
diff --git a/vendor/doctrine/instantiator/.travis.install.sh b/vendor/doctrine/instantiator/.travis.install.sh
new file mode 100755
index 0000000000..2819188c93
--- /dev/null
+++ b/vendor/doctrine/instantiator/.travis.install.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -x
+if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] || [ "$TRAVIS_PHP_VERSION" = 'hhvm-nightly' ] ; then
+ curl -sS https://getcomposer.org/installer > composer-installer.php
+ hhvm composer-installer.php
+ hhvm -v ResourceLimit.SocketDefaultTimeout=30 -v Http.SlowQueryThreshold=30000 composer.phar update --prefer-source
+elif [ "$TRAVIS_PHP_VERSION" = '5.3.3' ] ; then
+ composer self-update
+ composer update --prefer-source --no-dev
+ composer dump-autoload
+else
+ composer self-update
+ composer update --prefer-source
+fi
diff --git a/vendor/doctrine/instantiator/.travis.yml b/vendor/doctrine/instantiator/.travis.yml
new file mode 100644
index 0000000000..7f1ec5f98d
--- /dev/null
+++ b/vendor/doctrine/instantiator/.travis.yml
@@ -0,0 +1,22 @@
+language: php
+
+php:
+ - 5.3.3
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - hhvm
+
+before_script:
+ - ./.travis.install.sh
+ - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then PHPUNIT_FLAGS="--coverage-clover coverage.clover"; else PHPUNIT_FLAGS=""; fi
+
+script:
+ - if [ $TRAVIS_PHP_VERSION = '5.3.3' ]; then phpunit; fi
+ - if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpunit $PHPUNIT_FLAGS; fi
+ - if [ $TRAVIS_PHP_VERSION != '5.3.3' ]; then ./vendor/bin/phpcs --standard=PSR2 ./src/ ./tests/; fi
+ - if [[ $TRAVIS_PHP_VERSION != '5.3.3' && $TRAVIS_PHP_VERSION != '5.4.29' && $TRAVIS_PHP_VERSION != '5.5.13' ]]; then php -n ./vendor/bin/athletic -p ./tests/DoctrineTest/InstantiatorPerformance/ -f GroupedFormatter; fi
+
+after_script:
+ - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
diff --git a/vendor/doctrine/instantiator/CONTRIBUTING.md b/vendor/doctrine/instantiator/CONTRIBUTING.md
new file mode 100644
index 0000000000..75b84b2aa2
--- /dev/null
+++ b/vendor/doctrine/instantiator/CONTRIBUTING.md
@@ -0,0 +1,35 @@
+# Contributing
+
+ * Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
+ * The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php)
+ * Any contribution must provide tests for additional introduced conditions
+ * Any un-confirmed issue needs a failing test case before being accepted
+ * Pull requests must be sent from a new hotfix/feature branch, not from `master`.
+
+## Installation
+
+To install the project and run the tests, you need to clone it first:
+
+```sh
+$ git clone git://github.com/doctrine/instantiator.git
+```
+
+You will then need to run a composer installation:
+
+```sh
+$ cd Instantiator
+$ curl -s https://getcomposer.org/installer | php
+$ php composer.phar update
+```
+
+## Testing
+
+The PHPUnit version to be used is the one installed as a dev- dependency via composer:
+
+```sh
+$ ./vendor/bin/phpunit
+```
+
+Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement
+won't be merged.
+
diff --git a/vendor/doctrine/instantiator/LICENSE b/vendor/doctrine/instantiator/LICENSE
new file mode 100644
index 0000000000..4d983d1ac7
--- /dev/null
+++ b/vendor/doctrine/instantiator/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Doctrine Project
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vendor/doctrine/instantiator/README.md b/vendor/doctrine/instantiator/README.md
new file mode 100644
index 0000000000..393ec7caaf
--- /dev/null
+++ b/vendor/doctrine/instantiator/README.md
@@ -0,0 +1,40 @@
+# Instantiator
+
+This library provides a way of avoiding usage of constructors when instantiating PHP classes.
+
+[](https://travis-ci.org/doctrine/instantiator)
+[](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master)
+[](https://scrutinizer-ci.com/g/doctrine/instantiator/?branch=master)
+[](https://www.versioneye.com/package/php--doctrine--instantiator)
+[](http://hhvm.h4cc.de/package/doctrine/instantiator)
+
+[](https://packagist.org/packages/doctrine/instantiator)
+[](https://packagist.org/packages/doctrine/instantiator)
+
+## Installation
+
+The suggested installation method is via [composer](https://getcomposer.org/):
+
+```sh
+php composer.phar require "doctrine/instantiator:~1.0.3"
+```
+
+## Usage
+
+The instantiator is able to create new instances of any class without using the constructor or any API of the class
+itself:
+
+```php
+$instantiator = new \Doctrine\Instantiator\Instantiator();
+
+$instance = $instantiator->instantiate('My\\ClassName\\Here');
+```
+
+## Contributing
+
+Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out!
+
+## Credits
+
+This library was migrated from [ocramius/instantiator](https://github.com/Ocramius/Instantiator), which
+has been donated to the doctrine organization, and which is now deprecated in favour of this package.
diff --git a/vendor/doctrine/instantiator/composer.json b/vendor/doctrine/instantiator/composer.json
new file mode 100644
index 0000000000..4823890b4c
--- /dev/null
+++ b/vendor/doctrine/instantiator/composer.json
@@ -0,0 +1,45 @@
+{
+ "name": "doctrine/instantiator",
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "type": "library",
+ "license": "MIT",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "instantiate",
+ "constructor"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "require": {
+ "php": ">=5.3,<8.0-DEV"
+ },
+ "require-dev": {
+ "ext-phar": "*",
+ "ext-pdo": "*",
+ "phpunit/phpunit": "~4.0",
+ "squizlabs/php_codesniffer": "~2.0",
+ "athletic/athletic": "~0.1.8"
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "autoload-dev": {
+ "psr-0": {
+ "DoctrineTest\\InstantiatorPerformance\\": "tests",
+ "DoctrineTest\\InstantiatorTest\\": "tests",
+ "DoctrineTest\\InstantiatorTestAsset\\": "tests"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/vendor/doctrine/instantiator/phpmd.xml.dist b/vendor/doctrine/instantiator/phpmd.xml.dist
new file mode 100644
index 0000000000..8254105627
--- /dev/null
+++ b/vendor/doctrine/instantiator/phpmd.xml.dist
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/doctrine/instantiator/phpunit.xml.dist b/vendor/doctrine/instantiator/phpunit.xml.dist
new file mode 100644
index 0000000000..0a8d5709b7
--- /dev/null
+++ b/vendor/doctrine/instantiator/phpunit.xml.dist
@@ -0,0 +1,22 @@
+
+
+
+ ./tests/DoctrineTest/InstantiatorTest
+
+
+
+ ./src
+
+
+
diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php
new file mode 100644
index 0000000000..3065375a8c
--- /dev/null
+++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/ExceptionInterface.php
@@ -0,0 +1,29 @@
+.
+ */
+
+namespace Doctrine\Instantiator\Exception;
+
+/**
+ * Base exception marker interface for the instantiator component
+ *
+ * @author Marco Pivetta
+ */
+interface ExceptionInterface
+{
+}
diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php
new file mode 100644
index 0000000000..ea8d28c5c5
--- /dev/null
+++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php
@@ -0,0 +1,62 @@
+.
+ */
+
+namespace Doctrine\Instantiator\Exception;
+
+use InvalidArgumentException as BaseInvalidArgumentException;
+use ReflectionClass;
+
+/**
+ * Exception for invalid arguments provided to the instantiator
+ *
+ * @author Marco Pivetta
+ */
+class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface
+{
+ /**
+ * @param string $className
+ *
+ * @return self
+ */
+ public static function fromNonExistingClass($className)
+ {
+ if (interface_exists($className)) {
+ return new self(sprintf('The provided type "%s" is an interface, and can not be instantiated', $className));
+ }
+
+ if (PHP_VERSION_ID >= 50400 && trait_exists($className)) {
+ return new self(sprintf('The provided type "%s" is a trait, and can not be instantiated', $className));
+ }
+
+ return new self(sprintf('The provided class "%s" does not exist', $className));
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return self
+ */
+ public static function fromAbstractClass(ReflectionClass $reflectionClass)
+ {
+ return new self(sprintf(
+ 'The provided class "%s" is abstract, and can not be instantiated',
+ $reflectionClass->getName()
+ ));
+ }
+}
diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php
new file mode 100644
index 0000000000..1681e56e88
--- /dev/null
+++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php
@@ -0,0 +1,79 @@
+.
+ */
+
+namespace Doctrine\Instantiator\Exception;
+
+use Exception;
+use ReflectionClass;
+use UnexpectedValueException as BaseUnexpectedValueException;
+
+/**
+ * Exception for given parameters causing invalid/unexpected state on instantiation
+ *
+ * @author Marco Pivetta
+ */
+class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface
+{
+ /**
+ * @param ReflectionClass $reflectionClass
+ * @param Exception $exception
+ *
+ * @return self
+ */
+ public static function fromSerializationTriggeredException(ReflectionClass $reflectionClass, Exception $exception)
+ {
+ return new self(
+ sprintf(
+ 'An exception was raised while trying to instantiate an instance of "%s" via un-serialization',
+ $reflectionClass->getName()
+ ),
+ 0,
+ $exception
+ );
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ * @param string $errorString
+ * @param int $errorCode
+ * @param string $errorFile
+ * @param int $errorLine
+ *
+ * @return UnexpectedValueException
+ */
+ public static function fromUncleanUnSerialization(
+ ReflectionClass $reflectionClass,
+ $errorString,
+ $errorCode,
+ $errorFile,
+ $errorLine
+ ) {
+ return new self(
+ sprintf(
+ 'Could not produce an instance of "%s" via un-serialization, since an error was triggered '
+ . 'in file "%s" at line "%d"',
+ $reflectionClass->getName(),
+ $errorFile,
+ $errorLine
+ ),
+ 0,
+ new Exception($errorString, $errorCode)
+ );
+ }
+}
diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
new file mode 100644
index 0000000000..6d5b3b6567
--- /dev/null
+++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php
@@ -0,0 +1,273 @@
+.
+ */
+
+namespace Doctrine\Instantiator;
+
+use Closure;
+use Doctrine\Instantiator\Exception\InvalidArgumentException;
+use Doctrine\Instantiator\Exception\UnexpectedValueException;
+use Exception;
+use ReflectionClass;
+
+/**
+ * {@inheritDoc}
+ *
+ * @author Marco Pivetta
+ */
+final class Instantiator implements InstantiatorInterface
+{
+ /**
+ * Markers used internally by PHP to define whether {@see \unserialize} should invoke
+ * the method {@see \Serializable::unserialize()} when dealing with classes implementing
+ * the {@see \Serializable} interface.
+ */
+ const SERIALIZATION_FORMAT_USE_UNSERIALIZER = 'C';
+ const SERIALIZATION_FORMAT_AVOID_UNSERIALIZER = 'O';
+
+ /**
+ * @var \Closure[] of {@see \Closure} instances used to instantiate specific classes
+ */
+ private static $cachedInstantiators = array();
+
+ /**
+ * @var object[] of objects that can directly be cloned
+ */
+ private static $cachedCloneables = array();
+
+ /**
+ * {@inheritDoc}
+ */
+ public function instantiate($className)
+ {
+ if (isset(self::$cachedCloneables[$className])) {
+ return clone self::$cachedCloneables[$className];
+ }
+
+ if (isset(self::$cachedInstantiators[$className])) {
+ $factory = self::$cachedInstantiators[$className];
+
+ return $factory();
+ }
+
+ return $this->buildAndCacheFromFactory($className);
+ }
+
+ /**
+ * Builds the requested object and caches it in static properties for performance
+ *
+ * @param string $className
+ *
+ * @return object
+ */
+ private function buildAndCacheFromFactory($className)
+ {
+ $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className);
+ $instance = $factory();
+
+ if ($this->isSafeToClone(new ReflectionClass($instance))) {
+ self::$cachedCloneables[$className] = clone $instance;
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Builds a {@see \Closure} capable of instantiating the given $className without
+ * invoking its constructor.
+ *
+ * @param string $className
+ *
+ * @return Closure
+ */
+ private function buildFactory($className)
+ {
+ $reflectionClass = $this->getReflectionClass($className);
+
+ if ($this->isInstantiableViaReflection($reflectionClass)) {
+ return function () use ($reflectionClass) {
+ return $reflectionClass->newInstanceWithoutConstructor();
+ };
+ }
+
+ $serializedString = sprintf(
+ '%s:%d:"%s":0:{}',
+ $this->getSerializationFormat($reflectionClass),
+ strlen($className),
+ $className
+ );
+
+ $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString);
+
+ return function () use ($serializedString) {
+ return unserialize($serializedString);
+ };
+ }
+
+ /**
+ * @param string $className
+ *
+ * @return ReflectionClass
+ *
+ * @throws InvalidArgumentException
+ */
+ private function getReflectionClass($className)
+ {
+ if (! class_exists($className)) {
+ throw InvalidArgumentException::fromNonExistingClass($className);
+ }
+
+ $reflection = new ReflectionClass($className);
+
+ if ($reflection->isAbstract()) {
+ throw InvalidArgumentException::fromAbstractClass($reflection);
+ }
+
+ return $reflection;
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ * @param string $serializedString
+ *
+ * @throws UnexpectedValueException
+ *
+ * @return void
+ */
+ private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, $serializedString)
+ {
+ set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) {
+ $error = UnexpectedValueException::fromUncleanUnSerialization(
+ $reflectionClass,
+ $message,
+ $code,
+ $file,
+ $line
+ );
+ });
+
+ $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString);
+
+ restore_error_handler();
+
+ if ($error) {
+ throw $error;
+ }
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ * @param string $serializedString
+ *
+ * @throws UnexpectedValueException
+ *
+ * @return void
+ */
+ private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString)
+ {
+ try {
+ unserialize($serializedString);
+ } catch (Exception $exception) {
+ restore_error_handler();
+
+ throw UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $exception);
+ }
+ }
+
+ /**
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return bool
+ */
+ private function isInstantiableViaReflection(ReflectionClass $reflectionClass)
+ {
+ if (\PHP_VERSION_ID >= 50600) {
+ return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal());
+ }
+
+ return \PHP_VERSION_ID >= 50400 && ! $this->hasInternalAncestors($reflectionClass);
+ }
+
+ /**
+ * Verifies whether the given class is to be considered internal
+ *
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return bool
+ */
+ private function hasInternalAncestors(ReflectionClass $reflectionClass)
+ {
+ do {
+ if ($reflectionClass->isInternal()) {
+ return true;
+ }
+ } while ($reflectionClass = $reflectionClass->getParentClass());
+
+ return false;
+ }
+
+ /**
+ * Verifies if the given PHP version implements the `Serializable` interface serialization
+ * with an incompatible serialization format. If that's the case, use serialization marker
+ * "C" instead of "O".
+ *
+ * @link http://news.php.net/php.internals/74654
+ *
+ * @param ReflectionClass $reflectionClass
+ *
+ * @return string the serialization format marker, either self::SERIALIZATION_FORMAT_USE_UNSERIALIZER
+ * or self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER
+ */
+ private function getSerializationFormat(ReflectionClass $reflectionClass)
+ {
+ if ($this->isPhpVersionWithBrokenSerializationFormat()
+ && $reflectionClass->implementsInterface('Serializable')
+ ) {
+ return self::SERIALIZATION_FORMAT_USE_UNSERIALIZER;
+ }
+
+ return self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER;
+ }
+
+ /**
+ * Checks whether the current PHP runtime uses an incompatible serialization format
+ *
+ * @return bool
+ */
+ private function isPhpVersionWithBrokenSerializationFormat()
+ {
+ return PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513;
+ }
+
+ /**
+ * Checks if a class is cloneable
+ *
+ * @param ReflectionClass $reflection
+ *
+ * @return bool
+ */
+ private function isSafeToClone(ReflectionClass $reflection)
+ {
+ if (method_exists($reflection, 'isCloneable') && ! $reflection->isCloneable()) {
+ return false;
+ }
+
+ // not cloneable if it implements `__clone`, as we want to avoid calling it
+ return ! $reflection->hasMethod('__clone');
+ }
+}
diff --git a/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php
new file mode 100644
index 0000000000..b665bea854
--- /dev/null
+++ b/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php
@@ -0,0 +1,37 @@
+.
+ */
+
+namespace Doctrine\Instantiator;
+
+/**
+ * Instantiator provides utility methods to build objects without invoking their constructors
+ *
+ * @author Marco Pivetta
+ */
+interface InstantiatorInterface
+{
+ /**
+ * @param string $className
+ *
+ * @return object
+ *
+ * @throws \Doctrine\Instantiator\Exception\ExceptionInterface
+ */
+ public function instantiate($className);
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php
new file mode 100644
index 0000000000..3e8fc6ff43
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorPerformance/InstantiatorPerformanceEvent.php
@@ -0,0 +1,96 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorPerformance;
+
+use Athletic\AthleticEvent;
+use Doctrine\Instantiator\Instantiator;
+
+/**
+ * Performance tests for {@see \Doctrine\Instantiator\Instantiator}
+ *
+ * @author Marco Pivetta
+ */
+class InstantiatorPerformanceEvent extends AthleticEvent
+{
+ /**
+ * @var \Doctrine\Instantiator\Instantiator
+ */
+ private $instantiator;
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function setUp()
+ {
+ $this->instantiator = new Instantiator();
+
+ $this->instantiator->instantiate(__CLASS__);
+ $this->instantiator->instantiate('ArrayObject');
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset');
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset');
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset');
+ }
+
+ /**
+ * @iterations 20000
+ * @baseline
+ * @group instantiation
+ */
+ public function testInstantiateSelf()
+ {
+ $this->instantiator->instantiate(__CLASS__);
+ }
+
+ /**
+ * @iterations 20000
+ * @group instantiation
+ */
+ public function testInstantiateInternalClass()
+ {
+ $this->instantiator->instantiate('ArrayObject');
+ }
+
+ /**
+ * @iterations 20000
+ * @group instantiation
+ */
+ public function testInstantiateSimpleSerializableAssetClass()
+ {
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset');
+ }
+
+ /**
+ * @iterations 20000
+ * @group instantiation
+ */
+ public function testInstantiateSerializableArrayObjectAsset()
+ {
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset');
+ }
+
+ /**
+ * @iterations 20000
+ * @group instantiation
+ */
+ public function testInstantiateUnCloneableAsset()
+ {
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php
new file mode 100644
index 0000000000..39d9b94dfa
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/InvalidArgumentExceptionTest.php
@@ -0,0 +1,83 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTest\Exception;
+
+use Doctrine\Instantiator\Exception\InvalidArgumentException;
+use PHPUnit_Framework_TestCase;
+use ReflectionClass;
+
+/**
+ * Tests for {@see \Doctrine\Instantiator\Exception\InvalidArgumentException}
+ *
+ * @author Marco Pivetta
+ *
+ * @covers \Doctrine\Instantiator\Exception\InvalidArgumentException
+ */
+class InvalidArgumentExceptionTest extends PHPUnit_Framework_TestCase
+{
+ public function testFromNonExistingTypeWithNonExistingClass()
+ {
+ $className = __CLASS__ . uniqid();
+ $exception = InvalidArgumentException::fromNonExistingClass($className);
+
+ $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\InvalidArgumentException', $exception);
+ $this->assertSame('The provided class "' . $className . '" does not exist', $exception->getMessage());
+ }
+
+ public function testFromNonExistingTypeWithTrait()
+ {
+ if (PHP_VERSION_ID < 50400) {
+ $this->markTestSkipped('Need at least PHP 5.4.0, as this test requires traits support to run');
+ }
+
+ $exception = InvalidArgumentException::fromNonExistingClass(
+ 'DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset'
+ );
+
+ $this->assertSame(
+ 'The provided type "DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset" is a trait, '
+ . 'and can not be instantiated',
+ $exception->getMessage()
+ );
+ }
+
+ public function testFromNonExistingTypeWithInterface()
+ {
+ $exception = InvalidArgumentException::fromNonExistingClass('Doctrine\\Instantiator\\InstantiatorInterface');
+
+ $this->assertSame(
+ 'The provided type "Doctrine\\Instantiator\\InstantiatorInterface" is an interface, '
+ . 'and can not be instantiated',
+ $exception->getMessage()
+ );
+ }
+
+ public function testFromAbstractClass()
+ {
+ $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
+ $exception = InvalidArgumentException::fromAbstractClass($reflection);
+
+ $this->assertSame(
+ 'The provided class "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" is abstract, '
+ . 'and can not be instantiated',
+ $exception->getMessage()
+ );
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php
new file mode 100644
index 0000000000..84154e7397
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/Exception/UnexpectedValueExceptionTest.php
@@ -0,0 +1,69 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTest\Exception;
+
+use Doctrine\Instantiator\Exception\UnexpectedValueException;
+use Exception;
+use PHPUnit_Framework_TestCase;
+use ReflectionClass;
+
+/**
+ * Tests for {@see \Doctrine\Instantiator\Exception\UnexpectedValueException}
+ *
+ * @author Marco Pivetta
+ *
+ * @covers \Doctrine\Instantiator\Exception\UnexpectedValueException
+ */
+class UnexpectedValueExceptionTest extends PHPUnit_Framework_TestCase
+{
+ public function testFromSerializationTriggeredException()
+ {
+ $reflectionClass = new ReflectionClass($this);
+ $previous = new Exception();
+ $exception = UnexpectedValueException::fromSerializationTriggeredException($reflectionClass, $previous);
+
+ $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
+ $this->assertSame($previous, $exception->getPrevious());
+ $this->assertSame(
+ 'An exception was raised while trying to instantiate an instance of "'
+ . __CLASS__ . '" via un-serialization',
+ $exception->getMessage()
+ );
+ }
+
+ public function testFromUncleanUnSerialization()
+ {
+ $reflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset');
+ $exception = UnexpectedValueException::fromUncleanUnSerialization($reflection, 'foo', 123, 'bar', 456);
+
+ $this->assertInstanceOf('Doctrine\\Instantiator\\Exception\\UnexpectedValueException', $exception);
+ $this->assertSame(
+ 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset" '
+ . 'via un-serialization, since an error was triggered in file "bar" at line "456"',
+ $exception->getMessage()
+ );
+
+ $previous = $exception->getPrevious();
+
+ $this->assertInstanceOf('Exception', $previous);
+ $this->assertSame('foo', $previous->getMessage());
+ $this->assertSame(123, $previous->getCode());
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php
new file mode 100644
index 0000000000..0a2cb9313d
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php
@@ -0,0 +1,219 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTest;
+
+use Doctrine\Instantiator\Exception\UnexpectedValueException;
+use Doctrine\Instantiator\Instantiator;
+use PHPUnit_Framework_TestCase;
+use ReflectionClass;
+
+/**
+ * Tests for {@see \Doctrine\Instantiator\Instantiator}
+ *
+ * @author Marco Pivetta
+ *
+ * @covers \Doctrine\Instantiator\Instantiator
+ */
+class InstantiatorTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Instantiator
+ */
+ private $instantiator;
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function setUp()
+ {
+ $this->instantiator = new Instantiator();
+ }
+
+ /**
+ * @param string $className
+ *
+ * @dataProvider getInstantiableClasses
+ */
+ public function testCanInstantiate($className)
+ {
+ $this->assertInstanceOf($className, $this->instantiator->instantiate($className));
+ }
+
+ /**
+ * @param string $className
+ *
+ * @dataProvider getInstantiableClasses
+ */
+ public function testInstantiatesSeparateInstances($className)
+ {
+ $instance1 = $this->instantiator->instantiate($className);
+ $instance2 = $this->instantiator->instantiate($className);
+
+ $this->assertEquals($instance1, $instance2);
+ $this->assertNotSame($instance1, $instance2);
+ }
+
+ public function testExceptionOnUnSerializationException()
+ {
+ if (defined('HHVM_VERSION')) {
+ $this->markTestSkipped(
+ 'As of facebook/hhvm#3432, HHVM has no PDORow, and therefore '
+ . ' no internal final classes that cannot be instantiated'
+ );
+ }
+
+ $className = 'DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset';
+
+ if (\PHP_VERSION_ID >= 50600) {
+ $className = 'PDORow';
+ }
+
+ if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) {
+ $className = 'DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset';
+ }
+
+ $this->setExpectedException('Doctrine\\Instantiator\\Exception\\UnexpectedValueException');
+
+ $this->instantiator->instantiate($className);
+ }
+
+ public function testNoticeOnUnSerializationException()
+ {
+ if (\PHP_VERSION_ID >= 50600) {
+ $this->markTestSkipped(
+ 'PHP 5.6 supports `ReflectionClass#newInstanceWithoutConstructor()` for some internal classes'
+ );
+ }
+
+ try {
+ $this->instantiator->instantiate('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
+
+ $this->fail('No exception was raised');
+ } catch (UnexpectedValueException $exception) {
+ $wakeUpNoticesReflection = new ReflectionClass('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
+ $previous = $exception->getPrevious();
+
+ $this->assertInstanceOf('Exception', $previous);
+
+ // in PHP 5.4.29 and PHP 5.5.13, this case is not a notice, but an exception being thrown
+ if (! (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513)) {
+ $this->assertSame(
+ 'Could not produce an instance of "DoctrineTest\\InstantiatorTestAsset\WakeUpNoticesAsset" '
+ . 'via un-serialization, since an error was triggered in file "'
+ . $wakeUpNoticesReflection->getFileName() . '" at line "36"',
+ $exception->getMessage()
+ );
+
+ $this->assertSame('Something went bananas while un-serializing this instance', $previous->getMessage());
+ $this->assertSame(\E_USER_NOTICE, $previous->getCode());
+ }
+ }
+ }
+
+ /**
+ * @param string $invalidClassName
+ *
+ * @dataProvider getInvalidClassNames
+ */
+ public function testInstantiationFromNonExistingClass($invalidClassName)
+ {
+ $this->setExpectedException('Doctrine\\Instantiator\\Exception\\InvalidArgumentException');
+
+ $this->instantiator->instantiate($invalidClassName);
+ }
+
+ public function testInstancesAreNotCloned()
+ {
+ $className = 'TemporaryClass' . uniqid();
+
+ eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}');
+
+ $instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className);
+
+ $instance->foo = 'bar';
+
+ $instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className);
+
+ $this->assertObjectNotHasAttribute('foo', $instance2);
+ }
+
+ /**
+ * Provides a list of instantiable classes (existing)
+ *
+ * @return string[][]
+ */
+ public function getInstantiableClasses()
+ {
+ $classes = array(
+ array('stdClass'),
+ array(__CLASS__),
+ array('Doctrine\\Instantiator\\Instantiator'),
+ array('Exception'),
+ array('PharException'),
+ array('DoctrineTest\\InstantiatorTestAsset\\SimpleSerializableAsset'),
+ array('DoctrineTest\\InstantiatorTestAsset\\ExceptionAsset'),
+ array('DoctrineTest\\InstantiatorTestAsset\\FinalExceptionAsset'),
+ array('DoctrineTest\\InstantiatorTestAsset\\PharExceptionAsset'),
+ array('DoctrineTest\\InstantiatorTestAsset\\UnCloneableAsset'),
+ array('DoctrineTest\\InstantiatorTestAsset\\XMLReaderAsset'),
+ );
+
+ if (\PHP_VERSION_ID === 50429 || \PHP_VERSION_ID === 50513) {
+ return $classes;
+ }
+
+ $classes = array_merge(
+ $classes,
+ array(
+ array('PharException'),
+ array('ArrayObject'),
+ array('DoctrineTest\\InstantiatorTestAsset\\ArrayObjectAsset'),
+ array('DoctrineTest\\InstantiatorTestAsset\\SerializableArrayObjectAsset'),
+ )
+ );
+
+ if (\PHP_VERSION_ID >= 50600) {
+ $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\WakeUpNoticesAsset');
+ $classes[] = array('DoctrineTest\\InstantiatorTestAsset\\UnserializeExceptionArrayObjectAsset');
+ }
+
+ return $classes;
+ }
+
+ /**
+ * Provides a list of instantiable classes (existing)
+ *
+ * @return string[][]
+ */
+ public function getInvalidClassNames()
+ {
+ $classNames = array(
+ array(__CLASS__ . uniqid()),
+ array('Doctrine\\Instantiator\\InstantiatorInterface'),
+ array('DoctrineTest\\InstantiatorTestAsset\\AbstractClassAsset'),
+ );
+
+ if (\PHP_VERSION_ID >= 50400) {
+ $classNames[] = array('DoctrineTest\\InstantiatorTestAsset\\SimpleTraitAsset');
+ }
+
+ return $classNames;
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php
new file mode 100644
index 0000000000..fbe28ddd0e
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/AbstractClassAsset.php
@@ -0,0 +1,29 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+/**
+ * A simple asset for an abstract class
+ *
+ * @author Marco Pivetta
+ */
+abstract class AbstractClassAsset
+{
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php
new file mode 100644
index 0000000000..56146d7092
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php
@@ -0,0 +1,41 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+use BadMethodCallException;
+
+/**
+ * Test asset that extends an internal PHP class
+ *
+ * @author Marco Pivetta
+ */
+class ArrayObjectAsset extends ArrayObject
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php
new file mode 100644
index 0000000000..43bbe46b71
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/ExceptionAsset.php
@@ -0,0 +1,41 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Exception;
+
+/**
+ * Test asset that extends an internal PHP base exception
+ *
+ * @author Marco Pivetta
+ */
+class ExceptionAsset extends Exception
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php
new file mode 100644
index 0000000000..7d268f5b3b
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/FinalExceptionAsset.php
@@ -0,0 +1,41 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Exception;
+
+/**
+ * Test asset that extends an internal PHP base exception
+ *
+ * @author Marco Pivetta
+ */
+final class FinalExceptionAsset extends Exception
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php
new file mode 100644
index 0000000000..553fd56126
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharAsset.php
@@ -0,0 +1,41 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Phar;
+
+/**
+ * Test asset that extends an internal PHP class
+ *
+ * @author Marco Pivetta
+ */
+class PharAsset extends Phar
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php
new file mode 100644
index 0000000000..42bf73e7ee
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/PharExceptionAsset.php
@@ -0,0 +1,44 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use PharException;
+
+/**
+ * Test asset that extends an internal PHP class
+ * This class should be serializable without problems
+ * and without getting the "Erroneous data format for unserializing"
+ * error
+ *
+ * @author Marco Pivetta
+ */
+class PharExceptionAsset extends PharException
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php
new file mode 100644
index 0000000000..ba19aaf63f
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php
@@ -0,0 +1,62 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+use BadMethodCallException;
+use Serializable;
+
+/**
+ * Serializable test asset that also extends an internal class
+ *
+ * @author Marco Pivetta
+ */
+class SerializableArrayObjectAsset extends ArrayObject implements Serializable
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function serialize()
+ {
+ return '';
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function unserialize($serialized)
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php
new file mode 100644
index 0000000000..39f84a6c0d
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleSerializableAsset.php
@@ -0,0 +1,61 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use Serializable;
+
+/**
+ * Base serializable test asset
+ *
+ * @author Marco Pivetta
+ */
+class SimpleSerializableAsset implements Serializable
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function serialize()
+ {
+ return '';
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function unserialize($serialized)
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php
new file mode 100644
index 0000000000..04e78069d2
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/SimpleTraitAsset.php
@@ -0,0 +1,29 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+/**
+ * A simple trait with no attached logic
+ *
+ * @author Marco Pivetta
+ */
+trait SimpleTraitAsset
+{
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php
new file mode 100644
index 0000000000..7d03bdab0b
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnCloneableAsset.php
@@ -0,0 +1,50 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+
+/**
+ * Base un-cloneable asset
+ *
+ * @author Marco Pivetta
+ */
+class UnCloneableAsset
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+
+ /**
+ * Magic `__clone` - should not be invoked
+ *
+ * @throws BadMethodCallException
+ */
+ public function __clone()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php
new file mode 100644
index 0000000000..b348a40535
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php
@@ -0,0 +1,39 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+use BadMethodCallException;
+
+/**
+ * A simple asset for an abstract class
+ *
+ * @author Marco Pivetta
+ */
+class UnserializeExceptionArrayObjectAsset extends ArrayObject
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function __wakeup()
+ {
+ throw new BadMethodCallException();
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php
new file mode 100644
index 0000000000..18dc6711dc
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php
@@ -0,0 +1,38 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use ArrayObject;
+
+/**
+ * A simple asset for an abstract class
+ *
+ * @author Marco Pivetta
+ */
+class WakeUpNoticesAsset extends ArrayObject
+{
+ /**
+ * Wakeup method called after un-serialization
+ */
+ public function __wakeup()
+ {
+ trigger_error('Something went bananas while un-serializing this instance');
+ }
+}
diff --git a/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php
new file mode 100644
index 0000000000..39ee6992ae
--- /dev/null
+++ b/vendor/doctrine/instantiator/tests/DoctrineTest/InstantiatorTestAsset/XMLReaderAsset.php
@@ -0,0 +1,41 @@
+.
+ */
+
+namespace DoctrineTest\InstantiatorTestAsset;
+
+use BadMethodCallException;
+use XMLReader;
+
+/**
+ * Test asset that extends an internal PHP class
+ *
+ * @author Dave Marshall
+ */
+class XMLReaderAsset extends XMLReader
+{
+ /**
+ * Constructor - should not be called
+ *
+ * @throws BadMethodCallException
+ */
+ public function __construct()
+ {
+ throw new BadMethodCallException('Not supposed to be called!');
+ }
+}
diff --git a/vendor/fojuth/readmegen/.gitignore b/vendor/fojuth/readmegen/.gitignore
new file mode 100644
index 0000000000..4938aecf9a
--- /dev/null
+++ b/vendor/fojuth/readmegen/.gitignore
@@ -0,0 +1,6 @@
+/nbproject/private/
+vendor/
+bin/
+nbproject/
+composer.lock
+.idea/
diff --git a/vendor/fojuth/readmegen/.travis.yml b/vendor/fojuth/readmegen/.travis.yml
new file mode 100644
index 0000000000..6c46085acc
--- /dev/null
+++ b/vendor/fojuth/readmegen/.travis.yml
@@ -0,0 +1,20 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - hhvm
+
+before_script:
+ - composer self-update
+ - composer install --prefer-source --no-interaction --dev
+
+script:
+ - vendor/phpspec/phpspec/bin/phpspec run -f dot
+
+matrix:
+ allow_failures:
+ - php: hhvm
+ fast_finish: true
diff --git a/vendor/fojuth/readmegen/LICENSE b/vendor/fojuth/readmegen/LICENSE
new file mode 100644
index 0000000000..bcee004cc8
--- /dev/null
+++ b/vendor/fojuth/readmegen/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 fojuth
+
+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/fojuth/readmegen/README.md b/vendor/fojuth/readmegen/README.md
new file mode 100644
index 0000000000..9146a8003b
--- /dev/null
+++ b/vendor/fojuth/readmegen/README.md
@@ -0,0 +1,160 @@
+# ReadmeGen
+
+[](https://travis-ci.org/fojuth/readmegen)
+
+Generate your project's log using VCS commit messages.
+
+ReadmeGen is a PHP package that scans the VCS's log searching for messages with specific pattern. These messages are extracted, grouped and prepended to the changelog file (e.g. readme.md). The package can be instructed to fetch messages between specific tags (or commits). This way, whenever you're tagging a new release, you can run ReadmeGen to generate the changelog automatically.
+
+**Notice**: The package currently supports only GIT and the *.md output files. You can provide support for othe VCS's or output formats? Help welcome :)
+
+### Installation
+#### Global installation (recommended)
+```
+composer global require fojuth/readmegen:@stable
+```
+
+You can read more about global installation in the [composer docs](https://getcomposer.org/doc/03-cli.md#global).
+
+#### Local installation
+```
+composer require fojuth/readmegen:1.*
+```
+
+#### Windows installation
+Make sure the Windows `PATH` variable contains the path to the composer bin dir:
+```
+C:\Users\{USER}\AppData\Roaming\Composer\vendor\bin
+```
+Restart any shell terminal you want to use for changes to take effect.
+
+### Usage
+This package is intended to be used as an executable script, not a library you would include in your project. Assuming you installed ReadmeGen globally, to update your changelog file, simply run:
+
+```
+readmegen --from TAG --to TAG --release RELEASE_NUMBER --break BREAKPOINT
+```
+
+For example:
+```
+readmegen --from 1.12.0 --to 1.13.0 --release 1.13.0 --break *Changelog*
+```
+
+This tells the script to generate a changelod update named `1.13.0` and that it should scan the log since tag `1.12.0` up to `1.13.0`. No earlier (or latter) commits will be taken into consideration. ReadmeGen will inject the generated log *after* the `*Changelog*` line.
+
+If you want to generate the changelog from a specific tag (or commit checksum) up to the latest commit (`HEAD`) just omit the `--to` argument:
+```
+readmegen --from a04cf99 --release 1.13.0 --break *Changelog*
+```
+
+You can also specify the breakpoint in the `readmegen.yml` config file so the command will be even cleaner:
+```
+readmegen --from a04cf99 --release 1.13.0
+```
+
+### Message format
+ReadmeGen will search for messages that start with a specific keyword. These keywords tell the script to which group the commit should be appended. The message groups can be overwritten.
+
+For example - the default configuration supports four types of commits: Features, Bugfixes, Documentation and Refactoring. The commit will be appended to a certain group only if it starts with a specific word. The default config allows two keywords for bugfixes: `bugfix` and `fix`. This means, that for a message to be appended to the Bugfix group it has to start with either `bugfix: blabla` or `Fix: foo bar` (notice the colon `:` sign - it has to be right after the keyword). The keywords are case insensitive.
+
+All commits that do not fit into any of the groups will be ignored (we don't want merges and stuff like that in the changelog).
+
+### Grouping commits
+Each commit that fits into a group will be grouped (yeah, that sounds silly). Groups will be printed out in the order they appear in the config file, so if you have `Features` and `Bugfixes`, this is the order they will appear in the changelog:
+```
+Features
+- feature 1
+- feature 2
+
+Bugfixes
+- fix 1
+```
+
+You can override the groups in your custom config file (details below).
+
+### Link patterns
+ReadmeGen can link issues to a issue tracker - all numbers starting with `#` will be linked to a website defined in the config under the `issue_tracker_pattern` key. If a commit message has a string `#1234` in it, it will be converted to a link targeting the issue tracker.
+
+### Local config
+The default config holds the definitions of commit groups and the issue link pattern. It also specifies which VCS to use and the type of the output file. You can override these settings (project-wide) by creating a `readmegen.yml` file in the root dir of your project. When ReadmeGen will be run it will check if this file exists and merge the settings accordingly.
+
+The default `readmegen.yml` config looks like this:
+```
+vcs: git
+format: md
+issue_tracker_pattern: http://some.issue.tracker.com/\1
+break: "## Changelog"
+output_file_name: "README.md"
+message_groups:
+ Features:
+ - feature
+ - feat
+ Bugfixes:
+ - fix
+ - bugfix
+ Documentation:
+ - docs
+ Refactoring:
+ - refactoring
+```
+
+Each of the `message_groups` key is the name of the group that will be put in the changelog. The values inside the group are the keywords the commit must start with (followed by the colon `:` sign) to be appended to that group.
+
+### Release number
+ReadmeGen requires a release number (`--release`) to be provided. This will be the title of the generated changelog.
+
+### Breakpoint
+By default the changes will go onto the beginning of the changelog file. You can though specify a "breakpoint" beneath which these changes should be appended. Usually, you'll have some "intro" in you changelog, and the changes listed below. You don't want the script to push the changes on top of the file, but below a certain line. You can specify this line in the `readmegen.yml` config file or using the `--break` argument.
+
+For example:
+```
+readmegen --from 1.12.0 --to 1.13.0 --release 1.3.3 --break *Changelog*
+```
+The script will append the changes *below* the line that contains the `*Changelog*` phrase. This should be the only phrase in this line. If you use the CLI argument method (`--break`), the breakpoint **must not contain spaces**. Thus you are encouraged to use the config method - you can use spaces there, as shown in the default config.
+
+ReadmeGen will search for the `## Changelog` breakpoint by default. If the breakpoint phrase is not found, the output will go onto the beginning of the changelog file.
+
+### Example commits
+Here are some example commit messages that will be grabbed by ReadmeGen (with the default config):
+```
+feature: Added some cool stuff (#1234)
+fix: #4245, regarding client login bug
+docs: Updated the transaction section of the docs
+feat: Some more cool stuff
+```
+
+## Changelog
+## 1.1.2
+*(2015-07-12)*
+
+#### Features
+* Change output file name (thanks to [reva2](https://github.com/reva2))
+
+#### Bugfixes
+* Added missing new line character in example usage message (thanks to [reva2](https://github.com/reva2))
+
+---
+
+## 1.1.1
+*(2015-01-04)*
+
+#### Features
+* Added .travis.yml
+
+---
+
+## 1.1.0
+*(2014-12-30)*
+
+#### Features
+* Added "break" to the readmegen.yml default config file. It has a default value set and can be overwritten locally.
+
+---
+
+## 1.0.2
+*(2014-12-30)*
+
+#### Bugfixes
+* The release date is extracted from the --to commit.
+
+---
diff --git a/vendor/fojuth/readmegen/composer.json b/vendor/fojuth/readmegen/composer.json
new file mode 100644
index 0000000000..3891983aef
--- /dev/null
+++ b/vendor/fojuth/readmegen/composer.json
@@ -0,0 +1,30 @@
+{
+ "name": "fojuth/readmegen",
+ "description": "Readme file / doc generator. It uses VCS logs as a source of information.",
+ "keywords": ["readme", "generator", "log parser", "vcs"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Kamil Fojuth",
+ "email": "fojuth@gmail.com"
+ }
+ ],
+ "require": {
+ "symfony/yaml": "~2.1",
+ "ulrichsg/getopt-php": "2.*"
+ },
+ "require-dev": {
+ "phpspec/phpspec": "dev-master"
+ },
+ "config": {
+ "bin-dir": "bin"
+ },
+ "bin": [
+ "readmegen"
+ ],
+ "autoload": {
+ "psr-4": {
+ "ReadmeGen\\": "src/"
+ }
+ }
+}
diff --git a/vendor/fojuth/readmegen/phpspec.yml b/vendor/fojuth/readmegen/phpspec.yml
new file mode 100644
index 0000000000..6f0e531e22
--- /dev/null
+++ b/vendor/fojuth/readmegen/phpspec.yml
@@ -0,0 +1,4 @@
+suites:
+ readmegen:
+ namespace: ReadmeGen
+ psr4_prefix: ReadmeGen
\ No newline at end of file
diff --git a/vendor/fojuth/readmegen/readmegen b/vendor/fojuth/readmegen/readmegen
new file mode 100755
index 0000000000..24e39948ec
--- /dev/null
+++ b/vendor/fojuth/readmegen/readmegen
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+ count($argv)) {
+ die("Example usage: php generate.php --from --release \n");
+}
+
+new \ReadmeGen\Bootstrap($argv);
\ No newline at end of file
diff --git a/vendor/fojuth/readmegen/readmegen.yml b/vendor/fojuth/readmegen/readmegen.yml
new file mode 100644
index 0000000000..97ba9d7a59
--- /dev/null
+++ b/vendor/fojuth/readmegen/readmegen.yml
@@ -0,0 +1,16 @@
+vcs: git
+format: md
+issue_tracker_pattern: http://some.issue.tracker.com/\1
+break: "## Changelog"
+output_file_name: "README.md"
+message_groups:
+ Features:
+ - feature
+ - feat
+ Bugfixes:
+ - fix
+ - bugfix
+ Documentation:
+ - docs
+ Refactoring:
+ - refactoring
\ No newline at end of file
diff --git a/vendor/fojuth/readmegen/spec/Config/LoaderSpec.php b/vendor/fojuth/readmegen/spec/Config/LoaderSpec.php
new file mode 100644
index 0000000000..b543a21886
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Config/LoaderSpec.php
@@ -0,0 +1,54 @@
+dummyConfigFile, "vcs: git\nfoo: bar");
+ file_put_contents($this->badConfigFile, "badly:\tformed\n\tfile");
+ }
+
+ function letgo()
+ {
+ unlink($this->dummyConfigFile);
+ unlink($this->badConfigFile);
+ }
+
+ function it_should_throw_exception_when_default_config_doesnt_exist()
+ {
+ $this->shouldThrow('\InvalidArgumentException')->during('get', array('foobar.yml'));
+ }
+
+ function it_should_throw_exception_when_the_config_file_is_malformed()
+ {
+ $this->shouldThrow('\Symfony\Component\Yaml\Exception\ParseException')->during('get', array($this->badConfigFile));
+ }
+
+ function it_loads_the_default_config()
+ {
+ $this->get($this->dummyConfigFile)->shouldBeArray();
+ }
+
+ function it_should_have_specific_values_loaded()
+ {
+ $this->get($this->dummyConfigFile)->shouldHaveKey('vcs');
+ }
+
+ function getMatchers()
+ {
+ return array(
+ 'haveKey' => function($subject, $key) {
+ return array_key_exists($key, $subject);
+ },
+ );
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/spec/Input/ParserSpec.php b/vendor/fojuth/readmegen/spec/Input/ParserSpec.php
new file mode 100644
index 0000000000..5b44aba0ea
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Input/ParserSpec.php
@@ -0,0 +1,37 @@
+setInput('someDummyContent --f=foo --to=bar --release=4.5.6');
+
+ $result = $this->parse();
+
+ $result['from']->shouldReturn('foo');
+ $result['f']->shouldReturn('foo');
+ $result['to']->shouldReturn('bar');
+ $result['t']->shouldReturn('bar');
+ $result['release']->shouldReturn('4.5.6');
+ $result['r']->shouldReturn('4.5.6');
+ }
+
+ function it_should_check_for_required_arguments()
+ {
+ $this->setInput('someDummyContent --from=1.2');
+ $this->shouldThrow('\BadMethodCallException')->during('parse');
+
+ $this->setInput('someDummyContent --release=1.2');
+ $this->shouldThrow('\BadMethodCallException')->during('parse');
+
+ $this->setInput('someDummyContent --release=1.2 --from=2.3');
+ $result = $this->parse();
+
+ $result['release']->shouldBe('1.2');
+ $result['from']->shouldBe('2.3');
+ }
+}
diff --git a/vendor/fojuth/readmegen/spec/Log/DecoratorSpec.php b/vendor/fojuth/readmegen/spec/Log/DecoratorSpec.php
new file mode 100644
index 0000000000..8b32322c19
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Log/DecoratorSpec.php
@@ -0,0 +1,28 @@
+beConstructedWith($formatter);
+ }
+
+ function it_should_set_the_correct_output_class(FormatInterface $formatter)
+ {
+ $formatter->setLog(array())->shouldBeCalled();
+ $formatter->setIssueTrackerUrlPattern('')->shouldBeCalled();
+ $formatter->decorate()->willReturn('foo');
+
+ $this->setLog(array());
+ $this->setIssueTrackerUrlPattern('');
+ $this->decorate()->shouldReturn('foo');
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/spec/Log/ExtractorSpec.php b/vendor/fojuth/readmegen/spec/Log/ExtractorSpec.php
new file mode 100644
index 0000000000..d250d873b4
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Log/ExtractorSpec.php
@@ -0,0 +1,46 @@
+ array('feature', 'feat'),
+ 'Bugfixes' => array('bugfix', 'fix'),
+ 'Docs' => array('docs'),
+ );
+
+ $result = array(
+ 'Features' => array(
+ 'bar baz',
+ 'dummy feature',
+ 'lol',
+ ),
+ 'Bugfixes' => array(
+ 'some bugfix',
+ ),
+ );
+
+ $this->setLog($log);
+ $this->setMessageGroups($messageGroups);
+
+ $this->extract()->shouldReturn($result);
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/spec/Output/Format/MdSpec.php b/vendor/fojuth/readmegen/spec/Output/Format/MdSpec.php
new file mode 100644
index 0000000000..c6315eec78
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Output/Format/MdSpec.php
@@ -0,0 +1,59 @@
+ array(
+ 'bar #123 baz',
+ 'dummy feature',
+ ),
+ 'Bugfixes' => array(
+ 'some bugfix (#890)',
+ ),
+ );
+
+ function let() {
+ $this->setLog($this->log);
+ }
+
+ function it_should_add_links_to_the_issue_tracker()
+ {
+ $result = array(
+ 'Features' => array(
+ "bar [#123]({$this->issueTrackerUrl}123) baz",
+ 'dummy feature',
+ ),
+ 'Bugfixes' => array(
+ "some bugfix ([#890]({$this->issueTrackerUrl}890))",
+ ),
+ );
+
+ $this->setIssueTrackerUrlPattern($this->issueTrackerPattern);
+ $this->decorate()->shouldReturn($result);
+ }
+
+ function it_should_generate_a_write_ready_output() {
+ $this->setRelease('4.5.6')
+ ->setDate(new \DateTime('2014-12-21'));
+
+ $result = array(
+ "## 4.5.6",
+ "*(2014-12-21)*",
+ "\n#### Features",
+ '* bar #123 baz',
+ '* dummy feature',
+ "\n#### Bugfixes",
+ '* some bugfix (#890)',
+ "\n---\n",
+ );
+
+ $this->generate()->shouldReturn($result);
+ }
+}
diff --git a/vendor/fojuth/readmegen/spec/Output/WriterSpec.php b/vendor/fojuth/readmegen/spec/Output/WriterSpec.php
new file mode 100644
index 0000000000..1485ad4dbb
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Output/WriterSpec.php
@@ -0,0 +1,86 @@
+beConstructedWith($formatter);
+ file_put_contents($this->fileNameWithBreakpoint, "line one\n{$this->break}\nline two\n##{$this->break}\nline three");
+ }
+
+ function letgo()
+ {
+ @ unlink($this->fileName);
+ @ unlink($this->fileNameWithBreakpoint);
+ }
+
+ function it_should_write_log_output_to_a_file(FormatInterface $formatter)
+ {
+ $logContent = array(
+ 'Features:',
+ '- foo',
+ '- bar',
+ );
+
+ $formatter->generate()->willReturn($logContent);
+ $formatter->getFileName()->willReturn($this->fileName);
+
+ $this->write();
+
+ if (false === file_exists($this->fileName)) {
+ throw new \Exception(sprintf('File %s has not been created.', $this->fileName));
+ }
+
+ $content = file_get_contents($this->fileName);
+
+ if (true === empty($content)) {
+ throw new \Exception(sprintf('File %s is empty.', $this->fileName));
+ }
+
+ if (trim($content) !== join("\n", $logContent)) {
+ throw new \Exception('File content differs from expectations.');
+ }
+ }
+
+ function it_should_add_content_after_breakpoint(FormatInterface $formatter)
+ {
+ $logContent = array(
+ 'Features:',
+ '- foo',
+ '- bar',
+ );
+
+ $resultContent = array(
+ 'line one',
+ $this->break,
+ 'Features:',
+ '- foo',
+ '- bar',
+ '',
+ 'line two',
+ '##'.$this->break,
+ 'line three',
+ );
+
+ $formatter->generate()->willReturn($logContent);
+ $formatter->getFileName()->willReturn($this->fileNameWithBreakpoint);
+
+ $this->setBreak($this->break);
+ $this->write();
+
+ $content = file_get_contents($this->fileNameWithBreakpoint);
+
+ if (trim($content) !== join("\n", $resultContent)) {
+ throw new \Exception('File content differs from expectations.');
+ }
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/spec/ReadmeGenSpec.php b/vendor/fojuth/readmegen/spec/ReadmeGenSpec.php
new file mode 100644
index 0000000000..4896c6c2cf
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/ReadmeGenSpec.php
@@ -0,0 +1,163 @@
+ 'dummyvcs',
+ 'foo' => 'bar',
+ 'message_groups' => array(
+ 'Features' => array(
+ 'feat', 'feature'
+ ),
+ 'Bugfixes' => array(
+ 'fix', 'bugfix'
+ ),
+ ),
+ );
+ protected $badConfigFile = 'bad_config.yaml';
+ protected $badConfig = "vcs: nope\nfoo: bar";
+ protected $gitConfigFile = 'git_config.yaml';
+ protected $gitConfig = "vcs: git\nmessage_groups:\n Features:\n - feat\n - feature\n Bugfixes:\n - fix\n - bugfix\nformat: md\nissue_tracker_pattern: http://issue.tracker.com/\\1";
+ protected $outputFile = 'dummy.md';
+
+ function let()
+ {
+ file_put_contents($this->dummyConfigFile, $this->dummyConfig);
+ file_put_contents($this->badConfigFile, $this->badConfig);
+
+ $this->beConstructedWith(new ConfigLoader, $this->dummyConfigFile, true);
+ }
+
+ function letgo()
+ {
+ unlink($this->dummyConfigFile);
+ unlink($this->badConfigFile);
+ @ unlink($this->gitConfigFile);
+ @ unlink($this->outputFile);
+ }
+
+ function it_should_load_default_config()
+ {
+ $this->getConfig()->shouldBe($this->dummyConfigArray);
+ }
+
+ function it_loads_the_correct_vcs_parser()
+ {
+ $config = $this->getConfig();
+
+ $config['vcs']->shouldBe('dummyvcs');
+
+ $this->getParser()->shouldHaveType('\ReadmeGen\Vcs\Parser');
+ $this->getParser()->getVcsParser()->shouldHaveType('\ReadmeGen\Vcs\Type\Dummyvcs');
+ }
+
+ function it_throws_exception_when_trying_to_load_nonexisting_vcs_parser()
+ {
+ $this->beConstructedWith(new ConfigLoader, $this->badConfigFile, true);
+ $this->shouldThrow('\InvalidArgumentException')->during('getParser');
+ }
+
+ function it_runs_the_whole_process(Shell $shell)
+ {
+ file_put_contents($this->gitConfigFile, $this->gitConfig);
+
+ $shell->run(sprintf('git log --pretty=format:"%%s%s%%b" 1.2.3..4.0.0', Git::MSG_SEPARATOR))->willReturn($this->getLogAsString());
+
+ $this->beConstructedWith(new ConfigLoader, $this->gitConfigFile, true);
+
+ $this->getParser()->getVcsParser()->shouldHaveType('\ReadmeGen\Vcs\Type\Git');
+ $this->getParser()->setArguments(array(
+ 'from' => '1.2.3',
+ 'to' => '4.0.0',
+ ));
+ $this->getParser()->setShellRunner($shell);
+
+ $log = $this->getParser()->parse();
+
+ $this->setExtractor(new Extractor());
+ $logGrouped = $this->extractMessages($log)->shouldReturn(array(
+ 'Features' => array(
+ 'bar baz #123',
+ 'dummy feature',
+ 'lol',
+ ),
+ 'Bugfixes' => array(
+ 'some bugfix',
+ )
+ ));
+
+ $formatter = new Md();
+ $formatter->setFileName($this->outputFile)
+ ->setRelease('4.5.6')
+ ->setDate(new \DateTime(2014-12-12));
+
+ $this->setDecorator(new Decorator($formatter));
+ $this->getDecoratedMessages($logGrouped)->shouldReturn(array(
+ 'Features' => array(
+ 'bar baz [#123](http://issue.tracker.com/123)',
+ 'dummy feature',
+ 'lol',
+ ),
+ 'Bugfixes' => array(
+ 'some bugfix',
+ )
+ ));
+
+ $outputWriter = new Writer($formatter);
+
+ $this->setOutputWriter($outputWriter);
+ $this->writeOutput()->shouldReturn(true);
+ }
+
+ protected function getLogAsString()
+ {
+ $log = array(
+ 'foo',
+ 'feature: bar baz #123',
+ 'nope',
+ 'feature: dummy feature',
+ 'feat: lol',
+ 'also nope',
+ 'fix: some bugfix',
+ );
+
+ return join(Git::MSG_SEPARATOR."\n", $log).Git::MSG_SEPARATOR."\n";
+ }
+
+ }
+
+}
+
+/**
+ * Dummy VCS type class used by ReadmeGen during tests.
+ */
+namespace ReadmeGen\Vcs\Type {
+
+ class Dummyvcs extends \ReadmeGen\Vcs\Type\AbstractType
+ {
+
+ public function parse()
+ {
+ return array();
+ }
+
+ public function getToDate(){
+
+ }
+
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/spec/Vcs/ParserSpec.php b/vendor/fojuth/readmegen/spec/Vcs/ParserSpec.php
new file mode 100644
index 0000000000..a54c793093
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Vcs/ParserSpec.php
@@ -0,0 +1,26 @@
+beConstructedWith($vcs);
+ }
+
+ function it_should_parse_the_vcs_log_into_an_array(TypeInterface $vcs)
+ {
+ $returnData = array(
+ 'foo bar',
+ 'baz',
+ );
+
+ $vcs->parse()->willReturn($returnData);
+
+ $this->parse()->shouldBe($returnData);
+ }
+}
diff --git a/vendor/fojuth/readmegen/spec/Vcs/Type/GitSpec.php b/vendor/fojuth/readmegen/spec/Vcs/Type/GitSpec.php
new file mode 100644
index 0000000000..ca598e8282
--- /dev/null
+++ b/vendor/fojuth/readmegen/spec/Vcs/Type/GitSpec.php
@@ -0,0 +1,72 @@
+setArguments(array('from' => '1.0'));
+
+ $log = sprintf("Foo bar.%s\nDummy message.%s\n\n", Git::MSG_SEPARATOR, Git::MSG_SEPARATOR);
+ $shell->run($this->getCommand())->willReturn($log);
+
+ $this->setShellRunner($shell);
+
+ $this->parse()->shouldReturn(array(
+ 'Foo bar.',
+ 'Dummy message.',
+ ));
+ }
+
+ function it_has_input_options_and_arguments()
+ {
+ $this->setOptions(array('a'));
+ $this->setArguments(array('foo' => 'bar'));
+
+ $this->hasOption('z')->shouldReturn(false);
+ $this->hasOption('a')->shouldReturn(true);
+
+ $this->hasArgument('wat')->shouldReturn(false);
+ $this->hasArgument('foo')->shouldReturn(true);
+ $this->getArgument('foo')->shouldReturn('bar');
+ }
+
+ function it_should_add_options_and_arguments_to_the_command(Shell $shell)
+ {
+ $log = sprintf("Foo bar.%s\nDummy message.%s\n\n", Git::MSG_SEPARATOR, Git::MSG_SEPARATOR);
+ $shell->run(sprintf('git log --pretty=format:"%%s%s%%b"', Git::MSG_SEPARATOR))->willReturn($log);
+
+ $this->setShellRunner($shell);
+
+ $this->setOptions(array('x', 'y'));
+ $this->setArguments(array('foo' => 'bar', 'baz' => 'wat', 'from' => '1.0'));
+
+ $this->getCommand()->shouldReturn('git log --pretty=format:"%s'.Git::MSG_SEPARATOR.'%b" 1.0..HEAD --x --y');
+ }
+
+ function it_should_properly_include_the_from_and_to_arguments() {
+ $this->setOptions(array('x', 'y'));
+
+ $this->setArguments(array('from' => '3.4.5', 'foo' => 'bar'));
+ $this->getCommand()->shouldReturn('git log --pretty=format:"%s'.Git::MSG_SEPARATOR.'%b" 3.4.5..HEAD --x --y');
+
+ $this->setArguments(array('from' => '3.4.5', 'foo' => 'bar', 'to' => '4.0'));
+ $this->getCommand()->shouldReturn('git log --pretty=format:"%s'.Git::MSG_SEPARATOR.'%b" 3.4.5..4.0 --x --y');
+ }
+
+ function it_returns_the_date_of_the_commit(Shell $shell) {
+ $shell->run('git log -1 -s --format=%ci 3f04264')->willReturn('2014-11-28 01:01:58 +0100');
+
+ $this->setShellRunner($shell);
+
+ $this->setArguments(array('from' => '1.0', 'to' => '3f04264'));
+ $this->getToDate()->shouldReturn('2014-11-28');
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/src/Bootstrap.php b/vendor/fojuth/readmegen/src/Bootstrap.php
new file mode 100644
index 0000000000..0ae968abb2
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Bootstrap.php
@@ -0,0 +1,130 @@
+setInput(join(' ', $input));
+
+ // Parse the input
+ try {
+ $input = $inputParser->parse();
+ } catch (\BadMethodCallException $e) {
+ die($e->getMessage());
+ }
+
+ // Run the whole process
+ $this->run($input->getOptions());
+ }
+
+ /**
+ * Generates the output file.
+ *
+ * @param array $options
+ */
+ public function run(array $options)
+ {
+ $this->generator = new ReadmeGen(new ConfigLoader());
+
+ $this->setupParser($options);
+
+ // Extract useful log entries
+ $logGrouped = $this->generator->setExtractor(new Extractor())
+ ->extractMessages($this->getLog());
+
+ $config = $this->generator->getConfig();
+
+ $formatterClassName = '\ReadmeGen\Output\Format\\' . ucfirst($config['format']);
+
+ // Create the output formatter
+ $formatter = new $formatterClassName;
+
+ $formatter
+ ->setRelease($options['release'])
+ ->setFileName($config['output_file_name'])
+ ->setDate($this->getToDate());
+
+ // Pass decorated log entries to the generator
+ $this->generator->setDecorator(new Decorator($formatter))
+ ->getDecoratedMessages($logGrouped);
+
+ $writer = new Writer($formatter);
+
+ // If present, respect the breakpoint in the existing output file
+ $break = $this->getBreak($options, $config);
+
+ if (false === empty($break)) {
+ $writer->setBreak($break);
+ }
+
+ // Write the output
+ $this->generator->setOutputWriter($writer)
+ ->writeOutput();
+ }
+
+ /**
+ * Returns the parsed log.
+ *
+ * @return mixed
+ */
+ public function getLog()
+ {
+ return $this->generator->getParser()
+ ->parse();
+ }
+
+ /**
+ * Returns the date of the latter commit (--to).
+ *
+ * @return string
+ */
+ protected function getToDate()
+ {
+ $date = $this->generator->getParser()
+ ->getToDate();
+
+ return new \DateTime($date);
+ }
+
+ /**
+ * Sets the parser.
+ *
+ * @param array $options
+ */
+ protected function setupParser(array $options)
+ {
+ $this->generator->getParser()
+ ->setArguments($options)
+ ->setShellRunner(new Shell);
+ }
+
+ /**
+ * Returns the breakpoint if set, null otherwise.
+ *
+ * @param array $options
+ * @param array $config
+ * @return null|string
+ */
+ protected function getBreak(array $options, array $config){
+ if (true === isset($options['break'])) {
+ return $options['break'];
+ }
+
+ if (true === isset($config['break'])) {
+ return $config['break'];
+ }
+
+ return null;
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/src/Config/Loader.php b/vendor/fojuth/readmegen/src/Config/Loader.php
new file mode 100644
index 0000000000..da824ef626
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Config/Loader.php
@@ -0,0 +1,46 @@
+getFileContent($path));
+
+ if (false === empty($sourceConfig)) {
+ return array_replace_recursive($sourceConfig, $config);
+ }
+
+ return $config;
+ }
+
+ /**
+ * Returns the file's contents.
+ *
+ * @param string $path Path to file.
+ * @return string
+ * @throws \InvalidArgumentException When the file does not exist.
+ */
+ protected function getFileContent($path)
+ {
+ if (false === file_exists($path)) {
+ throw new \InvalidArgumentException(sprintf('File "%s" does not exist.', $path));
+ }
+
+ return file_get_contents($path);
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/src/Input/Parser.php b/vendor/fojuth/readmegen/src/Input/Parser.php
new file mode 100644
index 0000000000..bb2659e246
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Input/Parser.php
@@ -0,0 +1,74 @@
+handler = new Getopt(array(
+ new Option('r', 'release', Getopt::REQUIRED_ARGUMENT),
+ new Option('f', 'from', Getopt::REQUIRED_ARGUMENT),
+ new Option('t', 'to', Getopt::OPTIONAL_ARGUMENT),
+ new Option('b', 'break', Getopt::OPTIONAL_ARGUMENT),
+ ));
+ }
+
+ /**
+ * Set the input.
+ *
+ * @param $input string
+ */
+ public function setInput($input)
+ {
+ $inputArray = explode(' ', $input);
+
+ array_shift($inputArray);
+
+ $this->input = join(' ', $inputArray);
+ }
+
+ /**
+ * Parses the input and returns the Getopt handler.
+ *
+ * @return Getopt
+ */
+ public function parse()
+ {
+ $this->handler->parse($this->input);
+
+ $output = $this->handler->getOptions();
+
+ if (false === isset($output['from'])) {
+ throw new \BadMethodCallException('The --from argument is required.');
+ }
+
+ if (false === isset($output['release'])) {
+ throw new \BadMethodCallException('The --release argument is required.');
+ }
+
+ return $this->handler;
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/Log/Decorator.php b/vendor/fojuth/readmegen/src/Log/Decorator.php
new file mode 100644
index 0000000000..562622bf47
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Log/Decorator.php
@@ -0,0 +1,60 @@
+formatter = $formatter;
+ }
+
+ /**
+ * Log setter.
+ *
+ * @param array $log
+ * @return $this
+ */
+ public function setLog(array $log)
+ {
+ $this->formatter->setLog($log);
+
+ return $this;
+ }
+
+ /**
+ * Issue tracker pattern setter.
+ *
+ * @param string $pattern
+ * @return $this
+ */
+ public function setIssueTrackerUrlPattern($pattern)
+ {
+ $this->formatter->setIssueTrackerUrlPattern($pattern);
+
+ return $this;
+ }
+
+ /**
+ * Returns the decorated log.
+ *
+ * @return FormatInterface
+ */
+ public function decorate()
+ {
+ return $this->formatter->decorate();
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/Log/Extractor.php b/vendor/fojuth/readmegen/src/Log/Extractor.php
new file mode 100644
index 0000000000..44151ebd46
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Log/Extractor.php
@@ -0,0 +1,116 @@
+log = $log;
+
+ return $this;
+ }
+
+ /**
+ * Message groups setter.
+ *
+ * @param array $messageGroups
+ * @return $this
+ */
+ public function setMessageGroups(array $messageGroups)
+ {
+ $this->messageGroups = $messageGroups;
+
+ // Set the joined message groups as well
+ foreach ($this->messageGroups as $header => $keywords) {
+ $this->messageGroupsJoined[$header] = join('|', $keywords);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Groups messages and returns them.
+ *
+ * @return array
+ */
+ public function extract() {
+ foreach ($this->log as $line) {
+ foreach ($this->messageGroupsJoined as $header => $keywords) {
+ $pattern = $this->getPattern($keywords);
+
+ if (preg_match($pattern, $line)) {
+ $this->appendToGroup($header, $line, $pattern);
+ }
+ }
+ }
+
+ // Remove empty groups
+ foreach (array_keys($this->messageGroups) as $groupKey) {
+ if (true === empty($this->groups[$groupKey])) {
+ unset($this->messageGroups[$groupKey]);
+ }
+ }
+
+ // The array_merge sorts $messageGroups basing on $groups
+ return array_merge($this->messageGroups, $this->groups);
+ }
+
+ /**
+ * Appends a message to a group
+ *
+ * @param string $groupHeader
+ * @param string $text
+ * @param string $pattern
+ */
+ protected function appendToGroup($groupHeader, $text, $pattern) {
+ $this->groups[$groupHeader][] = trim(preg_replace($pattern, '', $text));
+ }
+
+ /**
+ * Returns the regexp pattern used to determine the log entry's group.
+ *
+ * @param string $keywords
+ * @return string
+ */
+ protected function getPattern($keywords) {
+ return '/^('.$keywords.'):/i';
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/Output/Format/FormatInterface.php b/vendor/fojuth/readmegen/src/Output/Format/FormatInterface.php
new file mode 100644
index 0000000000..4a3590a376
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Output/Format/FormatInterface.php
@@ -0,0 +1,66 @@
+log = $log;
+
+ return $this;
+ }
+
+ /**
+ * Issue tracker patter setter.
+ *
+ * @param $pattern
+ * @return mixed
+ */
+ public function setIssueTrackerUrlPattern($pattern)
+ {
+ $this->pattern = $pattern;
+
+ return $this;
+ }
+
+ /**
+ * Decorates the output (e.g. adds linkgs to the issue tracker)
+ *
+ * @return self
+ */
+ public function decorate()
+ {
+ foreach ($this->log as &$entries) {
+ array_walk($entries, array($this, 'injectLinks'));
+ }
+
+ return $this->log;
+ }
+
+ /**
+ * Injects issue tracker links into the log.
+ *
+ * @param string $entry Log entry.
+ */
+ protected function injectLinks(&$entry)
+ {
+ $entry = preg_replace('/#(\d+)/', "[#\\1]({$this->pattern})", $entry);
+ }
+
+ /**
+ * Returns a write-ready log.
+ *
+ * @return array
+ */
+ public function generate()
+ {
+ if (true === empty($this->log)) {
+ return array();
+ }
+
+ $log = array();
+
+ // Iterate over grouped entries
+ foreach ($this->log as $header => &$entries) {
+
+ // Add a group header (e.g. Bugfixes)
+ $log[] = sprintf("\n#### %s", $header);
+
+ // Iterate over entries
+ foreach ($entries as &$line) {
+ $message = explode(VCS::MSG_SEPARATOR, $line);
+
+ $log[] = sprintf("* %s", trim($message[0]));
+
+ // Include multi-line entries
+ if (true === isset($message[1])) {
+ $log[] = sprintf("\n %s", trim($message[1]));
+ }
+ }
+ }
+
+ // Return a write-ready log
+ return array_merge(array("## {$this->release}", "*({$this->date->format('Y-m-d')})*"), $log, array("\n---\n"));
+ }
+
+ /**
+ * Returns the output filename.
+ *
+ * @return string
+ */
+ public function getFileName()
+ {
+ return $this->fileName;
+ }
+
+ /**
+ * Output filename setter.
+ *
+ * @param $fileName
+ * @return mixed
+ */
+ public function setFileName($fileName)
+ {
+ $this->fileName = $fileName;
+
+ return $this;
+ }
+
+ /**
+ * Release number setter.
+ *
+ * @param $release
+ * @return mixed
+ */
+ public function setRelease($release) {
+ $this->release = $release;
+
+ return $this;
+ }
+
+ /**
+ * Creation date setter.
+ *
+ * @param \DateTime $date
+ * @return mixed
+ */
+ public function setDate(\DateTime $date) {
+ $this->date = $date;
+
+ return $this;
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/src/Output/Writer.php b/vendor/fojuth/readmegen/src/Output/Writer.php
new file mode 100644
index 0000000000..952b99a1b6
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Output/Writer.php
@@ -0,0 +1,89 @@
+formatter = $formatter;
+ }
+
+ /**
+ * Writes the output to a file.
+ *
+ * @return bool
+ */
+ public function write()
+ {
+ // Crete the file if it does not exist
+ $this->makeFile($this->formatter->getFileName());
+
+ // Contents of the original file
+ $fileContent = file_get_contents($this->formatter->getFileName());
+
+ // Final log
+ $log = join("\n", (array) $this->formatter->generate())."\n";
+
+ // Include the breakpoint
+ if (false === empty($this->break) && 1 === preg_match("/^{$this->break}/m", $fileContent)) {
+ $splitFileContent = preg_split("/^{$this->break}/m", $fileContent);
+
+ file_put_contents($this->formatter->getFileName(), $splitFileContent[0].$this->break."\n".$log.$splitFileContent[1]);
+
+ return true;
+ }
+
+ file_put_contents($this->formatter->getFileName(), $log.$fileContent);
+
+ return true;
+ }
+
+ /**
+ * Create the file if it does not exist.
+ *
+ * @param string $fileName
+ */
+ protected function makeFile($fileName){
+ if (file_exists($fileName)) {
+ return;
+ }
+
+ touch($fileName);
+ }
+
+ /**
+ * Breakpoint setter.
+ *
+ * @param null|string $break
+ * @return $this
+ */
+ public function setBreak($break = null)
+ {
+ if (false === empty($break)) {
+ $this->break = $break;
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/ReadmeGen.php b/vendor/fojuth/readmegen/src/ReadmeGen.php
new file mode 100644
index 0000000000..a3d9c6a12c
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/ReadmeGen.php
@@ -0,0 +1,187 @@
+defaultConfigPath);
+
+ // Overriding the root config
+ $configPath = (false === empty($defaultConfigPath) ? $defaultConfigPath : $rootConfigPath);
+
+ $this->configLoader = $configLoader;
+ $this->defaultConfig = $this->configLoader->get($configPath);
+
+ $localConfigPath = realpath($this->defaultConfigPath);
+
+ // Merging local config
+ if (file_exists($localConfigPath) && false === $ignoreLocalConfig) {
+ $this->config = $this->configLoader->get($localConfigPath, $this->defaultConfig);
+ }
+ else {
+ $this->config = $this->defaultConfig;
+ }
+ }
+
+ /**
+ * Returns the config.
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
+ /**
+ * Returns the parser.
+ *
+ * @return Parser
+ * @throws \InvalidArgumentException When the VCS parser class does not exist.
+ */
+ public function getParser()
+ {
+ if (true === empty($this->parser)) {
+ $typeParserClassName = sprintf('\ReadmeGen\Vcs\Type\%s', ucfirst($this->config['vcs']));
+
+ if (false === class_exists($typeParserClassName)) {
+ throw new \InvalidArgumentException(sprintf('Class "%s" does not exist', $typeParserClassName));
+ }
+
+ $this->parser = new Parser(new $typeParserClassName());
+ }
+
+ return $this->parser;
+ }
+
+ public function setExtractor(Extractor $extractor)
+ {
+ $this->extractor = $extractor;
+
+ return $this;
+ }
+
+ /**
+ * Returns messages extracted from the log.
+ *
+ * @param array $log
+ * @return array
+ */
+ public function extractMessages(array $log = null)
+ {
+ if (true === empty($log)) {
+ return array();
+ }
+
+ $this->extractor->setMessageGroups($this->config['message_groups']);
+
+ return $this->extractor->setLog($log)
+ ->extract();
+ }
+
+ /**
+ *
+ * phpspec failed to properly resolve the aliased version of this interface.
+ *
+ * @param \ReadmeGen\Log\Decorator $decorator
+ * @return $this
+ */
+ public function setDecorator(Decorator $decorator)
+ {
+ $this->decorator = $decorator;
+
+ return $this;
+ }
+
+ /**
+ * Returns decorated log messages.
+ *
+ * @param array $log
+ * @return array|Output\Format\FormatInterface
+ */
+ public function getDecoratedMessages(array $log = null)
+ {
+ if (true === empty($log)) {
+ return array();
+ }
+
+ return $this->decorator->setLog($log)
+ ->setIssueTrackerUrlPattern($this->config['issue_tracker_pattern'])
+ ->decorate();
+ }
+
+ public function setOutputWriter(OutputWriter $output)
+ {
+ $this->output = $output;
+
+ return $this;
+ }
+
+ /**
+ * Writes the ready output to the file.
+ *
+ * @return mixed
+ */
+ public function writeOutput()
+ {
+ return $this->output->write();
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/Shell.php b/vendor/fojuth/readmegen/src/Shell.php
new file mode 100644
index 0000000000..594085eabb
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Shell.php
@@ -0,0 +1,20 @@
+vcs = $vcs;
+ }
+
+ /**
+ * Returns the parsed log.
+ *
+ * @return array
+ */
+ public function parse()
+ {
+ return $this->vcs->parse();
+ }
+
+ /**
+ * Returns the VCS parser.
+ *
+ * @return TypeInterface
+ */
+ public function getVcsParser()
+ {
+ return $this->vcs;
+ }
+
+ /**
+ * Shell runner setter.
+ *
+ * @param Shell $shell
+ * @return $this
+ */
+ public function setShellRunner(Shell $shell)
+ {
+ $this->vcs->setShellRunner($shell);
+
+ return $this;
+ }
+
+ /**
+ * Sets input options.
+ *
+ * @param array $options
+ * @return $this
+ */
+ public function setOptions(array $options = null)
+ {
+ $this->vcs->setOptions($options);
+
+ return $this;
+ }
+
+ /**
+ * Sets input arguments.
+ *
+ * @param array $arguments
+ * @return $this
+ */
+ public function setArguments(array $arguments = null)
+ {
+ $this->vcs->setArguments($arguments);
+
+ return $this;
+ }
+
+ /**
+ * Returns the date of the latter (--to) commit, in the format YYYY-MM-DD.
+ *
+ * @return string
+ */
+ public function getToDate(){
+ return $this->vcs->getToDate();
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/Vcs/Type/AbstractType.php b/vendor/fojuth/readmegen/src/Vcs/Type/AbstractType.php
new file mode 100644
index 0000000000..f6f6fc9aca
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Vcs/Type/AbstractType.php
@@ -0,0 +1,126 @@
+shell = $shell;
+ }
+
+ /**
+ * Runs the shell command and returns the result.
+ *
+ * @param $command
+ * @return string
+ */
+ protected function runCommand($command)
+ {
+ return $this->shell->run($command);
+ }
+
+ /**
+ * Input option setter.
+ *
+ * @param array $options
+ * @return mixed
+ */
+ public function setOptions(array $options = null)
+ {
+ $this->options = $options;
+ }
+
+ /**
+ * Input argument setter.
+ *
+ * @param array $arguments
+ * @return mixed
+ */
+ public function setArguments(array $arguments = null)
+ {
+ $this->arguments = $arguments;
+ }
+
+ /**
+ * Returns true if an option exists.
+ *
+ * @param $option
+ * @return mixed
+ */
+ public function hasOption($option)
+ {
+ return in_array($option, $this->options);
+ }
+
+ /**
+ * Returns all options.
+ *
+ * @return mixed
+ */
+ public function getOptions()
+ {
+ return $this->options;
+ }
+
+ /**
+ * Returns true if an argument exists.
+ *
+ * @param $argument
+ * @return mixed
+ */
+ public function hasArgument($argument)
+ {
+ return isset($this->arguments[$argument]);
+ }
+
+ /**
+ * Returns the argument's value.
+ *
+ * @param $argument
+ * @return mixed
+ */
+ public function getArgument($argument)
+ {
+ return $this->arguments[$argument];
+ }
+
+ /**
+ * Return all arguments.
+ *
+ * @return mixed
+ */
+ public function getArguments()
+ {
+ return $this->arguments;
+ }
+
+}
diff --git a/vendor/fojuth/readmegen/src/Vcs/Type/Git.php b/vendor/fojuth/readmegen/src/Vcs/Type/Git.php
new file mode 100644
index 0000000000..ba78b8c2ee
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Vcs/Type/Git.php
@@ -0,0 +1,77 @@
+getLog())));
+ }
+
+ /**
+ * Returns the base VCS log command.
+ *
+ * @return string
+ */
+ protected function getBaseCommand()
+ {
+ return 'git log --pretty=format:"%s{{MSG_SEPARATOR}}%b"';
+ }
+
+ /**
+ * Returns the compiled VCS log command.
+ *
+ * @return string
+ */
+ public function getCommand()
+ {
+ $options = $this->getOptions();
+ $arguments = $this->getArguments();
+
+ $to = null;
+ $from = $arguments['from'];
+
+ if (true === isset($arguments['to'])) {
+ $to = $arguments['to'];
+ }
+
+ array_walk($options, function (&$option) {
+ $option = '--' . $option;
+ });
+
+ array_walk($arguments, function (&$value, $argument) {
+ $value = '--' . $argument . '=' . $value;
+ });
+
+ return trim(sprintf('%s %s %s', $this->getBaseCommand(), $this->getRange($from, $to), join(' ', $options)));
+ }
+
+ protected function getLog()
+ {
+ return $this->runCommand($this->getCommand());
+ }
+
+ protected function getRange($from, $to = null)
+ {
+ $range = $from . '..';
+
+ return $range . (($to) ?: 'HEAD');
+ }
+
+
+ public function getToDate()
+ {
+ $arguments = $this->getArguments();
+
+ $to = (true === isset($arguments['to'])) ? $arguments['to'] : 'HEAD';
+
+ $fullDate = $this->runCommand(sprintf('git log -1 -s --format=%%ci %s', $to));
+ $date = explode(' ', $fullDate);
+
+ return $date[0];
+ }
+}
diff --git a/vendor/fojuth/readmegen/src/Vcs/Type/TypeInterface.php b/vendor/fojuth/readmegen/src/Vcs/Type/TypeInterface.php
new file mode 100644
index 0000000000..9056fa3d5b
--- /dev/null
+++ b/vendor/fojuth/readmegen/src/Vcs/Type/TypeInterface.php
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-color/composer.json b/vendor/jakub-onderka/php-console-color/composer.json
new file mode 100644
index 0000000000..0721abca18
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "jakub-onderka/php-console-color",
+ "license": "BSD-2-Clause",
+ "version": "0.1",
+ "authors": [
+ {
+ "name": "Jakub Onderka",
+ "email": "jakub.onderka@gmail.com"
+ }
+ ],
+ "autoload": {
+ "psr-0": {"JakubOnderka\\PhpConsoleColor": "src/"}
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*",
+ "jakub-onderka/php-parallel-lint": "0.*",
+ "jakub-onderka/php-var-dump-check": "0.*",
+ "squizlabs/php_codesniffer": "1.*",
+ "jakub-onderka/php-code-style": "1.0"
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-color/example.php b/vendor/jakub-onderka/php-console-color/example.php
new file mode 100644
index 0000000000..5e698a24ec
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/example.php
@@ -0,0 +1,38 @@
+isSupported() ? 'Yes' : 'No') . "\n";
+echo "256 colors are supported: " . ($consoleColor->are256ColorsSupported() ? 'Yes' : 'No') . "\n\n";
+
+if ($consoleColor->isSupported()) {
+ foreach ($consoleColor->getPossibleStyles() as $style) {
+ echo $consoleColor->apply($style, $style) . "\n";
+ }
+}
+
+echo "\n";
+
+if ($consoleColor->are256ColorsSupported()) {
+ echo "Foreground colors:\n";
+ for ($i = 1; $i <= 255; $i++) {
+ echo $consoleColor->apply("color_$i", str_pad($i, 6, ' ', STR_PAD_BOTH));
+
+ if ($i % 15 === 0) {
+ echo "\n";
+ }
+ }
+
+ echo "\nBackground colors:\n";
+
+ for ($i = 1; $i <= 255; $i++) {
+ echo $consoleColor->apply("bg_color_$i", str_pad($i, 6, ' ', STR_PAD_BOTH));
+
+ if ($i % 15 === 0) {
+ echo "\n";
+ }
+ }
+
+ echo "\n";
+}
diff --git a/vendor/jakub-onderka/php-console-color/phpunit.xml b/vendor/jakub-onderka/php-console-color/phpunit.xml
new file mode 100644
index 0000000000..74011d9dfe
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/phpunit.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ tests/*
+
+
+
+
+
+
+ vendor
+
+
+
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-color/src/JakubOnderka/PhpConsoleColor/ConsoleColor.php b/vendor/jakub-onderka/php-console-color/src/JakubOnderka/PhpConsoleColor/ConsoleColor.php
new file mode 100644
index 0000000000..c367a7655c
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/src/JakubOnderka/PhpConsoleColor/ConsoleColor.php
@@ -0,0 +1,280 @@
+ null,
+ 'bold' => '1',
+ 'dark' => '2',
+ 'italic' => '3',
+ 'underline' => '4',
+ 'blink' => '5',
+ 'reverse' => '7',
+ 'concealed' => '8',
+
+ 'default' => '39',
+ 'black' => '30',
+ 'red' => '31',
+ 'green' => '32',
+ 'yellow' => '33',
+ 'blue' => '34',
+ 'magenta' => '35',
+ 'cyan' => '36',
+ 'light_gray' => '37',
+
+ 'dark_gray' => '90',
+ 'light_red' => '91',
+ 'light_green' => '92',
+ 'light_yellow' => '93',
+ 'light_blue' => '94',
+ 'light_magenta' => '95',
+ 'light_cyan' => '96',
+ 'white' => '97',
+
+ 'bg_default' => '49',
+ 'bg_black' => '40',
+ 'bg_red' => '41',
+ 'bg_green' => '42',
+ 'bg_yellow' => '43',
+ 'bg_blue' => '44',
+ 'bg_magenta' => '45',
+ 'bg_cyan' => '46',
+ 'bg_light_gray' => '47',
+
+ 'bg_dark_gray' => '100',
+ 'bg_light_red' => '101',
+ 'bg_light_green' => '102',
+ 'bg_light_yellow' => '103',
+ 'bg_light_blue' => '104',
+ 'bg_light_magenta' => '105',
+ 'bg_light_cyan' => '106',
+ 'bg_white' => '107',
+ );
+
+ /** @var array */
+ private $themes = array();
+
+ public function __construct()
+ {
+ $this->isSupported = $this->isSupported();
+ }
+
+ /**
+ * @param string|array $style
+ * @param string $text
+ * @return string
+ * @throws InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function apply($style, $text)
+ {
+ if (!$this->isStyleForced() && !$this->isSupported()) {
+ return $text;
+ }
+
+ if (is_string($style)) {
+ $style = array($style);
+ }
+ if (!is_array($style)) {
+ throw new \InvalidArgumentException("Style must be string or array.");
+ }
+
+ $sequences = array();
+
+ foreach ($style as $s) {
+ if (isset($this->themes[$s])) {
+ $sequences = array_merge($sequences, $this->themeSequence($s));
+ } else if ($this->isValidStyle($s)) {
+ $sequences[] = $this->styleSequence($s);
+ } else {
+ throw new InvalidStyleException($s);
+ }
+ }
+
+ $sequences = array_filter($sequences, function ($val) {
+ return $val !== null;
+ });
+
+ if (empty($sequences)) {
+ return $text;
+ }
+
+ return $this->escSequence(implode(';', $sequences)) . $text . $this->escSequence(self::RESET_STYLE);
+ }
+
+ /**
+ * @param bool $forceStyle
+ */
+ public function setForceStyle($forceStyle)
+ {
+ $this->forceStyle = (bool) $forceStyle;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isStyleForced()
+ {
+ return $this->forceStyle;
+ }
+
+ /**
+ * @param array $themes
+ * @throws InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function setThemes(array $themes)
+ {
+ $this->themes = array();
+ foreach ($themes as $name => $styles) {
+ $this->addTheme($name, $styles);
+ }
+ }
+
+ /**
+ * @param string $name
+ * @param array|string $styles
+ * @throws \InvalidArgumentException
+ * @throws InvalidStyleException
+ */
+ public function addTheme($name, $styles)
+ {
+ if (is_string($styles)) {
+ $styles = array($styles);
+ }
+ if (!is_array($styles)) {
+ throw new \InvalidArgumentException("Style must be string or array.");
+ }
+
+ foreach ($styles as $style) {
+ if (!$this->isValidStyle($style)) {
+ throw new InvalidStyleException($style);
+ }
+ }
+
+ $this->themes[$name] = $styles;
+ }
+
+ /**
+ * @return array
+ */
+ public function getThemes()
+ {
+ return $this->themes;
+ }
+
+ /**
+ * @param string $name
+ * @return bool
+ */
+ public function hasTheme($name)
+ {
+ return isset($this->themes[$name]);
+ }
+
+ /**
+ * @param string $name
+ */
+ public function removeTheme($name)
+ {
+ unset($this->themes[$name]);
+ }
+
+ /**
+ * @return bool
+ */
+ public function isSupported()
+ {
+ if (DIRECTORY_SEPARATOR === '\\') {
+ return getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON';
+ }
+
+ return function_exists('posix_isatty') && @posix_isatty(STDOUT);
+ }
+
+ /**
+ * @return bool
+ */
+ public function are256ColorsSupported()
+ {
+ return DIRECTORY_SEPARATOR === '/' && strpos(getenv('TERM'), '256color') !== false;
+ }
+
+ /**
+ * @return array
+ */
+ public function getPossibleStyles()
+ {
+ return array_keys($this->styles);
+ }
+
+ /**
+ * @param string $name
+ * @return string
+ * @throws InvalidStyleException
+ */
+ private function themeSequence($name)
+ {
+ $sequences = array();
+ foreach ($this->themes[$name] as $style) {
+ $sequences[] = $this->styleSequence($style);
+ }
+ return $sequences;
+ }
+
+ /**
+ * @param string $style
+ * @return string
+ * @throws InvalidStyleException
+ */
+ private function styleSequence($style)
+ {
+ if (array_key_exists($style, $this->styles)) {
+ return $this->styles[$style];
+ }
+
+ if (!$this->are256ColorsSupported()) {
+ return null;
+ }
+
+ preg_match(self::COLOR256_REGEXP, $style, $matches);
+
+ $type = $matches[1] === 'bg_' ? self::BACKGROUND : self::FOREGROUND;
+ $value = $matches[2];
+
+ return "$type;5;$value";
+ }
+
+ /**
+ * @param string $style
+ * @return bool
+ */
+ private function isValidStyle($style)
+ {
+ return array_key_exists($style, $this->styles) || preg_match(self::COLOR256_REGEXP, $style);
+ }
+
+ /**
+ * @param string|int $value
+ * @return string
+ */
+ private function escSequence($value)
+ {
+ return "\033[{$value}m";
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-color/src/JakubOnderka/PhpConsoleColor/InvalidStyleException.php b/vendor/jakub-onderka/php-console-color/src/JakubOnderka/PhpConsoleColor/InvalidStyleException.php
new file mode 100644
index 0000000000..6f1586f62e
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/src/JakubOnderka/PhpConsoleColor/InvalidStyleException.php
@@ -0,0 +1,10 @@
+isSupportedForce = $isSupported;
+ }
+
+ public function isSupported()
+ {
+ return $this->isSupportedForce;
+ }
+
+ public function setAre256ColorsSupported($are256ColorsSupported)
+ {
+ $this->are256ColorsSupportedForce = $are256ColorsSupported;
+ }
+
+ public function are256ColorsSupported()
+ {
+ return $this->are256ColorsSupportedForce;
+ }
+}
+
+class ConsoleColorTest extends \PHPUnit_Framework_TestCase
+{
+ /** @var ConsoleColorWithForceSupport */
+ private $uut;
+
+ protected function setUp()
+ {
+ $this->uut = new ConsoleColorWithForceSupport();
+ }
+
+ public function testNone()
+ {
+ $output = $this->uut->apply('none', 'text');
+ $this->assertEquals("text", $output);
+ }
+
+ public function testBold()
+ {
+ $output = $this->uut->apply('bold', 'text');
+ $this->assertEquals("\033[1mtext\033[0m", $output);
+ }
+
+ public function testBoldColorsAreNotSupported()
+ {
+ $this->uut->setIsSupported(false);
+
+ $output = $this->uut->apply('bold', 'text');
+ $this->assertEquals("text", $output);
+ }
+
+ public function testBoldColorsAreNotSupportedButAreForced()
+ {
+ $this->uut->setIsSupported(false);
+ $this->uut->setForceStyle(true);
+
+ $output = $this->uut->apply('bold', 'text');
+ $this->assertEquals("\033[1mtext\033[0m", $output);
+ }
+
+ public function testDark()
+ {
+ $output = $this->uut->apply('dark', 'text');
+ $this->assertEquals("\033[2mtext\033[0m", $output);
+ }
+
+ public function testBoldAndDark()
+ {
+ $output = $this->uut->apply(array('bold', 'dark'), 'text');
+ $this->assertEquals("\033[1;2mtext\033[0m", $output);
+ }
+
+ public function test256ColorForeground()
+ {
+ $output = $this->uut->apply('color_255', 'text');
+ $this->assertEquals("\033[38;5;255mtext\033[0m", $output);
+ }
+
+ public function test256ColorWithoutSupport()
+ {
+ $this->uut->setAre256ColorsSupported(false);
+
+ $output = $this->uut->apply('color_255', 'text');
+ $this->assertEquals("text", $output);
+ }
+
+ public function test256ColorBackground()
+ {
+ $output = $this->uut->apply('bg_color_255', 'text');
+ $this->assertEquals("\033[48;5;255mtext\033[0m", $output);
+ }
+
+ public function test256ColorForegroundAndBackground()
+ {
+ $output = $this->uut->apply(array('color_200', 'bg_color_255'), 'text');
+ $this->assertEquals("\033[38;5;200;48;5;255mtext\033[0m", $output);
+ }
+
+ public function testSetOwnTheme()
+ {
+ $this->uut->setThemes(array('bold_dark' => array('bold', 'dark')));
+ $output = $this->uut->apply(array('bold_dark'), 'text');
+ $this->assertEquals("\033[1;2mtext\033[0m", $output);
+ }
+
+ public function testAddOwnTheme()
+ {
+ $this->uut->addTheme('bold_own', 'bold');
+ $output = $this->uut->apply(array('bold_own'), 'text');
+ $this->assertEquals("\033[1mtext\033[0m", $output);
+ }
+
+ public function testAddOwnThemeArray()
+ {
+ $this->uut->addTheme('bold_dark', array('bold', 'dark'));
+ $output = $this->uut->apply(array('bold_dark'), 'text');
+ $this->assertEquals("\033[1;2mtext\033[0m", $output);
+ }
+
+ public function testOwnWithStyle()
+ {
+ $this->uut->addTheme('bold_dark', array('bold', 'dark'));
+ $output = $this->uut->apply(array('bold_dark', 'italic'), 'text');
+ $this->assertEquals("\033[1;2;3mtext\033[0m", $output);
+ }
+
+ public function testHasAndRemoveTheme()
+ {
+ $this->assertFalse($this->uut->hasTheme('bold_dark'));
+
+ $this->uut->addTheme('bold_dark', array('bold', 'dark'));
+ $this->assertTrue($this->uut->hasTheme('bold_dark'));
+
+ $this->uut->removeTheme('bold_dark');
+ $this->assertFalse($this->uut->hasTheme('bold_dark'));
+ }
+
+ public function testApplyInvalidArgument()
+ {
+ $this->setExpectedException('\InvalidArgumentException');
+ $this->uut->apply(new stdClass(), 'text');
+ }
+
+ public function testApplyInvalidStyleName()
+ {
+ $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
+ $this->uut->apply('invalid', 'text');
+ }
+
+ public function testApplyInvalid256Color()
+ {
+ $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
+ $this->uut->apply('color_2134', 'text');
+ }
+
+ public function testThemeInvalidStyle()
+ {
+ $this->setExpectedException('\JakubOnderka\PhpConsoleColor\InvalidStyleException');
+ $this->uut->addTheme('invalid', array('invalid'));
+ }
+
+ public function testForceStyle()
+ {
+ $this->assertFalse($this->uut->isStyleForced());
+ $this->uut->setForceStyle(true);
+ $this->assertTrue($this->uut->isStyleForced());
+ }
+
+ public function testGetPossibleStyles()
+ {
+ $this->assertInternalType('array', $this->uut->getPossibleStyles());
+ $this->assertNotEmpty($this->uut->getPossibleStyles());
+ }
+}
+
diff --git a/vendor/jakub-onderka/php-console-color/tests/bootstrap.php b/vendor/jakub-onderka/php-console-color/tests/bootstrap.php
new file mode 100644
index 0000000000..7500417eda
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-color/tests/bootstrap.php
@@ -0,0 +1,2 @@
+getWholeFile($fileContent);
+```
+
+------
+
+[](https://travis-ci.org/JakubOnderka/PHP-Console-Highlighter)
diff --git a/vendor/jakub-onderka/php-console-highlighter/build.xml b/vendor/jakub-onderka/php-console-highlighter/build.xml
new file mode 100644
index 0000000000..d656ea9d4b
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/build.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/composer.json b/vendor/jakub-onderka/php-console-highlighter/composer.json
new file mode 100644
index 0000000000..bd2f47a28b
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/composer.json
@@ -0,0 +1,26 @@
+{
+ "name": "jakub-onderka/php-console-highlighter",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Jakub Onderka",
+ "email": "acci@acci.cz",
+ "homepage": "http://www.acci.cz/"
+ }
+ ],
+ "autoload": {
+ "psr-0": {"JakubOnderka\\PhpConsoleHighlighter": "src/"}
+ },
+ "require": {
+ "php": ">=5.3.0",
+ "jakub-onderka/php-console-color": "~0.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0",
+ "jakub-onderka/php-parallel-lint": "~0.5",
+ "jakub-onderka/php-var-dump-check": "~0.1",
+ "squizlabs/php_codesniffer": "~1.5",
+ "jakub-onderka/php-code-style": "~1.0"
+ }
+}
diff --git a/vendor/jakub-onderka/php-console-highlighter/examples/snippet.php b/vendor/jakub-onderka/php-console-highlighter/examples/snippet.php
new file mode 100644
index 0000000000..1bf6ac3bd7
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/examples/snippet.php
@@ -0,0 +1,10 @@
+getCodeSnippet($fileContent, 3);
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/examples/whole_file.php b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file.php
new file mode 100644
index 0000000000..2a023d80ab
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file.php
@@ -0,0 +1,10 @@
+getWholeFile($fileContent);
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/examples/whole_file_line_numbers.php b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file_line_numbers.php
new file mode 100644
index 0000000000..f9178f2d13
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/examples/whole_file_line_numbers.php
@@ -0,0 +1,10 @@
+getWholeFileWithLineNumbers($fileContent);
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/phpunit.xml b/vendor/jakub-onderka/php-console-highlighter/phpunit.xml
new file mode 100644
index 0000000000..74011d9dfe
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/phpunit.xml
@@ -0,0 +1,15 @@
+
+
+
+
+ tests/*
+
+
+
+
+
+
+ vendor
+
+
+
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php b/vendor/jakub-onderka/php-console-highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php
new file mode 100644
index 0000000000..b908e93189
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php
@@ -0,0 +1,267 @@
+ 'red',
+ self::TOKEN_COMMENT => 'yellow',
+ self::TOKEN_KEYWORD => 'green',
+ self::TOKEN_DEFAULT => 'default',
+ self::TOKEN_HTML => 'cyan',
+
+ self::ACTUAL_LINE_MARK => 'red',
+ self::LINE_NUMBER => 'dark_gray',
+ );
+
+ /**
+ * @param ConsoleColor $color
+ */
+ public function __construct(ConsoleColor $color)
+ {
+ $this->color = $color;
+
+ foreach ($this->defaultTheme as $name => $styles) {
+ if (!$this->color->hasTheme($name)) {
+ $this->color->addTheme($name, $styles);
+ }
+ }
+ }
+
+ /**
+ * @param string $source
+ * @param int $lineNumber
+ * @param int $linesBefore
+ * @param int $linesAfter
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function getCodeSnippet($source, $lineNumber, $linesBefore = 2, $linesAfter = 2)
+ {
+ $tokenLines = $this->getHighlightedLines($source);
+
+ $offset = $lineNumber - $linesBefore - 1;
+ $offset = max($offset, 0);
+ $length = $linesAfter + $linesBefore + 1;
+ $tokenLines = array_slice($tokenLines, $offset, $length, $preserveKeys = true);
+
+ $lines = $this->colorLines($tokenLines);
+
+ return $this->lineNumbers($lines, $lineNumber);
+ }
+
+ /**
+ * @param string $source
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function getWholeFile($source)
+ {
+ $tokenLines = $this->getHighlightedLines($source);
+ $lines = $this->colorLines($tokenLines);
+ return implode(PHP_EOL, $lines);
+ }
+
+ /**
+ * @param string $source
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ public function getWholeFileWithLineNumbers($source)
+ {
+ $tokenLines = $this->getHighlightedLines($source);
+ $lines = $this->colorLines($tokenLines);
+ return $this->lineNumbers($lines);
+ }
+
+ /**
+ * @param string $source
+ * @return array
+ */
+ private function getHighlightedLines($source)
+ {
+ $source = str_replace(array("\r\n", "\r"), "\n", $source);
+ $tokens = $this->tokenize($source);
+ return $this->splitToLines($tokens);
+ }
+
+ /**
+ * @param string $source
+ * @return array
+ */
+ private function tokenize($source)
+ {
+ $tokens = token_get_all($source);
+
+ $output = array();
+ $currentType = null;
+ $buffer = '';
+
+ foreach ($tokens as $token) {
+ if (is_array($token)) {
+ switch ($token[0]) {
+ case T_INLINE_HTML:
+ $newType = self::TOKEN_HTML;
+ break;
+
+ case T_COMMENT:
+ case T_DOC_COMMENT:
+ $newType = self::TOKEN_COMMENT;
+ break;
+
+ case T_ENCAPSED_AND_WHITESPACE:
+ case T_CONSTANT_ENCAPSED_STRING:
+ $newType = self::TOKEN_STRING;
+ break;
+
+ case T_WHITESPACE:
+ break;
+
+ case T_OPEN_TAG:
+ case T_OPEN_TAG_WITH_ECHO:
+ case T_CLOSE_TAG:
+ case T_STRING:
+ case T_VARIABLE:
+
+ // Constants
+ case T_DIR:
+ case T_FILE:
+ case T_METHOD_C:
+ case T_DNUMBER:
+ case T_LNUMBER:
+ case T_NS_C:
+ case T_LINE:
+ case T_CLASS_C:
+ case T_FUNC_C:
+ //case T_TRAIT_C:
+ $newType = self::TOKEN_DEFAULT;
+ break;
+
+ default:
+ // Compatibility with PHP 5.3
+ if (defined('T_TRAIT_C') && $token[0] === T_TRAIT_C) {
+ $newType = self::TOKEN_DEFAULT;
+ } else {
+ $newType = self::TOKEN_KEYWORD;
+ }
+ }
+ } else {
+ $newType = $token === '"' ? self::TOKEN_STRING : self::TOKEN_KEYWORD;
+ }
+
+ if ($currentType === null) {
+ $currentType = $newType;
+ }
+
+ if ($currentType != $newType) {
+ $output[] = array($currentType, $buffer);
+ $buffer = '';
+ $currentType = $newType;
+ }
+
+ $buffer .= is_array($token) ? $token[1] : $token;
+ }
+
+ if (isset($newType)) {
+ $output[] = array($newType, $buffer);
+ }
+
+ return $output;
+ }
+
+ /**
+ * @param array $tokens
+ * @return array
+ */
+ private function splitToLines(array $tokens)
+ {
+ $lines = array();
+
+ $line = array();
+ foreach ($tokens as $token) {
+ foreach (explode("\n", $token[1]) as $count => $tokenLine) {
+ if ($count > 0) {
+ $lines[] = $line;
+ $line = array();
+ }
+
+ if ($tokenLine === '') {
+ continue;
+ }
+
+ $line[] = array($token[0], $tokenLine);
+ }
+ }
+
+ $lines[] = $line;
+
+ return $lines;
+ }
+
+ /**
+ * @param array $tokenLines
+ * @return array
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ * @throws \InvalidArgumentException
+ */
+ private function colorLines(array $tokenLines)
+ {
+ $lines = array();
+ foreach ($tokenLines as $lineCount => $tokenLine) {
+ $line = '';
+ foreach ($tokenLine as $token) {
+ list($tokenType, $tokenValue) = $token;
+ if ($this->color->hasTheme($tokenType)) {
+ $line .= $this->color->apply($tokenType, $tokenValue);
+ } else {
+ $line .= $tokenValue;
+ }
+ }
+ $lines[$lineCount] = $line;
+ }
+
+ return $lines;
+ }
+
+ /**
+ * @param array $lines
+ * @param null|int $markLine
+ * @return string
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ */
+ private function lineNumbers(array $lines, $markLine = null)
+ {
+ end($lines);
+ $lineStrlen = strlen(key($lines) + 1);
+
+ $snippet = '';
+ foreach ($lines as $i => $line) {
+ if ($markLine !== null) {
+ $snippet .= ($markLine === $i + 1 ? $this->color->apply(self::ACTUAL_LINE_MARK, ' > ') : ' ');
+ }
+
+ $snippet .= $this->color->apply(self::LINE_NUMBER, str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| ');
+ $snippet .= $line . PHP_EOL;
+ }
+
+ return $snippet;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php b/vendor/jakub-onderka/php-console-highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php
new file mode 100644
index 0000000000..269d03da56
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php
@@ -0,0 +1,263 @@
+getMock('\JakubOnderka\PhpConsoleColor\ConsoleColor');
+
+ $mock->expects($this->any())
+ ->method('apply')
+ ->will($this->returnCallback(function ($style, $text) {
+ return "<$style>$text$style>";
+ }));
+
+ $mock->expects($this->any())
+ ->method('hasTheme')
+ ->will($this->returnValue(true));
+
+ return $mock;
+ }
+
+ protected function setUp()
+ {
+ $this->uut = new Highlighter($this->getConsoleColorMock());
+ }
+
+ protected function compare($original, $expected)
+ {
+ $output = $this->uut->getWholeFile($original);
+ $this->assertEquals($expected, $output);
+ }
+
+ public function testVariable()
+ {
+ $this->compare(
+ <<
+echo \$a;
+EOL
+ );
+ }
+
+ public function testInteger()
+ {
+ $this->compare(
+ <<
+echo 43;
+EOL
+ );
+ }
+
+ public function testFloat()
+ {
+ $this->compare(
+ <<
+echo 43.3;
+EOL
+ );
+ }
+
+ public function testHex()
+ {
+ $this->compare(
+ <<
+echo 0x43;
+EOL
+ );
+ }
+
+ public function testBasicFunction()
+ {
+ $this->compare(
+ <<
+function plus(\$a, \$b) {
+ return \$a + \$b;
+}
+EOL
+ );
+ }
+
+ public function testStringNormal()
+ {
+ $this->compare(
+ <<
+echo 'Ahoj světe';
+EOL
+ );
+ }
+
+ public function testStringDouble()
+ {
+ $this->compare(
+ <<
+echo "Ahoj světe";
+EOL
+ );
+ }
+
+ public function testInstanceof()
+ {
+ $this->compare(
+ <<
+\$a instanceof stdClass;
+EOL
+ );
+ }
+
+ /*
+ * Constants
+ */
+ public function testConstant()
+ {
+ $constants = array(
+ '__FILE__',
+ '__LINE__',
+ '__CLASS__',
+ '__FUNCTION__',
+ '__METHOD__',
+ '__TRAIT__',
+ '__DIR__',
+ '__NAMESPACE__'
+ );
+
+ foreach ($constants as $constant) {
+ $this->compare(
+ <<
+$constant;
+EOL
+ );
+ }
+ }
+
+ /*
+ * Comments
+ */
+ public function testComment()
+ {
+ $this->compare(
+ <<
+/* Ahoj */
+EOL
+ );
+ }
+
+ public function testDocComment()
+ {
+ $this->compare(
+ <<
+/** Ahoj */
+EOL
+ );
+ }
+
+ public function testInlineComment()
+ {
+ $this->compare(
+ <<
+// Ahoj
+EOL
+ );
+ }
+
+ public function testHashComment()
+ {
+ $this->compare(
+ <<
+# Ahoj
+EOL
+ );
+ }
+
+ public function testEmpty()
+ {
+ $this->compare(
+ ''
+ ,
+ ''
+ );
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-console-highlighter/tests/bootstrap.php b/vendor/jakub-onderka/php-console-highlighter/tests/bootstrap.php
new file mode 100644
index 0000000000..7500417eda
--- /dev/null
+++ b/vendor/jakub-onderka/php-console-highlighter/tests/bootstrap.php
@@ -0,0 +1,2 @@
+` Specify PHP-CGI executable to run (default: 'php').
+- `-s, --short` Set short_open_tag to On (default: Off).
+- `-a, -asp` Set asp_tags to On (default: Off).
+- `-e ` Check only files with selected extensions separated by comma. (default: php,php3,php4,php5,phtml)
+- `--exclude` Exclude directory. If you want exclude multiple directories, use multiple exclude parameters.
+- `-j ` Run jobs in parallel (default: 10).
+- `--no-colors` Disable colors in console output.
+- `--json` Output results as JSON string (require PHP 5.4).
+- `--blame` Try to show git blame for row with error.
+- `--git ` Path to Git executable to show blame message (default: 'git').
+- `--stdin` Load files and folder to test from standard input.
+- `--ignore-fails` Ignore failed tests.
+- `-h, --help` Print this help.
+
+
+## Recommended setting for usage with Symfony framework
+For run from command line:
+
+```
+$ ./bin/parallel-lint --exclude app --exclude vendor .
+```
+
+or setting for ANT:
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+## Create Phar package
+PHP Parallel Lint supports [Box app](https://box-project.github.io/box2/) for creating Phar package. First, install box app:
+
+```
+curl -LSs https://box-project.github.io/box2/installer.php | php
+```
+
+and then run this command in parallel lint folder, which creates `parallel-lint.phar` file.
+
+```
+box build
+```
+
+------
+
+[](https://packagist.org/packages/jakub-onderka/php-parallel-lint)
+[](https://travis-ci.org/JakubOnderka/PHP-Parallel-Lint)
+[](https://ci.appveyor.com/project/JakubOnderka/php-parallel-lint/branch/master)
+[](https://packagist.org/packages/jakub-onderka/php-parallel-lint)
diff --git a/vendor/jakub-onderka/php-parallel-lint/appveyor.yml b/vendor/jakub-onderka/php-parallel-lint/appveyor.yml
new file mode 100644
index 0000000000..2d558dc31f
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/appveyor.yml
@@ -0,0 +1,29 @@
+build: off
+cache:
+ - c:\php -> appveyor.yml
+ - '%LOCALAPPDATA%\Composer\files -> appveyor.yml'
+
+clone_folder: c:\projects\php-parallel-lint
+
+init:
+ - SET PATH=c:\php;%PATH%
+ - SET INSTALL_PHP=1
+ - SET ANSICON=121x90 (121x90)
+
+install:
+ # Install PHP
+ - IF EXIST c:\php (SET INSTALL_PHP=0) ELSE (mkdir c:\php)
+ - IF %INSTALL_PHP%==1 cd c:\php
+ - IF %INSTALL_PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.6.15-nts-Win32-VC11-x86.zip
+ - IF %INSTALL_PHP%==1 7z x php-5.6.15-nts-Win32-VC11-x86.zip >nul
+ - IF %INSTALL_PHP%==1 del /Q *.zip
+ - cd c:\projects\php-parallel-lint
+
+ # Install Composer dependencies
+ - appveyor DownloadFile https://getcomposer.org/composer.phar
+ - php composer.phar install --no-interaction --prefer-source --no-progress
+
+test_script:
+ - vendor\bin\tester tests -p php
+ - php parallel-lint.php --exclude vendor --exclude tests\examples --no-colors .
+ - php parallel-lint.php --exclude vendor --exclude tests\examples .
diff --git a/vendor/jakub-onderka/php-parallel-lint/bin/skip-linting.php b/vendor/jakub-onderka/php-parallel-lint/bin/skip-linting.php
new file mode 100644
index 0000000000..91edff60db
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/bin/skip-linting.php
@@ -0,0 +1,22 @@
+=5.3.3"
+ },
+ "require-dev": {
+ "nette/tester": "~1.3",
+ "jakub-onderka/php-console-highlighter": "~0.3"
+ },
+ "suggest": {
+ "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet"
+ },
+ "authors": [
+ {
+ "name": "Jakub Onderka",
+ "email": "jakub.onderka@gmail.com"
+ }
+ ],
+ "autoload": {
+ "classmap": [
+ "./"
+ ]
+ },
+ "bin": ["parallel-lint"]
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/parallel-lint b/vendor/jakub-onderka/php-parallel-lint/parallel-lint
new file mode 100755
index 0000000000..cb32071887
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/parallel-lint
@@ -0,0 +1,4 @@
+#!/usr/bin/env php
+
+Options:
+ -p Specify PHP-CGI executable to run (default: 'php').
+ -s, --short Set short_open_tag to On (default: Off).
+ -a, -asp Set asp_tags to On (default: Off).
+ -e Check only files with selected extensions separated by comma.
+ (default: php,php3,php4,php5,phtml)
+ --exclude Exclude directory. If you want exclude multiple directories, use
+ multiple exclude parameters.
+ -j Run jobs in parallel (default: 10).
+ --no-colors Disable colors in console output.
+ --json Output results as JSON string (require PHP 5.4).
+ --blame Try to show git blame for row with error.
+ --git Path to Git executable to show blame message (default: 'git').
+ --stdin Load files and folder to test from standard input.
+ --ignore-fails Ignore failed tests.
+ -h, --help Print this help.
+
+PHP Parallel Lint version 0.9.1
+-------------------------------
+Usage:
+ parallel-lint [sa] [-p php] [-e ext] [-j num] [--exclude dir] [files or directories]
+
+json && PHP_VERSION_ID < 50400) {
+ throw new \Exception('JSON output require PHP version 5.4 and newer.');
+ }
+
+ if ($settings->stdin) {
+ $settings->addPaths(PhpParallelLint\Settings::getPathsFromStdIn());
+ }
+
+ if (empty($settings->paths)) {
+ showUsage();
+ }
+
+ $manager = new PhpParallelLint\Manager;
+ $result = $manager->run($settings);
+
+ if ($settings->ignoreFails) {
+ die($result->hasSyntaxError() ? WITH_ERRORS : SUCCESS);
+ } else {
+ die($result->hasError() ? WITH_ERRORS : SUCCESS);
+ }
+
+} catch (PhpParallelLint\InvalidArgumentException $e) {
+ echo "Invalid option {$e->getArgument()}" . PHP_EOL . PHP_EOL;
+ showOptions();
+ die(FAILED);
+
+} catch (PhpParallelLint\Exception $e) {
+ if ($settings->json) {
+ echo json_encode($e);
+ } else {
+ echo $e->getMessage(), PHP_EOL;
+ }
+ die(FAILED);
+
+} catch (Exception $e) {
+ echo $e->getMessage(), PHP_EOL;
+ die(FAILED);
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/phpcs-ruleset.xml b/vendor/jakub-onderka/php-parallel-lint/phpcs-ruleset.xml
new file mode 100644
index 0000000000..3aa686e881
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/phpcs-ruleset.xml
@@ -0,0 +1,71 @@
+
+
+ PHP Parallel Lint coding standard.
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Error.php b/vendor/jakub-onderka/php-parallel-lint/src/Error.php
new file mode 100644
index 0000000000..56d44647e3
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Error.php
@@ -0,0 +1,244 @@
+filePath = $filePath;
+ $this->message = rtrim($message);
+ }
+
+ /**
+ * @return string
+ */
+ public function getMessage()
+ {
+ return $this->message;
+ }
+
+ /**
+ * @return string
+ */
+ public function getFilePath()
+ {
+ return $this->filePath;
+ }
+
+ /**
+ * @return string
+ */
+ public function getShortFilePath()
+ {
+ return str_replace(getcwd(), '', $this->filePath);
+ }
+
+ /**
+ * (PHP 5 >= 5.4.0)
+ * Specify data which should be serialized to JSON
+ * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
+ * @return mixed data which can be serialized by json_encode,
+ * which is a value of any type other than a resource.
+ */
+ public function jsonSerialize()
+ {
+ return array(
+ 'type' => 'error',
+ 'file' => $this->getFilePath(),
+ 'message' => $this->getMessage(),
+ );
+ }
+}
+
+class Blame implements \JsonSerializable
+{
+ public $name;
+
+ public $email;
+
+ /** @var \DateTime */
+ public $datetime;
+
+ public $commitHash;
+
+ public $summary;
+
+ /**
+ * (PHP 5 >= 5.4.0)
+ * Specify data which should be serialized to JSON
+ * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
+ * @return mixed data which can be serialized by json_encode,
+ * which is a value of any type other than a resource.
+ */
+ function jsonSerialize()
+ {
+ return array(
+ 'name' => $this->name,
+ 'email' => $this->email,
+ 'datetime' => $this->datetime,
+ 'commitHash' => $this->commitHash,
+ 'summary' => $this->summary,
+ );
+ }
+
+
+}
+
+class SyntaxError extends Error
+{
+ /** @var Blame */
+ private $blame;
+
+ /**
+ * @return int|null
+ */
+ public function getLine()
+ {
+ preg_match('~on line ([0-9]*)~', $this->message, $matches);
+
+ if ($matches && isset($matches[1])) {
+ $onLine = (int) $matches[1];
+ return $onLine;
+ }
+
+ return null;
+ }
+
+ /**
+ * @param bool $translateTokens
+ * @return mixed|string
+ */
+ public function getNormalizedMessage($translateTokens = false)
+ {
+ $message = preg_replace('~(Parse|Fatal) error: syntax error, ~', '', $this->message);
+ $message = ucfirst($message);
+ $message = preg_replace('~ in (.*) on line [0-9]*~', '', $message);
+
+ if ($translateTokens) {
+ $message = $this->translateTokens($message);
+ }
+
+ return $message;
+ }
+
+ /**
+ * @param Blame $blame
+ */
+ public function setBlame(Blame $blame)
+ {
+ $this->blame = $blame;
+ }
+
+ /**
+ * @return Blame
+ */
+ public function getBlame()
+ {
+ return $this->blame;
+ }
+
+ /**
+ * @param string $message
+ * @return string
+ */
+ protected function translateTokens($message)
+ {
+ static $translateTokens = array(
+ 'T_FILE' => '__FILE__',
+ 'T_FUNC_C' => '__FUNCTION__',
+ 'T_HALT_COMPILER' => '__halt_compiler()',
+ 'T_INC' => '++',
+ 'T_IS_EQUAL' => '==',
+ 'T_IS_GREATER_OR_EQUAL' => '>=',
+ 'T_IS_IDENTICAL' => '===',
+ 'T_IS_NOT_IDENTICAL' => '!==',
+ 'T_IS_SMALLER_OR_EQUAL' => '<=',
+ 'T_LINE' => '__LINE__',
+ 'T_METHOD_C' => '__METHOD__',
+ 'T_MINUS_EQUAL' => '-=',
+ 'T_MOD_EQUAL' => '%=',
+ 'T_MUL_EQUAL' => '*=',
+ 'T_NS_C' => '__NAMESPACE__',
+ 'T_NS_SEPARATOR' => '\\',
+ 'T_OBJECT_OPERATOR' => '->',
+ 'T_OR_EQUAL' => '|=',
+ 'T_PAAMAYIM_NEKUDOTAYIM' => '::',
+ 'T_PLUS_EQUAL' => '+=',
+ 'T_SL' => '<<',
+ 'T_SL_EQUAL' => '<<=',
+ 'T_SR' => '>>',
+ 'T_SR_EQUAL' => '>>=',
+ 'T_START_HEREDOC' => '<<<',
+ 'T_XOR_EQUAL' => '^=',
+ 'T_ECHO' => 'echo'
+ );
+
+ return preg_replace_callback('~T_([A-Z_]*)~', function ($matches) use ($translateTokens) {
+ list($tokenName) = $matches;
+ if (isset($translateTokens[$tokenName])) {
+ $operator = $translateTokens[$tokenName];
+ return "$operator ($tokenName)";
+ }
+
+ return $tokenName;
+ }, $message);
+ }
+
+ /**
+ * (PHP 5 >= 5.4.0)
+ * Specify data which should be serialized to JSON
+ * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
+ * @return mixed data which can be serialized by json_encode,
+ * which is a value of any type other than a resource.
+ */
+ public function jsonSerialize()
+ {
+ return array(
+ 'type' => 'syntaxError',
+ 'file' => $this->getFilePath(),
+ 'line' => $this->getLine(),
+ 'message' => $this->getMessage(),
+ 'normalizeMessage' => $this->getNormalizedMessage(),
+ 'blame' => $this->blame,
+ );
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/ErrorFormatter.php b/vendor/jakub-onderka/php-parallel-lint/src/ErrorFormatter.php
new file mode 100644
index 0000000000..863e8df3e0
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/ErrorFormatter.php
@@ -0,0 +1,152 @@
+useColors = $useColors;
+ $this->translateTokens = $translateTokens;
+ }
+
+ /**
+ * @param Error $error
+ * @return string
+ */
+ public function format(Error $error)
+ {
+ if ($error instanceof SyntaxError) {
+ return $this->formatSyntaxErrorMessage($error);
+ } else {
+ if ($error->getMessage()) {
+ return $error->getMessage();
+ } else {
+ return "Unknown error for file '{$error->getFilePath()}'.";
+ }
+ }
+ }
+
+ /**
+ * @param SyntaxError $error
+ * @param bool $withCodeSnipped
+ * @return string
+ */
+ public function formatSyntaxErrorMessage(SyntaxError $error, $withCodeSnipped = true)
+ {
+ $string = "Parse error: {$error->getShortFilePath()}";
+
+ if ($error->getLine()) {
+ $onLine = $error->getLine();
+ $string .= ":$onLine" . PHP_EOL;
+
+ if ($withCodeSnipped) {
+ if ($this->useColors) {
+ $string .= $this->getColoredCodeSnippet($error->getFilePath(), $onLine);
+ } else {
+ $string .= $this->getCodeSnippet($error->getFilePath(), $onLine);
+ }
+ }
+ }
+
+ $string .= $error->getNormalizedMessage($this->translateTokens);
+
+ if ($error->getBlame()) {
+ $blame = $error->getBlame();
+ $shortCommitHash = substr($blame->commitHash, 0, 8);
+ $dateTime = $blame->datetime->format('c');
+ $string .= PHP_EOL . "Blame {$blame->name} <{$blame->email}>, commit '$shortCommitHash' from $dateTime";
+ }
+
+ return $string;
+ }
+
+ /**
+ * @param string $filePath
+ * @param int $lineNumber
+ * @param int $linesBefore
+ * @param int $linesAfter
+ * @return string
+ */
+ protected function getCodeSnippet($filePath, $lineNumber, $linesBefore = 2, $linesAfter = 2)
+ {
+ $lines = file($filePath);
+
+ $offset = $lineNumber - $linesBefore - 1;
+ $offset = max($offset, 0);
+ $length = $linesAfter + $linesBefore + 1;
+ $lines = array_slice($lines, $offset, $length, $preserveKeys = true);
+
+ end($lines);
+ $lineStrlen = strlen(key($lines) + 1);
+
+ $snippet = '';
+ foreach ($lines as $i => $line) {
+ $snippet .= ($lineNumber === $i + 1 ? ' > ' : ' ');
+ $snippet .= str_pad($i + 1, $lineStrlen, ' ', STR_PAD_LEFT) . '| ' . rtrim($line) . PHP_EOL;
+ }
+
+ return $snippet;
+ }
+
+ /**
+ * @param string $filePath
+ * @param int $lineNumber
+ * @param int $linesBefore
+ * @param int $linesAfter
+ * @return string
+ */
+ protected function getColoredCodeSnippet($filePath, $lineNumber, $linesBefore = 2, $linesAfter = 2)
+ {
+ if (
+ !class_exists('\JakubOnderka\PhpConsoleHighlighter\Highlighter') ||
+ !class_exists('\JakubOnderka\PhpConsoleColor\ConsoleColor')
+ ) {
+ return $this->getCodeSnippet($filePath, $lineNumber, $linesBefore, $linesAfter);
+ }
+
+ $colors = new ConsoleColor();
+ $colors->setForceStyle(true);
+ $highlighter = new Highlighter($colors);
+
+ $fileContent = file_get_contents($filePath);
+ return $highlighter->getCodeSnippet($fileContent, $lineNumber, $linesBefore, $linesAfter);
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/JsonSerializable.php b/vendor/jakub-onderka/php-parallel-lint/src/JsonSerializable.php
new file mode 100644
index 0000000000..dde24f559a
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/JsonSerializable.php
@@ -0,0 +1,7 @@
+output ?: $this->getDefaultOutput($settings);
+
+ $phpExecutable = PhpExecutable::getPhpExecutable($settings->phpExecutable);
+ $translateTokens = $phpExecutable->isIsHhvmType() || $phpExecutable->getVersionId() < 50400; // From PHP version 5.4 are tokens translated by default
+
+ $output->writeHeader($phpExecutable->getVersionId(), $settings->parallelJobs, $phpExecutable->getHhvmVersion());
+
+ $files = $this->getFilesFromPaths($settings->paths, $settings->extensions, $settings->excluded);
+
+ if (empty($files)) {
+ throw new Exception('No file found to check.');
+ }
+
+ $output->setTotalFileCount(count($files));
+
+ $parallelLint = new ParallelLint($phpExecutable, $settings->parallelJobs);
+ $parallelLint->setAspTagsEnabled($settings->aspTags);
+ $parallelLint->setShortTagEnabled($settings->shortTag);
+
+ $parallelLint->setProcessCallback(function ($status, $file) use ($output) {
+ if ($status === ParallelLint::STATUS_OK) {
+ $output->ok();
+ } elseif ($status === ParallelLint::STATUS_SKIP) {
+ $output->skip();
+ } elseif ($status === ParallelLint::STATUS_ERROR) {
+ $output->error();
+ } else {
+ $output->fail();
+ }
+ });
+
+ $result = $parallelLint->lint($files);
+
+ if ($settings->blame) {
+ $this->gitBlame($result, $settings);
+ }
+
+ $output->writeResult($result, new ErrorFormatter($settings->colors, $translateTokens), $settings->ignoreFails);
+
+ return $result;
+ }
+
+ /**
+ * @param Output $output
+ */
+ public function setOutput(Output $output)
+ {
+ $this->output = $output;
+ }
+
+ /**
+ * @param Settings $settings
+ * @return Output
+ */
+ protected function getDefaultOutput(Settings $settings)
+ {
+ $writer = new ConsoleWriter;
+ if ($settings->json) {
+ return new JsonOutput($writer);
+ } else {
+ return ($settings->colors ? new TextOutputColored($writer) : new TextOutput($writer));
+ }
+ }
+
+ /**
+ * @param Result $result
+ * @param Settings $settings
+ * @throws Exception
+ */
+ protected function gitBlame(Result $result, Settings $settings)
+ {
+ if (!GitBlameProcess::gitExists($settings->gitExecutable)) {
+ return;
+ }
+
+ foreach ($result->getErrors() as $error) {
+ if ($error instanceof SyntaxError) {
+ $process = new GitBlameProcess($settings->gitExecutable, $error->getFilePath(), $error->getLine());
+ $process->waitForFinish();
+
+ if ($process->isSuccess()) {
+ $blame = new Blame;
+ $blame->name = $process->getAuthor();
+ $blame->email = $process->getAuthorEmail();
+ $blame->datetime = $process->getAuthorTime();
+ $blame->commitHash = $process->getCommitHash();
+ $blame->summary = $process->getSummary();
+
+ $error->setBlame($blame);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param array $paths
+ * @param array $extensions
+ * @param array $excluded
+ * @return array
+ * @throws NotExistsPathException
+ */
+ protected function getFilesFromPaths(array $paths, array $extensions, array $excluded = array())
+ {
+ $extensions = array_flip($extensions);
+ $files = array();
+
+ foreach ($paths as $path) {
+ if (is_file($path)) {
+ $files[] = $path;
+ } elseif (is_dir($path)) {
+ $iterator = new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS);
+ if (!empty($excluded)) {
+ $iterator = new RecursiveDirectoryFilterIterator($iterator, $excluded);
+ }
+ $iterator = new \RecursiveIteratorIterator(
+ $iterator,
+ \RecursiveIteratorIterator::LEAVES_ONLY,
+ \RecursiveIteratorIterator::CATCH_GET_CHILD
+ );
+
+ /** @var \SplFileInfo[] $iterator */
+ foreach ($iterator as $directoryFile) {
+ if (isset($extensions[pathinfo($directoryFile->getFilename(), PATHINFO_EXTENSION)])) {
+ $files[] = (string) $directoryFile;
+ }
+ }
+ } else {
+ throw new NotExistsPathException($path);
+ }
+ }
+
+ $files = array_unique($files);
+
+ return $files;
+ }
+}
+
+class RecursiveDirectoryFilterIterator extends \RecursiveFilterIterator
+{
+ /** @var \RecursiveDirectoryIterator */
+ private $iterator;
+
+ /** @var array */
+ private $excluded = array();
+
+ /**
+ * @param \RecursiveDirectoryIterator $iterator
+ * @param array $excluded
+ */
+ public function __construct(\RecursiveDirectoryIterator $iterator, array $excluded)
+ {
+ parent::__construct($iterator);
+ $this->iterator = $iterator;
+ $this->excluded = array_map(array($this, 'getPathname'), $excluded);
+ }
+
+ /**
+ * (PHP 5 >= 5.1.0)
+ * Check whether the current element of the iterator is acceptable
+ *
+ * @link http://php.net/manual/en/filteriterator.accept.php
+ * @return bool true if the current element is acceptable, otherwise false.
+ */
+ public function accept()
+ {
+ $current = $this->current()->getPathname();
+ $current = $this->normalizeDirectorySeparator($current);
+
+ if ('.' . DIRECTORY_SEPARATOR !== $current[0] . $current[1]) {
+ $current = '.' . DIRECTORY_SEPARATOR . $current;
+ }
+
+ return !in_array($current, $this->excluded);
+ }
+
+ /**
+ * (PHP 5 >= 5.1.0)
+ * Check whether the inner iterator's current element has children
+ *
+ * @link http://php.net/manual/en/recursivefilteriterator.haschildren.php
+ * @return bool true if the inner iterator has children, otherwise false
+ */
+ public function hasChildren()
+ {
+ return $this->iterator->hasChildren();
+ }
+
+ /**
+ * (PHP 5 >= 5.1.0)
+ * Return the inner iterator's children contained in a RecursiveFilterIterator
+ *
+ * @link http://php.net/manual/en/recursivefilteriterator.getchildren.php
+ * @return \RecursiveFilterIterator containing the inner iterator's children.
+ */
+ public function getChildren()
+ {
+ return new self($this->iterator->getChildren(), $this->excluded);
+ }
+
+ /**
+ * @param string $file
+ * @return string
+ */
+ private function getPathname($file)
+ {
+ $file = $this->normalizeDirectorySeparator($file);
+
+ if ('.' . DIRECTORY_SEPARATOR !== $file[0] . $file[1]) {
+ $file = '.' . DIRECTORY_SEPARATOR . $file;
+ }
+
+ $directoryFile = new \SplFileInfo($file);
+ return $directoryFile->getPathname();
+ }
+
+ /**
+ * @param string $file
+ * @return string
+ */
+ private function normalizeDirectorySeparator($file)
+ {
+ return str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $file);
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Output.php b/vendor/jakub-onderka/php-parallel-lint/src/Output.php
new file mode 100644
index 0000000000..bb64a82ba5
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Output.php
@@ -0,0 +1,449 @@
+writer = $writer;
+ }
+
+ public function ok()
+ {
+
+ }
+
+ public function skip()
+ {
+
+ }
+
+ public function error()
+ {
+
+ }
+
+ public function fail()
+ {
+
+ }
+
+ public function setTotalFileCount($count)
+ {
+
+ }
+
+ public function writeHeader($phpVersion, $parallelJobs, $hhvmVersion = null)
+ {
+ $this->phpVersion = $phpVersion;
+ $this->parallelJobs = $parallelJobs;
+ $this->hhvmVersion = $hhvmVersion;
+ }
+
+ public function writeResult(Result $result, ErrorFormatter $errorFormatter, $ignoreFails)
+ {
+ echo json_encode(array(
+ 'phpVersion' => $this->phpVersion,
+ 'hhvmVersion' => $this->hhvmVersion,
+ 'parallelJobs' => $this->parallelJobs,
+ 'results' => $result,
+ ));
+ }
+}
+
+class TextOutput implements Output
+{
+ const TYPE_DEFAULT = 'default',
+ TYPE_SKIP = 'skip',
+ TYPE_ERROR = 'error',
+ TYPE_OK = 'ok';
+
+ /** @var int */
+ public $filesPerLine = 60;
+
+ /** @var int */
+ protected $checkedFiles;
+
+ /** @var int */
+ protected $totalFileCount;
+
+ /** @var IWriter */
+ protected $writer;
+
+ /**
+ * @param IWriter $writer
+ */
+ public function __construct(IWriter $writer)
+ {
+ $this->writer = $writer;
+ }
+
+ public function ok()
+ {
+ $this->writer->write('.');
+ $this->progress();
+ }
+
+ public function skip()
+ {
+ $this->write('S', self::TYPE_SKIP);
+ $this->progress();
+ }
+
+ public function error()
+ {
+ $this->write('X', self::TYPE_ERROR);
+ $this->progress();
+ }
+
+ public function fail()
+ {
+ $this->writer->write('-');
+ $this->progress();
+ }
+
+ /**
+ * @param string $string
+ * @param string $type
+ */
+ public function write($string, $type = self::TYPE_DEFAULT)
+ {
+ $this->writer->write($string);
+ }
+
+ /**
+ * @param string|null $line
+ * @param string $type
+ */
+ public function writeLine($line = null, $type = self::TYPE_DEFAULT)
+ {
+ $this->write($line, $type);
+ $this->writeNewLine();
+ }
+
+ /**
+ * @param int $count
+ */
+ public function writeNewLine($count = 1)
+ {
+ $this->write(str_repeat(PHP_EOL, $count));
+ }
+
+ /**
+ * @param int $count
+ */
+ public function setTotalFileCount($count)
+ {
+ $this->totalFileCount = $count;
+ }
+
+ /**
+ * @param int $phpVersion
+ * @param int $parallelJobs
+ * @param string $hhvmVersion
+ */
+ public function writeHeader($phpVersion, $parallelJobs, $hhvmVersion = null)
+ {
+ $this->write("PHP {$this->phpVersionIdToString($phpVersion)} | ");
+
+ if ($hhvmVersion) {
+ $this->write("HHVM $hhvmVersion | ");
+ }
+
+ if ($parallelJobs === 1) {
+ $this->writeLine("1 job");
+ } else {
+ $this->writeLine("{$parallelJobs} parallel jobs");
+ }
+ }
+
+ /**
+ * @param Result $result
+ * @param ErrorFormatter $errorFormatter
+ * @param bool $ignoreFails
+ */
+ public function writeResult(Result $result, ErrorFormatter $errorFormatter, $ignoreFails)
+ {
+ if ($this->checkedFiles % $this->filesPerLine !== 0) {
+ $rest = $this->filesPerLine - ($this->checkedFiles % $this->filesPerLine);
+ $this->write(str_repeat(' ', $rest));
+ $this->writeProgress();
+ }
+
+ $this->writeNewLine(2);
+
+ $testTime = round($result->getTestTime(), 1);
+ $message = "Checked {$result->getCheckedFilesCount()} files in $testTime ";
+ $message .= $testTime == 1 ? 'second' : 'seconds';
+
+ if ($result->getSkippedFilesCount() > 0) {
+ $message .= ", skipped {$result->getSkippedFilesCount()} ";
+ $message .= ($result->getSkippedFilesCount() === 1 ? 'file' : 'files');
+ }
+
+ $this->writeLine($message);
+
+ if (!$result->hasSyntaxError()) {
+ $message = "No syntax error found";
+ } else {
+ $message = "Syntax error found in {$result->getFilesWithSyntaxErrorCount()} ";
+ $message .= ($result->getFilesWithSyntaxErrorCount() === 1 ? 'file' : 'files');
+ }
+
+ if ($result->hasFilesWithFail()) {
+ $message .= ", failed to check {$result->getFilesWithFailCount()} ";
+ $message .= ($result->getFilesWithFailCount() === 1 ? 'file' : 'files');
+
+ if ($ignoreFails) {
+ $message .= ' (ignored)';
+ }
+ }
+
+ $hasError = $ignoreFails ? $result->hasSyntaxError() : $result->hasError();
+ $this->writeLine($message, $hasError ? self::TYPE_ERROR : self::TYPE_OK);
+
+ if ($result->hasError()) {
+ $this->writeNewLine();
+ foreach ($result->getErrors() as $error) {
+ $this->writeLine(str_repeat('-', 60));
+ $this->writeLine($errorFormatter->format($error));
+ }
+ }
+ }
+
+ protected function progress()
+ {
+ ++$this->checkedFiles;
+
+ if ($this->checkedFiles % $this->filesPerLine === 0) {
+ $this->writeProgress();
+ }
+ }
+
+ protected function writeProgress()
+ {
+ $percent = floor($this->checkedFiles / $this->totalFileCount * 100);
+ $current = $this->stringWidth($this->checkedFiles, strlen($this->totalFileCount));
+ $this->writeLine(" $current/$this->totalFileCount ($percent %)");
+ }
+
+ /**
+ * @param string $input
+ * @param int $width
+ * @return string
+ */
+ protected function stringWidth($input, $width = 3)
+ {
+ $multiplier = $width - strlen($input);
+ return str_repeat(' ', $multiplier > 0 ? $multiplier : 0) . $input;
+ }
+
+ /**
+ * @param int $phpVersionId
+ * @return string
+ */
+ protected function phpVersionIdToString($phpVersionId)
+ {
+ $releaseVersion = (int) substr($phpVersionId, -2, 2);
+ $minorVersion = (int) substr($phpVersionId, -4, 2);
+ $majorVersion = (int) substr($phpVersionId, 0, strlen($phpVersionId) - 4);
+
+ return "$majorVersion.$minorVersion.$releaseVersion";
+ }
+}
+
+class TextOutputColored extends TextOutput
+{
+ /** @var \JakubOnderka\PhpConsoleColor\ConsoleColor */
+ private $colors;
+
+ public function __construct(IWriter $writer)
+ {
+ parent::__construct($writer);
+
+ if (class_exists('\JakubOnderka\PhpConsoleColor\ConsoleColor')) {
+ $this->colors = new \JakubOnderka\PhpConsoleColor\ConsoleColor();
+ $this->colors->setForceStyle(true);
+ }
+ }
+
+ /**
+ * @param string $string
+ * @param string $type
+ * @throws \JakubOnderka\PhpConsoleColor\InvalidStyleException
+ */
+ public function write($string, $type = self::TYPE_DEFAULT)
+ {
+ if (!$this->colors instanceof \JakubOnderka\PhpConsoleColor\ConsoleColor) {
+ parent::write($string, $type);
+ } else {
+ switch ($type) {
+ case self::TYPE_OK:
+ parent::write($this->colors->apply('bg_green', $string));
+ break;
+
+ case self::TYPE_SKIP:
+ parent::write($this->colors->apply('bg_yellow', $string));
+ break;
+
+ case self::TYPE_ERROR:
+ parent::write($this->colors->apply('bg_red', $string));
+ break;
+
+ default:
+ parent::write($string);
+ }
+ }
+ }
+}
+
+interface IWriter
+{
+ /**
+ * @param string $string
+ */
+ public function write($string);
+}
+
+class NullWriter implements IWriter
+{
+ /**
+ * @param string $string
+ */
+ public function write($string)
+ {
+
+ }
+}
+
+class ConsoleWriter implements IWriter
+{
+ /**
+ * @param string $string
+ */
+ public function write($string)
+ {
+ echo $string;
+ }
+}
+
+class FileWriter implements IWriter
+{
+ /** @var string */
+ protected $logFile;
+
+ /** @var string */
+ protected $buffer;
+
+ public function __construct($logFile)
+ {
+ $this->logFile = $logFile;
+ }
+
+ public function write($string)
+ {
+ $this->buffer .= $string;
+ }
+
+ public function __destruct()
+ {
+ file_put_contents($this->logFile, $this->buffer);
+ }
+}
+
+class MultipleWriter implements IWriter
+{
+ /** @var IWriter[] */
+ protected $writers;
+
+ /**
+ * @param IWriter[] $writers
+ */
+ public function __construct(array $writers)
+ {
+ foreach ($writers as $writer) {
+ $this->addWriter($writer);
+ }
+ }
+
+ /**
+ * @param IWriter $writer
+ */
+ public function addWriter(IWriter $writer)
+ {
+ $this->writers[] = $writer;
+ }
+
+ /**
+ * @param $string
+ */
+ public function write($string)
+ {
+ foreach ($this->writers as $writer) {
+ $writer->write($string);
+ }
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/ParallelLint.php b/vendor/jakub-onderka/php-parallel-lint/src/ParallelLint.php
new file mode 100644
index 0000000000..d491d349cb
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/ParallelLint.php
@@ -0,0 +1,261 @@
+phpExecutable = $phpExecutable;
+ $this->parallelJobs = $parallelJobs;
+ }
+
+ /**
+ * @param array $files
+ * @return Result
+ * @throws \Exception
+ */
+ public function lint(array $files)
+ {
+ $startTime = microtime(true);
+
+ $skipLintProcess = new SkipLintProcess($this->phpExecutable, $files);
+
+ $processCallback = is_callable($this->processCallback) ? $this->processCallback : function() {};
+
+ /**
+ * @var LintProcess[] $running
+ * @var LintProcess[] $waiting
+ */
+ $errors = $running = $waiting = array();
+ $skippedFiles = $checkedFiles = array();
+
+ while ($files || $running) {
+ for ($i = count($running); $files && $i < $this->parallelJobs; $i++) {
+ $file = array_shift($files);
+
+ if ($skipLintProcess->isSkipped($file) === true) {
+ $skippedFiles[] = $file;
+ $processCallback(self::STATUS_SKIP, $file);
+ } else {
+ $running[$file] = new LintProcess(
+ $this->phpExecutable,
+ $file,
+ $this->aspTagsEnabled,
+ $this->shortTagEnabled
+ );
+ }
+ }
+
+ $skipLintProcess->getChunk();
+ usleep(100);
+
+ foreach ($running as $file => $process) {
+ if ($process->isFinished()) {
+ unset($running[$file]);
+
+ $skipStatus = $skipLintProcess->isSkipped($file);
+ if ($skipStatus === null) {
+ $waiting[$file] = $process;
+
+ } elseif ($skipStatus === true) {
+ $skippedFiles[] = $file;
+ $processCallback(self::STATUS_SKIP, $file);
+
+ } elseif ($process->isSuccess()) {
+ $checkedFiles[] = $file;
+ $processCallback(self::STATUS_OK, $file);
+
+ } elseif ($process->hasSyntaxError()) {
+ $checkedFiles[] = $file;
+ $errors[] = new SyntaxError($file, $process->getSyntaxError());
+ $processCallback(self::STATUS_ERROR, $file);
+
+ } else {
+ $errors[] = new Error($file, $process->getOutput());
+ $processCallback(self::STATUS_FAIL, $file);
+ }
+ }
+ }
+ }
+
+ if (!empty($waiting)) {
+ $skipLintProcess->waitForFinish();
+
+ foreach ($waiting as $file => $process) {
+ $skipStatus = $skipLintProcess->isSkipped($file);
+ if ($skipStatus === null) {
+ throw new \Exception("File $file has empty skip status. Please contact PHP Parallel Lint author.");
+
+ } elseif ($skipStatus === true) {
+ $skippedFiles[] = $file;
+ $processCallback(self::STATUS_SKIP, $file);
+
+ } elseif ($process->isSuccess()) {
+ $checkedFiles[] = $file;
+ $processCallback(self::STATUS_OK, $file);
+
+ } elseif ($process->hasSyntaxError()) {
+ $checkedFiles[] = $file;
+ $errors[] = new SyntaxError($file, $process->getSyntaxError());
+ $processCallback(self::STATUS_ERROR, $file);
+
+ } else {
+ $errors[] = new Error($file, $process->getOutput());
+ $processCallback(self::STATUS_FAIL, $file);
+ }
+ }
+ }
+
+ $testTime = microtime(true) - $startTime;
+
+ return new Result($errors, $checkedFiles, $skippedFiles, $testTime);
+ }
+
+ /**
+ * @return int
+ */
+ public function getParallelJobs()
+ {
+ return $this->parallelJobs;
+ }
+
+ /**
+ * @param int $parallelJobs
+ * @return ParallelLint
+ */
+ public function setParallelJobs($parallelJobs)
+ {
+ $this->parallelJobs = $parallelJobs;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPhpExecutable()
+ {
+ return $this->phpExecutable;
+ }
+
+ /**
+ * @param string $phpExecutable
+ * @return ParallelLint
+ */
+ public function setPhpExecutable($phpExecutable)
+ {
+ $this->phpExecutable = $phpExecutable;
+
+ return $this;
+ }
+
+ /**
+ * @return callable
+ */
+ public function getProcessCallback()
+ {
+ return $this->processCallback;
+ }
+
+ /**
+ * @param callable $processCallback
+ * @return ParallelLint
+ */
+ public function setProcessCallback($processCallback)
+ {
+ $this->processCallback = $processCallback;
+
+ return $this;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isAspTagsEnabled()
+ {
+ return $this->aspTagsEnabled;
+ }
+
+ /**
+ * @param boolean $aspTagsEnabled
+ * @return ParallelLint
+ */
+ public function setAspTagsEnabled($aspTagsEnabled)
+ {
+ $this->aspTagsEnabled = $aspTagsEnabled;
+
+ return $this;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isShortTagEnabled()
+ {
+ return $this->shortTagEnabled;
+ }
+
+ /**
+ * @param boolean $shortTagEnabled
+ * @return ParallelLint
+ */
+ public function setShortTagEnabled($shortTagEnabled)
+ {
+ $this->shortTagEnabled = $shortTagEnabled;
+
+ return $this;
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Process/GitBlameProcess.php b/vendor/jakub-onderka/php-parallel-lint/src/Process/GitBlameProcess.php
new file mode 100644
index 0000000000..640a83cd92
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Process/GitBlameProcess.php
@@ -0,0 +1,143 @@
+getStatusCode() === 0;
+ }
+
+ /**
+ * @return string
+ * @throws RunTimeException
+ */
+ public function getAuthor()
+ {
+ if (!$this->isSuccess()) {
+ throw new RunTimeException("Author can be taken only for success process output.");
+ }
+
+ $output = $this->getOutput();
+ preg_match('~^author (.*)~m', $output, $matches);
+ return $matches[1];
+ }
+
+ /**
+ * @return string
+ * @throws RunTimeException
+ */
+ public function getAuthorEmail()
+ {
+ if (!$this->isSuccess()) {
+ throw new RunTimeException("Author e-mail can be taken only for success process output.");
+ }
+
+ $output = $this->getOutput();
+ preg_match('~^author-mail <(.*)>~m', $output, $matches);
+ return $matches[1];
+ }
+
+ /**
+ * @return \DateTime
+ * @throws RunTimeException
+ */
+ public function getAuthorTime()
+ {
+ if (!$this->isSuccess()) {
+ throw new RunTimeException("Author time can be taken only for success process output.");
+ }
+
+ $output = $this->getOutput();
+
+ preg_match('~^author-time (.*)~m', $output, $matches);
+ $time = $matches[1];
+
+ preg_match('~^author-tz (.*)~m', $output, $matches);
+ $zone = $matches[1];
+
+ return $this->getDateTime($time, $zone);
+ }
+
+ /**
+ * @return string
+ * @throws RunTimeException
+ */
+ public function getCommitHash()
+ {
+ if (!$this->isSuccess()) {
+ throw new RunTimeException("Commit hash can be taken only for success process output.");
+ }
+
+ return substr($this->getOutput(), 0, strpos($this->getOutput(), ' '));
+ }
+
+ /**
+ * @return string
+ * @throws RunTimeException
+ */
+ public function getSummary()
+ {
+ if (!$this->isSuccess()) {
+ throw new RunTimeException("Commit summary can be taken only for success process output.");
+ }
+
+ $output = $this->getOutput();
+ preg_match('~^summary (.*)~m', $output, $matches);
+ return $matches[1];
+ }
+
+ /**
+ * @param string $gitExecutable
+ * @return bool
+ */
+ public static function gitExists($gitExecutable)
+ {
+ $process = new Process(escapeshellcmd($gitExecutable) . ' --version');
+ $process->waitForFinish();
+ return $process->getStatusCode() === 0;
+ }
+
+ /**
+ * This harakiri method is required to correct support time zone in PHP 5.4
+ *
+ * @param int $time
+ * @param string $zone
+ * @return \DateTime
+ */
+ protected function getDateTime($time, $zone)
+ {
+ $utcTimeZone = new \DateTimeZone('UTC');
+ $datetime = \DateTime::createFromFormat('U', $time, $utcTimeZone);
+
+ $way = substr($zone, 0, 1);
+ $hours = (int) substr($zone, 1, 2);
+ $minutes = (int) substr($zone, 3, 2);
+
+ $interval = new \DateInterval("PT{$hours}H{$minutes}M");
+
+ if ($way === '+') {
+ $datetime->add($interval);
+ } else {
+ $datetime->sub($interval);
+ }
+
+ return new \DateTime($datetime->format('Y-m-d\TH:i:s') . $zone, $utcTimeZone);
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Process/LintProcess.php b/vendor/jakub-onderka/php-parallel-lint/src/Process/LintProcess.php
new file mode 100644
index 0000000000..a411d6452f
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Process/LintProcess.php
@@ -0,0 +1,67 @@
+getOutput(), 'Fatal error') !== false ||
+ strpos($this->getOutput(), 'Parse error') !== false;
+ }
+
+ /**
+ * @return bool|string
+ */
+ public function getSyntaxError()
+ {
+ if ($this->hasSyntaxError()) {
+ list(, $out) = explode("\n", $this->getOutput());
+ return $out;
+ }
+
+ return false;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isFail()
+ {
+ return defined('PHP_WINDOWS_VERSION_MAJOR') ? $this->getStatusCode() === 1 : parent::isFail();
+ }
+
+ /**
+ * @return bool
+ */
+ public function isSuccess()
+ {
+ return $this->getStatusCode() === 0;
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Process/PhpExecutable.php b/vendor/jakub-onderka/php-parallel-lint/src/Process/PhpExecutable.php
new file mode 100644
index 0000000000..5593a9114c
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Process/PhpExecutable.php
@@ -0,0 +1,128 @@
+path = $path;
+ $this->versionId = $versionId;
+ $this->hhvmVersion = $hhvmVersion;
+ $this->isHhvmType = $isHhvmType;
+ }
+
+ /**
+ * @return string
+ */
+ public function getHhvmVersion()
+ {
+ return $this->hhvmVersion;
+ }
+
+ /**
+ * @return boolean
+ */
+ public function isIsHhvmType()
+ {
+ return $this->isHhvmType;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * @return int
+ */
+ public function getVersionId()
+ {
+ return $this->versionId;
+ }
+
+ /**
+ * @param string $phpExecutable
+ * @return PhpExecutable
+ * @throws \Exception
+ */
+ public static function getPhpExecutable($phpExecutable)
+ {
+ $codeToExecute = <<waitForFinish();
+
+ try {
+ if ($process->getStatusCode() !== 0 && $process->getStatusCode() !== 255) {
+ throw new RunTimeException("Unable to execute '{$phpExecutable}'.");
+ }
+
+ return self::getPhpExecutableFromOutput($phpExecutable, $process->getOutput());
+
+ } catch (RunTimeException $e) {
+ // Try HHVM type
+ $process = new Process(escapeshellarg($phpExecutable) . ' --php -r ' . escapeshellarg($codeToExecute));
+ $process->waitForFinish();
+
+ if ($process->getStatusCode() !== 0 && $process->getStatusCode() !== 255) {
+ throw new RunTimeException("Unable to execute '{$phpExecutable}'.");
+ }
+
+ return self::getPhpExecutableFromOutput($phpExecutable, $process->getOutput(), $isHhvmType = true);
+ }
+ }
+
+ /**
+ * @param string $phpExecutable
+ * @param string $output
+ * @param bool $isHhvmType
+ * @return PhpExecutable
+ * @throws RunTimeException
+ */
+ private static function getPhpExecutableFromOutput($phpExecutable, $output, $isHhvmType = false)
+ {
+ $parts = explode(';', $output);
+
+ if ($parts[0] !== 'PHP' || !preg_match('~([0-9]+)~', $parts[1], $matches)) {
+ throw new RunTimeException("'{$phpExecutable}' is not valid PHP binary.");
+ }
+
+ $hhvmVersion = isset($parts[2]) ? $parts[2] : false;
+
+ return new PhpExecutable(
+ $phpExecutable,
+ intval($matches[1]),
+ $hhvmVersion,
+ $isHhvmType
+ );
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Process/PhpProcess.php b/vendor/jakub-onderka/php-parallel-lint/src/Process/PhpProcess.php
new file mode 100644
index 0000000000..c627ce1cd8
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Process/PhpProcess.php
@@ -0,0 +1,27 @@
+getPath()) . ' ' . $this->constructParameters($parameters, $phpExecutable->isIsHhvmType());
+ parent::__construct($cmdLine, $stdIn);
+ }
+
+ /**
+ * @param array $parameters
+ * @param bool $isHhvm
+ * @return string
+ */
+ private function constructParameters(array $parameters, $isHhvm)
+ {
+ return ($isHhvm ? '--php ' : '') . implode(' ', $parameters);
+ }
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Process/Process.php b/vendor/jakub-onderka/php-parallel-lint/src/Process/Process.php
new file mode 100644
index 0000000000..947aa8c6ff
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Process/Process.php
@@ -0,0 +1,150 @@
+ array('pipe', self::READ),
+ self::STDOUT => array('pipe', self::WRITE),
+ self::STDERR => array('pipe', self::WRITE),
+ );
+
+ $this->process = proc_open($cmdLine, $descriptors, $pipes, null, null, array('bypass_shell' => true));
+
+ if ($this->process === false) {
+ throw new RunTimeException("Cannot create new process $cmdLine");
+ }
+
+ list($stdin, $this->stdout, $this->stderr) = $pipes;
+
+ if ($stdInInput) {
+ fwrite($stdin, $stdInInput);
+ }
+
+ fclose($stdin);
+ }
+
+ /**
+ * @return bool
+ */
+ public function isFinished()
+ {
+ if ($this->statusCode !== NULL) {
+ return true;
+ }
+
+ $status = proc_get_status($this->process);
+
+ if ($status['running']) {
+ return false;
+ } elseif ($this->statusCode === null) {
+ $this->statusCode = (int) $status['exitcode'];
+ }
+
+ // Process outputs
+ $this->output = stream_get_contents($this->stdout);
+ fclose($this->stdout);
+
+ $this->errorOutput = stream_get_contents($this->stderr);
+ fclose($this->stderr);
+
+ $statusCode = proc_close($this->process);
+
+ if ($this->statusCode === null) {
+ $this->statusCode = $statusCode;
+ }
+
+ $this->process = null;
+
+ return true;
+ }
+
+ public function waitForFinish()
+ {
+ while (!$this->isFinished()) {
+ usleep(100);
+ }
+ }
+
+ /**
+ * @return string
+ * @throws RunTimeException
+ */
+ public function getOutput()
+ {
+ if (!$this->isFinished()) {
+ throw new RunTimeException("Cannot get output for running process");
+ }
+
+ return $this->output;
+ }
+
+ /**
+ * @return string
+ * @throws RunTimeException
+ */
+ public function getErrorOutput()
+ {
+ if (!$this->isFinished()) {
+ throw new RunTimeException("Cannot get error output for running process");
+ }
+
+ return $this->errorOutput;
+ }
+
+ /**
+ * @return int
+ * @throws RunTimeException
+ */
+ public function getStatusCode()
+ {
+ if (!$this->isFinished()) {
+ throw new RunTimeException("Cannot get status code for running process");
+ }
+
+ return $this->statusCode;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isFail()
+ {
+ return $this->getStatusCode() === 1;
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Process/SkipLintProcess.php b/vendor/jakub-onderka/php-parallel-lint/src/Process/SkipLintProcess.php
new file mode 100644
index 0000000000..f66bf0d00d
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Process/SkipLintProcess.php
@@ -0,0 +1,89 @@
+isFinished()) {
+ $this->processLines(fread($this->stdout, 8192));
+ }
+ }
+
+ /**
+ * @return bool
+ * @throws \JakubOnderka\PhpParallelLint\RunTimeException
+ */
+ public function isFinished()
+ {
+ $isFinished = parent::isFinished();
+ if ($isFinished && !$this->done) {
+ $this->done = true;
+ $output = $this->getOutput();
+ $this->processLines($output);
+ }
+
+ return $isFinished;
+ }
+
+ /**
+ * @param string $file
+ * @return bool|null
+ */
+ public function isSkipped($file)
+ {
+ if (isset($this->skipped[$file])) {
+ return $this->skipped[$file];
+ }
+
+ return null;
+ }
+
+ /**
+ * @param string $content
+ */
+ private function processLines($content)
+ {
+ if (!empty($content)) {
+ $lines = explode(PHP_EOL, $this->endLastChunk . $content);
+ $this->endLastChunk = array_pop($lines);
+ foreach ($lines as $line) {
+ $parts = explode(';', $line);
+ list($file, $status) = $parts;
+ $this->skipped[$file] = $status === '1' ? true : false;
+ }
+ }
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Result.php b/vendor/jakub-onderka/php-parallel-lint/src/Result.php
new file mode 100644
index 0000000000..6826de13a5
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Result.php
@@ -0,0 +1,197 @@
+errors = $errors;
+ $this->checkedFiles = $checkedFiles;
+ $this->skippedFiles = $skippedFiles;
+ $this->testTime = $testTime;
+ }
+
+ /**
+ * @return array
+ */
+ public function getErrors()
+ {
+ return $this->errors;
+ }
+
+ /**
+ * @return bool
+ */
+ public function hasError()
+ {
+ return !empty($this->errors);
+ }
+
+ /**
+ * @return array
+ */
+ public function getFilesWithFail()
+ {
+ $filesWithFail = array();
+ foreach ($this->errors as $error) {
+ if (!$error instanceof SyntaxError) {
+ $filesWithFail[] = $error->getFilePath();
+ }
+ }
+
+ return $filesWithFail;
+ }
+
+ /**
+ * @return int
+ */
+ public function getFilesWithFailCount()
+ {
+ return count($this->getFilesWithFail());
+ }
+
+ /**
+ * @return bool
+ */
+ public function hasFilesWithFail()
+ {
+ return $this->getFilesWithFailCount() !== 0;
+ }
+
+ /**
+ * @return array
+ */
+ public function getCheckedFiles()
+ {
+ return $this->checkedFiles;
+ }
+
+ /**
+ * @return int
+ */
+ public function getCheckedFilesCount()
+ {
+ return count($this->checkedFiles);
+ }
+
+ /**
+ * @return array
+ */
+ public function getSkippedFiles()
+ {
+ return $this->skippedFiles;
+ }
+
+ /**
+ * @return int
+ */
+ public function getSkippedFilesCount()
+ {
+ return count($this->skippedFiles);
+ }
+
+ /**
+ * @return array
+ */
+ public function getFilesWithSyntaxError()
+ {
+ $filesWithSyntaxError = array();
+ foreach ($this->errors as $error) {
+ if ($error instanceof SyntaxError) {
+ $filesWithSyntaxError[] = $error->getFilePath();
+ }
+ }
+
+ return $filesWithSyntaxError;
+ }
+
+ /**
+ * @return int
+ */
+ public function getFilesWithSyntaxErrorCount()
+ {
+ return count($this->getFilesWithSyntaxError());
+ }
+
+ /**
+ * @return bool
+ */
+ public function hasSyntaxError()
+ {
+ return $this->getFilesWithSyntaxErrorCount() !== 0;
+ }
+
+ /**
+ * @return float
+ */
+ public function getTestTime()
+ {
+ return $this->testTime;
+ }
+
+ /**
+ * (PHP 5 >= 5.4.0)
+ * Specify data which should be serialized to JSON
+ * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
+ * @return mixed data which can be serialized by json_encode,
+ * which is a value of any type other than a resource.
+ */
+ function jsonSerialize()
+ {
+ return array(
+ 'checkedFiles' => $this->getCheckedFiles(),
+ 'filesWithSyntaxError' => $this->getFilesWithSyntaxError(),
+ 'skippedFiles' => $this->getSkippedFiles(),
+ 'errors' => $this->getErrors(),
+ );
+ }
+
+
+}
\ No newline at end of file
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/Settings.php b/vendor/jakub-onderka/php-parallel-lint/src/Settings.php
new file mode 100644
index 0000000000..0104417a71
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/Settings.php
@@ -0,0 +1,217 @@
+ tags.
+ * @var bool
+ */
+ public $aspTags = false;
+
+ /**
+ * Number of jobs running in same time
+ * @var int
+ */
+ public $parallelJobs = 10;
+
+ /**
+ * If path contains directory, only file with these extensions are checked
+ * @var array
+ */
+ public $extensions = array('php', 'phtml', 'php3', 'php4', 'php5');
+
+ /**
+ * Array of file or directories to check
+ * @var array
+ */
+ public $paths = array();
+
+ /**
+ * Dont't check files or directories
+ * @var array
+ */
+ public $excluded = array();
+
+ /**
+ * Print to console with colors
+ * @var bool
+ */
+ public $colors = true;
+
+ /**
+ * Output results as JSON string
+ * @var bool
+ */
+ public $json = false;
+
+ /**
+ * Read files and folder to tests from standard input (blocking)
+ * @var bool
+ */
+ public $stdin = false;
+
+ /**
+ * Try to show git blame for row with error
+ * @var bool
+ */
+ public $blame = false;
+
+ /**
+ * Path to git executable for blame
+ * @var string
+ */
+ public $gitExecutable = 'git';
+
+ /**
+ * @var bool
+ */
+ public $ignoreFails = false;
+
+ /**
+ * @param array $paths
+ */
+ public function addPaths(array $paths)
+ {
+ $this->paths = array_merge($this->paths, $paths);
+ }
+
+ /**
+ * @param array $arguments
+ * @return Settings
+ * @throws InvalidArgumentException
+ */
+ public static function parseArguments(array $arguments)
+ {
+ $arguments = new ArrayIterator(array_slice($arguments, 1));
+ $settings = new self;
+
+ foreach ($arguments as $argument) {
+ if ($argument{0} !== '-') {
+ $settings->paths[] = $argument;
+ } else {
+ switch ($argument) {
+ case '-p':
+ $settings->phpExecutable = $arguments->getNext();
+ break;
+
+ case '-s':
+ case '--short':
+ $settings->shortTag = true;
+ break;
+
+ case '-a':
+ case '--asp':
+ $settings->aspTags = true;
+ break;
+
+ case '--exclude':
+ $settings->excluded[] = $arguments->getNext();
+ break;
+
+ case '-e':
+ $settings->extensions = array_map('trim', explode(',', $arguments->getNext()));
+ break;
+
+ case '-j':
+ $settings->parallelJobs = max((int) $arguments->getNext(), 1);
+ break;
+
+ case '--no-colors':
+ $settings->colors = false;
+ break;
+
+ case '--json':
+ $settings->json = true;
+ break;
+
+ case '--git':
+ $settings->gitExecutable = $arguments->getNext();
+ break;
+
+ case '--stdin':
+ $settings->stdin = true;
+ break;
+
+ case '--blame':
+ $settings->blame = true;
+ break;
+
+ case '--ignore-fails':
+ $settings->ignoreFails = true;
+ break;
+
+ default:
+ throw new InvalidArgumentException($argument);
+ }
+ }
+ }
+
+ return $settings;
+ }
+
+ /**
+ * @return array
+ */
+ public static function getPathsFromStdIn()
+ {
+ $content = stream_get_contents(STDIN);
+
+ if (empty($content)) {
+ return array();
+ }
+
+ $lines = explode("\n", rtrim($content));
+ return array_map('rtrim', $lines);
+ }
+}
+
+class ArrayIterator extends \ArrayIterator
+{
+ public function getNext()
+ {
+ $this->next();
+ return $this->current();
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/src/exceptions.php b/vendor/jakub-onderka/php-parallel-lint/src/exceptions.php
new file mode 100644
index 0000000000..97f7d54ab9
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/src/exceptions.php
@@ -0,0 +1,80 @@
+ get_class($this),
+ 'message' => $this->getMessage(),
+ 'code' => $this->getCode(),
+ );
+ }
+}
+
+class RunTimeException extends Exception
+{
+
+}
+
+class InvalidArgumentException extends Exception
+{
+ protected $argument;
+
+ public function __construct($argument)
+ {
+ $this->argument = $argument;
+ $this->message = "Invalid argument $argument";
+ }
+
+ public function getArgument()
+ {
+ return $this->argument;
+ }
+}
+
+class NotExistsPathException extends Exception
+{
+ protected $path;
+
+ public function __construct($path)
+ {
+ $this->path = $path;
+ $this->message = "Path '$path' not found";
+ }
+
+ public function getPath()
+ {
+ return $this->path;
+ }
+}
diff --git a/vendor/jakub-onderka/php-parallel-lint/tests/Manager.run.phpt b/vendor/jakub-onderka/php-parallel-lint/tests/Manager.run.phpt
new file mode 100644
index 0000000000..169608c7dc
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/tests/Manager.run.phpt
@@ -0,0 +1,122 @@
+prepareSettings();
+ $settings->paths = array('path/for-not-found/');
+ $manager = $this->getManager($settings);
+ Assert::exception(function() use ($manager, $settings) {
+ $manager->run($settings);
+ }, 'JakubOnderka\PhpParallelLint\NotExistsPathException');
+ }
+
+ public function testFilesNotFound()
+ {
+ $settings = $this->prepareSettings();
+ $settings->paths = array('examples/example-01/');
+ $manager = $this->getManager($settings);
+ Assert::exception(function() use ($manager, $settings) {
+ $manager->run($settings);
+ }, 'JakubOnderka\PhpParallelLint\Exception', 'No file found to check.');
+ }
+
+ public function testSuccess()
+ {
+ $settings = $this->prepareSettings();
+ $settings->paths = array('examples/example-02/');
+
+ $manager = $this->getManager($settings);
+ $result = $manager->run($settings);
+ Assert::false($result->hasError());
+ }
+
+ public function testError()
+ {
+ $settings = $this->prepareSettings();
+ $settings->paths = array('examples/example-03/');
+
+ $manager = $this->getManager($settings);
+ $result = $manager->run($settings);
+ Assert::true($result->hasError());
+ }
+
+ public function testExcludeRelativeSubdirectory()
+ {
+ $settings = $this->prepareSettings();
+ $settings->paths = array('examples/example-04/');
+
+ $manager = $this->getManager($settings);
+ $result = $manager->run($settings);
+ Assert::true($result->hasError());
+
+ $settings->excluded = array('examples/example-04/dir1/dir2');
+
+ $manager = $this->getManager($settings);
+ $result = $manager->run($settings);
+ Assert::false($result->hasError());
+ }
+
+ public function testExcludeAbsoluteSubdirectory()
+ {
+ $settings = $this->prepareSettings();
+ $cwd = getcwd();
+ $settings->paths = array($cwd . '/examples/example-04/');
+ $settings->excluded = array();
+
+ $manager = $this->getManager($settings);
+ $result = $manager->run($settings);
+ Assert::true($result->hasError());
+
+ $settings->excluded = array($cwd . '/examples/example-04/dir1/dir2');
+
+ $manager = $this->getManager($settings);
+ $result = $manager->run($settings);
+ Assert::false($result->hasError());
+ }
+
+ /**
+ * @param Settings $settings
+ * @return Manager
+ */
+ private function getManager(Settings $settings)
+ {
+ $manager = new Manager($settings);
+ $manager->setOutput(new TextOutput(new NullWriter()));
+ return $manager;
+ }
+
+ /**
+ * @return JakubOnderka\PhpParallelLint\Settings
+ */
+ private function prepareSettings()
+ {
+ $settings = new Settings();
+ $settings->phpExecutable = 'php';
+ $settings->shortTag = false;
+ $settings->aspTags = false;
+ $settings->parallelJobs = 10;
+ $settings->extensions = array('php', 'phtml', 'php3', 'php4', 'php5');
+ $settings->paths = array('FOR-SET');
+ $settings->excluded = array();
+ $settings->colors = false;
+
+ return $settings;
+ }
+}
+
+$testCase = new ManagerRunTest;
+$testCase->run();
diff --git a/vendor/jakub-onderka/php-parallel-lint/tests/ParallelLint.lint.phpt b/vendor/jakub-onderka/php-parallel-lint/tests/ParallelLint.lint.phpt
new file mode 100644
index 0000000000..2aecb1273f
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/tests/ParallelLint.lint.phpt
@@ -0,0 +1,116 @@
+getPhpExecutable();
+ $parallelLint = new ParallelLint($phpExecutable, 10);
+ Assert::equal($phpExecutable, $parallelLint->getPhpExecutable());
+ Assert::equal(10, $parallelLint->getParallelJobs());
+
+ $phpExecutable2 = $this->getPhpExecutable();
+ $parallelLint->setPhpExecutable($phpExecutable2);
+ Assert::equal($phpExecutable2, $parallelLint->getPhpExecutable());
+
+ $parallelLint->setParallelJobs(33);
+ Assert::equal(33, $parallelLint->getParallelJobs());
+
+ $parallelLint->setShortTagEnabled(true);
+ Assert::true($parallelLint->isShortTagEnabled());
+
+ $parallelLint->setAspTagsEnabled(true);
+ Assert::true($parallelLint->isAspTagsEnabled());
+
+ $parallelLint->setShortTagEnabled(false);
+ Assert::false($parallelLint->isShortTagEnabled());
+
+ $parallelLint->setAspTagsEnabled(false);
+ Assert::false($parallelLint->isAspTagsEnabled());
+ }
+
+ public function testEmptyArray()
+ {
+ $parallelLint = new ParallelLint($this->getPhpExecutable());
+ $result = $parallelLint->lint(array());
+
+ Assert::equal(0, $result->getCheckedFilesCount());
+ Assert::equal(0, $result->getFilesWithSyntaxErrorCount());
+ Assert::false($result->hasSyntaxError());
+ Assert::equal(0, count($result->getErrors()));
+ }
+
+ public function testNotExistsFile()
+ {
+ $parallelLint = new ParallelLint($this->getPhpExecutable());
+ $result = $parallelLint->lint(array('path/for-not-found/'));
+
+ Assert::equal(0, $result->getCheckedFilesCount());
+ Assert::equal(0, $result->getFilesWithSyntaxErrorCount());
+ Assert::false($result->hasSyntaxError());
+ Assert::equal(1, count($result->getErrors()));
+ }
+
+ public function testEmptyFile()
+ {
+ $parallelLint = new ParallelLint($this->getPhpExecutable());
+ $result = $parallelLint->lint(array(__DIR__ . '/examples/example-01/empty-file'));
+
+ Assert::equal(1, $result->getCheckedFilesCount());
+ Assert::equal(0, $result->getFilesWithSyntaxErrorCount());
+ Assert::false($result->hasSyntaxError());
+ Assert::equal(0, count($result->getErrors()));
+ }
+
+ public function testValidFile()
+ {
+ $parallelLint = new ParallelLint($this->getPhpExecutable());
+ $result = $parallelLint->lint(array(__DIR__ . '/examples/example-02/example.php'));
+
+ Assert::equal(1, $result->getCheckedFilesCount());
+ Assert::equal(0, $result->getFilesWithSyntaxErrorCount());
+ Assert::equal(0, count($result->getErrors()));
+ }
+
+ public function testInvalidFile()
+ {
+ $parallelLint = new ParallelLint($this->getPhpExecutable());
+ $result = $parallelLint->lint(array(__DIR__ . '/examples/example-03/example.php'));
+
+ Assert::equal(1, $result->getCheckedFilesCount());
+ Assert::equal(1, $result->getFilesWithSyntaxErrorCount());
+ Assert::true($result->hasSyntaxError());
+ Assert::equal(1, count($result->getErrors()));
+ }
+
+ public function testValidAndInvalidFiles()
+ {
+ $parallelLint = new ParallelLint($this->getPhpExecutable());
+ $result = $parallelLint->lint(array(
+ __DIR__ . '/examples/example-02/example.php',
+ __DIR__ . '/examples/example-03/example.php',
+ ));
+
+ Assert::equal(2, $result->getCheckedFilesCount());
+ Assert::equal(1, $result->getFilesWithSyntaxErrorCount());
+ Assert::true($result->hasSyntaxError());
+ Assert::equal(1, count($result->getErrors()));
+ }
+
+ private function getPhpExecutable()
+ {
+ return \JakubOnderka\PhpParallelLint\Process\PhpExecutable::getPhpExecutable('php');
+ }
+}
+
+$testCase = new ParallelLintLintTest;
+$testCase->run();
diff --git a/vendor/jakub-onderka/php-parallel-lint/tests/Settings.parseArguments.phpt b/vendor/jakub-onderka/php-parallel-lint/tests/Settings.parseArguments.phpt
new file mode 100644
index 0000000000..1c12c95a41
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/tests/Settings.parseArguments.phpt
@@ -0,0 +1,72 @@
+phpExecutable = 'php';
+ $expectedSettings->shortTag = false;
+ $expectedSettings->aspTags = false;
+ $expectedSettings->parallelJobs = 10;
+ $expectedSettings->extensions = array('php', 'phtml', 'php3', 'php4', 'php5');
+ $expectedSettings->paths = array('.');
+ $expectedSettings->excluded = array();
+ $expectedSettings->colors = true;
+ $expectedSettings->json = false;
+
+ Assert::equal($expectedSettings->phpExecutable, $settings->phpExecutable);
+ Assert::equal($expectedSettings->shortTag, $settings->shortTag);
+ Assert::equal($expectedSettings->aspTags, $settings->aspTags);
+ Assert::equal($expectedSettings->parallelJobs, $settings->parallelJobs);
+ Assert::equal($expectedSettings->extensions, $settings->extensions);
+ Assert::equal($expectedSettings->paths, $settings->paths);
+ Assert::equal($expectedSettings->excluded, $settings->excluded);
+ Assert::equal($expectedSettings->colors, $settings->colors);
+ Assert::equal($expectedSettings->json, $settings->json);
+ }
+
+ public function testMoreArguments()
+ {
+ $commandLine = "./parallel-lint --exclude vendor --no-colors .";
+ $argv = explode(" ", $commandLine);
+ $settings = Settings::parseArguments($argv);
+
+ $expectedSettings = new Settings();
+ $expectedSettings->phpExecutable = 'php';
+ $expectedSettings->shortTag = false;
+ $expectedSettings->aspTags = false;
+ $expectedSettings->parallelJobs = 10;
+ $expectedSettings->extensions = array('php', 'phtml', 'php3', 'php4', 'php5');
+ $expectedSettings->paths = array('.');
+ $expectedSettings->excluded = array('vendor');
+ $expectedSettings->colors = false;
+ $expectedSettings->json = false;
+
+ Assert::equal($expectedSettings->phpExecutable, $settings->phpExecutable);
+ Assert::equal($expectedSettings->shortTag, $settings->shortTag);
+ Assert::equal($expectedSettings->aspTags, $settings->aspTags);
+ Assert::equal($expectedSettings->parallelJobs, $settings->parallelJobs);
+ Assert::equal($expectedSettings->extensions, $settings->extensions);
+ Assert::equal($expectedSettings->paths, $settings->paths);
+ Assert::equal($expectedSettings->excluded, $settings->excluded);
+ Assert::equal($expectedSettings->colors, $settings->colors);
+ Assert::equal($expectedSettings->json, $settings->json);
+ }
+}
+
+$testCase = new SettingsParseArgumentsTest;
+$testCase->run();
diff --git a/vendor/jakub-onderka/php-parallel-lint/tests/SkipLintProcess.phpt b/vendor/jakub-onderka/php-parallel-lint/tests/SkipLintProcess.phpt
new file mode 100644
index 0000000000..fa4fe854ba
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/tests/SkipLintProcess.phpt
@@ -0,0 +1,40 @@
+isFinished()) {
+ usleep(100);
+ $process->getChunk();
+ }
+
+ foreach ($filesToCheck as $fileToCheck) {
+ $status = $process->isSkipped($fileToCheck);
+ Assert::notEqual(null, $status);
+ }
+ }
+}
+
+$skipLintProcessTest = new SkipLintProcessTest;
+$skipLintProcessTest->run();
diff --git a/vendor/jakub-onderka/php-parallel-lint/tests/examples/example-01/empty-file b/vendor/jakub-onderka/php-parallel-lint/tests/examples/example-01/empty-file
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/vendor/jakub-onderka/php-parallel-lint/tests/examples/example-02/example.php b/vendor/jakub-onderka/php-parallel-lint/tests/examples/example-02/example.php
new file mode 100644
index 0000000000..2186cb4a17
--- /dev/null
+++ b/vendor/jakub-onderka/php-parallel-lint/tests/examples/example-02/example.php
@@ -0,0 +1,4 @@
+= 5.4
+
+trait ExampleTrait
+{
+
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/.gitignore b/vendor/phpdocumentor/reflection-docblock/.gitignore
new file mode 100644
index 0000000000..3ce5adbbde
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/.gitignore
@@ -0,0 +1,2 @@
+.idea
+vendor
diff --git a/vendor/phpdocumentor/reflection-docblock/.travis.yml b/vendor/phpdocumentor/reflection-docblock/.travis.yml
new file mode 100644
index 0000000000..eef782c423
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/.travis.yml
@@ -0,0 +1,32 @@
+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
new file mode 100644
index 0000000000..792e4040f2
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/LICENSE
@@ -0,0 +1,21 @@
+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
new file mode 100644
index 0000000000..6405d1a10c
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/README.md
@@ -0,0 +1,57 @@
+The ReflectionDocBlock Component [](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
new file mode 100644
index 0000000000..4c6a8bb78b
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/composer.lock
@@ -0,0 +1,827 @@
+{
+ "_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
new file mode 100644
index 0000000000..f67ad2a20c
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist
@@ -0,0 +1,14 @@
+
+
+
+
+
+ ./tests/
+
+
+
+
+ ./src/
+
+
+
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php
new file mode 100644
index 0000000000..02968b1637
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php
@@ -0,0 +1,468 @@
+
+ * @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
new file mode 100644
index 0000000000..81aa83ce53
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php
@@ -0,0 +1,154 @@
+
+ * @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
new file mode 100644
index 0000000000..d41142e28d
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php
@@ -0,0 +1,223 @@
+
+ * @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
new file mode 100644
index 0000000000..966ed44d72
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php
@@ -0,0 +1,76 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+/**
+ * The location a DocBlock occurs within a file.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Location
+{
+ /** @var int Line where the DocBlock text starts. */
+ protected $lineNumber = 0;
+
+ /** @var int Column where the DocBlock text starts. */
+ protected $columnNumber = 0;
+
+ public function __construct(
+ $lineNumber = 0,
+ $columnNumber = 0
+ ) {
+ $this->setLineNumber($lineNumber)->setColumnNumber($columnNumber);
+ }
+
+ /**
+ * @return int Line where the DocBlock text starts.
+ */
+ public function getLineNumber()
+ {
+ return $this->lineNumber;
+ }
+
+ /**
+ *
+ * @param type $lineNumber
+ * @return $this
+ */
+ public function setLineNumber($lineNumber)
+ {
+ $this->lineNumber = (int)$lineNumber;
+
+ return $this;
+ }
+
+ /**
+ * @return int Column where the DocBlock text starts.
+ */
+ public function getColumnNumber()
+ {
+ return $this->columnNumber;
+ }
+
+ /**
+ *
+ * @param int $columnNumber
+ * @return $this
+ */
+ public function setColumnNumber($columnNumber)
+ {
+ $this->columnNumber = (int)$columnNumber;
+
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php
new file mode 100644
index 0000000000..c1617850e2
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php
@@ -0,0 +1,198 @@
+
+ * @copyright 2013 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+use phpDocumentor\Reflection\DocBlock;
+
+/**
+ * Serializes a DocBlock instance.
+ *
+ * @author Barry vd. Heuvel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Serializer
+{
+
+ /** @var string The string to indent the comment with. */
+ protected $indentString = ' ';
+
+ /** @var int The number of times the indent string is repeated. */
+ protected $indent = 0;
+
+ /** @var bool Whether to indent the first line. */
+ protected $isFirstLineIndented = true;
+
+ /** @var int|null The max length of a line. */
+ protected $lineLength = null;
+
+ /**
+ * Create a Serializer instance.
+ *
+ * @param int $indent The number of times the indent string is
+ * repeated.
+ * @param string $indentString The string to indent the comment with.
+ * @param bool $indentFirstLine Whether to indent the first line.
+ * @param int|null $lineLength The max length of a line or NULL to
+ * disable line wrapping.
+ */
+ public function __construct(
+ $indent = 0,
+ $indentString = ' ',
+ $indentFirstLine = true,
+ $lineLength = null
+ ) {
+ $this->setIndentationString($indentString);
+ $this->setIndent($indent);
+ $this->setIsFirstLineIndented($indentFirstLine);
+ $this->setLineLength($lineLength);
+ }
+
+ /**
+ * Sets the string to indent comments with.
+ *
+ * @param string $indentationString The string to indent comments with.
+ *
+ * @return $this This serializer object.
+ */
+ public function setIndentationString($indentString)
+ {
+ $this->indentString = (string)$indentString;
+ return $this;
+ }
+
+ /**
+ * Gets the string to indent comments with.
+ *
+ * @return string The indent string.
+ */
+ public function getIndentationString()
+ {
+ return $this->indentString;
+ }
+
+ /**
+ * Sets the number of indents.
+ *
+ * @param int $indent The number of times the indent string is repeated.
+ *
+ * @return $this This serializer object.
+ */
+ public function setIndent($indent)
+ {
+ $this->indent = (int)$indent;
+ return $this;
+ }
+
+ /**
+ * Gets the number of indents.
+ *
+ * @return int The number of times the indent string is repeated.
+ */
+ public function getIndent()
+ {
+ return $this->indent;
+ }
+
+ /**
+ * Sets whether or not the first line should be indented.
+ *
+ * Sets whether or not the first line (the one with the "/**") should be
+ * indented.
+ *
+ * @param bool $indentFirstLine The new value for this setting.
+ *
+ * @return $this This serializer object.
+ */
+ public function setIsFirstLineIndented($indentFirstLine)
+ {
+ $this->isFirstLineIndented = (bool)$indentFirstLine;
+ return $this;
+ }
+
+ /**
+ * Gets whether or not the first line should be indented.
+ *
+ * @return bool Whether or not the first line should be indented.
+ */
+ public function isFirstLineIndented()
+ {
+ return $this->isFirstLineIndented;
+ }
+
+ /**
+ * Sets the line length.
+ *
+ * Sets the length of each line in the serialization. Content will be
+ * wrapped within this limit.
+ *
+ * @param int|null $lineLength The length of each line. NULL to disable line
+ * wrapping altogether.
+ *
+ * @return $this This serializer object.
+ */
+ public function setLineLength($lineLength)
+ {
+ $this->lineLength = null === $lineLength ? null : (int)$lineLength;
+ return $this;
+ }
+
+ /**
+ * Gets the line length.
+ *
+ * @return int|null The length of each line or NULL if line wrapping is
+ * disabled.
+ */
+ public function getLineLength()
+ {
+ return $this->lineLength;
+ }
+
+ /**
+ * Generate a DocBlock comment.
+ *
+ * @param DocBlock The DocBlock to serialize.
+ *
+ * @return string The serialized doc block.
+ */
+ public function getDocComment(DocBlock $docblock)
+ {
+ $indent = str_repeat($this->indentString, $this->indent);
+ $firstIndent = $this->isFirstLineIndented ? $indent : '';
+
+ $text = $docblock->getText();
+ if ($this->lineLength) {
+ //3 === strlen(' * ')
+ $wrapLength = $this->lineLength - strlen($indent) - 3;
+ $text = wordwrap($text, $wrapLength);
+ }
+ $text = str_replace("\n", "\n{$indent} * ", $text);
+
+ $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n";
+
+ /** @var Tag $tag */
+ foreach ($docblock->getTags() as $tag) {
+ $tagText = (string) $tag;
+ if ($this->lineLength) {
+ $tagText = wordwrap($tagText, $wrapLength);
+ }
+ $tagText = str_replace("\n", "\n{$indent} * ", $tagText);
+
+ $comment .= "{$indent} * {$tagText}\n";
+ }
+
+ $comment .= $indent . ' */';
+
+ return $comment;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php
new file mode 100644
index 0000000000..a96db09521
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php
@@ -0,0 +1,377 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+use phpDocumentor\Reflection\DocBlock;
+
+/**
+ * Parses a tag definition for a DocBlock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Tag implements \Reflector
+{
+ /**
+ * PCRE regular expression matching a tag name.
+ */
+ const REGEX_TAGNAME = '[\w\-\_\\\\]+';
+
+ /** @var string Name of the tag */
+ protected $tag = '';
+
+ /**
+ * @var string|null Content of the tag.
+ * When set to NULL, it means it needs to be regenerated.
+ */
+ protected $content = '';
+
+ /** @var string Description of the content of this tag */
+ protected $description = '';
+
+ /**
+ * @var array|null The description, as an array of strings and Tag objects.
+ * When set to NULL, it means it needs to be regenerated.
+ */
+ protected $parsedDescription = null;
+
+ /** @var Location Location of the tag. */
+ protected $location = null;
+
+ /** @var DocBlock The DocBlock which this tag belongs to. */
+ protected $docblock = null;
+
+ /**
+ * @var array An array with a tag as a key, and an FQCN to a class that
+ * handles it as an array value. The class is expected to inherit this
+ * class.
+ */
+ private static $tagHandlerMappings = array(
+ 'author'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\AuthorTag',
+ 'covers'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\CoversTag',
+ 'deprecated'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag',
+ 'example'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ExampleTag',
+ 'link'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\LinkTag',
+ 'method'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\MethodTag',
+ 'param'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ParamTag',
+ 'property-read'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyReadTag',
+ 'property'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyTag',
+ 'property-write'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyWriteTag',
+ 'return'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ReturnTag',
+ 'see'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\SeeTag',
+ 'since'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\SinceTag',
+ 'source'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\SourceTag',
+ 'throw'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
+ 'throws'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag',
+ 'uses'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\UsesTag',
+ 'var'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\VarTag',
+ 'version'
+ => '\phpDocumentor\Reflection\DocBlock\Tag\VersionTag'
+ );
+
+ /**
+ * Factory method responsible for instantiating the correct sub type.
+ *
+ * @param string $tag_line The text for this tag, including description.
+ * @param DocBlock $docblock The DocBlock which this tag belongs to.
+ * @param Location $location Location of the tag.
+ *
+ * @throws \InvalidArgumentException if an invalid tag line was presented.
+ *
+ * @return static A new tag object.
+ */
+ final public static function createInstance(
+ $tag_line,
+ DocBlock $docblock = null,
+ Location $location = null
+ ) {
+ if (!preg_match(
+ '/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
+ $tag_line,
+ $matches
+ )) {
+ throw new \InvalidArgumentException(
+ 'Invalid tag_line detected: ' . $tag_line
+ );
+ }
+
+ $handler = __CLASS__;
+ if (isset(self::$tagHandlerMappings[$matches[1]])) {
+ $handler = self::$tagHandlerMappings[$matches[1]];
+ } elseif (isset($docblock)) {
+ $tagName = (string)new Type\Collection(
+ array($matches[1]),
+ $docblock->getContext()
+ );
+
+ if (isset(self::$tagHandlerMappings[$tagName])) {
+ $handler = self::$tagHandlerMappings[$tagName];
+ }
+ }
+
+ return new $handler(
+ $matches[1],
+ isset($matches[2]) ? $matches[2] : '',
+ $docblock,
+ $location
+ );
+ }
+
+ /**
+ * Registers a handler for tags.
+ *
+ * Registers a handler for tags. The class specified is autoloaded if it's
+ * not available. It must inherit from this class.
+ *
+ * @param string $tag Name of tag to regiser a handler for. When
+ * registering a namespaced tag, the full name, along with a prefixing
+ * slash MUST be provided.
+ * @param string|null $handler FQCN of handler. Specifing NULL removes the
+ * handler for the specified tag, if any.
+ *
+ * @return bool TRUE on success, FALSE on failure.
+ */
+ final public static function registerTagHandler($tag, $handler)
+ {
+ $tag = trim((string)$tag);
+
+ if (null === $handler) {
+ unset(self::$tagHandlerMappings[$tag]);
+ return true;
+ }
+
+ if ('' !== $tag
+ && class_exists($handler, true)
+ && is_subclass_of($handler, __CLASS__)
+ && !strpos($tag, '\\') //Accept no slash, and 1st slash at offset 0.
+ ) {
+ self::$tagHandlerMappings[$tag] = $handler;
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Parses a tag and populates the member variables.
+ *
+ * @param string $name Name of the tag.
+ * @param string $content The contents of the given tag.
+ * @param DocBlock $docblock The DocBlock which this tag belongs to.
+ * @param Location $location Location of the tag.
+ */
+ public function __construct(
+ $name,
+ $content,
+ DocBlock $docblock = null,
+ Location $location = null
+ ) {
+ $this
+ ->setName($name)
+ ->setContent($content)
+ ->setDocBlock($docblock)
+ ->setLocation($location);
+ }
+
+ /**
+ * Gets the name of this tag.
+ *
+ * @return string The name of this tag.
+ */
+ public function getName()
+ {
+ return $this->tag;
+ }
+
+ /**
+ * Sets the name of this tag.
+ *
+ * @param string $name The new name of this tag.
+ *
+ * @return $this
+ * @throws \InvalidArgumentException When an invalid tag name is provided.
+ */
+ public function setName($name)
+ {
+ if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) {
+ throw new \InvalidArgumentException(
+ 'Invalid tag name supplied: ' . $name
+ );
+ }
+
+ $this->tag = $name;
+
+ return $this;
+ }
+
+ /**
+ * Gets the content of this tag.
+ *
+ * @return string
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = $this->description;
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * Sets the content of this tag.
+ *
+ * @param string $content The new content of this tag.
+ *
+ * @return $this
+ */
+ public function setContent($content)
+ {
+ $this->setDescription($content);
+ $this->content = $content;
+
+ return $this;
+ }
+
+ /**
+ * Gets the description component of this tag.
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * Sets the description component of this tag.
+ *
+ * @param string $description The new description component of this tag.
+ *
+ * @return $this
+ */
+ public function setDescription($description)
+ {
+ $this->content = null;
+ $this->parsedDescription = null;
+ $this->description = trim($description);
+
+ return $this;
+ }
+
+ /**
+ * Gets the parsed text of this description.
+ *
+ * @return array An array of strings and tag objects, in the order they
+ * occur within the description.
+ */
+ public function getParsedDescription()
+ {
+ if (null === $this->parsedDescription) {
+ $description = new Description($this->description, $this->docblock);
+ $this->parsedDescription = $description->getParsedContents();
+ }
+ return $this->parsedDescription;
+ }
+
+ /**
+ * Gets the docblock this tag belongs to.
+ *
+ * @return DocBlock The docblock this tag belongs to.
+ */
+ public function getDocBlock()
+ {
+ return $this->docblock;
+ }
+
+ /**
+ * Sets the docblock this tag belongs to.
+ *
+ * @param DocBlock $docblock The new docblock this tag belongs to. Setting
+ * NULL removes any association.
+ *
+ * @return $this
+ */
+ public function setDocBlock(DocBlock $docblock = null)
+ {
+ $this->docblock = $docblock;
+
+ return $this;
+ }
+
+ /**
+ * Gets the location of the tag.
+ *
+ * @return Location The tag's location.
+ */
+ public function getLocation()
+ {
+ return $this->location;
+ }
+
+ /**
+ * Sets the location of the tag.
+ *
+ * @param Location $location The new location of the tag.
+ *
+ * @return $this
+ */
+ public function setLocation(Location $location = null)
+ {
+ $this->location = $location;
+
+ return $this;
+ }
+
+ /**
+ * Builds a string representation of this object.
+ *
+ * @todo determine the exact format as used by PHP Reflection and implement it.
+ *
+ * @return void
+ * @codeCoverageIgnore Not yet implemented
+ */
+ public static function export()
+ {
+ throw new \Exception('Not yet implemented');
+ }
+
+ /**
+ * Returns the tag as a serialized string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return "@{$this->getName()} {$this->getContent()}";
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php
new file mode 100644
index 0000000000..bacf52ebe7
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php
@@ -0,0 +1,131 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for an @author tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class AuthorTag extends Tag
+{
+ /**
+ * PCRE regular expression matching any valid value for the name component.
+ */
+ const REGEX_AUTHOR_NAME = '[^\<]*';
+
+ /**
+ * PCRE regular expression matching any valid value for the email component.
+ */
+ const REGEX_AUTHOR_EMAIL = '[^\>]*';
+
+ /** @var string The name of the author */
+ protected $authorName = '';
+
+ /** @var string The email of the author */
+ protected $authorEmail = '';
+
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = $this->authorName;
+ if ('' != $this->authorEmail) {
+ $this->content .= "<{$this->authorEmail}>";
+ }
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ if (preg_match(
+ '/^(' . self::REGEX_AUTHOR_NAME .
+ ')(\<(' . self::REGEX_AUTHOR_EMAIL .
+ ')\>)?$/u',
+ $this->description,
+ $matches
+ )) {
+ $this->authorName = trim($matches[1]);
+ if (isset($matches[3])) {
+ $this->authorEmail = trim($matches[3]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Gets the author's name.
+ *
+ * @return string The author's name.
+ */
+ public function getAuthorName()
+ {
+ return $this->authorName;
+ }
+
+ /**
+ * Sets the author's name.
+ *
+ * @param string $authorName The new author name.
+ * An invalid value will set an empty string.
+ *
+ * @return $this
+ */
+ public function setAuthorName($authorName)
+ {
+ $this->content = null;
+ $this->authorName
+ = preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName)
+ ? $authorName : '';
+
+ return $this;
+ }
+
+ /**
+ * Gets the author's email.
+ *
+ * @return string The author's email.
+ */
+ public function getAuthorEmail()
+ {
+ return $this->authorEmail;
+ }
+
+ /**
+ * Sets the author's email.
+ *
+ * @param string $authorEmail The new author email.
+ * An invalid value will set an empty string.
+ *
+ * @return $this
+ */
+ public function setAuthorEmail($authorEmail)
+ {
+ $this->authorEmail
+ = preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail)
+ ? $authorEmail : '';
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php
new file mode 100644
index 0000000000..bd31b56bfc
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @covers tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class CoversTag extends SeeTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php
new file mode 100644
index 0000000000..7226316b7d
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php
@@ -0,0 +1,26 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
+
+/**
+ * Reflection class for a @deprecated tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DeprecatedTag extends VersionTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php
new file mode 100644
index 0000000000..0e163ea01b
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php
@@ -0,0 +1,156 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @example tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ExampleTag extends SourceTag
+{
+ /**
+ * @var string Path to a file to use as an example.
+ * May also be an absolute URI.
+ */
+ protected $filePath = '';
+
+ /**
+ * @var bool Whether the file path component represents an URI.
+ * This determines how the file portion appears at {@link getContent()}.
+ */
+ protected $isURI = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $filePath = '';
+ if ($this->isURI) {
+ if (false === strpos($this->filePath, ':')) {
+ $filePath = str_replace(
+ '%2F',
+ '/',
+ rawurlencode($this->filePath)
+ );
+ } else {
+ $filePath = $this->filePath;
+ }
+ } else {
+ $filePath = '"' . $this->filePath . '"';
+ }
+
+ $this->content = $filePath . ' ' . parent::getContent();
+ }
+
+ return $this->content;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ Tag::setContent($content);
+ if (preg_match(
+ '/^
+ # File component
+ (?:
+ # File path in quotes
+ \"([^\"]+)\"
+ |
+ # File URI
+ (\S+)
+ )
+ # Remaining content (parsed by SourceTag)
+ (?:\s+(.*))?
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ if ('' !== $matches[1]) {
+ $this->setFilePath($matches[1]);
+ } else {
+ $this->setFileURI($matches[2]);
+ }
+
+ if (isset($matches[3])) {
+ parent::setContent($matches[3]);
+ } else {
+ $this->setDescription('');
+ }
+ $this->content = $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the file path.
+ *
+ * @return string Path to a file to use as an example.
+ * May also be an absolute URI.
+ */
+ public function getFilePath()
+ {
+ return $this->filePath;
+ }
+
+ /**
+ * Sets the file path.
+ *
+ * @param string $filePath The new file path to use for the example.
+ *
+ * @return $this
+ */
+ public function setFilePath($filePath)
+ {
+ $this->isURI = false;
+ $this->filePath = trim($filePath);
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Sets the file path as an URI.
+ *
+ * This function is equivalent to {@link setFilePath()}, except that it
+ * convers an URI to a file path before that.
+ *
+ * There is no getFileURI(), as {@link getFilePath()} is compatible.
+ *
+ * @param type $uri The new file URI to use as an example.
+ */
+ public function setFileURI($uri)
+ {
+ $this->isURI = true;
+ if (false === strpos($uri, ':')) {
+ //Relative URL
+ $this->filePath = rawurldecode(
+ str_replace(array('/', '\\'), '%2F', $uri)
+ );
+ } else {
+ //Absolute URL or URI.
+ $this->filePath = $uri;
+ }
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php
new file mode 100644
index 0000000000..f79f25dd8b
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php
@@ -0,0 +1,81 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @link tag in a Docblock.
+ *
+ * @author Ben Selby
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class LinkTag extends Tag
+{
+ /** @var string */
+ protected $link = '';
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->link} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ $parts = preg_split('/\s+/Su', $this->description, 2);
+
+ $this->link = $parts[0];
+
+ $this->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]);
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Gets the link
+ *
+ * @return string
+ */
+ public function getLink()
+ {
+ return $this->link;
+ }
+
+ /**
+ * Sets the link
+ *
+ * @param string $link The link
+ *
+ * @return $this
+ */
+ public function setLink($link)
+ {
+ $this->link = $link;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php
new file mode 100644
index 0000000000..7a5ce79082
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php
@@ -0,0 +1,209 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @method in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class MethodTag extends ReturnTag
+{
+
+ /** @var string */
+ protected $method_name = '';
+
+ /** @var string */
+ protected $arguments = '';
+
+ /** @var bool */
+ protected $isStatic = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = '';
+ if ($this->isStatic) {
+ $this->content .= 'static ';
+ }
+ $this->content .= $this->type .
+ " {$this->method_name}({$this->arguments}) " .
+ $this->description;
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ Tag::setContent($content);
+ // 1. none or more whitespace
+ // 2. optionally the keyword "static" followed by whitespace
+ // 3. optionally a word with underscores followed by whitespace : as
+ // type for the return value
+ // 4. then optionally a word with underscores followed by () and
+ // whitespace : as method name as used by phpDocumentor
+ // 5. then a word with underscores, followed by ( and any character
+ // until a ) and whitespace : as method name with signature
+ // 6. any remaining text : as description
+ if (preg_match(
+ '/^
+ # Static keyword
+ # Declates a static method ONLY if type is also present
+ (?:
+ (static)
+ \s+
+ )?
+ # Return type
+ (?:
+ ([\w\|_\\\\]+)
+ \s+
+ )?
+ # Legacy method name (not captured)
+ (?:
+ [\w_]+\(\)\s+
+ )?
+ # Method name
+ ([\w\|_\\\\]+)
+ # Arguments
+ \(([^\)]*)\)
+ \s*
+ # Description
+ (.*)
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ list(
+ ,
+ $static,
+ $this->type,
+ $this->method_name,
+ $this->arguments,
+ $this->description
+ ) = $matches;
+ if ($static) {
+ if (!$this->type) {
+ $this->type = 'static';
+ } else {
+ $this->isStatic = true;
+ }
+ } else {
+ if (!$this->type) {
+ $this->type = 'void';
+ }
+ }
+ $this->parsedDescription = null;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets the name of this method.
+ *
+ * @param string $method_name The name of the method.
+ *
+ * @return $this
+ */
+ public function setMethodName($method_name)
+ {
+ $this->method_name = $method_name;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Retrieves the method name.
+ *
+ * @return string
+ */
+ public function getMethodName()
+ {
+ return $this->method_name;
+ }
+
+ /**
+ * Sets the arguments for this method.
+ *
+ * @param string $arguments A comma-separated arguments line.
+ *
+ * @return void
+ */
+ public function setArguments($arguments)
+ {
+ $this->arguments = $arguments;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Returns an array containing each argument as array of type and name.
+ *
+ * Please note that the argument sub-array may only contain 1 element if no
+ * type was specified.
+ *
+ * @return string[]
+ */
+ public function getArguments()
+ {
+ if (empty($this->arguments)) {
+ return array();
+ }
+
+ $arguments = explode(',', $this->arguments);
+ foreach ($arguments as $key => $value) {
+ $arguments[$key] = explode(' ', trim($value));
+ }
+
+ return $arguments;
+ }
+
+ /**
+ * Checks whether the method tag describes a static method or not.
+ *
+ * @return bool TRUE if the method declaration is for a static method, FALSE
+ * otherwise.
+ */
+ public function isStatic()
+ {
+ return $this->isStatic;
+ }
+
+ /**
+ * Sets a new value for whether the method is static or not.
+ *
+ * @param bool $isStatic The new value to set.
+ *
+ * @return $this
+ */
+ public function setIsStatic($isStatic)
+ {
+ $this->isStatic = $isStatic;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php
new file mode 100644
index 0000000000..9bc0270dd9
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php
@@ -0,0 +1,119 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @param tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ParamTag extends ReturnTag
+{
+ /** @var string */
+ protected $variableName = '';
+
+ /** @var bool determines whether this is a variadic argument */
+ protected $isVariadic = false;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content
+ = "{$this->type} {$this->variableName} {$this->description}";
+ }
+ return $this->content;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ Tag::setContent($content);
+ $parts = preg_split(
+ '/(\s+)/Su',
+ $this->description,
+ 3,
+ PREG_SPLIT_DELIM_CAPTURE
+ );
+
+ // if the first item that is encountered is not a variable; it is a type
+ if (isset($parts[0])
+ && (strlen($parts[0]) > 0)
+ && ($parts[0][0] !== '$')
+ ) {
+ $this->type = array_shift($parts);
+ array_shift($parts);
+ }
+
+ // if the next item starts with a $ or ...$ it must be the variable name
+ if (isset($parts[0])
+ && (strlen($parts[0]) > 0)
+ && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$')
+ ) {
+ $this->variableName = array_shift($parts);
+ array_shift($parts);
+
+ if (substr($this->variableName, 0, 3) === '...') {
+ $this->isVariadic = true;
+ $this->variableName = substr($this->variableName, 3);
+ }
+ }
+
+ $this->setDescription(implode('', $parts));
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Returns the variable's name.
+ *
+ * @return string
+ */
+ public function getVariableName()
+ {
+ return $this->variableName;
+ }
+
+ /**
+ * Sets the variable's name.
+ *
+ * @param string $name The new name for this variable.
+ *
+ * @return $this
+ */
+ public function setVariableName($name)
+ {
+ $this->variableName = $name;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Returns whether this tag is variadic.
+ *
+ * @return boolean
+ */
+ public function isVariadic()
+ {
+ return $this->isVariadic;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php
new file mode 100644
index 0000000000..33406026a1
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @property-read tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class PropertyReadTag extends PropertyTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php
new file mode 100644
index 0000000000..288ecff872
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @property tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class PropertyTag extends ParamTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php
new file mode 100644
index 0000000000..ec4e866d43
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @property-write tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class PropertyWriteTag extends PropertyTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php
new file mode 100644
index 0000000000..9293db9246
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php
@@ -0,0 +1,99 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+use phpDocumentor\Reflection\DocBlock\Type\Collection;
+
+/**
+ * Reflection class for a @return tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ReturnTag extends Tag
+{
+ /** @var string The raw type component. */
+ protected $type = '';
+
+ /** @var Collection The parsed type component. */
+ protected $types = null;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->type} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+
+ $parts = preg_split('/\s+/Su', $this->description, 2);
+
+ // any output is considered a type
+ $this->type = $parts[0];
+ $this->types = null;
+
+ $this->setDescription(isset($parts[1]) ? $parts[1] : '');
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Returns the unique types of the variable.
+ *
+ * @return string[]
+ */
+ public function getTypes()
+ {
+ return $this->getTypesCollection()->getArrayCopy();
+ }
+
+ /**
+ * Returns the type section of the variable.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return (string) $this->getTypesCollection();
+ }
+
+ /**
+ * Returns the type collection.
+ *
+ * @return void
+ */
+ protected function getTypesCollection()
+ {
+ if (null === $this->types) {
+ $this->types = new Collection(
+ array($this->type),
+ $this->docblock ? $this->docblock->getContext() : null
+ );
+ }
+ return $this->types;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php
new file mode 100644
index 0000000000..4f5f22ce17
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php
@@ -0,0 +1,81 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @see tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SeeTag extends Tag
+{
+ /** @var string */
+ protected $refers = null;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->refers} {$this->description}";
+ }
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ $parts = preg_split('/\s+/Su', $this->description, 2);
+
+ // any output is considered a type
+ $this->refers = $parts[0];
+
+ $this->setDescription(isset($parts[1]) ? $parts[1] : '');
+
+ $this->content = $content;
+ return $this;
+ }
+
+ /**
+ * Gets the structural element this tag refers to.
+ *
+ * @return string
+ */
+ public function getReference()
+ {
+ return $this->refers;
+ }
+
+ /**
+ * Sets the structural element this tag refers to.
+ *
+ * @param string $refers The new type this tag refers to.
+ *
+ * @return $this
+ */
+ public function setReference($refers)
+ {
+ $this->refers = $refers;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php
new file mode 100644
index 0000000000..ba009c4473
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php
@@ -0,0 +1,26 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag\VersionTag;
+
+/**
+ * Reflection class for a @since tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SinceTag extends VersionTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php
new file mode 100644
index 0000000000..3400220ea7
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php
@@ -0,0 +1,137 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @source tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SourceTag extends Tag
+{
+ /**
+ * @var int The starting line, relative to the structural element's
+ * location.
+ */
+ protected $startingLine = 1;
+
+ /**
+ * @var int|null The number of lines, relative to the starting line. NULL
+ * means "to the end".
+ */
+ protected $lineCount = null;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content
+ = "{$this->startingLine} {$this->lineCount} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+ if (preg_match(
+ '/^
+ # Starting line
+ ([1-9]\d*)
+ \s*
+ # Number of lines
+ (?:
+ ((?1))
+ \s+
+ )?
+ # Description
+ (.*)
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ $this->startingLine = (int)$matches[1];
+ if (isset($matches[2]) && '' !== $matches[2]) {
+ $this->lineCount = (int)$matches[2];
+ }
+ $this->setDescription($matches[3]);
+ $this->content = $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Gets the starting line.
+ *
+ * @return int The starting line, relative to the structural element's
+ * location.
+ */
+ public function getStartingLine()
+ {
+ return $this->startingLine;
+ }
+
+ /**
+ * Sets the starting line.
+ *
+ * @param int $startingLine The new starting line, relative to the
+ * structural element's location.
+ *
+ * @return $this
+ */
+ public function setStartingLine($startingLine)
+ {
+ $this->startingLine = $startingLine;
+
+ $this->content = null;
+ return $this;
+ }
+
+ /**
+ * Returns the number of lines.
+ *
+ * @return int|null The number of lines, relative to the starting line. NULL
+ * means "to the end".
+ */
+ public function getLineCount()
+ {
+ return $this->lineCount;
+ }
+
+ /**
+ * Sets the number of lines.
+ *
+ * @param int|null $lineCount The new number of lines, relative to the
+ * starting line. NULL means "to the end".
+ *
+ * @return $this
+ */
+ public function setLineCount($lineCount)
+ {
+ $this->lineCount = $lineCount;
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php
new file mode 100644
index 0000000000..58ee44a42d
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @throws tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ThrowsTag extends ReturnTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php
new file mode 100644
index 0000000000..da0d66381e
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @uses tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class UsesTag extends SeeTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php
new file mode 100644
index 0000000000..236b2c8b01
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php
@@ -0,0 +1,24 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @var tag in a Docblock.
+ *
+ * @author Mike van Riel
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VarTag extends ParamTag
+{
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php
new file mode 100644
index 0000000000..260f6984f4
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php
@@ -0,0 +1,108 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+use phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Reflection class for a @version tag in a Docblock.
+ *
+ * @author Vasil Rangelov
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VersionTag extends Tag
+{
+ /**
+ * PCRE regular expression matching a version vector.
+ * Assumes the "x" modifier.
+ */
+ const REGEX_VECTOR = '(?:
+ # Normal release vectors.
+ \d\S*
+ |
+ # VCS version vectors. Per PHPCS, they are expected to
+ # follow the form of the VCS name, followed by ":", followed
+ # by the version vector itself.
+ # By convention, popular VCSes like CVS, SVN and GIT use "$"
+ # around the actual version vector.
+ [^\s\:]+\:\s*\$[^\$]+\$
+ )';
+
+ /** @var string The version vector. */
+ protected $version = '';
+
+ public function getContent()
+ {
+ if (null === $this->content) {
+ $this->content = "{$this->version} {$this->description}";
+ }
+
+ return $this->content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContent($content)
+ {
+ parent::setContent($content);
+
+ if (preg_match(
+ '/^
+ # The version vector
+ (' . self::REGEX_VECTOR . ')
+ \s*
+ # The description
+ (.+)?
+ $/sux',
+ $this->description,
+ $matches
+ )) {
+ $this->version = $matches[1];
+ $this->setDescription(isset($matches[2]) ? $matches[2] : '');
+ $this->content = $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Gets the version section of the tag.
+ *
+ * @return string The version section of the tag.
+ */
+ public function getVersion()
+ {
+ return $this->version;
+ }
+
+ /**
+ * Sets the version section of the tag.
+ *
+ * @param string $version The new version section of the tag.
+ * An invalid value will set an empty string.
+ *
+ * @return $this
+ */
+ public function setVersion($version)
+ {
+ $this->version
+ = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version)
+ ? $version
+ : '';
+
+ $this->content = null;
+ return $this;
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php
new file mode 100644
index 0000000000..90ead3ff4e
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php
@@ -0,0 +1,221 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Type;
+
+use phpDocumentor\Reflection\DocBlock\Context;
+
+/**
+ * Collection
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class Collection extends \ArrayObject
+{
+ /** @var string Definition of the OR operator for types */
+ const OPERATOR_OR = '|';
+
+ /** @var string Definition of the ARRAY operator for types */
+ const OPERATOR_ARRAY = '[]';
+
+ /** @var string Definition of the NAMESPACE operator in PHP */
+ const OPERATOR_NAMESPACE = '\\';
+
+ /** @var string[] List of recognized keywords */
+ protected static $keywords = array(
+ 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
+ 'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
+ 'callback', 'callable', 'false', 'true', 'self', '$this', 'static'
+ );
+
+ /**
+ * Current invoking location.
+ *
+ * This is used to prepend to type with a relative location.
+ * May also be 'default' or 'global', in which case they are ignored.
+ *
+ * @var Context
+ */
+ protected $context = null;
+
+ /**
+ * Registers the namespace and aliases; uses that to add and expand the
+ * given types.
+ *
+ * @param string[] $types Array containing a list of types to add to this
+ * container.
+ * @param Context $location The current invoking location.
+ */
+ public function __construct(
+ array $types = array(),
+ Context $context = null
+ ) {
+ $this->context = null === $context ? new Context() : $context;
+
+ foreach ($types as $type) {
+ $this->add($type);
+ }
+ }
+
+ /**
+ * Returns the current invoking location.
+ *
+ * @return Context
+ */
+ public function getContext()
+ {
+ return $this->context;
+ }
+
+ /**
+ * Adds a new type to the collection and expands it if it contains a
+ * relative namespace.
+ *
+ * If a class in the type contains a relative namespace than this collection
+ * will try to expand that into a FQCN.
+ *
+ * @param string $type A 'Type' as defined in the phpDocumentor
+ * documentation.
+ *
+ * @throws \InvalidArgumentException if a non-string argument is passed.
+ *
+ * @see http://phpdoc.org/docs/latest/for-users/types.html for the
+ * definition of a type.
+ *
+ * @return void
+ */
+ public function add($type)
+ {
+ if (!is_string($type)) {
+ throw new \InvalidArgumentException(
+ 'A type should be represented by a string, received: '
+ .var_export($type, true)
+ );
+ }
+
+ // separate the type by the OR operator
+ $type_parts = explode(self::OPERATOR_OR, $type);
+ foreach ($type_parts as $part) {
+ $expanded_type = $this->expand($part);
+ if ($expanded_type) {
+ $this[] = $expanded_type;
+ }
+ }
+ }
+
+ /**
+ * Returns a string representation of the collection.
+ *
+ * @return string The resolved types across the collection, separated with
+ * {@link self::OPERATOR_OR}.
+ */
+ public function __toString()
+ {
+ return implode(self::OPERATOR_OR, $this->getArrayCopy());
+ }
+
+ /**
+ * Analyzes the given type and returns the FQCN variant.
+ *
+ * When a type is provided this method checks whether it is not a keyword or
+ * Fully Qualified Class Name. If so it will use the given namespace and
+ * aliases to expand the type to a FQCN representation.
+ *
+ * This method only works as expected if the namespace and aliases are set;
+ * no dynamic reflection is being performed here.
+ *
+ * @param string $type The relative or absolute type.
+ *
+ * @uses getNamespace to determine with what to prefix the type name.
+ * @uses getNamespaceAliases to check whether the first part of the relative
+ * type name should not be replaced with another namespace.
+ *
+ * @return string
+ */
+ protected function expand($type)
+ {
+ $type = trim($type);
+ if (!$type) {
+ return '';
+ }
+
+ if ($this->isTypeAnArray($type)) {
+ return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY;
+ }
+
+ if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) {
+ $type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2);
+
+ $namespace_aliases = $this->context->getNamespaceAliases();
+ // if the first segment is not an alias; prepend namespace name and
+ // return
+ if (!isset($namespace_aliases[$type_parts[0]])) {
+ $namespace = $this->context->getNamespace();
+ if ('' !== $namespace) {
+ $namespace .= self::OPERATOR_NAMESPACE;
+ }
+ return self::OPERATOR_NAMESPACE . $namespace . $type;
+ }
+
+ $type_parts[0] = $namespace_aliases[$type_parts[0]];
+ $type = implode(self::OPERATOR_NAMESPACE, $type_parts);
+ }
+
+ return $type;
+ }
+
+ /**
+ * Detects whether the given type represents an array.
+ *
+ * @param string $type A relative or absolute type as defined in the
+ * phpDocumentor documentation.
+ *
+ * @return bool
+ */
+ protected function isTypeAnArray($type)
+ {
+ return substr($type, -2) === self::OPERATOR_ARRAY;
+ }
+
+ /**
+ * Detects whether the given type represents a PHPDoc keyword.
+ *
+ * @param string $type A relative or absolute type as defined in the
+ * phpDocumentor documentation.
+ *
+ * @return bool
+ */
+ protected function isTypeAKeyword($type)
+ {
+ return in_array(strtolower($type), static::$keywords, true);
+ }
+
+ /**
+ * Detects whether the given type represents a relative or absolute path.
+ *
+ * This method will detect keywords as being absolute; even though they are
+ * not preceeded by a namespace separator.
+ *
+ * @param string $type A relative or absolute type as defined in the
+ * phpDocumentor documentation.
+ *
+ * @return bool
+ */
+ protected function isRelativeType($type)
+ {
+ return ($type[0] !== self::OPERATOR_NAMESPACE)
+ || $this->isTypeAKeyword($type);
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php
new file mode 100644
index 0000000000..a6ca7b37e4
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php
@@ -0,0 +1,245 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Description
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DescriptionTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstruct()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame($fixture, $parsedContents[0]);
+ }
+
+ public function testInlineTagParsing()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame('This is text for a ', $parsedContents[0]);
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag\LinkTag',
+ $parsedContents[1]
+ );
+ $this->assertSame(
+ ' that uses inline
+tags.',
+ $parsedContents[2]
+ );
+ }
+
+ public function testInlineTagAtStartParsing()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+
+ $this->assertSame('', $parsedContents[0]);
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag\LinkTag',
+ $parsedContents[1]
+ );
+ $this->assertSame(
+ ' is text for a description that uses inline
+tags.',
+ $parsedContents[2]
+ );
+ }
+
+ public function testNestedInlineTagParsing()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+
+ $this->assertSame(
+ 'This is text for a description with ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $parsedDescription = $parsedContents[1]->getParsedDescription();
+ $this->assertCount(3, $parsedDescription);
+ $this->assertSame("inline tag with\n", $parsedDescription[0]);
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag\LinkTag',
+ $parsedDescription[1]
+ );
+ $this->assertSame(' in it', $parsedDescription[2]);
+ }
+
+ public function testLiteralOpeningDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame($fixture, $parsedContents[0]);
+ }
+
+ public function testNestedLiteralOpeningDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description containing ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $this->assertSame(
+ array('inline tag that has { that
+is literal'),
+ $parsedContents[1]->getParsedDescription()
+ );
+ }
+
+ public function testLiteralClosingDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with } that is not a tag.',
+ $parsedContents[0]
+ );
+ }
+
+ public function testNestedLiteralClosingDelimiter()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $this->assertSame(
+ array('inline tag with } that is not an
+inline tag'),
+ $parsedContents[1]->getParsedDescription()
+ );
+ }
+
+ public function testInlineTagEscapingSequence()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(1, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with literal {@link}.',
+ $parsedContents[0]
+ );
+ }
+
+ public function testNestedInlineTagEscapingSequence()
+ {
+ $fixture = <<assertSame($fixture, $object->getContents());
+
+ $parsedContents = $object->getParsedContents();
+ $this->assertCount(3, $parsedContents);
+ $this->assertSame(
+ 'This is text for a description with an ',
+ $parsedContents[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $parsedContents[1]
+ );
+ $this->assertSame('.', $parsedContents[2]);
+
+ $this->assertSame(
+ array('inline tag with literal
+{@link} in it'),
+ $parsedContents[1]->getParsedDescription()
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php
new file mode 100644
index 0000000000..ff257aa197
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php
@@ -0,0 +1,86 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\CoversTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class CoversTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\CoversTag can create
+ * a link for the covers doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exReference
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\CoversTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exReference
+ ) {
+ $tag = new CoversTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exReference, $tag->getReference());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exReference
+ return array(
+ array(
+ 'covers',
+ 'Foo::bar()',
+ 'Foo::bar()',
+ '',
+ 'Foo::bar()'
+ ),
+ array(
+ 'covers',
+ 'Foo::bar() Testing',
+ 'Foo::bar() Testing',
+ 'Testing',
+ 'Foo::bar()',
+ ),
+ array(
+ 'covers',
+ 'Foo::bar() Testing comments',
+ 'Foo::bar() Testing comments',
+ 'Testing comments',
+ 'Foo::bar()',
+ ),
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php
new file mode 100644
index 0000000000..7a75e79ce5
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php
@@ -0,0 +1,115 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DeprecatedTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @deprecated doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exVersion
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exVersion
+ ) {
+ $tag = new DeprecatedTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exVersion, $tag->getVersion());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exVersion
+ return array(
+ array(
+ 'deprecated',
+ '1.0 First release.',
+ '1.0 First release.',
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ "1.0\nFirst release.",
+ "1.0\nFirst release.",
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ "1.0\nFirst\nrelease.",
+ "1.0\nFirst\nrelease.",
+ "First\nrelease.",
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ 'Unfinished release',
+ 'Unfinished release',
+ 'Unfinished release',
+ ''
+ ),
+ array(
+ 'deprecated',
+ '1.0',
+ '1.0',
+ '',
+ '1.0'
+ ),
+ array(
+ 'deprecated',
+ 'GIT: $Id$',
+ 'GIT: $Id$',
+ '',
+ 'GIT: $Id$'
+ ),
+ array(
+ 'deprecated',
+ 'GIT: $Id$ Dev build',
+ 'GIT: $Id$ Dev build',
+ 'Dev build',
+ 'GIT: $Id$'
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php
new file mode 100644
index 0000000000..519a61b3a9
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php
@@ -0,0 +1,203 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ExampleTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can
+ * understand the @source DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exStartingLine
+ * @param string $exLineCount
+ * @param string $exFilepath
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exStartingLine,
+ $exLineCount,
+ $exFilePath
+ ) {
+ $tag = new ExampleTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exStartingLine, $tag->getStartingLine());
+ $this->assertEquals($exLineCount, $tag->getLineCount());
+ $this->assertEquals($exFilePath, $tag->getFilePath());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type,
+ // $content,
+ // $exContent,
+ // $exDescription,
+ // $exStartingLine,
+ // $exLineCount,
+ // $exFilePath
+ return array(
+ array(
+ 'example',
+ 'file.php',
+ 'file.php',
+ '',
+ 1,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'Testing comments',
+ 'Testing comments',
+ 'comments',
+ 1,
+ null,
+ 'Testing'
+ ),
+ array(
+ 'example',
+ 'file.php 2 Testing',
+ 'file.php 2 Testing',
+ 'Testing',
+ 2,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'file.php 2 3 Testing comments',
+ 'file.php 2 3 Testing comments',
+ 'Testing comments',
+ 2,
+ 3,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'file.php 2 -1 Testing comments',
+ 'file.php 2 -1 Testing comments',
+ '-1 Testing comments',
+ 2,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ 'file.php -1 1 Testing comments',
+ 'file.php -1 1 Testing comments',
+ '-1 1 Testing comments',
+ 1,
+ null,
+ 'file.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" Testing comments',
+ '"file with spaces.php" Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" 2 Testing comments',
+ '"file with spaces.php" 2 Testing comments',
+ 'Testing comments',
+ 2,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" 2 3 Testing comments',
+ '"file with spaces.php" 2 3 Testing comments',
+ 'Testing comments',
+ 2,
+ 3,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" 2 -3 Testing comments',
+ '"file with spaces.php" 2 -3 Testing comments',
+ '-3 Testing comments',
+ 2,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ '"file with spaces.php" -2 3 Testing comments',
+ '"file with spaces.php" -2 3 Testing comments',
+ '-2 3 Testing comments',
+ 1,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ 'file%20with%20spaces.php Testing comments',
+ 'file%20with%20spaces.php Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'file with spaces.php'
+ ),
+ array(
+ 'example',
+ 'folder/file%20with%20spaces.php Testing comments',
+ 'folder/file%20with%20spaces.php Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'folder/file with spaces.php'
+ ),
+ array(
+ 'example',
+ 'http://example.com/file%20with%20spaces.php Testing comments',
+ 'http://example.com/file%20with%20spaces.php Testing comments',
+ 'Testing comments',
+ 1,
+ null,
+ 'http://example.com/file%20with%20spaces.php'
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php
new file mode 100644
index 0000000000..0c64ed086e
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php
@@ -0,0 +1,87 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
+ *
+ * @author Ben Selby
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class LinkTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @link doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exLink
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exLink
+ ) {
+ $tag = new LinkTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exLink, $tag->getLink());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exLink
+ return array(
+ array(
+ 'link',
+ 'http://www.phpdoc.org/',
+ 'http://www.phpdoc.org/',
+ 'http://www.phpdoc.org/',
+ 'http://www.phpdoc.org/'
+ ),
+ array(
+ 'link',
+ 'http://www.phpdoc.org/ Testing',
+ 'http://www.phpdoc.org/ Testing',
+ 'Testing',
+ 'http://www.phpdoc.org/'
+ ),
+ array(
+ 'link',
+ 'http://www.phpdoc.org/ Testing comments',
+ 'http://www.phpdoc.org/ Testing comments',
+ 'Testing comments',
+ 'http://www.phpdoc.org/'
+ ),
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php
new file mode 100644
index 0000000000..efc3a15b53
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php
@@ -0,0 +1,146 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class MethodTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @param string $signature The signature to test.
+ * @param bool $valid Whether the given signature is expected to
+ * be valid.
+ * @param string $expected_name The method name that is expected from this
+ * signature.
+ * @param string $expected_return The return type that is expected from this
+ * signature.
+ * @param bool $paramCount Number of parameters in the signature.
+ * @param string $description The short description mentioned in the
+ * signature.
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag
+ * @dataProvider getTestSignatures
+ *
+ * @return void
+ */
+ public function testConstruct(
+ $signature,
+ $valid,
+ $expected_name,
+ $expected_return,
+ $expected_isStatic,
+ $paramCount,
+ $description
+ ) {
+ ob_start();
+ $tag = new MethodTag('method', $signature);
+ $stdout = ob_get_clean();
+
+ $this->assertSame(
+ $valid,
+ empty($stdout),
+ 'No error should have been output if the signature is valid'
+ );
+
+ if (!$valid) {
+ return;
+ }
+
+ $this->assertEquals($expected_name, $tag->getMethodName());
+ $this->assertEquals($expected_return, $tag->getType());
+ $this->assertEquals($description, $tag->getDescription());
+ $this->assertEquals($expected_isStatic, $tag->isStatic());
+ $this->assertCount($paramCount, $tag->getArguments());
+ }
+
+ public function getTestSignatures()
+ {
+ return array(
+ // TODO: Verify this case
+// array(
+// 'foo',
+// false, 'foo', '', false, 0, ''
+// ),
+ array(
+ 'foo()',
+ true, 'foo', 'void', false, 0, ''
+ ),
+ array(
+ 'foo() description',
+ true, 'foo', 'void', false, 0, 'description'
+ ),
+ array(
+ 'int foo()',
+ true, 'foo', 'int', false, 0, ''
+ ),
+ array(
+ 'int foo() description',
+ true, 'foo', 'int', false, 0, 'description'
+ ),
+ array(
+ 'int foo($a, $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ 'int foo() foo(int $a, int $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ 'int foo(int $a, int $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ 'null|int foo(int $a, int $b)',
+ true, 'foo', 'null|int', false, 2, ''
+ ),
+ array(
+ 'int foo(null|int $a, int $b)',
+ true, 'foo', 'int', false, 2, ''
+ ),
+ array(
+ '\Exception foo() foo(Exception $a, Exception $b)',
+ true, 'foo', '\Exception', false, 2, ''
+ ),
+ array(
+ 'int foo() foo(Exception $a, Exception $b) description',
+ true, 'foo', 'int', false, 2, 'description'
+ ),
+ array(
+ 'int foo() foo(\Exception $a, \Exception $b) description',
+ true, 'foo', 'int', false, 2, 'description'
+ ),
+ array(
+ 'void()',
+ true, 'void', 'void', false, 0, ''
+ ),
+ array(
+ 'static foo()',
+ true, 'foo', 'static', false, 0, ''
+ ),
+ array(
+ 'static void foo()',
+ true, 'foo', 'void', true, 0, ''
+ ),
+ array(
+ 'static static foo()',
+ true, 'foo', 'static', true, 0, ''
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php
new file mode 100644
index 0000000000..0e05382fab
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php
@@ -0,0 +1,118 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\ParamTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ParamTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ParamTag can
+ * understand the @param DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $extractedType
+ * @param string $extractedTypes
+ * @param string $extractedVarName
+ * @param string $extractedDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag
+ * @dataProvider provideDataForConstructor
+ *
+ * @return void
+ */
+ public function testConstructorParsesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $extractedType,
+ $extractedTypes,
+ $extractedVarName,
+ $extractedDescription
+ ) {
+ $tag = new ParamTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($extractedType, $tag->getType());
+ $this->assertEquals($extractedTypes, $tag->getTypes());
+ $this->assertEquals($extractedVarName, $tag->getVariableName());
+ $this->assertEquals($extractedDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParsesInputsIntoCorrectFields()
+ *
+ * @return array
+ */
+ public function provideDataForConstructor()
+ {
+ return array(
+ array('param', 'int', 'int', array('int'), '', ''),
+ array('param', '$bob', '', array(), '$bob', ''),
+ array(
+ 'param',
+ 'int Number of bobs',
+ 'int',
+ array('int'),
+ '',
+ 'Number of bobs'
+ ),
+ array(
+ 'param',
+ 'int $bob',
+ 'int',
+ array('int'),
+ '$bob',
+ ''
+ ),
+ array(
+ 'param',
+ 'int $bob Number of bobs',
+ 'int',
+ array('int'),
+ '$bob',
+ 'Number of bobs'
+ ),
+ array(
+ 'param',
+ "int Description \n on multiple lines",
+ 'int',
+ array('int'),
+ '',
+ "Description \n on multiple lines"
+ ),
+ array(
+ 'param',
+ "int \n\$bob Variable name on a new line",
+ 'int',
+ array('int'),
+ '$bob',
+ "Variable name on a new line"
+ ),
+ array(
+ 'param',
+ "\nint \$bob Type on a new line",
+ 'int',
+ array('int'),
+ '$bob',
+ "Type on a new line"
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php
new file mode 100644
index 0000000000..9e2aec0d19
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php
@@ -0,0 +1,102 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\ReturnTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ReturnTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag can
+ * understand the @return DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $extractedType
+ * @param string $extractedTypes
+ * @param string $extractedDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag
+ * @dataProvider provideDataForConstructor
+ *
+ * @return void
+ */
+ public function testConstructorParsesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $extractedType,
+ $extractedTypes,
+ $extractedDescription
+ ) {
+ $tag = new ReturnTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($extractedType, $tag->getType());
+ $this->assertEquals($extractedTypes, $tag->getTypes());
+ $this->assertEquals($extractedDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParsesInputsIntoCorrectFields()
+ *
+ * @return array
+ */
+ public function provideDataForConstructor()
+ {
+ return array(
+ array('return', '', '', array(), ''),
+ array('return', 'int', 'int', array('int'), ''),
+ array(
+ 'return',
+ 'int Number of Bobs',
+ 'int',
+ array('int'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'return',
+ 'int|double Number of Bobs',
+ 'int|double',
+ array('int', 'double'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'return',
+ "int Number of \n Bobs",
+ 'int',
+ array('int'),
+ "Number of \n Bobs"
+ ),
+ array(
+ 'return',
+ " int Number of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ ),
+ array(
+ 'return',
+ "int\nNumber of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php
new file mode 100644
index 0000000000..6829b04605
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php
@@ -0,0 +1,86 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SeeTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SeeTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link
+ * for the @see doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exReference
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exReference
+ ) {
+ $tag = new SeeTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exReference, $tag->getReference());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exReference
+ return array(
+ array(
+ 'see',
+ 'Foo::bar()',
+ 'Foo::bar()',
+ '',
+ 'Foo::bar()'
+ ),
+ array(
+ 'see',
+ 'Foo::bar() Testing',
+ 'Foo::bar() Testing',
+ 'Testing',
+ 'Foo::bar()',
+ ),
+ array(
+ 'see',
+ 'Foo::bar() Testing comments',
+ 'Foo::bar() Testing comments',
+ 'Testing comments',
+ 'Foo::bar()',
+ ),
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php
new file mode 100644
index 0000000000..8caf25d1cf
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php
@@ -0,0 +1,115 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SinceTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SinceTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @since doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exVersion
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\SinceTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exVersion
+ ) {
+ $tag = new SinceTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exVersion, $tag->getVersion());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exVersion
+ return array(
+ array(
+ 'since',
+ '1.0 First release.',
+ '1.0 First release.',
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'since',
+ "1.0\nFirst release.",
+ "1.0\nFirst release.",
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'since',
+ "1.0\nFirst\nrelease.",
+ "1.0\nFirst\nrelease.",
+ "First\nrelease.",
+ '1.0'
+ ),
+ array(
+ 'since',
+ 'Unfinished release',
+ 'Unfinished release',
+ 'Unfinished release',
+ ''
+ ),
+ array(
+ 'since',
+ '1.0',
+ '1.0',
+ '',
+ '1.0'
+ ),
+ array(
+ 'since',
+ 'GIT: $Id$',
+ 'GIT: $Id$',
+ '',
+ 'GIT: $Id$'
+ ),
+ array(
+ 'since',
+ 'GIT: $Id$ Dev build',
+ 'GIT: $Id$ Dev build',
+ 'Dev build',
+ 'GIT: $Id$'
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php
new file mode 100644
index 0000000000..2a40e0aa3b
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php
@@ -0,0 +1,116 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class SourceTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can
+ * understand the @source DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exStartingLine
+ * @param string $exLineCount
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exStartingLine,
+ $exLineCount
+ ) {
+ $tag = new SourceTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exStartingLine, $tag->getStartingLine());
+ $this->assertEquals($exLineCount, $tag->getLineCount());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exStartingLine, $exLineCount
+ return array(
+ array(
+ 'source',
+ '2',
+ '2',
+ '',
+ 2,
+ null
+ ),
+ array(
+ 'source',
+ 'Testing',
+ 'Testing',
+ 'Testing',
+ 1,
+ null
+ ),
+ array(
+ 'source',
+ '2 Testing',
+ '2 Testing',
+ 'Testing',
+ 2,
+ null
+ ),
+ array(
+ 'source',
+ '2 3 Testing comments',
+ '2 3 Testing comments',
+ 'Testing comments',
+ 2,
+ 3
+ ),
+ array(
+ 'source',
+ '2 -1 Testing comments',
+ '2 -1 Testing comments',
+ '-1 Testing comments',
+ 2,
+ null
+ ),
+ array(
+ 'source',
+ '-1 1 Testing comments',
+ '-1 1 Testing comments',
+ '-1 1 Testing comments',
+ 1,
+ null
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php
new file mode 100644
index 0000000000..3c669d5583
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php
@@ -0,0 +1,102 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\ThrowsTag
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class ThrowsTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag can
+ * understand the @throws DocBlock.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $extractedType
+ * @param string $extractedTypes
+ * @param string $extractedDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag
+ * @dataProvider provideDataForConstructor
+ *
+ * @return void
+ */
+ public function testConstructorParsesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $extractedType,
+ $extractedTypes,
+ $extractedDescription
+ ) {
+ $tag = new ThrowsTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($extractedType, $tag->getType());
+ $this->assertEquals($extractedTypes, $tag->getTypes());
+ $this->assertEquals($extractedDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParsesInputsIntoCorrectFields()
+ *
+ * @return array
+ */
+ public function provideDataForConstructor()
+ {
+ return array(
+ array('throws', '', '', array(), ''),
+ array('throws', 'int', 'int', array('int'), ''),
+ array(
+ 'throws',
+ 'int Number of Bobs',
+ 'int',
+ array('int'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'throws',
+ 'int|double Number of Bobs',
+ 'int|double',
+ array('int', 'double'),
+ 'Number of Bobs'
+ ),
+ array(
+ 'throws',
+ "int Number of \n Bobs",
+ 'int',
+ array('int'),
+ "Number of \n Bobs"
+ ),
+ array(
+ 'throws',
+ " int Number of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ ),
+ array(
+ 'throws',
+ "int\nNumber of Bobs",
+ 'int',
+ array('int'),
+ "Number of Bobs"
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php
new file mode 100644
index 0000000000..45868d73e9
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php
@@ -0,0 +1,86 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\UsesTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class UsesTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\UsesTag can create
+ * a link for the @uses doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exReference
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\UsesTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exReference
+ ) {
+ $tag = new UsesTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exReference, $tag->getReference());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exReference
+ return array(
+ array(
+ 'uses',
+ 'Foo::bar()',
+ 'Foo::bar()',
+ '',
+ 'Foo::bar()'
+ ),
+ array(
+ 'uses',
+ 'Foo::bar() Testing',
+ 'Foo::bar() Testing',
+ 'Testing',
+ 'Foo::bar()',
+ ),
+ array(
+ 'uses',
+ 'Foo::bar() Testing comments',
+ 'Foo::bar() Testing comments',
+ 'Testing comments',
+ 'Foo::bar()',
+ ),
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php
new file mode 100644
index 0000000000..9ae2aa5f7f
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php
@@ -0,0 +1,94 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VarTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
+ * understand the @var doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exType
+ * @param string $exVariable
+ * @param string $exDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exType,
+ $exVariable,
+ $exDescription
+ ) {
+ $tag = new VarTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exType, $tag->getType());
+ $this->assertEquals($exVariable, $tag->getVariableName());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exType, $exVariable, $exDescription
+ return array(
+ array(
+ 'var',
+ 'int',
+ 'int',
+ '',
+ ''
+ ),
+ array(
+ 'var',
+ 'int $bob',
+ 'int',
+ '$bob',
+ ''
+ ),
+ array(
+ 'var',
+ 'int $bob Number of bobs',
+ 'int',
+ '$bob',
+ 'Number of bobs'
+ ),
+ array(
+ 'var',
+ '',
+ '',
+ '',
+ ''
+ ),
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php
new file mode 100644
index 0000000000..e145386d45
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php
@@ -0,0 +1,115 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Tag;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
+ *
+ * @author Vasil Rangelov
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class VersionTagTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create
+ * a link for the @version doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exContent
+ * @param string $exDescription
+ * @param string $exVersion
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exContent,
+ $exDescription,
+ $exVersion
+ ) {
+ $tag = new VersionTag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($exContent, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ $this->assertEquals($exVersion, $tag->getVersion());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exContent, $exDescription, $exVersion
+ return array(
+ array(
+ 'version',
+ '1.0 First release.',
+ '1.0 First release.',
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'version',
+ "1.0\nFirst release.",
+ "1.0\nFirst release.",
+ 'First release.',
+ '1.0'
+ ),
+ array(
+ 'version',
+ "1.0\nFirst\nrelease.",
+ "1.0\nFirst\nrelease.",
+ "First\nrelease.",
+ '1.0'
+ ),
+ array(
+ 'version',
+ 'Unfinished release',
+ 'Unfinished release',
+ 'Unfinished release',
+ ''
+ ),
+ array(
+ 'version',
+ '1.0',
+ '1.0',
+ '',
+ '1.0'
+ ),
+ array(
+ 'version',
+ 'GIT: $Id$',
+ 'GIT: $Id$',
+ '',
+ 'GIT: $Id$'
+ ),
+ array(
+ 'version',
+ 'GIT: $Id$ Dev build',
+ 'GIT: $Id$ Dev build',
+ 'Dev build',
+ 'GIT: $Id$'
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
new file mode 100644
index 0000000000..9e873ecb5d
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@@ -0,0 +1,313 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock;
+
+use phpDocumentor\Reflection\DocBlock;
+use phpDocumentor\Reflection\DocBlock\Context;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag
+ *
+ * @author Daniel O'Connor
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class TagTest extends \PHPUnit_Framework_TestCase
+{
+
+ /**
+ * @expectedException \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function testInvalidTagLine()
+ {
+ Tag::createInstance('Invalid tag line');
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testTagHandlerUnregistration()
+ {
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreUnreg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreUnreg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreUnreg
+ );
+
+ Tag::registerTagHandler('var', null);
+
+ $tagPostUnreg = Tag::createInstance('@var mixed');
+ $this->assertNotInstanceOf(
+ $currentHandler,
+ $tagPostUnreg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostUnreg
+ );
+
+ Tag::registerTagHandler('var', $currentHandler);
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testTagHandlerCorrectRegistration()
+ {
+ if (0 == ini_get('allow_url_include')) {
+ $this->markTestSkipped('"data" URIs for includes are required.');
+ }
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+
+ include 'data:text/plain;base64,'. base64_encode(
+<<assertTrue(Tag::registerTagHandler('var', '\MyTagHandler'));
+
+ $tagPostReg = Tag::createInstance('@var mixed');
+ $this->assertNotInstanceOf(
+ $currentHandler,
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ '\MyTagHandler',
+ $tagPostReg
+ );
+
+ $this->assertTrue(Tag::registerTagHandler('var', $currentHandler));
+ }
+
+ /**
+ * @depends testTagHandlerCorrectRegistration
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance
+ *
+ * @return void
+ */
+ public function testNamespacedTagHandlerCorrectRegistration()
+ {
+ $tagPreReg = Tag::createInstance('@T something');
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+ $this->assertNotInstanceOf(
+ '\MyTagHandler',
+ $tagPreReg
+ );
+
+ $this->assertTrue(
+ Tag::registerTagHandler('\MyNamespace\MyTag', '\MyTagHandler')
+ );
+
+ $tagPostReg = Tag::createInstance(
+ '@T something',
+ new DocBlock(
+ '',
+ new Context('', array('T' => '\MyNamespace\MyTag'))
+ )
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ '\MyTagHandler',
+ $tagPostReg
+ );
+
+ $this->assertTrue(
+ Tag::registerTagHandler('\MyNamespace\MyTag', null)
+ );
+ }
+
+ /**
+ * @depends testTagHandlerCorrectRegistration
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance
+ *
+ * @return void
+ */
+ public function testNamespacedTagHandlerIncorrectRegistration()
+ {
+ $tagPreReg = Tag::createInstance('@T something');
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+ $this->assertNotInstanceOf(
+ '\MyTagHandler',
+ $tagPreReg
+ );
+
+ $this->assertFalse(
+ Tag::registerTagHandler('MyNamespace\MyTag', '\MyTagHandler')
+ );
+
+ $tagPostReg = Tag::createInstance(
+ '@T something',
+ new DocBlock(
+ '',
+ new Context('', array('T' => '\MyNamespace\MyTag'))
+ )
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ $this->assertNotInstanceOf(
+ '\MyTagHandler',
+ $tagPostReg
+ );
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testNonExistentTagHandlerRegistration()
+ {
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+
+ $this->assertFalse(Tag::registerTagHandler('var', 'Non existent'));
+
+ $tagPostReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
+ *
+ * @return void
+ */
+ public function testIncompatibleTagHandlerRegistration()
+ {
+ $currentHandler = __NAMESPACE__ . '\Tag\VarTag';
+ $tagPreReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPreReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPreReg
+ );
+
+ $this->assertFalse(
+ Tag::registerTagHandler('var', __NAMESPACE__ . '\TagTest')
+ );
+
+ $tagPostReg = Tag::createInstance('@var mixed');
+ $this->assertInstanceOf(
+ $currentHandler,
+ $tagPostReg
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\Tag',
+ $tagPostReg
+ );
+ }
+
+ /**
+ * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can
+ * understand the @var doc block.
+ *
+ * @param string $type
+ * @param string $content
+ * @param string $exDescription
+ *
+ * @covers \phpDocumentor\Reflection\DocBlock\Tag
+ * @dataProvider provideDataForConstuctor
+ *
+ * @return void
+ */
+ public function testConstructorParesInputsIntoCorrectFields(
+ $type,
+ $content,
+ $exDescription
+ ) {
+ $tag = new Tag($type, $content);
+
+ $this->assertEquals($type, $tag->getName());
+ $this->assertEquals($content, $tag->getContent());
+ $this->assertEquals($exDescription, $tag->getDescription());
+ }
+
+ /**
+ * Data provider for testConstructorParesInputsIntoCorrectFields
+ *
+ * @return array
+ */
+ public function provideDataForConstuctor()
+ {
+ // $type, $content, $exDescription
+ return array(
+ array(
+ 'unknown',
+ 'some content',
+ 'some content',
+ ),
+ array(
+ 'unknown',
+ '',
+ '',
+ )
+ );
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php
new file mode 100644
index 0000000000..78c7306d60
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php
@@ -0,0 +1,195 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection\DocBlock\Type;
+
+use phpDocumentor\Reflection\DocBlock\Context;
+
+/**
+ * Test class for \phpDocumentor\Reflection\DocBlock\Type\Collection
+ *
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class CollectionTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getContext
+ *
+ * @return void
+ */
+ public function testConstruct()
+ {
+ $collection = new Collection();
+ $this->assertCount(0, $collection);
+ $this->assertEquals('', $collection->getContext()->getNamespace());
+ $this->assertCount(0, $collection->getContext()->getNamespaceAliases());
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ *
+ * @return void
+ */
+ public function testConstructWithTypes()
+ {
+ $collection = new Collection(array('integer', 'string'));
+ $this->assertCount(2, $collection);
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ *
+ * @return void
+ */
+ public function testConstructWithNamespace()
+ {
+ $collection = new Collection(array(), new Context('\My\Space'));
+ $this->assertEquals('My\Space', $collection->getContext()->getNamespace());
+
+ $collection = new Collection(array(), new Context('My\Space'));
+ $this->assertEquals('My\Space', $collection->getContext()->getNamespace());
+
+ $collection = new Collection(array(), null);
+ $this->assertEquals('', $collection->getContext()->getNamespace());
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct
+ *
+ * @return void
+ */
+ public function testConstructWithNamespaceAliases()
+ {
+ $fixture = array('a' => 'b');
+ $collection = new Collection(array(), new Context(null, $fixture));
+ $this->assertEquals(
+ array('a' => '\b'),
+ $collection->getContext()->getNamespaceAliases()
+ );
+ }
+
+ /**
+ * @param string $fixture
+ * @param array $expected
+ *
+ * @dataProvider provideTypesToExpand
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
+ *
+ * @return void
+ */
+ public function testAdd($fixture, $expected)
+ {
+ $collection = new Collection(
+ array(),
+ new Context('\My\Space', array('Alias' => '\My\Space\Aliasing'))
+ );
+ $collection->add($fixture);
+
+ $this->assertSame($expected, $collection->getArrayCopy());
+ }
+
+ /**
+ * @param string $fixture
+ * @param array $expected
+ *
+ * @dataProvider provideTypesToExpandWithoutNamespace
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
+ *
+ * @return void
+ */
+ public function testAddWithoutNamespace($fixture, $expected)
+ {
+ $collection = new Collection(
+ array(),
+ new Context(null, array('Alias' => '\My\Space\Aliasing'))
+ );
+ $collection->add($fixture);
+
+ $this->assertSame($expected, $collection->getArrayCopy());
+ }
+
+ /**
+ * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add
+ * @expectedException InvalidArgumentException
+ *
+ * @return void
+ */
+ public function testAddWithInvalidArgument()
+ {
+ $collection = new Collection();
+ $collection->add(array());
+ }
+
+ /**
+ * Returns the types and their expected values to test the retrieval of
+ * types.
+ *
+ * @param string $method Name of the method consuming this data provider.
+ * @param string $namespace Name of the namespace to user as basis.
+ *
+ * @return string[]
+ */
+ public function provideTypesToExpand($method, $namespace = '\My\Space\\')
+ {
+ return array(
+ array('', array()),
+ array(' ', array()),
+ array('int', array('int')),
+ array('int ', array('int')),
+ array('string', array('string')),
+ array('DocBlock', array($namespace.'DocBlock')),
+ array('DocBlock[]', array($namespace.'DocBlock[]')),
+ array(' DocBlock ', array($namespace.'DocBlock')),
+ array('\My\Space\DocBlock', array('\My\Space\DocBlock')),
+ array('Alias\DocBlock', array('\My\Space\Aliasing\DocBlock')),
+ array(
+ 'DocBlock|Tag',
+ array($namespace .'DocBlock', $namespace .'Tag')
+ ),
+ array(
+ 'DocBlock|null',
+ array($namespace.'DocBlock', 'null')
+ ),
+ array(
+ '\My\Space\DocBlock|Tag',
+ array('\My\Space\DocBlock', $namespace.'Tag')
+ ),
+ array(
+ 'DocBlock[]|null',
+ array($namespace.'DocBlock[]', 'null')
+ ),
+ array(
+ 'DocBlock[]|int[]',
+ array($namespace.'DocBlock[]', 'int[]')
+ ),
+ );
+ }
+
+ /**
+ * Returns the types and their expected values to test the retrieval of
+ * types when no namespace is available.
+ *
+ * @param string $method Name of the method consuming this data provider.
+ *
+ * @return string[]
+ */
+ public function provideTypesToExpandWithoutNamespace($method)
+ {
+ return $this->provideTypesToExpand($method, '\\');
+ }
+}
diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php
new file mode 100644
index 0000000000..30eedfc581
--- /dev/null
+++ b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php
@@ -0,0 +1,337 @@
+
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+
+namespace phpDocumentor\Reflection;
+
+use phpDocumentor\Reflection\DocBlock\Context;
+use phpDocumentor\Reflection\DocBlock\Location;
+use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag;
+
+/**
+ * Test class for phpDocumentor\Reflection\DocBlock
+ *
+ * @author Mike van Riel
+ * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
+ * @license http://www.opensource.org/licenses/mit-license.php MIT
+ * @link http://phpdoc.org
+ */
+class DocBlockTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock
+ *
+ * @return void
+ */
+ public function testConstruct()
+ {
+ $fixture = << '\phpDocumentor')),
+ new Location(2)
+ );
+ $this->assertEquals(
+ 'This is a short description',
+ $object->getShortDescription()
+ );
+ $this->assertEquals(
+ 'This is a long description',
+ $object->getLongDescription()->getContents()
+ );
+ $this->assertCount(2, $object->getTags());
+ $this->assertTrue($object->hasTag('see'));
+ $this->assertTrue($object->hasTag('return'));
+ $this->assertFalse($object->hasTag('category'));
+
+ $this->assertSame('MyNamespace', $object->getContext()->getNamespace());
+ $this->assertSame(
+ array('PHPDoc' => '\phpDocumentor'),
+ $object->getContext()->getNamespaceAliases()
+ );
+ $this->assertSame(2, $object->getLocation()->getLineNumber());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::splitDocBlock
+ *
+ * @return void
+ */
+ public function testConstructWithTagsOnly()
+ {
+ $fixture = <<assertEquals('', $object->getShortDescription());
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(2, $object->getTags());
+ $this->assertTrue($object->hasTag('see'));
+ $this->assertTrue($object->hasTag('return'));
+ $this->assertFalse($object->hasTag('category'));
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::isTemplateStart
+ */
+ public function testIfStartOfTemplateIsDiscovered()
+ {
+ $fixture = <<assertEquals('', $object->getShortDescription());
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(2, $object->getTags());
+ $this->assertTrue($object->hasTag('see'));
+ $this->assertTrue($object->hasTag('return'));
+ $this->assertFalse($object->hasTag('category'));
+ $this->assertTrue($object->isTemplateStart());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::isTemplateEnd
+ */
+ public function testIfEndOfTemplateIsDiscovered()
+ {
+ $fixture = <<assertEquals('', $object->getShortDescription());
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertTrue($object->isTemplateEnd());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::cleanInput
+ *
+ * @return void
+ */
+ public function testConstructOneLiner()
+ {
+ $fixture = '/** Short description and nothing more. */';
+ $object = new DocBlock($fixture);
+ $this->assertEquals(
+ 'Short description and nothing more.',
+ $object->getShortDescription()
+ );
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(0, $object->getTags());
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::__construct
+ *
+ * @return void
+ */
+ public function testConstructFromReflector()
+ {
+ $object = new DocBlock(new \ReflectionClass($this));
+ $this->assertEquals(
+ 'Test class for phpDocumentor\Reflection\DocBlock',
+ $object->getShortDescription()
+ );
+ $this->assertEquals('', $object->getLongDescription()->getContents());
+ $this->assertCount(4, $object->getTags());
+ $this->assertTrue($object->hasTag('author'));
+ $this->assertTrue($object->hasTag('copyright'));
+ $this->assertTrue($object->hasTag('license'));
+ $this->assertTrue($object->hasTag('link'));
+ $this->assertFalse($object->hasTag('category'));
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function testExceptionOnInvalidObject()
+ {
+ new DocBlock($this);
+ }
+
+ public function testDotSeperation()
+ {
+ $fixture = <<assertEquals(
+ 'This is a short description.',
+ $object->getShortDescription()
+ );
+ $this->assertEquals(
+ "This is a long description.\nThis is a continuation of the long "
+ ."description.",
+ $object->getLongDescription()->getContents()
+ );
+ }
+
+ /**
+ * @covers \phpDocumentor\Reflection\DocBlock::parseTags
+ * @expectedException \LogicException
+ *
+ * @return void
+ */
+ public function testInvalidTagBlock()
+ {
+ if (0 == ini_get('allow_url_include')) {
+ $this->markTestSkipped('"data" URIs for includes are required.');
+ }
+
+ include 'data:text/plain;base64,'. base64_encode(
+ <<assertEquals(
+ 'This is a short description.',
+ $object->getShortDescription()
+ );
+ $this->assertEquals(
+ 'This is a long description.',
+ $object->getLongDescription()->getContents()
+ );
+ $tags = $object->getTags();
+ $this->assertCount(2, $tags);
+ $this->assertTrue($object->hasTag('method'));
+ $this->assertTrue($object->hasTag('Method'));
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\DocBlock\Tag\MethodTag',
+ $tags[0]
+ );
+ $this->assertInstanceOf(
+ __NAMESPACE__ . '\DocBlock\Tag',
+ $tags[1]
+ );
+ $this->assertNotInstanceOf(
+ __NAMESPACE__ . '\DocBlock\Tag\MethodTag',
+ $tags[1]
+ );
+ }
+
+ /**
+ * @depends testConstructFromReflector
+ * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName
+ *
+ * @return void
+ */
+ public function testGetTagsByNameZeroAndOneMatch()
+ {
+ $object = new DocBlock(new \ReflectionClass($this));
+ $this->assertEmpty($object->getTagsByName('category'));
+ $this->assertCount(1, $object->getTagsByName('author'));
+ }
+
+ /**
+ * @depends testConstructWithTagsOnly
+ * @covers \phpDocumentor\Reflection\DocBlock::parseTags
+ *
+ * @return void
+ */
+ public function testParseMultilineTag()
+ {
+ $fixture = <<assertCount(1, $object->getTags());
+ }
+
+ /**
+ * @depends testConstructWithTagsOnly
+ * @covers \phpDocumentor\Reflection\DocBlock::parseTags
+ *
+ * @return void
+ */
+ public function testParseMultilineTagWithLineBreaks()
+ {
+ $fixture = <<assertCount(1, $tags = $object->getTags());
+ /** @var ReturnTag $tag */
+ $tag = reset($tags);
+ $this->assertEquals("Content on\n multiple lines.\n\n One more, after the break.", $tag->getDescription());
+ }
+
+ /**
+ * @depends testConstructWithTagsOnly
+ * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName
+ *
+ * @return void
+ */
+ public function testGetTagsByNameMultipleMatch()
+ {
+ $fixture = <<assertEmpty($object->getTagsByName('category'));
+ $this->assertCount(1, $object->getTagsByName('return'));
+ $this->assertCount(2, $object->getTagsByName('param'));
+ }
+}
diff --git a/vendor/phpspec/prophecy/.gitignore b/vendor/phpspec/prophecy/.gitignore
new file mode 100644
index 0000000000..88ee1c14c9
--- /dev/null
+++ b/vendor/phpspec/prophecy/.gitignore
@@ -0,0 +1,5 @@
+*.tgz
+*.phar
+/composer.lock
+/vendor
+/phpunit.xml
diff --git a/vendor/phpspec/prophecy/.travis.yml b/vendor/phpspec/prophecy/.travis.yml
new file mode 100644
index 0000000000..a277922bed
--- /dev/null
+++ b/vendor/phpspec/prophecy/.travis.yml
@@ -0,0 +1,39 @@
+language: php
+
+sudo: false
+
+cache:
+ directories:
+ - $HOME/.composer/cache
+
+branches:
+ except:
+ - /^bugfix\/.*$/
+ - /^feature\/.*$/
+ - /^optimization\/.*$/
+
+matrix:
+ include:
+ - php: 5.3
+ - php: 5.4
+ - php: 5.5
+ - php: 5.6
+ env: DEPENDENCIES='low'
+ - php: 5.6
+ - php: 7.0
+ - php: 7.1
+ # Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
+ - php: hhvm
+ sudo: required
+ dist: trusty
+ group: edge
+ fast_finish: true
+
+install:
+ - export COMPOSER_ROOT_VERSION=dev-master
+ - if [ "$DEPENDENCIES" != "low" ]; then composer update; fi;
+ - if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi;
+
+script:
+ - vendor/bin/phpspec run -fpretty -v
+ - vendor/bin/phpunit
diff --git a/vendor/phpspec/prophecy/CHANGES.md b/vendor/phpspec/prophecy/CHANGES.md
new file mode 100644
index 0000000000..996567aab3
--- /dev/null
+++ b/vendor/phpspec/prophecy/CHANGES.md
@@ -0,0 +1,165 @@
+1.7.0 / 2017-03-02
+==================
+
+* Add full PHP 7.1 Support (thanks @prolic)
+* Allow `sebastian/comparator ^2.0` (thanks @sebastianbergmann)
+* Allow `sebastian/recursion-context ^3.0` (thanks @sebastianbergmann)
+* Allow `\Error` instances in `ThrowPromise` (thanks @jameshalsall)
+* Support `phpspec/phpspect ^3.2` (thanks @Sam-Burns)
+* Fix failing builds (thanks @Sam-Burns)
+
+1.6.2 / 2016-11-21
+==================
+
+* Added support for detecting @method on interfaces that the class itself implements, or when the stubbed class is an interface itself (thanks @Seldaek)
+* Added support for sebastian/recursion-context 2 (thanks @sebastianbergmann)
+* Added testing on PHP 7.1 on Travis (thanks @danizord)
+* Fixed the usage of the phpunit comparator (thanks @Anyqax)
+
+1.6.1 / 2016-06-07
+==================
+
+ * Ignored empty method names in invalid `@method` phpdoc
+ * Fixed the mocking of SplFileObject
+ * Added compatibility with phpdocumentor/reflection-docblock 3
+
+1.6.0 / 2016-02-15
+==================
+
+ * Add Variadics support (thanks @pamil)
+ * Add ProphecyComparator for comparing objects that need revealing (thanks @jon-acker)
+ * Add ApproximateValueToken (thanks @dantleech)
+ * Add support for 'self' and 'parent' return type (thanks @bendavies)
+ * Add __invoke to allowed reflectable methods list (thanks @ftrrtf)
+ * Updated ExportUtil to reflect the latest changes by Sebastian (thanks @jakari)
+ * Specify the required php version for composer (thanks @jakzal)
+ * Exclude 'args' in the generated backtrace (thanks @oradwell)
+ * Fix code generation for scalar parameters (thanks @trowski)
+ * Fix missing sprintf in InvalidArgumentException __construct call (thanks @emmanuelballery)
+ * Fix phpdoc for magic methods (thanks @Tobion)
+ * Fix PhpDoc for interfaces usage (thanks @ImmRanneft)
+ * Prevent final methods from being manually extended (thanks @kamioftea)
+ * Enhance exception for invalid argument to ThrowPromise (thanks @Tobion)
+
+1.5.0 / 2015-04-27
+==================
+
+ * Add support for PHP7 scalar type hints (thanks @trowski)
+ * Add support for PHP7 return types (thanks @trowski)
+ * Update internal test suite to support PHP7
+
+1.4.1 / 2015-04-27
+==================
+
+ * Fixed bug in closure-based argument tokens (#181)
+
+1.4.0 / 2015-03-27
+==================
+
+ * Fixed errors in return type phpdocs (thanks @sobit)
+ * Fixed stringifying of hash containing one value (thanks @avant1)
+ * Improved clarity of method call expectation exception (thanks @dantleech)
+ * Add ability to specify which argument is returned in willReturnArgument (thanks @coderbyheart)
+ * Add more information to MethodNotFound exceptions (thanks @ciaranmcnulty)
+ * Support for mocking classes with methods that return references (thanks @edsonmedina)
+ * Improved object comparison (thanks @whatthejeff)
+ * Adopted '^' in composer dependencies (thanks @GrahamCampbell)
+ * Fixed non-typehinted arguments being treated as optional (thanks @whatthejeff)
+ * Magic methods are now filtered for keywords (thanks @seagoj)
+ * More readable errors for failure when expecting single calls (thanks @dantleech)
+
+1.3.1 / 2014-11-17
+==================
+
+ * Fix the edge case when failed predictions weren't recorded for `getCheckedPredictions()`
+
+1.3.0 / 2014-11-14
+==================
+
+ * Add a way to get checked predictions with `MethodProphecy::getCheckedPredictions()`
+ * Fix HHVM compatibility
+ * Remove dead code (thanks @stof)
+ * Add support for DirectoryIterators (thanks @shanethehat)
+
+1.2.0 / 2014-07-18
+==================
+
+ * Added support for doubling magic methods documented in the class phpdoc (thanks @armetiz)
+ * Fixed a segfault appearing in some cases (thanks @dmoreaulf)
+ * Fixed the doubling of methods with typehints on non-existent classes (thanks @gquemener)
+ * Added support for internal classes using keywords as method names (thanks @milan)
+ * Added IdenticalValueToken and Argument::is (thanks @florianv)
+ * Removed the usage of scalar typehints in HHVM as HHVM 3 does not support them anymore in PHP code (thanks @whatthejeff)
+
+1.1.2 / 2014-01-24
+==================
+
+ * Spy automatically promotes spied method call to an expected one
+
+1.1.1 / 2014-01-15
+==================
+
+ * Added support for HHVM
+
+1.1.0 / 2014-01-01
+==================
+
+ * Changed the generated class names to use a static counter instead of a random number
+ * Added a clss patch for ReflectionClass::newInstance to make its argument optional consistently (thanks @docteurklein)
+ * Fixed mirroring of classes with typehints on non-existent classes (thanks @docteurklein)
+ * Fixed the support of array callables in CallbackPromise and CallbackPrediction (thanks @ciaranmcnulty)
+ * Added support for properties in ObjectStateToken (thanks @adrienbrault)
+ * Added support for mocking classes with a final constructor (thanks @ciaranmcnulty)
+ * Added ArrayEveryEntryToken and Argument::withEveryEntry() (thanks @adrienbrault)
+ * Added an exception when trying to prophesize on a final method instead of ignoring silently (thanks @docteurklein)
+ * Added StringContainToken and Argument::containingString() (thanks @peterjmit)
+ * Added ``shouldNotHaveBeenCalled`` on the MethodProphecy (thanks @ciaranmcnulty)
+ * Fixed the comparison of objects in ExactValuetoken (thanks @sstok)
+ * Deprecated ``shouldNotBeenCalled`` in favor of ``shouldNotHaveBeenCalled``
+
+1.0.4 / 2013-08-10
+==================
+
+ * Better randomness for generated class names (thanks @sstok)
+ * Add support for interfaces into TypeToken and Argument::type() (thanks @sstok)
+ * Add support for old-style (method name === class name) constructors (thanks @l310 for report)
+
+1.0.3 / 2013-07-04
+==================
+
+ * Support callable typehints (thanks @stof)
+ * Do not attempt to autoload arrays when generating code (thanks @MarcoDeBortoli)
+ * New ArrayEntryToken (thanks @kagux)
+
+1.0.2 / 2013-05-19
+==================
+
+ * Logical `AND` token added (thanks @kagux)
+ * Logical `NOT` token added (thanks @kagux)
+ * Add support for setting custom constructor arguments
+ * Properly stringify hashes
+ * Record calls that throw exceptions
+ * Migrate spec suite to PhpSpec 2.0
+
+1.0.1 / 2013-04-30
+==================
+
+ * Fix broken UnexpectedCallException message
+ * Trim AggregateException message
+
+1.0.0 / 2013-04-29
+==================
+
+ * Improve exception messages
+
+1.0.0-BETA2 / 2013-04-03
+========================
+
+ * Add more debug information to CallTimes and Call prediction exception messages
+ * Fix MethodNotFoundException wrong namespace (thanks @gunnarlium)
+ * Fix some typos in the exception messages (thanks @pborreli)
+
+1.0.0-BETA1 / 2013-03-25
+========================
+
+ * Initial release
diff --git a/vendor/phpspec/prophecy/CONTRIBUTING.md b/vendor/phpspec/prophecy/CONTRIBUTING.md
new file mode 100644
index 0000000000..4a8169d081
--- /dev/null
+++ b/vendor/phpspec/prophecy/CONTRIBUTING.md
@@ -0,0 +1,22 @@
+Contributing
+------------
+
+Prophecy is an open source, community-driven project. If you'd like to contribute,
+feel free to do this, but remember to follow these few simple rules:
+
+- Make your feature addition or bug fix,
+- Add either specs or examples for any changes you're making (bugfixes or additions)
+ (please look into `spec/` folder for some examples). This is important so we don't break
+ it in a future version unintentionally,
+- Commit your code, but do not mess with `CHANGES.md`,
+
+Running tests
+-------------
+
+Make sure that you don't break anything with your changes by running:
+
+```bash
+$> composer install --prefer-dist
+$> vendor/bin/phpspec run
+$> vendor/bin/phpunit
+```
diff --git a/vendor/phpspec/prophecy/LICENSE b/vendor/phpspec/prophecy/LICENSE
new file mode 100644
index 0000000000..c8b364711a
--- /dev/null
+++ b/vendor/phpspec/prophecy/LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2013 Konstantin Kudryashov
+ Marcello Duarte
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/phpspec/prophecy/README.md b/vendor/phpspec/prophecy/README.md
new file mode 100644
index 0000000000..65ec16c4fc
--- /dev/null
+++ b/vendor/phpspec/prophecy/README.md
@@ -0,0 +1,391 @@
+# Prophecy
+
+[](https://packagist.org/packages/phpspec/prophecy)
+[](https://travis-ci.org/phpspec/prophecy)
+
+Prophecy is a highly opinionated yet very powerful and flexible PHP object mocking
+framework. Though initially it was created to fulfil phpspec2 needs, it is flexible
+enough to be used inside any testing framework out there with minimal effort.
+
+## A simple example
+
+```php
+prophet->prophesize('App\Security\Hasher');
+ $user = new App\Entity\User($hasher->reveal());
+
+ $hasher->generateHash($user, 'qwerty')->willReturn('hashed_pass');
+
+ $user->setPassword('qwerty');
+
+ $this->assertEquals('hashed_pass', $user->getPassword());
+ }
+
+ protected function setup()
+ {
+ $this->prophet = new \Prophecy\Prophet;
+ }
+
+ protected function tearDown()
+ {
+ $this->prophet->checkPredictions();
+ }
+}
+```
+
+## Installation
+
+### Prerequisites
+
+Prophecy requires PHP 5.3.3 or greater.
+
+### Setup through composer
+
+First, add Prophecy to the list of dependencies inside your `composer.json`:
+
+```json
+{
+ "require-dev": {
+ "phpspec/prophecy": "~1.0"
+ }
+}
+```
+
+Then simply install it with composer:
+
+```bash
+$> composer install --prefer-dist
+```
+
+You can read more about Composer on its [official webpage](http://getcomposer.org).
+
+## How to use it
+
+First of all, in Prophecy every word has a logical meaning, even the name of the library
+itself (Prophecy). When you start feeling that, you'll become very fluid with this
+tool.
+
+For example, Prophecy has been named that way because it concentrates on describing the future
+behavior of objects with very limited knowledge about them. But as with any other prophecy,
+those object prophecies can't create themselves - there should be a Prophet:
+
+```php
+$prophet = new Prophecy\Prophet;
+```
+
+The Prophet creates prophecies by *prophesizing* them:
+
+```php
+$prophecy = $prophet->prophesize();
+```
+
+The result of the `prophesize()` method call is a new object of class `ObjectProphecy`. Yes,
+that's your specific object prophecy, which describes how your object would behave
+in the near future. But first, you need to specify which object you're talking about,
+right?
+
+```php
+$prophecy->willExtend('stdClass');
+$prophecy->willImplement('SessionHandlerInterface');
+```
+
+There are 2 interesting calls - `willExtend` and `willImplement`. The first one tells
+object prophecy that our object should extend specific class, the second one says that
+it should implement some interface. Obviously, objects in PHP can implement multiple
+interfaces, but extend only one parent class.
+
+### Dummies
+
+Ok, now we have our object prophecy. What can we do with it? First of all, we can get
+our object *dummy* by revealing its prophecy:
+
+```php
+$dummy = $prophecy->reveal();
+```
+
+The `$dummy` variable now holds a special dummy object. Dummy objects are objects that extend
+and/or implement preset classes/interfaces by overriding all their public methods. The key
+point about dummies is that they do not hold any logic - they just do nothing. Any method
+of the dummy will always return `null` and the dummy will never throw any exceptions.
+Dummy is your friend if you don't care about the actual behavior of this double and just need
+a token object to satisfy a method typehint.
+
+You need to understand one thing - a dummy is not a prophecy. Your object prophecy is still
+assigned to `$prophecy` variable and in order to manipulate with your expectations, you
+should work with it. `$dummy` is a dummy - a simple php object that tries to fulfil your
+prophecy.
+
+### Stubs
+
+Ok, now we know how to create basic prophecies and reveal dummies from them. That's
+awesome if we don't care about our _doubles_ (objects that reflect originals)
+interactions. If we do, we need to use *stubs* or *mocks*.
+
+A stub is an object double, which doesn't have any expectations about the object behavior,
+but when put in specific environment, behaves in specific way. Ok, I know, it's cryptic,
+but bear with me for a minute. Simply put, a stub is a dummy, which depending on the called
+method signature does different things (has logic). To create stubs in Prophecy:
+
+```php
+$prophecy->read('123')->willReturn('value');
+```
+
+Oh wow. We've just made an arbitrary call on the object prophecy? Yes, we did. And this
+call returned us a new object instance of class `MethodProphecy`. Yep, that's a specific
+method with arguments prophecy. Method prophecies give you the ability to create method
+promises or predictions. We'll talk about method predictions later in the _Mocks_ section.
+
+#### Promises
+
+Promises are logical blocks, that represent your fictional methods in prophecy terms
+and they are handled by the `MethodProphecy::will(PromiseInterface $promise)` method.
+As a matter of fact, the call that we made earlier (`willReturn('value')`) is a simple
+shortcut to:
+
+```php
+$prophecy->read('123')->will(new Prophecy\Promise\ReturnPromise(array('value')));
+```
+
+This promise will cause any call to our double's `read()` method with exactly one
+argument - `'123'` to always return `'value'`. But that's only for this
+promise, there's plenty others you can use:
+
+- `ReturnPromise` or `->willReturn(1)` - returns a value from a method call
+- `ReturnArgumentPromise` or `->willReturnArgument($index)` - returns the nth method argument from call
+- `ThrowPromise` or `->willThrow` - causes the method to throw specific exception
+- `CallbackPromise` or `->will($callback)` - gives you a quick way to define your own custom logic
+
+Keep in mind, that you can always add even more promises by implementing
+`Prophecy\Promise\PromiseInterface`.
+
+#### Method prophecies idempotency
+
+Prophecy enforces same method prophecies and, as a consequence, same promises and
+predictions for the same method calls with the same arguments. This means:
+
+```php
+$methodProphecy1 = $prophecy->read('123');
+$methodProphecy2 = $prophecy->read('123');
+$methodProphecy3 = $prophecy->read('321');
+
+$methodProphecy1 === $methodProphecy2;
+$methodProphecy1 !== $methodProphecy3;
+```
+
+That's interesting, right? Now you might ask me how would you define more complex
+behaviors where some method call changes behavior of others. In PHPUnit or Mockery
+you do that by predicting how many times your method will be called. In Prophecy,
+you'll use promises for that:
+
+```php
+$user->getName()->willReturn(null);
+
+// For PHP 5.4
+$user->setName('everzet')->will(function () {
+ $this->getName()->willReturn('everzet');
+});
+
+// For PHP 5.3
+$user->setName('everzet')->will(function ($args, $user) {
+ $user->getName()->willReturn('everzet');
+});
+
+// Or
+$user->setName('everzet')->will(function ($args) use ($user) {
+ $user->getName()->willReturn('everzet');
+});
+```
+
+And now it doesn't matter how many times or in which order your methods are called.
+What matters is their behaviors and how well you faked it.
+
+#### Arguments wildcarding
+
+The previous example is awesome (at least I hope it is for you), but that's not
+optimal enough. We hardcoded `'everzet'` in our expectation. Isn't there a better
+way? In fact there is, but it involves understanding what this `'everzet'`
+actually is.
+
+You see, even if method arguments used during method prophecy creation look
+like simple method arguments, in reality they are not. They are argument token
+wildcards. As a matter of fact, `->setName('everzet')` looks like a simple call just
+because Prophecy automatically transforms it under the hood into:
+
+```php
+$user->setName(new Prophecy\Argument\Token\ExactValueToken('everzet'));
+```
+
+Those argument tokens are simple PHP classes, that implement
+`Prophecy\Argument\Token\TokenInterface` and tell Prophecy how to compare real arguments
+with your expectations. And yes, those classnames are damn big. That's why there's a
+shortcut class `Prophecy\Argument`, which you can use to create tokens like that:
+
+```php
+use Prophecy\Argument;
+
+$user->setName(Argument::exact('everzet'));
+```
+
+`ExactValueToken` is not very useful in our case as it forced us to hardcode the username.
+That's why Prophecy comes bundled with a bunch of other tokens:
+
+- `IdenticalValueToken` or `Argument::is($value)` - checks that the argument is identical to a specific value
+- `ExactValueToken` or `Argument::exact($value)` - checks that the argument matches a specific value
+- `TypeToken` or `Argument::type($typeOrClass)` - checks that the argument matches a specific type or
+ classname
+- `ObjectStateToken` or `Argument::which($method, $value)` - checks that the argument method returns
+ a specific value
+- `CallbackToken` or `Argument::that(callback)` - checks that the argument matches a custom callback
+- `AnyValueToken` or `Argument::any()` - matches any argument
+- `AnyValuesToken` or `Argument::cetera()` - matches any arguments to the rest of the signature
+- `StringContainsToken` or `Argument::containingString($value)` - checks that the argument contains a specific string value
+
+And you can add even more by implementing `TokenInterface` with your own custom classes.
+
+So, let's refactor our initial `{set,get}Name()` logic with argument tokens:
+
+```php
+use Prophecy\Argument;
+
+$user->getName()->willReturn(null);
+
+// For PHP 5.4
+$user->setName(Argument::type('string'))->will(function ($args) {
+ $this->getName()->willReturn($args[0]);
+});
+
+// For PHP 5.3
+$user->setName(Argument::type('string'))->will(function ($args, $user) {
+ $user->getName()->willReturn($args[0]);
+});
+
+// Or
+$user->setName(Argument::type('string'))->will(function ($args) use ($user) {
+ $user->getName()->willReturn($args[0]);
+});
+```
+
+That's it. Now our `{set,get}Name()` prophecy will work with any string argument provided to it.
+We've just described how our stub object should behave, even though the original object could have
+no behavior whatsoever.
+
+One last bit about arguments now. You might ask, what happens in case of:
+
+```php
+use Prophecy\Argument;
+
+$user->getName()->willReturn(null);
+
+// For PHP 5.4
+$user->setName(Argument::type('string'))->will(function ($args) {
+ $this->getName()->willReturn($args[0]);
+});
+
+// For PHP 5.3
+$user->setName(Argument::type('string'))->will(function ($args, $user) {
+ $user->getName()->willReturn($args[0]);
+});
+
+// Or
+$user->setName(Argument::type('string'))->will(function ($args) use ($user) {
+ $user->getName()->willReturn($args[0]);
+});
+
+$user->setName(Argument::any())->will(function () {
+});
+```
+
+Nothing. Your stub will continue behaving the way it did before. That's because of how
+arguments wildcarding works. Every argument token type has a different score level, which
+wildcard then uses to calculate the final arguments match score and use the method prophecy
+promise that has the highest score. In this case, `Argument::type()` in case of success
+scores `5` and `Argument::any()` scores `3`. So the type token wins, as does the first
+`setName()` method prophecy and its promise. The simple rule of thumb - more precise token
+always wins.
+
+#### Getting stub objects
+
+Ok, now we know how to define our prophecy method promises, let's get our stub from
+it:
+
+```php
+$stub = $prophecy->reveal();
+```
+
+As you might see, the only difference between how we get dummies and stubs is that with
+stubs we describe every object conversation instead of just agreeing with `null` returns
+(object being *dummy*). As a matter of fact, after you define your first promise
+(method call), Prophecy will force you to define all the communications - it throws
+the `UnexpectedCallException` for any call you didn't describe with object prophecy before
+calling it on a stub.
+
+### Mocks
+
+Now we know how to define doubles without behavior (dummies) and doubles with behavior, but
+no expectations (stubs). What's left is doubles for which we have some expectations. These
+are called mocks and in Prophecy they look almost exactly the same as stubs, except that
+they define *predictions* instead of *promises* on method prophecies:
+
+```php
+$entityManager->flush()->shouldBeCalled();
+```
+
+#### Predictions
+
+The `shouldBeCalled()` method here assigns `CallPrediction` to our method prophecy.
+Predictions are a delayed behavior check for your prophecies. You see, during the entire lifetime
+of your doubles, Prophecy records every single call you're making against it inside your
+code. After that, Prophecy can use this collected information to check if it matches defined
+predictions. You can assign predictions to method prophecies using the
+`MethodProphecy::should(PredictionInterface $prediction)` method. As a matter of fact,
+the `shouldBeCalled()` method we used earlier is just a shortcut to:
+
+```php
+$entityManager->flush()->should(new Prophecy\Prediction\CallPrediction());
+```
+
+It checks if your method of interest (that matches both the method name and the arguments wildcard)
+was called 1 or more times. If the prediction failed then it throws an exception. When does this
+check happen? Whenever you call `checkPredictions()` on the main Prophet object:
+
+```php
+$prophet->checkPredictions();
+```
+
+In PHPUnit, you would want to put this call into the `tearDown()` method. If no predictions
+are defined, it would do nothing. So it won't harm to call it after every test.
+
+There are plenty more predictions you can play with:
+
+- `CallPrediction` or `shouldBeCalled()` - checks that the method has been called 1 or more times
+- `NoCallsPrediction` or `shouldNotBeCalled()` - checks that the method has not been called
+- `CallTimesPrediction` or `shouldBeCalledTimes($count)` - checks that the method has been called
+ `$count` times
+- `CallbackPrediction` or `should($callback)` - checks the method against your own custom callback
+
+Of course, you can always create your own custom prediction any time by implementing
+`PredictionInterface`.
+
+### Spies
+
+The last bit of awesomeness in Prophecy is out-of-the-box spies support. As I said in the previous
+section, Prophecy records every call made during the double's entire lifetime. This means
+you don't need to record predictions in order to check them. You can also do it
+manually by using the `MethodProphecy::shouldHave(PredictionInterface $prediction)` method:
+
+```php
+$em = $prophet->prophesize('Doctrine\ORM\EntityManager');
+
+$controller->createUser($em->reveal());
+
+$em->flush()->shouldHaveBeenCalled();
+```
+
+Such manipulation with doubles is called spying. And with Prophecy it just works.
diff --git a/vendor/phpspec/prophecy/composer.json b/vendor/phpspec/prophecy/composer.json
new file mode 100644
index 0000000000..7918065f09
--- /dev/null
+++ b/vendor/phpspec/prophecy/composer.json
@@ -0,0 +1,50 @@
+{
+ "name": "phpspec/prophecy",
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "keywords": ["Mock", "Stub", "Dummy", "Double", "Fake", "Spy"],
+ "homepage": "https://github.com/phpspec/prophecy",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+
+ "require": {
+ "php": "^5.3|^7.0",
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
+ "sebastian/comparator": "^1.1|^2.0",
+ "doctrine/instantiator": "^1.0.2",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ },
+
+ "require-dev": {
+ "phpspec/phpspec": "^2.5|^3.2",
+ "phpunit/phpunit": "^4.8 || ^5.6.5"
+ },
+
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\": "src/"
+ }
+ },
+
+ "autoload-dev": {
+ "psr-4": {
+ "Fixtures\\Prophecy\\": "fixtures"
+ }
+ },
+
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.6.x-dev"
+ }
+ }
+}
diff --git a/vendor/phpspec/prophecy/fixtures/EmptyClass.php b/vendor/phpspec/prophecy/fixtures/EmptyClass.php
new file mode 100644
index 0000000000..4db3b50ab1
--- /dev/null
+++ b/vendor/phpspec/prophecy/fixtures/EmptyClass.php
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
+
+
+ tests
+
+
+
+
+
+ ./src/
+
+
+
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php
new file mode 100644
index 0000000000..b82f1b893b
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/ArgumentsWildcardSpec.php
@@ -0,0 +1,128 @@
+beConstructedWith(array(42, 'zet', $object));
+
+ $class = get_class($object->getWrappedObject());
+ $hash = spl_object_hash($object->getWrappedObject());
+
+ $this->__toString()->shouldReturn("exact(42), exact(\"zet\"), exact($class:$hash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))");
+ }
+
+ function it_generates_string_representation_from_all_tokens_imploded(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->__toString()->willReturn('token_1');
+ $token2->__toString()->willReturn('token_2');
+ $token3->__toString()->willReturn('token_3');
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->__toString()->shouldReturn('token_1, token_2, token_3');
+ }
+
+ function it_exposes_list_of_tokens(TokenInterface $token)
+ {
+ $this->beConstructedWith(array($token));
+
+ $this->getTokens()->shouldReturn(array($token));
+ }
+
+ function it_returns_score_of_1_if_there_are_no_tokens_and_arguments()
+ {
+ $this->beConstructedWith(array());
+
+ $this->scoreArguments(array())->shouldReturn(1);
+ }
+
+ function it_should_return_match_score_based_on_all_tokens_score(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(5);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj))->shouldReturn(18);
+ }
+
+ function it_returns_false_if_there_is_less_arguments_than_tokens(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(5);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument(null)->willReturn(false);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2))->shouldReturn(false);
+ }
+
+ function it_returns_false_if_there_is_less_tokens_than_arguments(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(5);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj, 4))->shouldReturn(false);
+ }
+
+ function it_should_return_false_if_one_of_the_tokens_returns_false(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(false);
+ $token2->isLast()->willReturn(false);
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj))->shouldReturn(false);
+ }
+
+ function it_should_calculate_score_until_last_token(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->scoreArgument('one')->willReturn(3);
+ $token1->isLast()->willReturn(false);
+
+ $token2->scoreArgument(2)->willReturn(7);
+ $token2->isLast()->willReturn(true);
+
+ $token3->scoreArgument($obj = new \stdClass())->willReturn(10);
+ $token3->isLast()->willReturn(false);
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->scoreArguments(array('one', 2, $obj))->shouldReturn(10);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php
new file mode 100644
index 0000000000..a43e923cf3
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValueTokenSpec.php
@@ -0,0 +1,28 @@
+shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function its_string_representation_is_star()
+ {
+ $this->__toString()->shouldReturn('*');
+ }
+
+ function it_scores_any_argument_as_3()
+ {
+ $this->scoreArgument(42)->shouldReturn(3);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php
new file mode 100644
index 0000000000..c29076f593
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/AnyValuesTokenSpec.php
@@ -0,0 +1,28 @@
+shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_last()
+ {
+ $this->shouldBeLast();
+ }
+
+ function its_string_representation_is_star_with_followup()
+ {
+ $this->__toString()->shouldReturn('* [, ...]');
+ }
+
+ function it_scores_any_argument_as_2()
+ {
+ $this->scoreArgument(42)->shouldReturn(2);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ApproximateValueTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ApproximateValueTokenSpec.php
new file mode 100644
index 0000000000..8799d6d519
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ApproximateValueTokenSpec.php
@@ -0,0 +1,55 @@
+beConstructedWith(10.12345678, 4);
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Argument\Token\ApproximateValueToken');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_10_if_rounded_argument_matches_rounded_value()
+ {
+ $this->scoreArgument(10.12345)->shouldReturn(10);
+ }
+
+ function it_does_not_score_if_rounded_argument_does_not_match_rounded_value()
+ {
+ $this->scoreArgument(10.1234)->shouldReturn(false);
+ }
+
+ function it_uses_a_default_precision_of_zero()
+ {
+ $this->beConstructedWith(10.7);
+ $this->scoreArgument(11.4)->shouldReturn(10);
+ }
+
+ function it_does_not_score_if_rounded_argument_is_not_numeric()
+ {
+ $this->scoreArgument('hello')->shouldReturn(false);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldBe('≅10.1235');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php
new file mode 100644
index 0000000000..cc81fe01a4
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayCountTokenSpec.php
@@ -0,0 +1,58 @@
+beConstructedWith(2);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_6_if_argument_array_has_proper_count()
+ {
+ $this->scoreArgument(array(1,2))->shouldReturn(6);
+ }
+
+ function it_scores_6_if_argument_countable_object_has_proper_count(\Countable $countable)
+ {
+ $countable->count()->willReturn(2);
+ $this->scoreArgument($countable)->shouldReturn(6);
+ }
+
+ function it_does_not_score_if_argument_is_neither_array_nor_countable_object()
+ {
+ $this->scoreArgument('string')->shouldBe(false);
+ $this->scoreArgument(5)->shouldBe(false);
+ $this->scoreArgument(new \stdClass)->shouldBe(false);
+ }
+
+ function it_does_not_score_if_argument_array_has_wrong_count()
+ {
+ $this->scoreArgument(array(1))->shouldReturn(false);
+ }
+
+ function it_does_not_score_if_argument_countable_object_has_wrong_count(\Countable $countable)
+ {
+ $countable->count()->willReturn(3);
+ $this->scoreArgument($countable)->shouldReturn(false);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldBe('count(2)');
+ }
+
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php
new file mode 100644
index 0000000000..632118aebb
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEntryTokenSpec.php
@@ -0,0 +1,202 @@
+beConstructedWith($key, $value);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_holds_key_and_value($key, $value)
+ {
+ $this->getKey()->shouldBe($key);
+ $this->getValue()->shouldBe($value);
+ }
+
+ function its_string_representation_tells_that_its_an_array_containing_the_key_value_pair($key, $value)
+ {
+ $key->__toString()->willReturn('key');
+ $value->__toString()->willReturn('value');
+ $this->__toString()->shouldBe('[..., key => value, ...]');
+ }
+
+ function it_wraps_non_token_value_into_ExactValueToken(TokenInterface $key, \stdClass $object)
+ {
+ $this->beConstructedWith($key, $object);
+ $this->getValue()->shouldHaveType('\Prophecy\Argument\Token\ExactValueToken');
+ }
+
+ function it_wraps_non_token_key_into_ExactValueToken(\stdClass $object, TokenInterface $value)
+ {
+ $this->beConstructedWith($object, $value);
+ $this->getKey()->shouldHaveType('\Prophecy\Argument\Token\ExactValueToken');
+ }
+
+ function it_scores_array_half_of_combined_scores_from_key_and_value_tokens($key, $value)
+ {
+ $key->scoreArgument('key')->willReturn(4);
+ $value->scoreArgument('value')->willReturn(6);
+ $this->scoreArgument(array('key'=>'value'))->shouldBe(5);
+ }
+
+ function it_scores_traversable_object_half_of_combined_scores_from_key_and_value_tokens(
+ TokenInterface $key,
+ TokenInterface $value,
+ \Iterator $object
+ ) {
+ $object->current()->will(function () use ($object) {
+ $object->valid()->willReturn(false);
+
+ return 'value';
+ });
+ $object->key()->willReturn('key');
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $key->scoreArgument('key')->willReturn(6);
+ $value->scoreArgument('value')->willReturn(2);
+ $this->scoreArgument($object)->shouldBe(4);
+ }
+
+ function it_throws_exception_during_scoring_of_array_accessible_object_if_key_is_not_ExactValueToken(
+ TokenInterface $key,
+ TokenInterface $value,
+ \ArrayAccess $object
+ ) {
+ $key->__toString()->willReturn('any_token');
+ $this->beConstructedWith($key,$value);
+ $errorMessage = 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL.
+ 'But you used `any_token`.';
+ $this->shouldThrow(new InvalidArgumentException($errorMessage))->duringScoreArgument($object);
+ }
+
+ function it_scores_array_accessible_object_half_of_combined_scores_from_key_and_value_tokens(
+ ExactValueToken $key,
+ TokenInterface $value,
+ \ArrayAccess $object
+ ) {
+ $object->offsetExists('key')->willReturn(true);
+ $object->offsetGet('key')->willReturn('value');
+ $key->getValue()->willReturn('key');
+ $key->scoreArgument('key')->willReturn(3);
+ $value->scoreArgument('value')->willReturn(1);
+ $this->scoreArgument($object)->shouldBe(2);
+ }
+
+ function it_accepts_any_key_token_type_to_score_object_that_is_both_traversable_and_array_accessible(
+ TokenInterface $key,
+ TokenInterface $value,
+ \ArrayIterator $object
+ ) {
+ $this->beConstructedWith($key, $value);
+ $object->current()->will(function () use ($object) {
+ $object->valid()->willReturn(false);
+
+ return 'value';
+ });
+ $object->key()->willReturn('key');
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $this->shouldNotThrow(new InvalidArgumentException)->duringScoreArgument($object);
+ }
+
+ function it_does_not_score_if_argument_is_neither_array_nor_traversable_nor_array_accessible()
+ {
+ $this->scoreArgument('string')->shouldBe(false);
+ $this->scoreArgument(new \stdClass)->shouldBe(false);
+ }
+
+ function it_does_not_score_empty_array()
+ {
+ $this->scoreArgument(array())->shouldBe(false);
+ }
+
+ function it_does_not_score_array_if_key_and_value_tokens_do_not_score_same_entry($key, $value)
+ {
+ $argument = array(1 => 'foo', 2 => 'bar');
+ $key->scoreArgument(1)->willReturn(true);
+ $key->scoreArgument(2)->willReturn(false);
+ $value->scoreArgument('foo')->willReturn(false);
+ $value->scoreArgument('bar')->willReturn(true);
+ $this->scoreArgument($argument)->shouldBe(false);
+ }
+
+ function it_does_not_score_traversable_object_without_entries(\Iterator $object)
+ {
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(false);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function it_does_not_score_traversable_object_if_key_and_value_tokens_do_not_score_same_entry(
+ TokenInterface $key,
+ TokenInterface $value,
+ \Iterator $object
+ ) {
+ $object->current()->willReturn('foo');
+ $object->current()->will(function () use ($object) {
+ $object->valid()->willReturn(false);
+
+ return 'bar';
+ });
+ $object->key()->willReturn(1);
+ $object->key()->willReturn(2);
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $key->scoreArgument(1)->willReturn(true);
+ $key->scoreArgument(2)->willReturn(false);
+ $value->scoreArgument('foo')->willReturn(false);
+ $value->scoreArgument('bar')->willReturn(true);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function it_does_not_score_array_accessible_object_if_it_has_no_offset_with_key_token_value(
+ ExactValueToken $key,
+ \ArrayAccess $object
+ ) {
+ $object->offsetExists('key')->willReturn(false);
+ $key->getValue()->willReturn('key');
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function it_does_not_score_array_accessible_object_if_key_and_value_tokens_do_not_score_same_entry(
+ ExactValueToken $key,
+ TokenInterface $value,
+ \ArrayAccess $object
+ ) {
+ $object->offsetExists('key')->willReturn(true);
+ $object->offsetGet('key')->willReturn('value');
+ $key->getValue()->willReturn('key');
+ $value->scoreArgument('value')->willReturn(false);
+ $key->scoreArgument('key')->willReturn(true);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function its_score_is_capped_at_8($key, $value)
+ {
+ $key->scoreArgument('key')->willReturn(10);
+ $value->scoreArgument('value')->willReturn(10);
+ $this->scoreArgument(array('key'=>'value'))->shouldBe(8);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php
new file mode 100644
index 0000000000..e57ff8cd4a
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ArrayEveryEntryTokenSpec.php
@@ -0,0 +1,96 @@
+beConstructedWith($value);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_holds_value($value)
+ {
+ $this->getValue()->shouldBe($value);
+ }
+
+ function its_string_representation_tells_that_its_an_array_containing_only_value($value)
+ {
+ $value->__toString()->willReturn('value');
+ $this->__toString()->shouldBe('[value, ..., value]');
+ }
+
+ function it_wraps_non_token_value_into_ExactValueToken(\stdClass $stdClass)
+ {
+ $this->beConstructedWith($stdClass);
+ $this->getValue()->shouldHaveType('Prophecy\Argument\Token\ExactValueToken');
+ }
+
+ function it_does_not_score_if_argument_is_neither_array_nor_traversable()
+ {
+ $this->scoreArgument('string')->shouldBe(false);
+ $this->scoreArgument(new \stdClass)->shouldBe(false);
+ }
+
+ function it_does_not_score_empty_array()
+ {
+ $this->scoreArgument(array())->shouldBe(false);
+ }
+
+ function it_does_not_score_traversable_object_without_entries(\Iterator $object)
+ {
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(false);
+ $this->scoreArgument($object)->shouldBe(false);
+ }
+
+ function it_scores_avg_of_scores_from_value_tokens($value)
+ {
+ $value->scoreArgument('value1')->willReturn(6);
+ $value->scoreArgument('value2')->willReturn(3);
+ $this->scoreArgument(array('value1', 'value2'))->shouldBe(4.5);
+ }
+
+ function it_scores_false_if_entry_scores_false($value)
+ {
+ $value->scoreArgument('value1')->willReturn(6);
+ $value->scoreArgument('value2')->willReturn(false);
+ $this->scoreArgument(array('value1', 'value2'))->shouldBe(false);
+ }
+
+ function it_does_not_score_array_keys($value)
+ {
+ $value->scoreArgument('value')->willReturn(6);
+ $value->scoreArgument('key')->shouldNotBeCalled(0);
+ $this->scoreArgument(array('key' => 'value'))->shouldBe(6);
+ }
+
+ function it_scores_traversable_object_from_value_token(TokenInterface $value, \Iterator $object)
+ {
+ $object->current()->will(function ($args, $object) {
+ $object->valid()->willReturn(false);
+
+ return 'value';
+ });
+ $object->key()->willReturn('key');
+ $object->rewind()->willReturn(null);
+ $object->next()->willReturn(null);
+ $object->valid()->willReturn(true);
+ $value->scoreArgument('value')->willReturn(2);
+ $this->scoreArgument($object)->shouldBe(2);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php
new file mode 100644
index 0000000000..4395bf097d
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/CallbackTokenSpec.php
@@ -0,0 +1,42 @@
+beConstructedWith('get_class');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_7_if_argument_matches_callback()
+ {
+ $this->beConstructedWith(function ($argument) { return 2 === $argument; });
+
+ $this->scoreArgument(2)->shouldReturn(7);
+ }
+
+ function it_does_not_scores_if_argument_does_not_match_callback()
+ {
+ $this->beConstructedWith(function ($argument) { return 2 === $argument; });
+
+ $this->scoreArgument(5)->shouldReturn(false);
+ }
+
+ function its_string_representation_should_tell_that_its_callback()
+ {
+ $this->__toString()->shouldReturn('callback()');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php
new file mode 100644
index 0000000000..14322f8290
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ExactValueTokenSpec.php
@@ -0,0 +1,152 @@
+beConstructedWith(42);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_holds_value()
+ {
+ $this->getValue()->shouldReturn(42);
+ }
+
+ function it_scores_10_if_value_is_equal_to_argument()
+ {
+ $this->scoreArgument(42)->shouldReturn(10);
+ $this->scoreArgument('42')->shouldReturn(10);
+ }
+
+ function it_scores_10_if_value_is_an_object_and_equal_to_argument()
+ {
+ $value = new \DateTime();
+ $value2 = clone $value;
+
+ $this->beConstructedWith($value);
+ $this->scoreArgument($value2)->shouldReturn(10);
+ }
+
+ function it_does_not_scores_if_value_is_not_equal_to_argument()
+ {
+ $this->scoreArgument(50)->shouldReturn(false);
+ $this->scoreArgument(new \stdClass())->shouldReturn(false);
+ }
+
+ function it_does_not_scores_if_value_an_object_and_is_not_equal_to_argument()
+ {
+ $value = new ExactValueTokenFixtureB('ABC');
+ $value2 = new ExactValueTokenFixtureB('CBA');
+
+ $this->beConstructedWith($value);
+ $this->scoreArgument($value2)->shouldReturn(false);
+ }
+
+ function it_does_not_scores_if_value_type_and_is_not_equal_to_argument()
+ {
+ $this->beConstructedWith(false);
+ $this->scoreArgument(0)->shouldReturn(false);
+ }
+
+ function it_generates_proper_string_representation_for_integer()
+ {
+ $this->beConstructedWith(42);
+ $this->__toString()->shouldReturn('exact(42)');
+ }
+
+ function it_generates_proper_string_representation_for_string()
+ {
+ $this->beConstructedWith('some string');
+ $this->__toString()->shouldReturn('exact("some string")');
+ }
+
+ function it_generates_single_line_representation_for_multiline_string()
+ {
+ $this->beConstructedWith("some\nstring");
+ $this->__toString()->shouldReturn('exact("some\\nstring")');
+ }
+
+ function it_generates_proper_string_representation_for_double()
+ {
+ $this->beConstructedWith(42.3);
+ $this->__toString()->shouldReturn('exact(42.3)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_true()
+ {
+ $this->beConstructedWith(true);
+ $this->__toString()->shouldReturn('exact(true)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_false()
+ {
+ $this->beConstructedWith(false);
+ $this->__toString()->shouldReturn('exact(false)');
+ }
+
+ function it_generates_proper_string_representation_for_null()
+ {
+ $this->beConstructedWith(null);
+ $this->__toString()->shouldReturn('exact(null)');
+ }
+
+ function it_generates_proper_string_representation_for_empty_array()
+ {
+ $this->beConstructedWith(array());
+ $this->__toString()->shouldReturn('exact([])');
+ }
+
+ function it_generates_proper_string_representation_for_array()
+ {
+ $this->beConstructedWith(array('zet', 42));
+ $this->__toString()->shouldReturn('exact(["zet", 42])');
+ }
+
+ function it_generates_proper_string_representation_for_resource()
+ {
+ $resource = fopen(__FILE__, 'r');
+ $this->beConstructedWith($resource);
+ $this->__toString()->shouldReturn('exact(stream:'.$resource.')');
+ }
+
+ function it_generates_proper_string_representation_for_object(\stdClass $object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ );
+
+ $this->beConstructedWith($object);
+ $this->__toString()->shouldReturn("exact($objHash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))");
+ }
+}
+
+class ExactValueTokenFixtureA
+{
+ public $errors;
+}
+
+class ExactValueTokenFixtureB extends ExactValueTokenFixtureA
+{
+ public $errors;
+ public $value = null;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php
new file mode 100644
index 0000000000..00c3a2157f
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/IdenticalValueTokenSpec.php
@@ -0,0 +1,152 @@
+beConstructedWith(42);
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Argument\Token\IdenticalValueToken');
+ }
+
+ function it_scores_11_if_string_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith('foo');
+ $this->scoreArgument('foo')->shouldReturn(11);
+ }
+
+ function it_scores_11_if_boolean_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(false);
+ $this->scoreArgument(false)->shouldReturn(11);
+ }
+
+ function it_scores_11_if_integer_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(31);
+ $this->scoreArgument(31)->shouldReturn(11);
+ }
+
+ function it_scores_11_if_float_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(31.12);
+ $this->scoreArgument(31.12)->shouldReturn(11);
+ }
+
+ function it_scores_11_if_array_value_is_identical_to_argument()
+ {
+ $this->beConstructedWith(array('foo' => 'bar'));
+ $this->scoreArgument(array('foo' => 'bar'))->shouldReturn(11);
+ }
+
+ function it_scores_11_if_object_value_is_identical_to_argument()
+ {
+ $object = new \stdClass();
+
+ $this->beConstructedWith($object);
+ $this->scoreArgument($object)->shouldReturn(11);
+ }
+
+ function it_scores_false_if_value_is_not_identical_to_argument()
+ {
+ $this->beConstructedWith(new \stdClass());
+ $this->scoreArgument('foo')->shouldReturn(false);
+ }
+
+ function it_scores_false_if_object_value_is_not_the_same_instance_than_argument()
+ {
+ $this->beConstructedWith(new \stdClass());
+ $this->scoreArgument(new \stdClass())->shouldReturn(false);
+ }
+
+ function it_scores_false_if_integer_value_is_not_identical_to_boolean_argument()
+ {
+ $this->beConstructedWith(1);
+ $this->scoreArgument(true)->shouldReturn(false);
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_generates_proper_string_representation_for_integer()
+ {
+ $this->beConstructedWith(42);
+ $this->__toString()->shouldReturn('identical(42)');
+ }
+
+ function it_generates_proper_string_representation_for_string()
+ {
+ $this->beConstructedWith('some string');
+ $this->__toString()->shouldReturn('identical("some string")');
+ }
+
+ function it_generates_single_line_representation_for_multiline_string()
+ {
+ $this->beConstructedWith("some\nstring");
+ $this->__toString()->shouldReturn('identical("some\\nstring")');
+ }
+
+ function it_generates_proper_string_representation_for_double()
+ {
+ $this->beConstructedWith(42.3);
+ $this->__toString()->shouldReturn('identical(42.3)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_true()
+ {
+ $this->beConstructedWith(true);
+ $this->__toString()->shouldReturn('identical(true)');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_false()
+ {
+ $this->beConstructedWith(false);
+ $this->__toString()->shouldReturn('identical(false)');
+ }
+
+ function it_generates_proper_string_representation_for_null()
+ {
+ $this->beConstructedWith(null);
+ $this->__toString()->shouldReturn('identical(null)');
+ }
+
+ function it_generates_proper_string_representation_for_empty_array()
+ {
+ $this->beConstructedWith(array());
+ $this->__toString()->shouldReturn('identical([])');
+ }
+
+ function it_generates_proper_string_representation_for_array()
+ {
+ $this->beConstructedWith(array('zet', 42));
+ $this->__toString()->shouldReturn('identical(["zet", 42])');
+ }
+
+ function it_generates_proper_string_representation_for_resource()
+ {
+ $resource = fopen(__FILE__, 'r');
+ $this->beConstructedWith($resource);
+ $this->__toString()->shouldReturn('identical(stream:'.$resource.')');
+ }
+
+ function it_generates_proper_string_representation_for_object($object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ );
+
+ $this->beConstructedWith($object);
+ $this->__toString()->shouldReturn("identical($objHash Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n))");
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php
new file mode 100644
index 0000000000..a79acf4cc6
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalAndTokenSpec.php
@@ -0,0 +1,69 @@
+beConstructedWith(array());
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->beConstructedWith(array());
+ $this->shouldNotBeLast();
+ }
+
+ function it_generates_string_representation_from_all_tokens_imploded(
+ TokenInterface $token1,
+ TokenInterface $token2,
+ TokenInterface $token3
+ ) {
+ $token1->__toString()->willReturn('token_1');
+ $token2->__toString()->willReturn('token_2');
+ $token3->__toString()->willReturn('token_3');
+
+ $this->beConstructedWith(array($token1, $token2, $token3));
+ $this->__toString()->shouldReturn('bool(token_1 AND token_2 AND token_3)');
+ }
+
+ function it_wraps_non_token_arguments_into_ExactValueToken()
+ {
+ $this->beConstructedWith(array(15, '1985'));
+ $this->__toString()->shouldReturn("bool(exact(15) AND exact(\"1985\"))");
+ }
+
+ function it_scores_the_maximum_score_from_all_scores_returned_by_tokens(TokenInterface $token1, TokenInterface $token2)
+ {
+ $token1->scoreArgument(1)->willReturn(10);
+ $token2->scoreArgument(1)->willReturn(5);
+ $this->beConstructedWith(array($token1, $token2));
+ $this->scoreArgument(1)->shouldReturn(10);
+ }
+
+ function it_does_not_score_if_there_are_no_arguments_or_tokens()
+ {
+ $this->beConstructedWith(array());
+ $this->scoreArgument('any')->shouldReturn(false);
+ }
+
+ function it_does_not_score_if_either_of_tokens_does_not_score(TokenInterface $token1, TokenInterface $token2)
+ {
+ $token1->scoreArgument(1)->willReturn(10);
+ $token1->scoreArgument(2)->willReturn(false);
+
+ $token2->scoreArgument(1)->willReturn(false);
+ $token2->scoreArgument(2)->willReturn(10);
+
+ $this->beConstructedWith(array($token1, $token2));
+
+ $this->scoreArgument(1)->shouldReturn(false);
+ $this->scoreArgument(2)->shouldReturn(false);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php
new file mode 100644
index 0000000000..c2cbbad174
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/LogicalNotTokenSpec.php
@@ -0,0 +1,62 @@
+beConstructedWith($token);
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_holds_originating_token($token)
+ {
+ $this->getOriginatingToken()->shouldReturn($token);
+ }
+
+ function it_has_simple_string_representation($token)
+ {
+ $token->__toString()->willReturn('value');
+ $this->__toString()->shouldBe('not(value)');
+ }
+
+ function it_wraps_non_token_argument_into_ExactValueToken()
+ {
+ $this->beConstructedWith(5);
+ $token = $this->getOriginatingToken();
+ $token->shouldhaveType('Prophecy\Argument\Token\ExactValueToken');
+ $token->getValue()->shouldBe(5);
+ }
+
+ function it_scores_4_if_preset_token_does_not_match_the_argument($token)
+ {
+ $token->scoreArgument('argument')->willReturn(false);
+ $this->scoreArgument('argument')->shouldBe(4);
+ }
+
+ function it_does_not_score_if_preset_token_matches_argument($token)
+ {
+ $token->scoreArgument('argument')->willReturn(5);
+ $this->scoreArgument('argument')->shouldBe(false);
+ }
+
+ function it_is_last_if_preset_token_is_last($token)
+ {
+ $token->isLast()->willReturn(true);
+ $this->shouldBeLast();
+ }
+
+ function it_is_not_last_if_preset_token_is_not_last($token)
+ {
+ $token->isLast()->willReturn(false);
+ $this->shouldNotBeLast();
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php
new file mode 100644
index 0000000000..d71b22a00e
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/ObjectStateTokenSpec.php
@@ -0,0 +1,89 @@
+beConstructedWith('getName', 'stdClass');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_8_if_argument_object_has_specific_method_state(\ReflectionClass $reflection)
+ {
+ $reflection->getName()->willReturn('stdClass');
+
+ $this->scoreArgument($reflection)->shouldReturn(8);
+ }
+
+ function it_scores_8_if_argument_object_has_specific_property_state(\stdClass $class)
+ {
+ $class->getName = 'stdClass';
+
+ $this->scoreArgument($class)->shouldReturn(8);
+ }
+
+ function it_does_not_score_if_argument_method_state_does_not_match()
+ {
+ $value = new ObjectStateTokenFixtureB('ABC');
+ $value2 = new ObjectStateTokenFixtureB('CBA');
+
+ $this->beConstructedWith('getSelf', $value);
+ $this->scoreArgument($value2)->shouldReturn(false);
+ }
+
+ function it_does_not_score_if_argument_property_state_does_not_match(\stdClass $class)
+ {
+ $class->getName = 'SplFileInfo';
+
+ $this->scoreArgument($class)->shouldReturn(false);
+ }
+
+ function it_does_not_score_if_argument_object_does_not_have_method_or_property(ObjectStateTokenFixtureA $class)
+ {
+ $this->scoreArgument($class)->shouldReturn(false);
+ }
+
+ function it_does_not_score_if_argument_is_not_object()
+ {
+ $this->scoreArgument(42)->shouldReturn(false);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldReturn('state(getName(), "stdClass")');
+ }
+}
+
+class ObjectStateTokenFixtureA
+{
+ public $errors;
+}
+
+class ObjectStateTokenFixtureB extends ObjectStateTokenFixtureA
+{
+ public $errors;
+ public $value = null;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ public function getSelf()
+ {
+ return $this;
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php
new file mode 100644
index 0000000000..c7fd265231
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/StringContainsTokenSpec.php
@@ -0,0 +1,49 @@
+beConstructedWith('a substring');
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Argument\Token\StringContainsToken');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_holds_value()
+ {
+ $this->getValue()->shouldReturn('a substring');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_6_if_the_argument_contains_the_value()
+ {
+ $this->scoreArgument('Argument containing a substring')->shouldReturn(6);
+ }
+
+ function it_does_not_score_if_the_argument_does_not_contain_the_value()
+ {
+ $this->scoreArgument('Argument will not match')->shouldReturn(false);
+ }
+
+ function its_string_representation_shows_substring()
+ {
+ $this->__toString()->shouldReturn('contains("a substring")');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php
new file mode 100644
index 0000000000..2829f31f73
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Argument/Token/TypeTokenSpec.php
@@ -0,0 +1,57 @@
+beConstructedWith('integer');
+ }
+
+ function it_implements_TokenInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Argument\Token\TokenInterface');
+ }
+
+ function it_is_not_last()
+ {
+ $this->shouldNotBeLast();
+ }
+
+ function it_scores_5_if_argument_matches_simple_type()
+ {
+ $this->beConstructedWith('integer');
+
+ $this->scoreArgument(42)->shouldReturn(5);
+ }
+
+ function it_does_not_scores_if_argument_does_not_match_simple_type()
+ {
+ $this->beConstructedWith('integer');
+
+ $this->scoreArgument(42.0)->shouldReturn(false);
+ }
+
+ function it_scores_5_if_argument_is_an_instance_of_specified_class(\ReflectionObject $object)
+ {
+ $this->beConstructedWith('ReflectionClass');
+
+ $this->scoreArgument($object)->shouldReturn(5);
+ }
+
+ function it_has_simple_string_representation()
+ {
+ $this->__toString()->shouldReturn('type(integer)');
+ }
+
+ function it_scores_5_if_argument_is_an_instance_of_specified_interface(TokenInterface $interface)
+ {
+ $this->beConstructedWith('Prophecy\Argument\Token\TokenInterface');
+
+ $this->scoreArgument($interface)->shouldReturn(5);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php
new file mode 100644
index 0000000000..64232a4d22
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/ArgumentSpec.php
@@ -0,0 +1,107 @@
+exact(42);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ExactValueToken');
+ $token->getValue()->shouldReturn(42);
+ }
+
+ function it_has_a_shortcut_for_any_argument_token()
+ {
+ $token = $this->any();
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\AnyValueToken');
+ }
+
+ function it_has_a_shortcut_for_multiple_arguments_token()
+ {
+ $token = $this->cetera();
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\AnyValuesToken');
+ }
+
+ function it_has_a_shortcut_for_type_token()
+ {
+ $token = $this->type('integer');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\TypeToken');
+ }
+
+ function it_has_a_shortcut_for_callback_token()
+ {
+ $token = $this->that('get_class');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\CallbackToken');
+ }
+
+ function it_has_a_shortcut_for_object_state_token()
+ {
+ $token = $this->which('getName', 'everzet');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ObjectStateToken');
+ }
+
+ function it_has_a_shortcut_for_logical_and_token()
+ {
+ $token = $this->allOf('integer', 5);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\LogicalAndToken');
+ }
+
+ function it_has_a_shortcut_for_array_count_token()
+ {
+ $token = $this->size(5);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayCountToken');
+ }
+
+ function it_has_a_shortcut_for_array_entry_token()
+ {
+ $token = $this->withEntry('key', 'value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken');
+ }
+
+ function it_has_a_shortcut_for_array_every_entry_token()
+ {
+ $token = $this->withEveryEntry('value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEveryEntryToken');
+ }
+
+ function it_has_a_shortcut_for_identical_value_token()
+ {
+ $token = $this->is('value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\IdenticalValueToken');
+ }
+
+ function it_has_a_shortcut_for_array_entry_token_matching_any_key()
+ {
+ $token = $this->containing('value');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken');
+ $token->getKey()->shouldHaveType('Prophecy\Argument\Token\AnyValueToken');
+ }
+
+ function it_has_a_shortcut_for_array_entry_token_matching_any_value()
+ {
+ $token = $this->withKey('key');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ArrayEntryToken');
+ $token->getValue()->shouldHaveType('Prophecy\Argument\Token\AnyValueToken');
+ }
+
+ function it_has_a_shortcut_for_logical_not_token()
+ {
+ $token = $this->not('kagux');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\LogicalNotToken');
+ }
+
+ function it_has_a_shortcut_for_string_contains_token()
+ {
+ $token = $this->containingString('string');
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\StringContainsToken');
+ }
+
+ function it_has_a_shortcut_for_approximate_token()
+ {
+ $token = $this->approximate(10);
+ $token->shouldBeAnInstanceOf('Prophecy\Argument\Token\ApproximateValueToken');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php
new file mode 100644
index 0000000000..83d61f1eca
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Call/CallCenterSpec.php
@@ -0,0 +1,180 @@
+scoreArguments(array(5, 2, 3))->willReturn(10);
+ $objectProphecy->getMethodProphecies()->willReturn(array());
+
+ $this->makeCall($objectProphecy, 'setValues', array(5, 2, 3));
+
+ $calls = $this->findCalls('setValues', $wildcard);
+ $calls->shouldHaveCount(1);
+
+ $calls[0]->shouldBeAnInstanceOf('Prophecy\Call\Call');
+ $calls[0]->getMethodName()->shouldReturn('setValues');
+ $calls[0]->getArguments()->shouldReturn(array(5, 2, 3));
+ $calls[0]->getReturnValue()->shouldReturn(null);
+ }
+
+ function it_returns_null_for_any_call_through_makeCall_if_no_method_prophecies_added(
+ $objectProphecy
+ )
+ {
+ $objectProphecy->getMethodProphecies()->willReturn(array());
+
+ $this->makeCall($objectProphecy, 'setValues', array(5, 2, 3))->shouldReturn(null);
+ }
+
+ function it_executes_promise_of_method_prophecy_that_matches_signature_passed_to_makeCall(
+ $objectProphecy,
+ MethodProphecy $method1,
+ MethodProphecy $method2,
+ MethodProphecy $method3,
+ ArgumentsWildcard $arguments1,
+ ArgumentsWildcard $arguments2,
+ ArgumentsWildcard $arguments3,
+ PromiseInterface $promise
+ ) {
+ $method1->hasReturnVoid()->willReturn(false);
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments1);
+ $arguments1->scoreArguments(array('world', 'everything'))->willReturn(false);
+
+ $method2->hasReturnVoid()->willReturn(false);
+ $method2->getMethodName()->willReturn('setTitle');
+ $method2->getArgumentsWildcard()->willReturn($arguments2);
+ $arguments2->scoreArguments(array('world', 'everything'))->willReturn(false);
+
+ $method3->hasReturnVoid()->willReturn(false);
+ $method3->getMethodName()->willReturn('getName');
+ $method3->getArgumentsWildcard()->willReturn($arguments3);
+ $method3->getPromise()->willReturn($promise);
+ $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200);
+
+ $objectProphecy->getMethodProphecies()->willReturn(array(
+ 'method1' => array($method1),
+ 'method2' => array($method2, $method3)
+ ));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array($method1, $method3));
+ $objectProphecy->reveal()->willReturn(new \stdClass());
+
+ $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method3)->willReturn(42);
+
+ $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))->shouldReturn(42);
+
+ $calls = $this->findCalls('getName', $arguments3);
+ $calls->shouldHaveCount(1);
+ $calls[0]->getReturnValue()->shouldReturn(42);
+ }
+
+ function it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall(
+ $objectProphecy,
+ MethodProphecy $method1,
+ MethodProphecy $method2,
+ MethodProphecy $method3,
+ ArgumentsWildcard $arguments1,
+ ArgumentsWildcard $arguments2,
+ ArgumentsWildcard $arguments3,
+ PromiseInterface $promise
+ ) {
+ $method1->hasReturnVoid()->willReturn(false);
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments1);
+ $arguments1->scoreArguments(array('world', 'everything'))->willReturn(50);
+
+ $method2->hasReturnVoid()->willReturn(false);
+ $method2->getMethodName()->willReturn('getName');
+ $method2->getArgumentsWildcard()->willReturn($arguments2);
+ $method2->getPromise()->willReturn($promise);
+ $arguments2->scoreArguments(array('world', 'everything'))->willReturn(300);
+
+ $method3->hasReturnVoid()->willReturn(false);
+ $method3->getMethodName()->willReturn('getName');
+ $method3->getArgumentsWildcard()->willReturn($arguments3);
+ $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200);
+
+ $objectProphecy->getMethodProphecies()->willReturn(array(
+ 'method1' => array($method1),
+ 'method2' => array($method2, $method3)
+ ));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array(
+ $method1, $method2, $method3
+ ));
+ $objectProphecy->reveal()->willReturn(new \stdClass());
+
+ $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method2)
+ ->willReturn('second');
+
+ $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))
+ ->shouldReturn('second');
+ }
+
+ function it_throws_exception_if_call_does_not_match_any_of_defined_method_prophecies(
+ $objectProphecy,
+ MethodProphecy $method,
+ ArgumentsWildcard $arguments
+ ) {
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->scoreArguments(array('world', 'everything'))->willReturn(false);
+ $arguments->__toString()->willReturn('arg1, arg2');
+
+ $objectProphecy->getMethodProphecies()->willReturn(array('method1' => array($method)));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array($method));
+
+ $this->shouldThrow('Prophecy\Exception\Call\UnexpectedCallException')
+ ->duringMakeCall($objectProphecy, 'getName', array('world', 'everything'));
+ }
+
+ function it_returns_null_if_method_prophecy_that_matches_makeCall_arguments_has_no_promise(
+ $objectProphecy,
+ MethodProphecy $method,
+ ArgumentsWildcard $arguments
+ ) {
+ $method->hasReturnVoid()->willReturn(false);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $method->getPromise()->willReturn(null);
+ $arguments->scoreArguments(array('world', 'everything'))->willReturn(100);
+
+ $objectProphecy->getMethodProphecies()->willReturn(array($method));
+ $objectProphecy->getMethodProphecies('getName')->willReturn(array($method));
+
+ $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))
+ ->shouldReturn(null);
+ }
+
+ function it_finds_recorded_calls_by_a_method_name_and_arguments_wildcard(
+ $objectProphecy,
+ ArgumentsWildcard $wildcard
+ ) {
+ $objectProphecy->getMethodProphecies()->willReturn(array());
+
+ $this->makeCall($objectProphecy, 'getName', array('world'));
+ $this->makeCall($objectProphecy, 'getName', array('everything'));
+ $this->makeCall($objectProphecy, 'setName', array(42));
+
+ $wildcard->scoreArguments(array('world'))->willReturn(false);
+ $wildcard->scoreArguments(array('everything'))->willReturn(10);
+
+ $calls = $this->findCalls('getName', $wildcard);
+
+ $calls->shouldHaveCount(1);
+ $calls[0]->getMethodName()->shouldReturn('getName');
+ $calls[0]->getArguments()->shouldReturn(array('everything'));
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php
new file mode 100644
index 0000000000..a622b493c4
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Call/CallSpec.php
@@ -0,0 +1,51 @@
+beConstructedWith('setValues', array(5, 2), 42, $exception, 'some_file.php', 23);
+ }
+
+ function it_exposes_method_name_through_getter()
+ {
+ $this->getMethodName()->shouldReturn('setValues');
+ }
+
+ function it_exposes_arguments_through_getter()
+ {
+ $this->getArguments()->shouldReturn(array(5, 2));
+ }
+
+ function it_exposes_return_value_through_getter()
+ {
+ $this->getReturnValue()->shouldReturn(42);
+ }
+
+ function it_exposes_exception_through_getter($exception)
+ {
+ $this->getException()->shouldReturn($exception);
+ }
+
+ function it_exposes_file_and_line_through_getter()
+ {
+ $this->getFile()->shouldReturn('some_file.php');
+ $this->getLine()->shouldReturn(23);
+ }
+
+ function it_returns_shortpath_to_callPlace()
+ {
+ $this->getCallPlace()->shouldReturn('some_file.php:23');
+ }
+
+ function it_returns_unknown_as_callPlace_if_no_file_or_line_provided()
+ {
+ $this->beConstructedWith('setValues', array(), 0, null, null, null);
+
+ $this->getCallPlace()->shouldReturn('unknown');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php
new file mode 100644
index 0000000000..c174e73c02
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ClosureComparatorSpec.php
@@ -0,0 +1,39 @@
+shouldHaveType('SebastianBergmann\Comparator\Comparator');
+ }
+
+ function it_accepts_only_closures()
+ {
+ $this->accepts(123, 321)->shouldReturn(false);
+ $this->accepts('string', 'string')->shouldReturn(false);
+ $this->accepts(false, true)->shouldReturn(false);
+ $this->accepts(true, false)->shouldReturn(false);
+ $this->accepts((object)array(), (object)array())->shouldReturn(false);
+ $this->accepts(function(){}, (object)array())->shouldReturn(false);
+ $this->accepts(function(){}, (object)array())->shouldReturn(false);
+
+ $this->accepts(function(){}, function(){})->shouldReturn(true);
+ }
+
+ function it_asserts_that_all_closures_are_different()
+ {
+ $this->shouldThrow()->duringAssertEquals(function(){}, function(){});
+ }
+
+ function it_asserts_that_all_closures_are_different_even_if_its_the_same_closure()
+ {
+ $closure = function(){};
+
+ $this->shouldThrow()->duringAssertEquals($closure, $closure);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php
new file mode 100644
index 0000000000..6b13336d2a
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Comparator/FactorySpec.php
@@ -0,0 +1,20 @@
+shouldHaveType('SebastianBergmann\Comparator\Factory');
+ }
+
+ function it_should_have_ClosureComparator_registered()
+ {
+ $comparator = $this->getInstance()->getComparatorFor(function(){}, function(){});
+ $comparator->shouldHaveType('Prophecy\Comparator\ClosureComparator');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php
new file mode 100644
index 0000000000..06bf6f17d1
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Comparator/ProphecyComparatorSpec.php
@@ -0,0 +1,39 @@
+shouldHaveType('SebastianBergmann\Comparator\ObjectComparator');
+ }
+
+ function it_accepts_only_prophecy_objects()
+ {
+ $this->accepts(123, 321)->shouldReturn(false);
+ $this->accepts('string', 'string')->shouldReturn(false);
+ $this->accepts(false, true)->shouldReturn(false);
+ $this->accepts(true, false)->shouldReturn(false);
+ $this->accepts((object)array(), (object)array())->shouldReturn(false);
+ $this->accepts(function(){}, (object)array())->shouldReturn(false);
+ $this->accepts(function(){}, function(){})->shouldReturn(false);
+
+ $prophet = new Prophet();
+ $prophecy = $prophet->prophesize('Prophecy\Prophecy\ObjectProphecy');
+
+ $this->accepts($prophecy, $prophecy)->shouldReturn(true);
+ }
+
+ function it_asserts_that_an_object_is_equal_to_its_revealed_prophecy()
+ {
+ $prophet = new Prophet();
+ $prophecy = $prophet->prophesize('Prophecy\Prophecy\ObjectProphecy');
+
+ $this->shouldNotThrow()->duringAssertEquals($prophecy->reveal(), $prophecy);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php
new file mode 100644
index 0000000000..4fd28d7eb1
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/DisableConstructorPatchSpec.php
@@ -0,0 +1,54 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_100()
+ {
+ $this->getPriority()->shouldReturn(100);
+ }
+
+ function it_supports_anything(ClassNode $node)
+ {
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ function it_makes_all_constructor_arguments_optional(
+ ClassNode $class,
+ MethodNode $method,
+ ArgumentNode $arg1,
+ ArgumentNode $arg2
+ ) {
+ $class->hasMethod('__construct')->willReturn(true);
+ $class->getMethod('__construct')->willReturn($method);
+ $method->getArguments()->willReturn(array($arg1, $arg2));
+
+ $arg1->setDefault(null)->shouldBeCalled();
+ $arg2->setDefault(null)->shouldBeCalled();
+
+ $method->setCode(Argument::type('string'))->shouldBeCalled();
+
+ $this->apply($class);
+ }
+
+ function it_creates_new_constructor_if_object_has_none(ClassNode $class)
+ {
+ $class->hasMethod('__construct')->willReturn(false);
+ $class->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))
+ ->shouldBeCalled();
+
+ $this->apply($class);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php
new file mode 100644
index 0000000000..9d04421af9
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/HhvmExceptionPatchSpec.php
@@ -0,0 +1,34 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_minus_50()
+ {
+ $this->getPriority()->shouldReturn(-50);
+ }
+
+ function it_uses_parent_code_for_setTraceOptions(ClassNode $node, MethodNode $method, MethodNode $getterMethod)
+ {
+ $node->hasMethod('setTraceOptions')->willReturn(true);
+ $node->getMethod('setTraceOptions')->willReturn($method);
+ $node->hasMethod('getTraceOptions')->willReturn(true);
+ $node->getMethod('getTraceOptions')->willReturn($getterMethod);
+
+ $method->useParentCode()->shouldBeCalled();
+ $getterMethod->useParentCode()->shouldBeCalled();
+
+ $this->apply($node);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php
new file mode 100644
index 0000000000..1c454e62d9
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/KeywordPatchSpec.php
@@ -0,0 +1,43 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_49()
+ {
+ $this->getPriority()->shouldReturn(49);
+ }
+
+ function it_will_remove_echo_and_eval_methods(
+ ClassNode $node,
+ MethodNode $method1,
+ MethodNode $method2,
+ MethodNode $method3
+ ) {
+ $node->removeMethod('eval')->shouldBeCalled();
+ $node->removeMethod('echo')->shouldBeCalled();
+
+ $method1->getName()->willReturn('echo');
+ $method2->getName()->willReturn('eval');
+ $method3->getName()->willReturn('notKeyword');
+
+ $node->getMethods()->willReturn(array(
+ 'echo' => $method1,
+ 'eval' => $method2,
+ 'notKeyword' => $method3,
+ ));
+
+ $this->apply($node);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php
new file mode 100644
index 0000000000..f7a56317cc
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php
@@ -0,0 +1,140 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function it_supports_anything(ClassNode $node)
+ {
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ function it_discovers_api_using_phpdoc(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApi');
+ $node->getInterfaces()->willReturn(array());
+
+ $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_ignores_existing_methods(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiExtended');
+ $node->getInterfaces()->willReturn(array());
+
+ $node->addMethod(new MethodNode('undefinedMethod'))->shouldBeCalled();
+ $node->addMethod(new MethodNode('definedMethod'))->shouldNotBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_ignores_empty_methods_from_phpdoc(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiInvalidMethodDefinition');
+ $node->getInterfaces()->willReturn(array());
+
+ $node->addMethod(new MethodNode(''))->shouldNotBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_discovers_api_using_phpdoc_from_implemented_interfaces(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplemented');
+ $node->getInterfaces()->willReturn(array());
+
+ $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_discovers_api_using_phpdoc_from_own_interfaces(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('stdClass');
+ $node->getInterfaces()->willReturn(array('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplemented'));
+
+ $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_discovers_api_using_phpdoc_from_extended_parent_interfaces(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiImplementedExtended');
+ $node->getInterfaces()->willReturn(array());
+
+ $node->addMethod(new MethodNode('implementedMethod'))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_has_50_priority()
+ {
+ $this->getPriority()->shouldReturn(50);
+ }
+}
+
+/**
+ * @method void undefinedMethod()
+ */
+class MagicalApi
+{
+ /**
+ * @return void
+ */
+ public function definedMethod()
+ {
+
+ }
+}
+
+/**
+ * @method void invalidMethodDefinition
+ * @method void
+ * @method
+ */
+class MagicalApiInvalidMethodDefinition
+{
+}
+
+/**
+ * @method void undefinedMethod()
+ * @method void definedMethod()
+ */
+class MagicalApiExtended extends MagicalApi
+{
+
+}
+
+/**
+ */
+class MagicalApiImplemented implements MagicalApiInterface
+{
+
+}
+
+/**
+ */
+class MagicalApiImplementedExtended extends MagicalApiImplemented
+{
+}
+
+/**
+ * @method void implementedMethod()
+ */
+interface MagicalApiInterface
+{
+
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php
new file mode 100644
index 0000000000..96f0e20a3b
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ProphecySubjectPatchSpec.php
@@ -0,0 +1,79 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function it_has_priority_of_0()
+ {
+ $this->getPriority()->shouldReturn(0);
+ }
+
+ function it_supports_any_class(ClassNode $node)
+ {
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ function it_forces_class_to_implement_ProphecySubjectInterface(ClassNode $node)
+ {
+ $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface')->shouldBeCalled();
+
+ $node->addProperty('objectProphecy', 'private')->willReturn(null);
+ $node->getMethods()->willReturn(array());
+ $node->hasMethod(Argument::any())->willReturn(false);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+
+ $this->apply($node);
+ }
+
+ function it_forces_all_class_methods_except_constructor_to_proxy_calls_into_prophecy_makeCall(
+ ClassNode $node,
+ MethodNode $constructor,
+ MethodNode $method1,
+ MethodNode $method2,
+ MethodNode $method3
+ ) {
+ $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface')->willReturn(null);
+ $node->addProperty('objectProphecy', 'private')->willReturn(null);
+ $node->hasMethod(Argument::any())->willReturn(false);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+
+ $constructor->getName()->willReturn('__construct');
+ $method1->getName()->willReturn('method1');
+ $method2->getName()->willReturn('method2');
+ $method3->getName()->willReturn('method3');
+
+ $method1->getReturnType()->willReturn('int');
+ $method2->getReturnType()->willReturn('int');
+ $method3->getReturnType()->willReturn('void');
+
+ $node->getMethods()->willReturn(array(
+ 'method1' => $method1,
+ 'method2' => $method2,
+ 'method3' => $method3,
+ ));
+
+ $constructor->setCode(Argument::any())->shouldNotBeCalled();
+
+ $method1->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());')
+ ->shouldBeCalled();
+ $method2->setCode('return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());')
+ ->shouldBeCalled();
+ $method3->setCode('$this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());')
+ ->shouldBeCalled();
+
+ $this->apply($node);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php
new file mode 100644
index 0000000000..effd61e7b8
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatchSpec.php
@@ -0,0 +1,43 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_50()
+ {
+ $this->getPriority()->shouldReturn(50);
+ }
+
+ function it_supports_ReflectionClass_only(ClassNode $reflectionClassNode, ClassNode $anotherClassNode)
+ {
+ $reflectionClassNode->getParentClass()->willReturn('ReflectionClass');
+ $anotherClassNode->getParentClass()->willReturn('stdClass');
+
+ $this->supports($reflectionClassNode)->shouldReturn(true);
+ $this->supports($anotherClassNode)->shouldReturn(false);
+ }
+
+ function it_makes_all_newInstance_arguments_optional(
+ ClassNode $class,
+ MethodNode $method,
+ ArgumentNode $arg1
+ ) {
+ $class->getMethod('newInstance')->willReturn($method);
+ $method->getArguments()->willReturn(array($arg1));
+ $arg1->setDefault(null)->shouldBeCalled();
+
+ $this->apply($class);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php
new file mode 100644
index 0000000000..5bc3958c8e
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php
@@ -0,0 +1,85 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function its_priority_is_50()
+ {
+ $this->getPriority()->shouldReturn(50);
+ }
+
+ function it_does_not_support_nodes_without_parent_class(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('stdClass');
+ $this->supports($node)->shouldReturn(false);
+ }
+
+ function it_supports_nodes_with_SplFileInfo_as_parent_class(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('SplFileInfo');
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ function it_supports_nodes_with_derivative_of_SplFileInfo_as_parent_class(ClassNode $node)
+ {
+ $node->getParentClass()->willReturn('SplFileInfo');
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ function it_adds_a_method_to_node_if_not_exists(ClassNode $node)
+ {
+ $node->hasMethod('__construct')->willReturn(false);
+ $node->addMethod(Argument::any())->shouldBeCalled();
+ $node->getParentClass()->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_updates_existing_method_if_found(ClassNode $node, MethodNode $method)
+ {
+ $node->hasMethod('__construct')->willReturn(true);
+ $node->getMethod('__construct')->willReturn($method);
+ $node->getParentClass()->shouldBeCalled();
+
+ $method->useParentCode()->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_should_not_supply_a_file_for_a_directory_iterator(ClassNode $node, MethodNode $method)
+ {
+ $node->hasMethod('__construct')->willReturn(true);
+ $node->getMethod('__construct')->willReturn($method);
+ $node->getParentClass()->willReturn('DirectoryIterator');
+
+ $method->setCode(Argument::that(function($value) {
+ return strpos($value, '.php') === false;
+ }))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+
+ function it_should_supply_a_file_for_a_spl_file_object(ClassNode $node, MethodNode $method)
+ {
+ $node->hasMethod('__construct')->willReturn(true);
+ $node->getMethod('__construct')->willReturn($method);
+ $node->getParentClass()->willReturn('SplFileObject');
+
+ $method->setCode(Argument::that(function($value) {
+ return strpos($value, '.php') !== false;
+ }))->shouldBeCalled();
+
+ $this->apply($node);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php
new file mode 100644
index 0000000000..abce2f1e31
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/TraversablePatchSpec.php
@@ -0,0 +1,50 @@
+shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
+ }
+
+ function it_supports_class_that_implements_only_Traversable(ClassNode $node)
+ {
+ $node->getInterfaces()->willReturn(array('Traversable'));
+
+ $this->supports($node)->shouldReturn(true);
+ }
+
+ function it_does_not_support_class_that_implements_Iterator(ClassNode $node)
+ {
+ $node->getInterfaces()->willReturn(array('Traversable', 'Iterator'));
+
+ $this->supports($node)->shouldReturn(false);
+ }
+
+ function it_does_not_support_class_that_implements_IteratorAggregate(ClassNode $node)
+ {
+ $node->getInterfaces()->willReturn(array('Traversable', 'IteratorAggregate'));
+
+ $this->supports($node)->shouldReturn(false);
+ }
+
+ function it_has_100_priority()
+ {
+ $this->getPriority()->shouldReturn(100);
+ }
+
+ function it_forces_node_to_implement_IteratorAggregate(ClassNode $node)
+ {
+ $node->addInterface('Iterator')->shouldBeCalled();
+
+ $node->addMethod(Argument::type('Prophecy\Doubler\Generator\Node\MethodNode'))->willReturn(null);
+
+ $this->apply($node);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php
new file mode 100644
index 0000000000..b58b1a80ab
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/DoublerSpec.php
@@ -0,0 +1,115 @@
+beConstructedWith($mirror, $creator, $namer);
+ }
+
+ function it_does_not_have_patches_by_default()
+ {
+ $this->getClassPatches()->shouldHaveCount(0);
+ }
+
+ function its_registerClassPatch_adds_a_patch_to_the_doubler(ClassPatchInterface $patch)
+ {
+ $this->registerClassPatch($patch);
+ $this->getClassPatches()->shouldReturn(array($patch));
+ }
+
+ function its_getClassPatches_sorts_patches_by_priority(
+ ClassPatchInterface $alt1,
+ ClassPatchInterface $alt2,
+ ClassPatchInterface $alt3,
+ ClassPatchInterface $alt4
+ ) {
+ $alt1->getPriority()->willReturn(2);
+ $alt2->getPriority()->willReturn(50);
+ $alt3->getPriority()->willReturn(10);
+ $alt4->getPriority()->willReturn(0);
+
+ $this->registerClassPatch($alt1);
+ $this->registerClassPatch($alt2);
+ $this->registerClassPatch($alt3);
+ $this->registerClassPatch($alt4);
+
+ $this->getClassPatches()->shouldReturn(array($alt2, $alt3, $alt1, $alt4));
+ }
+
+ function its_double_mirrors_alterates_and_instantiates_provided_class(
+ $mirror,
+ $creator,
+ $namer,
+ ClassPatchInterface $alt1,
+ ClassPatchInterface $alt2,
+ \ReflectionClass $class,
+ \ReflectionClass $interface1,
+ \ReflectionClass $interface2,
+ ClassNode $node
+ ) {
+ $mirror->reflect($class, array($interface1, $interface2))->willReturn($node);
+ $alt1->supports($node)->willReturn(true);
+ $alt2->supports($node)->willReturn(false);
+ $alt1->getPriority()->willReturn(1);
+ $alt2->getPriority()->willReturn(2);
+ $namer->name($class, array($interface1, $interface2))->willReturn('SplStack');
+ $class->getName()->willReturn('stdClass');
+ $interface1->getName()->willReturn('ArrayAccess');
+ $interface2->getName()->willReturn('Iterator');
+
+ $alt1->apply($node)->shouldBeCalled();
+ $alt2->apply($node)->shouldNotBeCalled();
+ $creator->create('SplStack', $node)->shouldBeCalled();
+
+ $this->registerClassPatch($alt1);
+ $this->registerClassPatch($alt2);
+
+ $this->double($class, array($interface1, $interface2))
+ ->shouldReturnAnInstanceOf('SplStack');
+ }
+
+ function it_double_instantiates_a_class_with_constructor_argument(
+ $mirror,
+ \ReflectionClass $class,
+ ClassNode $node,
+ $namer
+ ) {
+ $class->getName()->willReturn('ReflectionClass');
+ $mirror->reflect($class, array())->willReturn($node);
+ $namer->name($class, array())->willReturn('ReflectionClass');
+
+ $double = $this->double($class, array(), array('stdClass'));
+ $double->shouldBeAnInstanceOf('ReflectionClass');
+ $double->getName()->shouldReturn('stdClass');
+ }
+
+ function it_can_instantiate_class_with_final_constructor(
+ $mirror,
+ \ReflectionClass $class,
+ ClassNode $node,
+ $namer
+ ) {
+ $class->getName()->willReturn('spec\Prophecy\Doubler\WithFinalConstructor');
+ $mirror->reflect($class, array())->willReturn($node);
+ $namer->name($class, array())->willReturn('spec\Prophecy\Doubler\WithFinalConstructor');
+
+ $double = $this->double($class, array());
+
+ $double->shouldBeAnInstanceOf('spec\Prophecy\Doubler\WithFinalConstructor');
+ }
+}
+
+class WithFinalConstructor
+{
+ final public function __construct() {}
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php
new file mode 100644
index 0000000000..2e85b6ca55
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCodeGeneratorSpec.php
@@ -0,0 +1,362 @@
+getParentClass()->willReturn('RuntimeException');
+ $class->getInterfaces()->willReturn(array(
+ 'Prophecy\Doubler\Generator\MirroredInterface', 'ArrayAccess', 'ArrayIterator'
+ ));
+ $class->getProperties()->willReturn(array('name' => 'public', 'email' => 'private'));
+ $class->getMethods()->willReturn(array($method1, $method2, $method3, $method4));
+
+ $method1->getName()->willReturn('getName');
+ $method1->getVisibility()->willReturn('public');
+ $method1->returnsReference()->willReturn(false);
+ $method1->isStatic()->willReturn(true);
+ $method1->getArguments()->willReturn(array($argument11, $argument12));
+ $method1->hasReturnType()->willReturn(true);
+ $method1->getReturnType()->willReturn('string');
+ $method1->hasNullableReturnType()->willReturn(true);
+ $method1->getCode()->willReturn('return $this->name;');
+
+ $method2->getName()->willReturn('getEmail');
+ $method2->getVisibility()->willReturn('protected');
+ $method2->returnsReference()->willReturn(false);
+ $method2->isStatic()->willReturn(false);
+ $method2->getArguments()->willReturn(array($argument21));
+ $method2->hasReturnType()->willReturn(false);
+ $method2->hasNullableReturnType()->willReturn(true);
+ $method2->getCode()->willReturn('return $this->email;');
+
+ $method3->getName()->willReturn('getRefValue');
+ $method3->getVisibility()->willReturn('public');
+ $method3->returnsReference()->willReturn(true);
+ $method3->isStatic()->willReturn(false);
+ $method3->getArguments()->willReturn(array($argument31));
+ $method3->hasReturnType()->willReturn(true);
+ $method3->getReturnType()->willReturn('string');
+ $method3->hasNullableReturnType()->willReturn(false);
+ $method3->getCode()->willReturn('return $this->refValue;');
+
+ $method4->getName()->willReturn('doSomething');
+ $method4->getVisibility()->willReturn('public');
+ $method4->returnsReference()->willReturn(false);
+ $method4->isStatic()->willReturn(false);
+ $method4->getArguments()->willReturn(array());
+ $method4->hasReturnType()->willReturn(true);
+ $method4->getReturnType()->willReturn('void');
+ $method4->hasNullableReturnType()->willReturn(false);
+ $method4->getCode()->willReturn('return;');
+
+ $argument11->getName()->willReturn('fullname');
+ $argument11->getTypeHint()->willReturn('array');
+ $argument11->isOptional()->willReturn(true);
+ $argument11->getDefault()->willReturn(null);
+ $argument11->isPassedByReference()->willReturn(false);
+ $argument11->isVariadic()->willReturn(false);
+ $argument11->isNullable()->willReturn(false);
+
+ $argument12->getName()->willReturn('class');
+ $argument12->getTypeHint()->willReturn('ReflectionClass');
+ $argument12->isOptional()->willReturn(false);
+ $argument12->isPassedByReference()->willReturn(false);
+ $argument12->isVariadic()->willReturn(false);
+ $argument12->isNullable()->willReturn(false);
+
+ $argument21->getName()->willReturn('default');
+ $argument21->getTypeHint()->willReturn('string');
+ $argument21->isOptional()->willReturn(true);
+ $argument21->getDefault()->willReturn('ever.zet@gmail.com');
+ $argument21->isPassedByReference()->willReturn(false);
+ $argument21->isVariadic()->willReturn(false);
+ $argument21->isNullable()->willReturn(true);
+
+ $argument31->getName()->willReturn('refValue');
+ $argument31->getTypeHint()->willReturn(null);
+ $argument31->isOptional()->willReturn(false);
+ $argument31->getDefault()->willReturn();
+ $argument31->isPassedByReference()->willReturn(false);
+ $argument31->isVariadic()->willReturn(false);
+ $argument31->isNullable()->willReturn(false);
+
+ $code = $this->generate('CustomClass', $class);
+
+ if (version_compare(PHP_VERSION, '7.1', '>=')) {
+ $expected = <<<'PHP'
+namespace {
+class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator {
+public $name;
+private $email;
+
+public static function getName(array $fullname = NULL, \ReflectionClass $class): ?string {
+return $this->name;
+}
+protected function getEmail(?string $default = 'ever.zet@gmail.com') {
+return $this->email;
+}
+public function &getRefValue( $refValue): string {
+return $this->refValue;
+}
+public function doSomething(): void {
+return;
+}
+
+}
+}
+PHP;
+ } elseif (version_compare(PHP_VERSION, '7.0', '>=')) {
+ $expected = <<<'PHP'
+namespace {
+class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator {
+public $name;
+private $email;
+
+public static function getName(array $fullname = NULL, \ReflectionClass $class): string {
+return $this->name;
+}
+protected function getEmail(string $default = 'ever.zet@gmail.com') {
+return $this->email;
+}
+public function &getRefValue( $refValue): string {
+return $this->refValue;
+}
+public function doSomething() {
+return;
+}
+
+}
+}
+PHP;
+ } else {
+ $expected = <<<'PHP'
+namespace {
+class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface, \ArrayAccess, \ArrayIterator {
+public $name;
+private $email;
+
+public static function getName(array $fullname = NULL, \ReflectionClass $class) {
+return $this->name;
+}
+protected function getEmail(\string $default = 'ever.zet@gmail.com') {
+return $this->email;
+}
+public function &getRefValue( $refValue) {
+return $this->refValue;
+}
+public function doSomething() {
+return;
+}
+
+}
+}
+PHP;
+ }
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ function it_generates_proper_php_code_for_variadics(
+ ClassNode $class,
+ MethodNode $method1,
+ MethodNode $method2,
+ MethodNode $method3,
+ MethodNode $method4,
+ ArgumentNode $argument1,
+ ArgumentNode $argument2,
+ ArgumentNode $argument3,
+ ArgumentNode $argument4
+ ) {
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array(
+ $method1, $method2, $method3, $method4
+ ));
+
+ $method1->getName()->willReturn('variadic');
+ $method1->getVisibility()->willReturn('public');
+ $method1->returnsReference()->willReturn(false);
+ $method1->isStatic()->willReturn(false);
+ $method1->getArguments()->willReturn(array($argument1));
+ $method1->hasReturnType()->willReturn(false);
+ $method1->getCode()->willReturn('');
+
+ $method2->getName()->willReturn('variadicByRef');
+ $method2->getVisibility()->willReturn('public');
+ $method2->returnsReference()->willReturn(false);
+ $method2->isStatic()->willReturn(false);
+ $method2->getArguments()->willReturn(array($argument2));
+ $method2->hasReturnType()->willReturn(false);
+ $method2->getCode()->willReturn('');
+
+ $method3->getName()->willReturn('variadicWithType');
+ $method3->getVisibility()->willReturn('public');
+ $method3->returnsReference()->willReturn(false);
+ $method3->isStatic()->willReturn(false);
+ $method3->getArguments()->willReturn(array($argument3));
+ $method3->hasReturnType()->willReturn(false);
+ $method3->getCode()->willReturn('');
+
+ $method4->getName()->willReturn('variadicWithTypeByRef');
+ $method4->getVisibility()->willReturn('public');
+ $method4->returnsReference()->willReturn(false);
+ $method4->isStatic()->willReturn(false);
+ $method4->getArguments()->willReturn(array($argument4));
+ $method4->hasReturnType()->willReturn(false);
+ $method4->getCode()->willReturn('');
+
+ $argument1->getName()->willReturn('args');
+ $argument1->getTypeHint()->willReturn(null);
+ $argument1->isOptional()->willReturn(false);
+ $argument1->isPassedByReference()->willReturn(false);
+ $argument1->isVariadic()->willReturn(true);
+ $argument1->isNullable()->willReturn(false);
+
+ $argument2->getName()->willReturn('args');
+ $argument2->getTypeHint()->willReturn(null);
+ $argument2->isOptional()->willReturn(false);
+ $argument2->isPassedByReference()->willReturn(true);
+ $argument2->isVariadic()->willReturn(true);
+ $argument2->isNullable()->willReturn(false);
+
+ $argument3->getName()->willReturn('args');
+ $argument3->getTypeHint()->willReturn('\ReflectionClass');
+ $argument3->isOptional()->willReturn(false);
+ $argument3->isPassedByReference()->willReturn(false);
+ $argument3->isVariadic()->willReturn(true);
+ $argument3->isNullable()->willReturn(false);
+
+ $argument4->getName()->willReturn('args');
+ $argument4->getTypeHint()->willReturn('\ReflectionClass');
+ $argument4->isOptional()->willReturn(false);
+ $argument4->isPassedByReference()->willReturn(true);
+ $argument4->isVariadic()->willReturn(true);
+ $argument4->isNullable()->willReturn(false);
+
+ $code = $this->generate('CustomClass', $class);
+ $expected = <<<'PHP'
+namespace {
+class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+public function variadic( ...$args) {
+
+}
+public function variadicByRef( &...$args) {
+
+}
+public function variadicWithType(\\ReflectionClass ...$args) {
+
+}
+public function variadicWithTypeByRef(\\ReflectionClass &...$args) {
+
+}
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ function it_overrides_properly_methods_with_args_passed_by_reference(
+ ClassNode $class,
+ MethodNode $method,
+ ArgumentNode $argument
+ ) {
+ $class->getParentClass()->willReturn('RuntimeException');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array($method));
+
+ $method->getName()->willReturn('getName');
+ $method->getVisibility()->willReturn('public');
+ $method->isStatic()->willReturn(false);
+ $method->getArguments()->willReturn(array($argument));
+ $method->hasReturnType()->willReturn(false);
+ $method->returnsReference()->willReturn(false);
+ $method->getCode()->willReturn('return $this->name;');
+
+ $argument->getName()->willReturn('fullname');
+ $argument->getTypeHint()->willReturn('array');
+ $argument->isOptional()->willReturn(true);
+ $argument->getDefault()->willReturn(null);
+ $argument->isPassedByReference()->willReturn(true);
+ $argument->isVariadic()->willReturn(false);
+ $argument->isNullable()->willReturn(false);
+
+ $code = $this->generate('CustomClass', $class);
+ $expected =<<<'PHP'
+namespace {
+class CustomClass extends \RuntimeException implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+public function getName(array &$fullname = NULL) {
+return $this->name;
+}
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ function it_generates_empty_class_for_empty_ClassNode(ClassNode $class)
+ {
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array());
+
+ $code = $this->generate('CustomClass', $class);
+ $expected =<<<'PHP'
+namespace {
+class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+
+ function it_wraps_class_in_namespace_if_it_is_namespaced(ClassNode $class)
+ {
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Prophecy\Doubler\Generator\MirroredInterface'));
+ $class->getProperties()->willReturn(array());
+ $class->getMethods()->willReturn(array());
+
+ $code = $this->generate('My\Awesome\CustomClass', $class);
+ $expected =<<<'PHP'
+namespace My\Awesome {
+class CustomClass extends \stdClass implements \Prophecy\Doubler\Generator\MirroredInterface {
+
+
+}
+}
+PHP;
+ $expected = strtr($expected, array("\r\n" => "\n", "\r" => "\n"));
+ $code->shouldBe($expected);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php
new file mode 100644
index 0000000000..e7cae23bc0
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassCreatorSpec.php
@@ -0,0 +1,37 @@
+beConstructedWith($generator);
+ }
+
+ function it_evaluates_code_generated_by_ClassCodeGenerator($generator, ClassNode $class)
+ {
+ $generator->generate('stdClass', $class)->shouldBeCalled()->willReturn(
+ 'return 42;'
+ );
+
+ $this->create('stdClass', $class)->shouldReturn(42);
+ }
+
+ function it_throws_an_exception_if_class_does_not_exist_after_evaluation($generator, ClassNode $class)
+ {
+ $generator->generate('CustomClass', $class)->shouldBeCalled()->willReturn(
+ 'return 42;'
+ );
+
+ $class->getParentClass()->willReturn('stdClass');
+ $class->getInterfaces()->willReturn(array('Interface1', 'Interface2'));
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\ClassCreatorException')
+ ->duringCreate('CustomClass', $class);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php
new file mode 100644
index 0000000000..2c8d1886ab
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ArgumentNodeSpec.php
@@ -0,0 +1,92 @@
+beConstructedWith('name');
+ }
+
+ function it_is_not_be_passed_by_reference_by_default()
+ {
+ $this->shouldNotBePassedByReference();
+ }
+
+ function it_is_passed_by_reference_if_marked()
+ {
+ $this->setAsPassedByReference();
+ $this->shouldBePassedByReference();
+ }
+
+ function it_is_not_variadic_by_default()
+ {
+ $this->shouldNotBeVariadic();
+ }
+
+ function it_is_variadic_if_marked()
+ {
+ $this->setAsVariadic();
+ $this->shouldBeVariadic();
+ }
+
+ function it_does_not_have_default_by_default()
+ {
+ $this->shouldNotHaveDefault();
+ }
+
+ function it_does_not_have_default_if_variadic()
+ {
+ $this->setDefault(null);
+ $this->setAsVariadic();
+ $this->shouldNotHaveDefault();
+ }
+
+ function it_does_have_default_if_not_variadic()
+ {
+ $this->setDefault(null);
+ $this->setAsVariadic(false);
+ $this->hasDefault()->shouldReturn(true);
+ }
+
+ function it_has_name_with_which_it_was_been_constructed()
+ {
+ $this->getName()->shouldReturn('name');
+ }
+
+ function it_has_no_typehint_by_default()
+ {
+ $this->getTypeHint()->shouldReturn(null);
+ }
+
+ function its_typeHint_is_mutable()
+ {
+ $this->setTypeHint('array');
+ $this->getTypeHint()->shouldReturn('array');
+ }
+
+ function it_does_not_have_default_value_by_default()
+ {
+ $this->getDefault()->shouldReturn(null);
+ }
+
+ function it_is_not_optional_by_default()
+ {
+ $this->isOptional()->shouldReturn(false);
+ }
+
+ function its_default_is_mutable()
+ {
+ $this->setDefault(array());
+ $this->getDefault()->shouldReturn(array());
+ }
+
+ function it_is_marked_as_optional_when_default_is_set()
+ {
+ $this->setDefault(null);
+ $this->isOptional()->shouldReturn(true);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php
new file mode 100644
index 0000000000..16fc498b46
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/ClassNodeSpec.php
@@ -0,0 +1,185 @@
+getParentClass()->shouldReturn('stdClass');
+ }
+
+ function its_parentClass_is_mutable()
+ {
+ $this->setParentClass('Exception');
+ $this->getParentClass()->shouldReturn('Exception');
+ }
+
+ function its_parentClass_is_set_to_stdClass_if_user_set_null()
+ {
+ $this->setParentClass(null);
+ $this->getParentClass()->shouldReturn('stdClass');
+ }
+
+ function it_does_not_implement_any_interface_by_default()
+ {
+ $this->getInterfaces()->shouldHaveCount(0);
+ }
+
+ function its_addInterface_adds_item_to_the_list_of_implemented_interfaces()
+ {
+ $this->addInterface('MyInterface');
+ $this->getInterfaces()->shouldHaveCount(1);
+ }
+
+ function its_hasInterface_returns_true_if_class_implements_interface()
+ {
+ $this->addInterface('MyInterface');
+ $this->hasInterface('MyInterface')->shouldReturn(true);
+ }
+
+ function its_hasInterface_returns_false_if_class_does_not_implements_interface()
+ {
+ $this->hasInterface('MyInterface')->shouldReturn(false);
+ }
+
+ function it_supports_implementation_of_multiple_interfaces()
+ {
+ $this->addInterface('MyInterface');
+ $this->addInterface('MySecondInterface');
+ $this->getInterfaces()->shouldHaveCount(2);
+ }
+
+ function it_ignores_same_interfaces_added_twice()
+ {
+ $this->addInterface('MyInterface');
+ $this->addInterface('MyInterface');
+
+ $this->getInterfaces()->shouldHaveCount(1);
+ $this->getInterfaces()->shouldReturn(array('MyInterface'));
+ }
+
+ function it_does_not_have_methods_by_default()
+ {
+ $this->getMethods()->shouldHaveCount(0);
+ }
+
+ function it_can_has_methods(MethodNode $method1, MethodNode $method2)
+ {
+ $method1->getName()->willReturn('__construct');
+ $method2->getName()->willReturn('getName');
+
+ $this->addMethod($method1);
+ $this->addMethod($method2);
+
+ $this->getMethods()->shouldReturn(array(
+ '__construct' => $method1,
+ 'getName' => $method2
+ ));
+ }
+
+ function its_hasMethod_returns_true_if_method_exists(MethodNode $method)
+ {
+ $method->getName()->willReturn('getName');
+
+ $this->addMethod($method);
+
+ $this->hasMethod('getName')->shouldReturn(true);
+ }
+
+ function its_getMethod_returns_method_by_name(MethodNode $method)
+ {
+ $method->getName()->willReturn('getName');
+
+ $this->addMethod($method);
+
+ $this->getMethod('getName')->shouldReturn($method);
+ }
+
+ function its_hasMethod_returns_false_if_method_does_not_exists()
+ {
+ $this->hasMethod('getName')->shouldReturn(false);
+ }
+
+ function its_hasMethod_returns_false_if_method_has_been_removed(MethodNode $method)
+ {
+ $method->getName()->willReturn('getName');
+ $this->addMethod($method);
+ $this->removeMethod('getName');
+
+ $this->hasMethod('getName')->shouldReturn(false);
+ }
+
+
+ function it_does_not_have_properties_by_default()
+ {
+ $this->getProperties()->shouldHaveCount(0);
+ }
+
+ function it_is_able_to_have_properties()
+ {
+ $this->addProperty('title');
+ $this->addProperty('text', 'private');
+ $this->getProperties()->shouldReturn(array(
+ 'title' => 'public',
+ 'text' => 'private'
+ ));
+ }
+
+ function its_addProperty_does_not_accept_unsupported_visibility()
+ {
+ $this->shouldThrow('InvalidArgumentException')->duringAddProperty('title', 'town');
+ }
+
+ function its_addProperty_lowercases_visibility_before_setting()
+ {
+ $this->addProperty('text', 'PRIVATE');
+ $this->getProperties()->shouldReturn(array('text' => 'private'));
+ }
+
+ function its_has_no_unextendable_methods_by_default()
+ {
+ $this->getUnextendableMethods()->shouldHaveCount(0);
+ }
+
+ function its_addUnextendableMethods_adds_an_unextendable_method()
+ {
+ $this->addUnextendableMethod('testMethod');
+ $this->getUnextendableMethods()->shouldHaveCount(1);
+ }
+
+ function its_methods_are_extendable_by_default()
+ {
+ $this->isExtendable('testMethod')->shouldReturn(true);
+ }
+
+ function its_unextendable_methods_are_not_extendable()
+ {
+ $this->addUnextendableMethod('testMethod');
+ $this->isExtendable('testMethod')->shouldReturn(false);
+ }
+
+ function its_addUnextendableMethods_doesnt_create_duplicates()
+ {
+ $this->addUnextendableMethod('testMethod');
+ $this->addUnextendableMethod('testMethod');
+ $this->getUnextendableMethods()->shouldHaveCount(1);
+ }
+
+ function it_throws_an_exception_when_adding_a_method_that_isnt_extendable(MethodNode $method)
+ {
+ $this->addUnextendableMethod('testMethod');
+ $method->getName()->willReturn('testMethod');
+
+ $expectedException = new MethodNotExtendableException(
+ "Method `testMethod` is not extendable, so can not be added.",
+ "stdClass",
+ "testMethod"
+ );
+ $this->shouldThrow($expectedException)->duringAddMethod($method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php
new file mode 100644
index 0000000000..14cfe8dec7
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/Node/MethodNodeSpec.php
@@ -0,0 +1,134 @@
+beConstructedWith('getTitle');
+ }
+
+ function it_has_a_name()
+ {
+ $this->getName()->shouldReturn('getTitle');
+ }
+
+ function it_has_public_visibility_by_default()
+ {
+ $this->getVisibility()->shouldReturn('public');
+ }
+
+ function its_visibility_is_mutable()
+ {
+ $this->setVisibility('private');
+ $this->getVisibility()->shouldReturn('private');
+ }
+
+ function it_is_not_static_by_default()
+ {
+ $this->shouldNotBeStatic();
+ }
+
+ function it_does_not_return_a_reference_by_default()
+ {
+ $this->returnsReference()->shouldReturn(false);
+ }
+
+ function it_should_be_settable_as_returning_a_reference_through_setter()
+ {
+ $this->setReturnsReference();
+ $this->returnsReference()->shouldReturn(true);
+ }
+
+ function it_should_be_settable_as_static_through_setter()
+ {
+ $this->setStatic();
+ $this->shouldBeStatic();
+ }
+
+ function it_accepts_only_supported_visibilities()
+ {
+ $this->shouldThrow('InvalidArgumentException')->duringSetVisibility('stealth');
+ }
+
+ function it_lowercases_visibility_before_setting_it()
+ {
+ $this->setVisibility('Public');
+ $this->getVisibility()->shouldReturn('public');
+ }
+
+ function its_useParentCode_causes_method_to_call_parent(ArgumentNode $argument1, ArgumentNode $argument2)
+ {
+ $argument1->getName()->willReturn('objectName');
+ $argument2->getName()->willReturn('default');
+
+ $argument1->isVariadic()->willReturn(false);
+ $argument2->isVariadic()->willReturn(true);
+
+ $this->addArgument($argument1);
+ $this->addArgument($argument2);
+
+ $this->useParentCode();
+
+ $this->getCode()->shouldReturn(
+ 'return parent::getTitle($objectName, ...$default);'
+ );
+ }
+
+ function its_code_is_mutable()
+ {
+ $this->setCode('echo "code";');
+ $this->getCode()->shouldReturn('echo "code";');
+ }
+
+ function its_reference_returning_methods_will_generate_exceptions()
+ {
+ $this->setCode('echo "code";');
+ $this->setReturnsReference();
+ $this->getCode()->shouldReturn("throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), 'getTitle');");
+ }
+
+ function its_setCode_provided_with_null_cleans_method_body()
+ {
+ $this->setCode(null);
+ $this->getCode()->shouldReturn('');
+ }
+
+ function it_is_constructable_with_code()
+ {
+ $this->beConstructedWith('getTitle', 'die();');
+ $this->getCode()->shouldReturn('die();');
+ }
+
+ function it_does_not_have_arguments_by_default()
+ {
+ $this->getArguments()->shouldHaveCount(0);
+ }
+
+ function it_supports_adding_arguments(ArgumentNode $argument1, ArgumentNode $argument2)
+ {
+ $this->addArgument($argument1);
+ $this->addArgument($argument2);
+
+ $this->getArguments()->shouldReturn(array($argument1, $argument2));
+ }
+
+ function it_does_not_have_return_type_by_default()
+ {
+ $this->hasReturnType()->shouldReturn(false);
+ }
+
+ function it_setReturnType_sets_return_type()
+ {
+ $returnType = 'string';
+
+ $this->setReturnType($returnType);
+
+ $this->hasReturnType()->shouldReturn(true);
+ $this->getReturnType()->shouldReturn($returnType);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php
new file mode 100644
index 0000000000..fdf1e9621c
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/LazyDoubleSpec.php
@@ -0,0 +1,79 @@
+beConstructedWith($doubler);
+ }
+
+ function it_returns_anonymous_double_instance_by_default($doubler, ProphecySubjectInterface $double)
+ {
+ $doubler->double(null, array())->willReturn($double);
+
+ $this->getInstance()->shouldReturn($double);
+ }
+
+ function it_returns_class_double_instance_if_set($doubler, ProphecySubjectInterface $double, \ReflectionClass $class)
+ {
+ $doubler->double($class, array())->willReturn($double);
+
+ $this->setParentClass($class);
+
+ $this->getInstance()->shouldReturn($double);
+ }
+
+ function it_returns_same_double_instance_if_called_2_times(
+ $doubler,
+ ProphecySubjectInterface $double1,
+ ProphecySubjectInterface $double2
+ ) {
+ $doubler->double(null, array())->willReturn($double1);
+ $doubler->double(null, array())->willReturn($double2);
+
+ $this->getInstance()->shouldReturn($double2);
+ $this->getInstance()->shouldReturn($double2);
+ }
+
+ function its_setParentClass_throws_ClassNotFoundException_if_class_not_found()
+ {
+ $this->shouldThrow('Prophecy\Exception\Doubler\ClassNotFoundException')
+ ->duringSetParentClass('SomeUnexistingClass');
+ }
+
+ function its_setParentClass_throws_exception_if_prophecy_is_already_created(
+ $doubler,
+ ProphecySubjectInterface $double
+ ) {
+ $doubler->double(null, array())->willReturn($double);
+
+ $this->getInstance();
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\DoubleException')
+ ->duringSetParentClass('stdClass');
+ }
+
+ function its_addInterface_throws_InterfaceNotFoundException_if_no_interface_found()
+ {
+ $this->shouldThrow('Prophecy\Exception\Doubler\InterfaceNotFoundException')
+ ->duringAddInterface('SomeUnexistingInterface');
+ }
+
+ function its_addInterface_throws_exception_if_prophecy_is_already_created(
+ $doubler,
+ ProphecySubjectInterface $double
+ ) {
+ $doubler->double(null, array())->willReturn($double);
+
+ $this->getInstance();
+
+ $this->shouldThrow('Prophecy\Exception\Doubler\DoubleException')
+ ->duringAddInterface('ArrayAccess');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php
new file mode 100644
index 0000000000..1e9b17fb65
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/NameGeneratorSpec.php
@@ -0,0 +1,60 @@
+getName()->willReturn('stdClass');
+ $this->name($class, array())->shouldStartWith('Double\stdClass\\');
+ }
+
+ function its_name_generates_name_based_on_namespaced_class_reflection(\ReflectionClass $class)
+ {
+ $class->getName()->willReturn('Some\Custom\Class');
+ $this->name($class, array())->shouldStartWith('Double\Some\Custom\Class\P');
+ }
+
+ function its_name_generates_name_based_on_interface_shortnames(
+ \ReflectionClass $interface1,
+ \ReflectionClass $interface2
+ ) {
+ $interface1->getShortName()->willReturn('HandlerInterface');
+ $interface2->getShortName()->willReturn('LoaderInterface');
+
+ $this->name(null, array($interface1, $interface2))->shouldStartWith(
+ 'Double\HandlerInterface\LoaderInterface\P'
+ );
+ }
+
+ function it_generates_proper_name_for_no_class_and_interfaces_list()
+ {
+ $this->name(null, array())->shouldStartWith('Double\stdClass\P');
+ }
+
+ function its_name_generates_name_based_only_on_class_if_its_available(
+ \ReflectionClass $class,
+ \ReflectionClass $interface1,
+ \ReflectionClass $interface2
+ ) {
+ $class->getName()->willReturn('Some\Custom\Class');
+ $interface1->getShortName()->willReturn('HandlerInterface');
+ $interface2->getShortName()->willReturn('LoaderInterface');
+
+ $this->name($class, array($interface1, $interface2))->shouldStartWith(
+ 'Double\Some\Custom\Class\P'
+ );
+ }
+
+ public function getMatchers()
+ {
+ return array(
+ 'startWith' => function ($subject, $string) {
+ return 0 === strpos($subject, $string);
+ },
+ );
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php
new file mode 100644
index 0000000000..5e2c635b4c
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Call/UnexpectedCallExceptionSpec.php
@@ -0,0 +1,30 @@
+beConstructedWith('msg', $objectProphecy, 'getName', array('arg1', 'arg2'));
+ }
+
+ function it_is_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException');
+ }
+
+ function it_exposes_method_name_through_getter()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ function it_exposes_arguments_through_getter()
+ {
+ $this->getArguments()->shouldReturn(array('arg1', 'arg2'));
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php
new file mode 100644
index 0000000000..da3aa58000
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassCreatorExceptionSpec.php
@@ -0,0 +1,26 @@
+beConstructedWith('', $node);
+ }
+
+ function it_is_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
+ }
+
+ function it_contains_a_reflected_node($node)
+ {
+ $this->getClassNode()->shouldReturn($node);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php
new file mode 100644
index 0000000000..c4f547a78a
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassMirrorExceptionSpec.php
@@ -0,0 +1,24 @@
+beConstructedWith('', $class);
+ }
+
+ function it_is_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
+ }
+
+ function it_contains_a_reflected_class_link($class)
+ {
+ $this->getReflectedClass()->shouldReturn($class);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php
new file mode 100644
index 0000000000..251512b9bb
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/ClassNotFoundExceptionSpec.php
@@ -0,0 +1,25 @@
+beConstructedWith('msg', 'CustomClass');
+ }
+
+ function it_is_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoubleException');
+ }
+
+ function its_getClassname_returns_classname()
+ {
+ $this->getClassname()->shouldReturn('CustomClass');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php
new file mode 100644
index 0000000000..6fe5a19aeb
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/DoubleExceptionSpec.php
@@ -0,0 +1,14 @@
+shouldBeAnInstanceOf('RuntimeException');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php
new file mode 100644
index 0000000000..ad1a439e77
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/InterfaceNotFoundExceptionSpec.php
@@ -0,0 +1,24 @@
+beConstructedWith('msg', 'CustomInterface');
+ }
+
+ function it_extends_ClassNotFoundException()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\ClassNotFoundException');
+ }
+
+ function its_getClassname_returns_classname()
+ {
+ $this->getClassname()->shouldReturn('CustomInterface');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotExtendableExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotExtendableExceptionSpec.php
new file mode 100644
index 0000000000..5028b0263f
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotExtendableExceptionSpec.php
@@ -0,0 +1,29 @@
+beConstructedWith('', 'User', 'getName');
+ }
+
+ function it_is_DoubleException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Doubler\DoubleException');
+ }
+
+ function it_has_MethodName()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ function it_has_classname()
+ {
+ $this->getClassName()->shouldReturn('User');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php
new file mode 100644
index 0000000000..a889dd7ef4
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Doubler/MethodNotFoundExceptionSpec.php
@@ -0,0 +1,40 @@
+beConstructedWith('', 'User', 'getName', array(1, 2, 3));
+ }
+
+ function it_is_DoubleException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Doubler\DoubleException');
+ }
+
+ function it_has_MethodName()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ function it_has_classnamej()
+ {
+ $this->getClassname()->shouldReturn('User');
+ }
+
+ function it_has_an_arguments_list()
+ {
+ $this->getArguments()->shouldReturn(array(1, 2, 3));
+ }
+
+ function it_has_a_default_null_argument_list()
+ {
+ $this->beConstructedWith('', 'User', 'getName');
+ $this->getArguments()->shouldReturn(null);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php
new file mode 100644
index 0000000000..d78ea7386f
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php
@@ -0,0 +1,50 @@
+beConstructedWith(null);
+ }
+
+ function it_is_prediction_exception()
+ {
+ $this->shouldBeAnInstanceOf('RuntimeException');
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\PredictionException');
+ }
+
+ function it_can_store_objectProphecy_link(ObjectProphecy $object)
+ {
+ $this->setObjectProphecy($object);
+ $this->getObjectProphecy()->shouldReturn($object);
+ }
+
+ function it_should_not_have_exceptions_at_the_beginning()
+ {
+ $this->getExceptions()->shouldHaveCount(0);
+ }
+
+ function it_should_append_exception_through_append_method(PredictionException $exception)
+ {
+ $exception->getMessage()->willReturn('Exception #1');
+
+ $this->append($exception);
+
+ $this->getExceptions()->shouldReturn(array($exception));
+ }
+
+ function it_should_update_message_during_append(PredictionException $exception)
+ {
+ $exception->getMessage()->willReturn('Exception #1');
+
+ $this->append($exception);
+
+ $this->getMessage()->shouldReturn(" Exception #1");
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php
new file mode 100644
index 0000000000..c2aa31dff9
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/NoCallsExceptionSpec.php
@@ -0,0 +1,27 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy);
+ }
+
+ function it_is_PredictionException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException');
+ }
+
+ function it_extends_MethodProphecyException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php
new file mode 100644
index 0000000000..e18932edcd
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsCountExceptionSpec.php
@@ -0,0 +1,27 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy, 5, array($call1, $call2));
+ }
+
+ function it_extends_UnexpectedCallsException()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\UnexpectedCallsException');
+ }
+
+ function it_should_expose_expectedCount_through_getter()
+ {
+ $this->getExpectedCount()->shouldReturn(5);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php
new file mode 100644
index 0000000000..49d12d597d
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/UnexpectedCallsExceptionSpec.php
@@ -0,0 +1,33 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy, array($call1, $call2));
+ }
+
+ function it_is_PredictionException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException');
+ }
+
+ function it_extends_MethodProphecyException()
+ {
+ $this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException');
+ }
+
+ function it_should_expose_calls_list_through_getter($call1, $call2)
+ {
+ $this->getCalls()->shouldReturn(array($call1, $call2));
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php
new file mode 100644
index 0000000000..d05c66a587
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/MethodProphecyExceptionSpec.php
@@ -0,0 +1,28 @@
+getObjectProphecy()->willReturn($objectProphecy);
+
+ $this->beConstructedWith('message', $methodProphecy);
+ }
+
+ function it_extends_DoubleException()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException');
+ }
+
+ function it_holds_a_stub_reference($methodProphecy)
+ {
+ $this->getMethodProphecy()->shouldReturn($methodProphecy);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php
new file mode 100644
index 0000000000..91ffd5b9c0
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Exception/Prophecy/ObjectProphecyExceptionSpec.php
@@ -0,0 +1,24 @@
+beConstructedWith('message', $objectProphecy);
+ }
+
+ function it_should_be_a_prophecy_exception()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ProphecyException');
+ }
+
+ function it_holds_double_reference($objectProphecy)
+ {
+ $this->getObjectProphecy()->shouldReturn($objectProphecy);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php
new file mode 100644
index 0000000000..4f03db2f2d
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallPredictionSpec.php
@@ -0,0 +1,42 @@
+shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ function it_does_nothing_if_there_is_more_than_one_call_been_made(
+ ObjectProphecy $object,
+ MethodProphecy $method,
+ Call $call
+ ) {
+ $this->check(array($call), $object, $method)->shouldReturn(null);
+ }
+
+ function it_throws_NoCallsException_if_no_calls_found(
+ ObjectProphecy $object,
+ MethodProphecy $method,
+ ArgumentsWildcard $arguments
+ ) {
+ $method->getObjectProphecy()->willReturn($object);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->__toString()->willReturn('123');
+ $object->reveal()->willReturn(new \stdClass());
+ $object->findProphecyMethodCalls('getName', Argument::any())->willReturn(array());
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\NoCallsException')
+ ->duringCheck(array(), $object, $method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php
new file mode 100644
index 0000000000..52ce31cfd1
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallTimesPredictionSpec.php
@@ -0,0 +1,50 @@
+beConstructedWith(2);
+ }
+
+ function it_is_prediction()
+ {
+ $this->shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ function it_does_nothing_if_there_were_exact_amount_of_calls_being_made(
+ ObjectProphecy $object,
+ MethodProphecy $method,
+ Call $call1,
+ Call $call2
+ ) {
+ $this->check(array($call1, $call2), $object, $method)->shouldReturn(null);
+ }
+
+ function it_throws_UnexpectedCallsCountException_if_calls_found(
+ ObjectProphecy $object,
+ MethodProphecy $method,
+ Call $call,
+ ArgumentsWildcard $arguments
+ ) {
+ $method->getObjectProphecy()->willReturn($object);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->__toString()->willReturn('123');
+
+ $call->getMethodName()->willReturn('getName');
+ $call->getArguments()->willReturn(array(5, 4, 'three'));
+ $call->getCallPlace()->willReturn('unknown');
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\UnexpectedCallsCountException')
+ ->duringCheck(array($call), $object, $method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php
new file mode 100644
index 0000000000..6da95f06a3
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/CallbackPredictionSpec.php
@@ -0,0 +1,34 @@
+beConstructedWith('get_class');
+ }
+
+ function it_is_prediction()
+ {
+ $this->shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ function it_proxies_call_to_callback(ObjectProphecy $object, MethodProphecy $method, Call $call)
+ {
+ $returnFirstCallCallback = function ($calls, $object, $method) {
+ throw new RuntimeException;
+ };
+
+ $this->beConstructedWith($returnFirstCallCallback);
+
+ $this->shouldThrow('RuntimeException')->duringCheck(array($call), $object, $method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php
new file mode 100644
index 0000000000..b5fa28a9ee
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prediction/NoCallsPredictionSpec.php
@@ -0,0 +1,41 @@
+shouldHaveType('Prophecy\Prediction\PredictionInterface');
+ }
+
+ function it_does_nothing_if_there_is_no_calls_made(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->check(array(), $object, $method)->shouldReturn(null);
+ }
+
+ function it_throws_UnexpectedCallsException_if_calls_found(
+ ObjectProphecy $object,
+ MethodProphecy $method,
+ Call $call,
+ ArgumentsWildcard $arguments
+ ) {
+ $method->getObjectProphecy()->willReturn($object);
+ $method->getMethodName()->willReturn('getName');
+ $method->getArgumentsWildcard()->willReturn($arguments);
+ $arguments->__toString()->willReturn('123');
+
+ $call->getMethodName()->willReturn('getName');
+ $call->getArguments()->willReturn(array(5, 4, 'three'));
+ $call->getCallPlace()->willReturn('unknown');
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\UnexpectedCallsException')
+ ->duringCheck(array($call), $object, $method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php
new file mode 100644
index 0000000000..fb1dc62eb9
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Promise/CallbackPromiseSpec.php
@@ -0,0 +1,96 @@
+beConstructedWith('get_class');
+ }
+
+ function it_is_promise()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ function it_should_execute_closure_callback(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $firstArgumentCallback = function ($args) {
+ return $args[0];
+ };
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ function it_should_execute_static_array_callback(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $firstArgumentCallback = array('spec\Prophecy\Promise\ClassCallback', 'staticCallbackMethod');
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ function it_should_execute_instance_array_callback(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $class = new ClassCallback();
+ $firstArgumentCallback = array($class, 'callbackMethod');
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ function it_should_execute_string_function_callback(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $firstArgumentCallback = 'spec\Prophecy\Promise\functionCallbackFirstArgument';
+
+ $this->beConstructedWith($firstArgumentCallback);
+
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+}
+
+/**
+ * Class used to test callbackpromise
+ *
+ * @param array
+ * @return string
+ */
+class ClassCallback
+{
+ /**
+ * @param array $args
+ */
+ function callbackMethod($args)
+ {
+ return $args[0];
+ }
+
+ /**
+ * @param array $args
+ */
+ static function staticCallbackMethod($args)
+ {
+ return $args[0];
+ }
+}
+
+/**
+ * Callback function used to test callbackpromise
+ *
+ * @param array
+ * @return string
+ */
+function functionCallbackFirstArgument($args)
+{
+ return $args[0];
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php
new file mode 100644
index 0000000000..1cef3aa641
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnArgumentPromiseSpec.php
@@ -0,0 +1,31 @@
+shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ function it_should_return_first_argument_if_provided(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('one');
+ }
+
+ function it_should_return_null_if_no_arguments_provided(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->execute(array(), $object, $method)->shouldReturn(null);
+ }
+
+ function it_should_return_nth_argument_if_provided(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->beConstructedWith(1);
+ $this->execute(array('one', 'two'), $object, $method)->shouldReturn('two');
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php
new file mode 100644
index 0000000000..bc6a99188e
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Promise/ReturnPromiseSpec.php
@@ -0,0 +1,49 @@
+beConstructedWith(array(42));
+ }
+
+ function it_is_promise()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ function it_returns_value_it_was_constructed_with(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ }
+
+ function it_always_returns_last_value_left_in_the_return_values(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ }
+
+ function it_consequently_returns_multiple_values_it_was_constructed_with(
+ ObjectProphecy $object,
+ MethodProphecy $method
+ ) {
+ $this->beConstructedWith(array(42, 24, 12));
+
+ $this->execute(array(), $object, $method)->shouldReturn(42);
+ $this->execute(array(), $object, $method)->shouldReturn(24);
+ $this->execute(array(), $object, $method)->shouldReturn(12);
+ }
+
+ function it_returns_null_if_constructed_with_empty_array(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->beConstructedWith(array());
+
+ $this->execute(array(), $object, $method)->shouldReturn(null);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php
new file mode 100644
index 0000000000..b5a10bc1eb
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Promise/ThrowPromiseSpec.php
@@ -0,0 +1,92 @@
+beConstructedWith('RuntimeException');
+ }
+
+ function it_is_promise()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Promise\PromiseInterface');
+ }
+
+ function it_instantiates_and_throws_exception_from_provided_classname(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->beConstructedWith('InvalidArgumentException');
+
+ $this->shouldThrow('InvalidArgumentException')
+ ->duringExecute(array(), $object, $method);
+ }
+
+ function it_instantiates_exceptions_with_required_arguments(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->beConstructedWith('spec\Prophecy\Promise\RequiredArgumentException');
+
+ $this->shouldThrow('spec\Prophecy\Promise\RequiredArgumentException')
+ ->duringExecute(array(), $object, $method);
+ }
+
+ function it_throws_provided_exception(ObjectProphecy $object, MethodProphecy $method)
+ {
+ $this->beConstructedWith($exc = new \RuntimeException('Some exception'));
+
+ $this->shouldThrow($exc)->duringExecute(array(), $object, $method);
+ }
+
+ function it_throws_error_instances(ObjectProphecy $object, MethodProphecy $method)
+ {
+ if (!class_exists('\Error')) {
+ throw new SkippingException('The class Error, introduced in PHP 7, does not exist');
+ }
+
+ $this->beConstructedWith($exc = new \Error('Error exception'));
+
+ $this->shouldThrow($exc)->duringExecute(array(), $object, $method);
+ }
+
+ function it_throws_errors_by_class_name()
+ {
+ if (!class_exists('\Error')) {
+ throw new SkippingException('The class Error, introduced in PHP 7, does not exist');
+ }
+
+ $this->beConstructedWith('\Error');
+
+ $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation();
+ }
+
+ function it_does_not_throw_something_that_is_not_throwable_by_class_name()
+ {
+ $this->beConstructedWith('\stdClass');
+
+ $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation();
+ }
+
+ function it_does_not_throw_something_that_is_not_throwable_by_instance()
+ {
+ $this->beConstructedWith(new \stdClass());
+
+ $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation();
+ }
+
+ function it_throws_an_exception_by_class_name()
+ {
+ $this->beConstructedWith('\Exception');
+
+ $this->shouldNotThrow('Prophecy\Exception\InvalidArgumentException')->duringInstantiation();
+ }
+}
+
+class RequiredArgumentException extends \Exception
+{
+ final public function __construct($message, $code) {}
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php
new file mode 100644
index 0000000000..969e644a77
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/MethodProphecySpec.php
@@ -0,0 +1,342 @@
+reveal()->willReturn($reflection);
+
+ $this->beConstructedWith($objectProphecy, 'getName', null);
+ }
+
+ function it_is_initializable()
+ {
+ $this->shouldHaveType('Prophecy\Prophecy\MethodProphecy');
+ }
+
+ function its_constructor_throws_MethodNotFoundException_for_unexisting_method($objectProphecy)
+ {
+ $this->shouldThrow('Prophecy\Exception\Doubler\MethodNotFoundException')->during(
+ '__construct', array($objectProphecy, 'getUnexisting', null)
+ );
+ }
+
+ function its_constructor_throws_MethodProphecyException_for_final_methods($objectProphecy, ClassWithFinalMethod $subject)
+ {
+ $objectProphecy->reveal()->willReturn($subject);
+
+ $this->shouldThrow('Prophecy\Exception\Prophecy\MethodProphecyException')->during(
+ '__construct', array($objectProphecy, 'finalMethod', null)
+ );
+ }
+
+ function its_constructor_transforms_array_passed_as_3rd_argument_to_ArgumentsWildcard(
+ $objectProphecy
+ )
+ {
+ $this->beConstructedWith($objectProphecy, 'getName', array(42, 33));
+
+ $wildcard = $this->getArgumentsWildcard();
+ $wildcard->shouldNotBe(null);
+ $wildcard->__toString()->shouldReturn('exact(42), exact(33)');
+ }
+
+ function its_constructor_does_not_touch_third_argument_if_it_is_null($objectProphecy)
+ {
+ $this->beConstructedWith($objectProphecy, 'getName', null);
+
+ $wildcard = $this->getArgumentsWildcard();
+ $wildcard->shouldBe(null);
+ }
+
+ function it_records_promise_through_will_method(PromiseInterface $promise, $objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->will($promise);
+ $this->getPromise()->shouldReturn($promise);
+ }
+
+ function it_adds_itself_to_ObjectProphecy_during_call_to_will(PromiseInterface $objectProphecy, $promise)
+ {
+ $objectProphecy->addMethodProphecy($this)->shouldBeCalled();
+
+ $this->will($promise);
+ }
+
+ function it_adds_ReturnPromise_during_willReturn_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willReturn(42);
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ReturnPromise');
+ }
+
+ function it_adds_ThrowPromise_during_willThrow_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willThrow('RuntimeException');
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ThrowPromise');
+ }
+
+ function it_adds_ReturnArgumentPromise_during_willReturnArgument_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willReturnArgument();
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\ReturnArgumentPromise');
+ }
+
+ function it_adds_ReturnArgumentPromise_during_willReturnArgument_call_with_index_argument($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->willReturnArgument(1);
+ $promise = $this->getPromise();
+ $promise->shouldBeAnInstanceOf('Prophecy\Promise\ReturnArgumentPromise');
+ $promise->execute(array('one', 'two'), $objectProphecy, $this)->shouldReturn('two');
+ }
+
+ function it_adds_CallbackPromise_during_will_call_with_callback_argument($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $callback = function () {};
+
+ $this->will($callback);
+ $this->getPromise()->shouldBeAnInstanceOf('Prophecy\Promise\CallbackPromise');
+ }
+
+ function it_records_prediction_through_should_method(PredictionInterface $prediction, $objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('should', array($prediction));
+ $this->getPrediction()->shouldReturn($prediction);
+ }
+
+ function it_adds_CallbackPrediction_during_should_call_with_callback_argument($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $callback = function () {};
+
+ $this->callOnWrappedObject('should', array($callback));
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallbackPrediction');
+ }
+
+ function it_adds_itself_to_ObjectProphecy_during_call_to_should($objectProphecy, PredictionInterface $prediction)
+ {
+ $objectProphecy->addMethodProphecy($this)->shouldBeCalled();
+
+ $this->callOnWrappedObject('should', array($prediction));
+ }
+
+ function it_adds_CallPrediction_during_shouldBeCalled_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('shouldBeCalled', array());
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallPrediction');
+ }
+
+ function it_adds_NoCallsPrediction_during_shouldNotBeCalled_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('shouldNotBeCalled', array());
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\NoCallsPrediction');
+ }
+
+ function it_adds_CallTimesPrediction_during_shouldBeCalledTimes_call($objectProphecy)
+ {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->callOnWrappedObject('shouldBeCalledTimes', array(5));
+ $this->getPrediction()->shouldBeAnInstanceOf('Prophecy\Prediction\CallTimesPrediction');
+ }
+
+ function it_checks_prediction_via_shouldHave_method_call(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ PredictionInterface $prediction,
+ Call $call1,
+ Call $call2
+ ) {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+ }
+
+ function it_sets_return_promise_during_shouldHave_call_if_none_was_set_before(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ PredictionInterface $prediction,
+ Call $call1,
+ Call $call2
+ ) {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+
+ $this->getPromise()->shouldReturnAnInstanceOf('Prophecy\Promise\ReturnPromise');
+ }
+
+ function it_does_not_set_return_promise_during_shouldHave_call_if_it_was_set_before(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ PredictionInterface $prediction,
+ Call $call1,
+ Call $call2,
+ PromiseInterface $promise
+ ) {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->will($promise);
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+
+ $this->getPromise()->shouldReturn($promise);
+ }
+
+ function it_records_checked_predictions(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ PredictionInterface $prediction1,
+ PredictionInterface $prediction2,
+ Call $call1,
+ Call $call2,
+ PromiseInterface $promise
+ ) {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction1->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willReturn();
+ $prediction2->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willReturn();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->will($promise);
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('shouldHave', array($prediction1));
+ $this->callOnWrappedObject('shouldHave', array($prediction2));
+
+ $this->getCheckedPredictions()->shouldReturn(array($prediction1, $prediction2));
+ }
+
+ function it_records_even_failed_checked_predictions(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ PredictionInterface $prediction,
+ Call $call1,
+ Call $call2,
+ PromiseInterface $promise
+ ) {
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->willThrow(new \RuntimeException());
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->will($promise);
+ $this->withArguments($arguments);
+
+ try {
+ $this->callOnWrappedObject('shouldHave', array($prediction));
+ } catch (\Exception $e) {}
+
+ $this->getCheckedPredictions()->shouldReturn(array($prediction));
+ }
+
+ function it_checks_prediction_via_shouldHave_method_call_with_callback(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ Call $call1,
+ Call $call2
+ ) {
+ $callback = function ($calls, $object, $method) {
+ throw new \RuntimeException;
+ };
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+
+ $this->withArguments($arguments);
+ $this->shouldThrow('RuntimeException')->duringShouldHave($callback);
+ }
+
+ function it_does_nothing_during_checkPrediction_if_no_prediction_set()
+ {
+ $this->checkPrediction()->shouldReturn(null);
+ }
+
+ function it_checks_set_prediction_during_checkPrediction(
+ $objectProphecy,
+ ArgumentsWildcard $arguments,
+ PredictionInterface $prediction,
+ Call $call1,
+ Call $call2
+ ) {
+ $prediction->check(array($call1, $call2), $objectProphecy->getWrappedObject(), $this)->shouldBeCalled();
+ $objectProphecy->findProphecyMethodCalls('getName', $arguments)->willReturn(array($call1, $call2));
+ $objectProphecy->addMethodProphecy($this)->willReturn(null);
+
+ $this->withArguments($arguments);
+ $this->callOnWrappedObject('should', array($prediction));
+ $this->checkPrediction();
+ }
+
+ function it_links_back_to_ObjectProphecy_through_getter($objectProphecy)
+ {
+ $this->getObjectProphecy()->shouldReturn($objectProphecy);
+ }
+
+ function it_has_MethodName()
+ {
+ $this->getMethodName()->shouldReturn('getName');
+ }
+
+ function it_contains_ArgumentsWildcard_it_was_constructed_with($objectProphecy, ArgumentsWildcard $wildcard)
+ {
+ $this->beConstructedWith($objectProphecy, 'getName', $wildcard);
+
+ $this->getArgumentsWildcard()->shouldReturn($wildcard);
+ }
+
+ function its_ArgumentWildcard_is_mutable_through_setter(ArgumentsWildcard $wildcard)
+ {
+ $this->withArguments($wildcard);
+
+ $this->getArgumentsWildcard()->shouldReturn($wildcard);
+ }
+
+ function its_withArguments_transforms_passed_array_into_ArgumentsWildcard()
+ {
+ $this->withArguments(array(42, 33));
+
+ $wildcard = $this->getArgumentsWildcard();
+ $wildcard->shouldNotBe(null);
+ $wildcard->__toString()->shouldReturn('exact(42), exact(33)');
+ }
+
+ function its_withArguments_throws_exception_if_wrong_arguments_provided()
+ {
+ $this->shouldThrow('Prophecy\Exception\InvalidArgumentException')->duringWithArguments(42);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php
new file mode 100644
index 0000000000..c6afb3ef02
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/ObjectProphecySpec.php
@@ -0,0 +1,283 @@
+beConstructedWith($lazyDouble);
+
+ $lazyDouble->getInstance()->willReturn($double);
+ }
+
+ function it_implements_ProphecyInterface()
+ {
+ $this->shouldBeAnInstanceOf('Prophecy\Prophecy\ProphecyInterface');
+ }
+
+ function it_sets_parentClass_during_willExtend_call($lazyDouble)
+ {
+ $lazyDouble->setParentClass('123')->shouldBeCalled();
+
+ $this->willExtend('123');
+ }
+
+ function it_adds_interface_during_willImplement_call($lazyDouble)
+ {
+ $lazyDouble->addInterface('222')->shouldBeCalled();
+
+ $this->willImplement('222');
+ }
+
+ function it_sets_constructor_arguments_during_willBeConstructedWith_call($lazyDouble)
+ {
+ $lazyDouble->setArguments(array(1, 2, 5))->shouldBeCalled();
+
+ $this->willBeConstructedWith(array(1, 2, 5));
+ }
+
+ function it_does_not_have_method_prophecies_by_default()
+ {
+ $this->getMethodProphecies()->shouldHaveCount(0);
+ }
+
+ function it_should_get_method_prophecies_by_method_name(
+ MethodProphecy $method1,
+ MethodProphecy $method2,
+ ArgumentsWildcard $arguments
+ ) {
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments);
+ $method2->getMethodName()->willReturn('setName');
+ $method2->getArgumentsWildcard()->willReturn($arguments);
+
+ $this->addMethodProphecy($method1);
+ $this->addMethodProphecy($method2);
+
+ $methods = $this->getMethodProphecies('setName');
+ $methods->shouldHaveCount(1);
+ $methods[0]->getMethodName()->shouldReturn('setName');
+ }
+
+ function it_should_return_empty_array_if_no_method_prophecies_found()
+ {
+ $methods = $this->getMethodProphecies('setName');
+ $methods->shouldHaveCount(0);
+ }
+
+ function it_should_proxy_makeProphecyMethodCall_to_CallCenter($lazyDouble, CallCenter $callCenter)
+ {
+ $this->beConstructedWith($lazyDouble, $callCenter);
+
+ $callCenter->makeCall($this->getWrappedObject(), 'setName', array('everzet'))->willReturn(42);
+
+ $this->makeProphecyMethodCall('setName', array('everzet'))->shouldReturn(42);
+ }
+
+ function it_should_reveal_arguments_and_return_values_from_callCenter(
+ $lazyDouble,
+ CallCenter $callCenter,
+ RevealerInterface $revealer
+ ) {
+ $this->beConstructedWith($lazyDouble, $callCenter, $revealer);
+
+ $revealer->reveal(array('question'))->willReturn(array('life'));
+ $revealer->reveal('answer')->willReturn(42);
+
+ $callCenter->makeCall($this->getWrappedObject(), 'setName', array('life'))->willReturn('answer');
+
+ $this->makeProphecyMethodCall('setName', array('question'))->shouldReturn(42);
+ }
+
+ function it_should_proxy_getProphecyMethodCalls_to_CallCenter(
+ $lazyDouble,
+ CallCenter $callCenter,
+ ArgumentsWildcard $wildcard,
+ Call $call
+ ) {
+ $this->beConstructedWith($lazyDouble, $callCenter);
+
+ $callCenter->findCalls('setName', $wildcard)->willReturn(array($call));
+
+ $this->findProphecyMethodCalls('setName', $wildcard)->shouldReturn(array($call));
+ }
+
+ function its_addMethodProphecy_adds_method_prophecy(
+ MethodProphecy $methodProphecy,
+ ArgumentsWildcard $argumentsWildcard
+ ) {
+ $methodProphecy->getArgumentsWildcard()->willReturn($argumentsWildcard);
+ $methodProphecy->getMethodName()->willReturn('getUsername');
+
+ $this->addMethodProphecy($methodProphecy);
+
+ $this->getMethodProphecies()->shouldReturn(array(
+ 'getUsername' => array($methodProphecy)
+ ));
+ }
+
+ function its_addMethodProphecy_handles_prophecies_with_different_arguments(
+ MethodProphecy $methodProphecy1,
+ MethodProphecy $methodProphecy2,
+ ArgumentsWildcard $argumentsWildcard1,
+ ArgumentsWildcard $argumentsWildcard2
+ ) {
+ $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1);
+ $methodProphecy1->getMethodName()->willReturn('getUsername');
+
+ $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2);
+ $methodProphecy2->getMethodName()->willReturn('getUsername');
+
+ $this->addMethodProphecy($methodProphecy1);
+ $this->addMethodProphecy($methodProphecy2);
+
+ $this->getMethodProphecies()->shouldReturn(array(
+ 'getUsername' => array(
+ $methodProphecy1,
+ $methodProphecy2,
+ )
+ ));
+ }
+
+ function its_addMethodProphecy_handles_prophecies_for_different_methods(
+ MethodProphecy $methodProphecy1,
+ MethodProphecy $methodProphecy2,
+ ArgumentsWildcard $argumentsWildcard1,
+ ArgumentsWildcard $argumentsWildcard2
+ ) {
+ $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1);
+ $methodProphecy1->getMethodName()->willReturn('getUsername');
+
+ $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2);
+ $methodProphecy2->getMethodName()->willReturn('isUsername');
+
+ $this->addMethodProphecy($methodProphecy1);
+ $this->addMethodProphecy($methodProphecy2);
+
+ $this->getMethodProphecies()->shouldReturn(array(
+ 'getUsername' => array(
+ $methodProphecy1
+ ),
+ 'isUsername' => array(
+ $methodProphecy2
+ )
+ ));
+ }
+
+ function its_addMethodProphecy_throws_exception_when_method_has_no_ArgumentsWildcard(MethodProphecy $methodProphecy)
+ {
+ $methodProphecy->getArgumentsWildcard()->willReturn(null);
+ $methodProphecy->getObjectProphecy()->willReturn($this);
+ $methodProphecy->getMethodName()->willReturn('getTitle');
+
+ $this->shouldThrow('Prophecy\Exception\Prophecy\MethodProphecyException')->duringAddMethodProphecy(
+ $methodProphecy
+ );
+ }
+
+ function it_returns_null_after_checkPredictions_call_if_there_is_no_method_prophecies()
+ {
+ $this->checkProphecyMethodsPredictions()->shouldReturn(null);
+ }
+
+ function it_throws_AggregateException_during_checkPredictions_if_predictions_fail(
+ MethodProphecy $methodProphecy1, MethodProphecy $methodProphecy2,
+ ArgumentsWildcard $argumentsWildcard1,
+ ArgumentsWildcard $argumentsWildcard2
+ ) {
+ $methodProphecy1->getMethodName()->willReturn('getName');
+ $methodProphecy1->getArgumentsWildcard()->willReturn($argumentsWildcard1);
+ $methodProphecy1->checkPrediction()
+ ->willThrow('Prophecy\Exception\Prediction\AggregateException');
+
+ $methodProphecy2->getMethodName()->willReturn('setName');
+ $methodProphecy2->getArgumentsWildcard()->willReturn($argumentsWildcard2);
+ $methodProphecy2->checkPrediction()
+ ->willThrow('Prophecy\Exception\Prediction\AggregateException');
+
+ $this->addMethodProphecy($methodProphecy1);
+ $this->addMethodProphecy($methodProphecy2);
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\AggregateException')
+ ->duringCheckProphecyMethodsPredictions();
+ }
+
+ function it_returns_new_MethodProphecy_instance_for_arbitrary_call(
+ Doubler $doubler,
+ ProphecySubjectInterface $reflection
+ ) {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $return = $this->getProphecy();
+ $return->shouldBeAnInstanceOf('Prophecy\Prophecy\MethodProphecy');
+ $return->getMethodName()->shouldReturn('getProphecy');
+ }
+
+ function it_returns_same_MethodProphecy_for_same_registered_signature(
+ Doubler $doubler,
+ ProphecySubjectInterface $reflection
+ ) {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(1, 2, 3));
+ $methodProphecy2 = $this->getProphecy(1, 2, 3);
+
+ $methodProphecy2->shouldBe($methodProphecy1);
+ }
+
+ function it_returns_new_MethodProphecy_for_different_signatures(
+ Doubler $doubler,
+ ProphecySubjectInterface $reflection
+ ) {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $value = new ObjectProphecySpecFixtureB('ABC');
+ $value2 = new ObjectProphecySpecFixtureB('CBA');
+
+ $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(1, 2, 3, $value));
+ $methodProphecy2 = $this->getProphecy(1, 2, 3, $value2);
+
+ $methodProphecy2->shouldNotBe($methodProphecy1);
+ }
+
+ function it_returns_new_MethodProphecy_for_all_callback_signatures(
+ Doubler $doubler,
+ ProphecySubjectInterface $reflection
+ ) {
+ $doubler->double(Argument::any())->willReturn($reflection);
+
+ $this->addMethodProphecy($methodProphecy1 = $this->getProphecy(function(){}));
+ $methodProphecy2 = $this->getProphecy(function(){});
+
+ $methodProphecy2->shouldNotBe($methodProphecy1);
+ }
+}
+
+class ObjectProphecySpecFixtureA
+{
+ public $errors;
+}
+
+class ObjectProphecySpecFixtureB extends ObjectProphecySpecFixtureA
+{
+ public $errors;
+ public $value = null;
+
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php
new file mode 100644
index 0000000000..fcaa7ca3a3
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Prophecy/RevealerSpec.php
@@ -0,0 +1,44 @@
+shouldBeAnInstanceOf('Prophecy\Prophecy\RevealerInterface');
+ }
+
+ function it_reveals_single_instance_of_ProphecyInterface(ProphecyInterface $prophecy, \stdClass $object)
+ {
+ $prophecy->reveal()->willReturn($object);
+
+ $this->reveal($prophecy)->shouldReturn($object);
+ }
+
+ function it_reveals_instances_of_ProphecyInterface_inside_array(
+ ProphecyInterface $prophecy1,
+ ProphecyInterface $prophecy2,
+ \stdClass $object1,
+ \stdClass $object2
+ ) {
+ $prophecy1->reveal()->willReturn($object1);
+ $prophecy2->reveal()->willReturn($object2);
+
+ $this->reveal(array(
+ array('item' => $prophecy2),
+ $prophecy1
+ ))->shouldReturn(array(
+ array('item' => $object2),
+ $object1
+ ));
+ }
+
+ function it_does_not_touch_non_prophecy_interface()
+ {
+ $this->reveal(42)->shouldReturn(42);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php
new file mode 100644
index 0000000000..67f0275259
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/ProphetSpec.php
@@ -0,0 +1,81 @@
+double(null, array())->willReturn($double);
+
+ $this->beConstructedWith($doubler);
+ }
+
+ function it_constructs_new_prophecy_on_prophesize_call()
+ {
+ $prophecy = $this->prophesize();
+ $prophecy->shouldBeAnInstanceOf('Prophecy\Prophecy\ObjectProphecy');
+ }
+
+ function it_constructs_new_prophecy_with_parent_class_if_specified($doubler, ProphecySubjectInterface $newDouble)
+ {
+ $doubler->double(Argument::any(), array())->willReturn($newDouble);
+
+ $this->prophesize('Prophecy\Prophet')->reveal()->shouldReturn($newDouble);
+ }
+
+ function it_constructs_new_prophecy_with_interface_if_specified($doubler, ProphecySubjectInterface $newDouble)
+ {
+ $doubler->double(null, Argument::any())->willReturn($newDouble);
+
+ $this->prophesize('ArrayAccess')->reveal()->shouldReturn($newDouble);
+ }
+
+ function it_exposes_all_created_prophecies_through_getter()
+ {
+ $prophecy1 = $this->prophesize();
+ $prophecy2 = $this->prophesize();
+
+ $this->getProphecies()->shouldReturn(array($prophecy1, $prophecy2));
+ }
+
+ function it_does_nothing_during_checkPredictions_call_if_no_predictions_defined()
+ {
+ $this->checkPredictions()->shouldReturn(null);
+ }
+
+ function it_throws_AggregateException_if_defined_predictions_fail(
+ MethodProphecy $method1,
+ MethodProphecy $method2,
+ ArgumentsWildcard $arguments1,
+ ArgumentsWildcard $arguments2
+ ) {
+ $method1->getMethodName()->willReturn('getName');
+ $method1->getArgumentsWildcard()->willReturn($arguments1);
+ $method1->checkPrediction()->willReturn(null);
+
+ $method2->getMethodName()->willReturn('isSet');
+ $method2->getArgumentsWildcard()->willReturn($arguments2);
+ $method2->checkPrediction()->willThrow(
+ 'Prophecy\Exception\Prediction\AggregateException'
+ );
+
+ $this->prophesize()->addMethodProphecy($method1);
+ $this->prophesize()->addMethodProphecy($method2);
+
+ $this->shouldThrow('Prophecy\Exception\Prediction\AggregateException')
+ ->duringCheckPredictions();
+ }
+
+ function it_exposes_doubler_through_getter($doubler)
+ {
+ $this->getDoubler()->shouldReturn($doubler);
+ }
+}
diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php
new file mode 100644
index 0000000000..80573cffb3
--- /dev/null
+++ b/vendor/phpspec/prophecy/spec/Prophecy/Util/StringUtilSpec.php
@@ -0,0 +1,91 @@
+stringify(42)->shouldReturn('42');
+ }
+
+ function it_generates_proper_string_representation_for_string()
+ {
+ $this->stringify('some string')->shouldReturn('"some string"');
+ }
+
+ function it_generates_single_line_representation_for_multiline_string()
+ {
+ $this->stringify("some\nstring")->shouldReturn('"some\\nstring"');
+ }
+
+ function it_generates_proper_string_representation_for_double()
+ {
+ $this->stringify(42.3)->shouldReturn('42.3');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_true()
+ {
+ $this->stringify(true)->shouldReturn('true');
+ }
+
+ function it_generates_proper_string_representation_for_boolean_false()
+ {
+ $this->stringify(false)->shouldReturn('false');
+ }
+
+ function it_generates_proper_string_representation_for_null()
+ {
+ $this->stringify(null)->shouldReturn('null');
+ }
+
+ function it_generates_proper_string_representation_for_empty_array()
+ {
+ $this->stringify(array())->shouldReturn('[]');
+ }
+
+ function it_generates_proper_string_representation_for_array()
+ {
+ $this->stringify(array('zet', 42))->shouldReturn('["zet", 42]');
+ }
+
+ function it_generates_proper_string_representation_for_hash_containing_one_value()
+ {
+ $this->stringify(array('ever' => 'zet'))->shouldReturn('["ever" => "zet"]');
+ }
+
+ function it_generates_proper_string_representation_for_hash()
+ {
+ $this->stringify(array('ever' => 'zet', 52 => 'hey', 'num' => 42))->shouldReturn(
+ '["ever" => "zet", 52 => "hey", "num" => 42]'
+ );
+ }
+
+ function it_generates_proper_string_representation_for_resource()
+ {
+ $resource = fopen(__FILE__, 'r');
+ $this->stringify($resource)->shouldReturn('stream:'.$resource);
+ }
+
+ function it_generates_proper_string_representation_for_object(\stdClass $object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ ) . " Object (\n 'objectProphecy' => Prophecy\Prophecy\ObjectProphecy Object (*Prophecy*)\n)";
+
+ $this->stringify($object)->shouldReturn("$objHash");
+ }
+
+ function it_generates_proper_string_representation_for_object_without_exporting(\stdClass $object)
+ {
+ $objHash = sprintf('%s:%s',
+ get_class($object->getWrappedObject()),
+ spl_object_hash($object->getWrappedObject())
+ );
+
+ $this->stringify($object, false)->shouldReturn("$objHash");
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument.php b/vendor/phpspec/prophecy/src/Prophecy/Argument.php
new file mode 100644
index 0000000000..fde6aa9000
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument.php
@@ -0,0 +1,212 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy;
+
+use Prophecy\Argument\Token;
+
+/**
+ * Argument tokens shortcuts.
+ *
+ * @author Konstantin Kudryashov
+ */
+class Argument
+{
+ /**
+ * Checks that argument is exact value or object.
+ *
+ * @param mixed $value
+ *
+ * @return Token\ExactValueToken
+ */
+ public static function exact($value)
+ {
+ return new Token\ExactValueToken($value);
+ }
+
+ /**
+ * Checks that argument is of specific type or instance of specific class.
+ *
+ * @param string $type Type name (`integer`, `string`) or full class name
+ *
+ * @return Token\TypeToken
+ */
+ public static function type($type)
+ {
+ return new Token\TypeToken($type);
+ }
+
+ /**
+ * Checks that argument object has specific state.
+ *
+ * @param string $methodName
+ * @param mixed $value
+ *
+ * @return Token\ObjectStateToken
+ */
+ public static function which($methodName, $value)
+ {
+ return new Token\ObjectStateToken($methodName, $value);
+ }
+
+ /**
+ * Checks that argument matches provided callback.
+ *
+ * @param callable $callback
+ *
+ * @return Token\CallbackToken
+ */
+ public static function that($callback)
+ {
+ return new Token\CallbackToken($callback);
+ }
+
+ /**
+ * Matches any single value.
+ *
+ * @return Token\AnyValueToken
+ */
+ public static function any()
+ {
+ return new Token\AnyValueToken;
+ }
+
+ /**
+ * Matches all values to the rest of the signature.
+ *
+ * @return Token\AnyValuesToken
+ */
+ public static function cetera()
+ {
+ return new Token\AnyValuesToken;
+ }
+
+ /**
+ * Checks that argument matches all tokens
+ *
+ * @param mixed ... a list of tokens
+ *
+ * @return Token\LogicalAndToken
+ */
+ public static function allOf()
+ {
+ return new Token\LogicalAndToken(func_get_args());
+ }
+
+ /**
+ * Checks that argument array or countable object has exact number of elements.
+ *
+ * @param integer $value array elements count
+ *
+ * @return Token\ArrayCountToken
+ */
+ public static function size($value)
+ {
+ return new Token\ArrayCountToken($value);
+ }
+
+ /**
+ * Checks that argument array contains (key, value) pair
+ *
+ * @param mixed $key exact value or token
+ * @param mixed $value exact value or token
+ *
+ * @return Token\ArrayEntryToken
+ */
+ public static function withEntry($key, $value)
+ {
+ return new Token\ArrayEntryToken($key, $value);
+ }
+
+ /**
+ * Checks that arguments array entries all match value
+ *
+ * @param mixed $value
+ *
+ * @return Token\ArrayEveryEntryToken
+ */
+ public static function withEveryEntry($value)
+ {
+ return new Token\ArrayEveryEntryToken($value);
+ }
+
+ /**
+ * Checks that argument array contains value
+ *
+ * @param mixed $value
+ *
+ * @return Token\ArrayEntryToken
+ */
+ public static function containing($value)
+ {
+ return new Token\ArrayEntryToken(self::any(), $value);
+ }
+
+ /**
+ * Checks that argument array has key
+ *
+ * @param mixed $key exact value or token
+ *
+ * @return Token\ArrayEntryToken
+ */
+ public static function withKey($key)
+ {
+ return new Token\ArrayEntryToken($key, self::any());
+ }
+
+ /**
+ * Checks that argument does not match the value|token.
+ *
+ * @param mixed $value either exact value or argument token
+ *
+ * @return Token\LogicalNotToken
+ */
+ public static function not($value)
+ {
+ return new Token\LogicalNotToken($value);
+ }
+
+ /**
+ * @param string $value
+ *
+ * @return Token\StringContainsToken
+ */
+ public static function containingString($value)
+ {
+ return new Token\StringContainsToken($value);
+ }
+
+ /**
+ * Checks that argument is identical value.
+ *
+ * @param mixed $value
+ *
+ * @return Token\IdenticalValueToken
+ */
+ public static function is($value)
+ {
+ return new Token\IdenticalValueToken($value);
+ }
+
+ /**
+ * Check that argument is same value when rounding to the
+ * given precision.
+ *
+ * @param float $value
+ * @param float $precision
+ *
+ * @return Token\ApproximateValueToken
+ */
+ public static function approximate($value, $precision = 0)
+ {
+ return new Token\ApproximateValueToken($value, $precision);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php
new file mode 100644
index 0000000000..a088f21d21
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/ArgumentsWildcard.php
@@ -0,0 +1,101 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument;
+
+/**
+ * Arguments wildcarding.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ArgumentsWildcard
+{
+ /**
+ * @var Token\TokenInterface[]
+ */
+ private $tokens = array();
+ private $string;
+
+ /**
+ * Initializes wildcard.
+ *
+ * @param array $arguments Array of argument tokens or values
+ */
+ public function __construct(array $arguments)
+ {
+ foreach ($arguments as $argument) {
+ if (!$argument instanceof Token\TokenInterface) {
+ $argument = new Token\ExactValueToken($argument);
+ }
+
+ $this->tokens[] = $argument;
+ }
+ }
+
+ /**
+ * Calculates wildcard match score for provided arguments.
+ *
+ * @param array $arguments
+ *
+ * @return false|int False OR integer score (higher - better)
+ */
+ public function scoreArguments(array $arguments)
+ {
+ if (0 == count($arguments) && 0 == count($this->tokens)) {
+ return 1;
+ }
+
+ $arguments = array_values($arguments);
+ $totalScore = 0;
+ foreach ($this->tokens as $i => $token) {
+ $argument = isset($arguments[$i]) ? $arguments[$i] : null;
+ if (1 >= $score = $token->scoreArgument($argument)) {
+ return false;
+ }
+
+ $totalScore += $score;
+
+ if (true === $token->isLast()) {
+ return $totalScore;
+ }
+ }
+
+ if (count($arguments) > count($this->tokens)) {
+ return false;
+ }
+
+ return $totalScore;
+ }
+
+ /**
+ * Returns string representation for wildcard.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (null === $this->string) {
+ $this->string = implode(', ', array_map(function ($token) {
+ return (string) $token;
+ }, $this->tokens));
+ }
+
+ return $this->string;
+ }
+
+ /**
+ * @return array
+ */
+ public function getTokens()
+ {
+ return $this->tokens;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php
new file mode 100644
index 0000000000..50988112c5
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValueToken.php
@@ -0,0 +1,52 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Any single value token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class AnyValueToken implements TokenInterface
+{
+ /**
+ * Always scores 3 for any argument.
+ *
+ * @param $argument
+ *
+ * @return int
+ */
+ public function scoreArgument($argument)
+ {
+ return 3;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '*';
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php
new file mode 100644
index 0000000000..f76b17bc0b
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/AnyValuesToken.php
@@ -0,0 +1,52 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Any values token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class AnyValuesToken implements TokenInterface
+{
+ /**
+ * Always scores 2 for any argument.
+ *
+ * @param $argument
+ *
+ * @return int
+ */
+ public function scoreArgument($argument)
+ {
+ return 2;
+ }
+
+ /**
+ * Returns true to stop wildcard from processing other tokens.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return true;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return '* [, ...]';
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php
new file mode 100644
index 0000000000..d4918b1ad8
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php
@@ -0,0 +1,55 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Approximate value token
+ *
+ * @author Daniel Leech
+ */
+class ApproximateValueToken implements TokenInterface
+{
+ private $value;
+ private $precision;
+
+ public function __construct($value, $precision = 0)
+ {
+ $this->value = $value;
+ $this->precision = $precision;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function scoreArgument($argument)
+ {
+ return round($argument, $this->precision) === round($this->value, $this->precision) ? 10 : false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('≅%s', round($this->value, $this->precision));
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php
new file mode 100644
index 0000000000..96b4befd7f
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php
@@ -0,0 +1,86 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Array elements count token.
+ *
+ * @author Boris Mikhaylov
+ */
+
+class ArrayCountToken implements TokenInterface
+{
+ private $count;
+
+ /**
+ * @param integer $value
+ */
+ public function __construct($value)
+ {
+ $this->count = $value;
+ }
+
+ /**
+ * Scores 6 when argument has preset number of elements.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return $this->isCountable($argument) && $this->hasProperCount($argument) ? 6 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return boolean
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('count(%s)', $this->count);
+ }
+
+ /**
+ * Returns true if object is either array or instance of \Countable
+ *
+ * @param $argument
+ * @return bool
+ */
+ private function isCountable($argument)
+ {
+ return (is_array($argument) || $argument instanceof \Countable);
+ }
+
+ /**
+ * Returns true if $argument has expected number of elements
+ *
+ * @param array|\Countable $argument
+ *
+ * @return bool
+ */
+ private function hasProperCount($argument)
+ {
+ return $this->count === count($argument);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php
new file mode 100644
index 0000000000..0305fc7207
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEntryToken.php
@@ -0,0 +1,143 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Array entry token.
+ *
+ * @author Boris Mikhaylov
+ */
+class ArrayEntryToken implements TokenInterface
+{
+ /** @var \Prophecy\Argument\Token\TokenInterface */
+ private $key;
+ /** @var \Prophecy\Argument\Token\TokenInterface */
+ private $value;
+
+ /**
+ * @param mixed $key exact value or token
+ * @param mixed $value exact value or token
+ */
+ public function __construct($key, $value)
+ {
+ $this->key = $this->wrapIntoExactValueToken($key);
+ $this->value = $this->wrapIntoExactValueToken($value);
+ }
+
+ /**
+ * Scores half of combined scores from key and value tokens for same entry. Capped at 8.
+ * If argument implements \ArrayAccess without \Traversable, then key token is restricted to ExactValueToken.
+ *
+ * @param array|\ArrayAccess|\Traversable $argument
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if ($argument instanceof \Traversable) {
+ $argument = iterator_to_array($argument);
+ }
+
+ if ($argument instanceof \ArrayAccess) {
+ $argument = $this->convertArrayAccessToEntry($argument);
+ }
+
+ if (!is_array($argument) || empty($argument)) {
+ return false;
+ }
+
+ $keyScores = array_map(array($this->key,'scoreArgument'), array_keys($argument));
+ $valueScores = array_map(array($this->value,'scoreArgument'), $argument);
+ $scoreEntry = function ($value, $key) {
+ return $value && $key ? min(8, ($key + $value) / 2) : false;
+ };
+
+ return max(array_map($scoreEntry, $valueScores, $keyScores));
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return boolean
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('[..., %s => %s, ...]', $this->key, $this->value);
+ }
+
+ /**
+ * Returns key
+ *
+ * @return TokenInterface
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * Returns value
+ *
+ * @return TokenInterface
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Wraps non token $value into ExactValueToken
+ *
+ * @param $value
+ * @return TokenInterface
+ */
+ private function wrapIntoExactValueToken($value)
+ {
+ return $value instanceof TokenInterface ? $value : new ExactValueToken($value);
+ }
+
+ /**
+ * Converts instance of \ArrayAccess to key => value array entry
+ *
+ * @param \ArrayAccess $object
+ *
+ * @return array|null
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ private function convertArrayAccessToEntry(\ArrayAccess $object)
+ {
+ if (!$this->key instanceof ExactValueToken) {
+ throw new InvalidArgumentException(sprintf(
+ 'You can only use exact value tokens to match key of ArrayAccess object'.PHP_EOL.
+ 'But you used `%s`.',
+ $this->key
+ ));
+ }
+
+ $key = $this->key->getValue();
+
+ return $object->offsetExists($key) ? array($key => $object[$key]) : array();
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php
new file mode 100644
index 0000000000..5d41fa487c
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayEveryEntryToken.php
@@ -0,0 +1,82 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Array every entry token.
+ *
+ * @author Adrien Brault
+ */
+class ArrayEveryEntryToken implements TokenInterface
+{
+ /**
+ * @var TokenInterface
+ */
+ private $value;
+
+ /**
+ * @param mixed $value exact value or token
+ */
+ public function __construct($value)
+ {
+ if (!$value instanceof TokenInterface) {
+ $value = new ExactValueToken($value);
+ }
+
+ $this->value = $value;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function scoreArgument($argument)
+ {
+ if (!$argument instanceof \Traversable && !is_array($argument)) {
+ return false;
+ }
+
+ $scores = array();
+ foreach ($argument as $key => $argumentEntry) {
+ $scores[] = $this->value->scoreArgument($argumentEntry);
+ }
+
+ if (empty($scores) || in_array(false, $scores, true)) {
+ return false;
+ }
+
+ return array_sum($scores) / count($scores);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function __toString()
+ {
+ return sprintf('[%s, ..., %s]', $this->value, $this->value);
+ }
+
+ /**
+ * @return TokenInterface
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php
new file mode 100644
index 0000000000..f45ba20bec
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/CallbackToken.php
@@ -0,0 +1,75 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Callback-verified token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallbackToken implements TokenInterface
+{
+ private $callback;
+
+ /**
+ * Initializes token.
+ *
+ * @param callable $callback
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ public function __construct($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new InvalidArgumentException(sprintf(
+ 'Callable expected as an argument to CallbackToken, but got %s.',
+ gettype($callback)
+ ));
+ }
+
+ $this->callback = $callback;
+ }
+
+ /**
+ * Scores 7 if callback returns true, false otherwise.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return call_user_func($this->callback, $argument) ? 7 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return 'callback()';
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php
new file mode 100644
index 0000000000..aa960f3fbc
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php
@@ -0,0 +1,116 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use SebastianBergmann\Comparator\ComparisonFailure;
+use Prophecy\Comparator\Factory as ComparatorFactory;
+use Prophecy\Util\StringUtil;
+
+/**
+ * Exact value token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ExactValueToken implements TokenInterface
+{
+ private $value;
+ private $string;
+ private $util;
+ private $comparatorFactory;
+
+ /**
+ * Initializes token.
+ *
+ * @param mixed $value
+ * @param StringUtil $util
+ * @param ComparatorFactory $comparatorFactory
+ */
+ public function __construct($value, StringUtil $util = null, ComparatorFactory $comparatorFactory = null)
+ {
+ $this->value = $value;
+ $this->util = $util ?: new StringUtil();
+
+ $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
+ }
+
+ /**
+ * Scores 10 if argument matches preset value.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if (is_object($argument) && is_object($this->value)) {
+ $comparator = $this->comparatorFactory->getComparatorFor(
+ $argument, $this->value
+ );
+
+ try {
+ $comparator->assertEquals($argument, $this->value);
+ return 10;
+ } catch (ComparisonFailure $failure) {}
+ }
+
+ // If either one is an object it should be castable to a string
+ if (is_object($argument) xor is_object($this->value)) {
+ if (is_object($argument) && !method_exists($argument, '__toString')) {
+ return false;
+ }
+
+ if (is_object($this->value) && !method_exists($this->value, '__toString')) {
+ return false;
+ }
+ } elseif (is_numeric($argument) && is_numeric($this->value)) {
+ // noop
+ } elseif (gettype($argument) !== gettype($this->value)) {
+ return false;
+ }
+
+ return $argument == $this->value ? 10 : false;
+ }
+
+ /**
+ * Returns preset value against which token checks arguments.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (null === $this->string) {
+ $this->string = sprintf('exact(%s)', $this->util->stringify($this->value));
+ }
+
+ return $this->string;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php
new file mode 100644
index 0000000000..0b6d23ab66
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/IdenticalValueToken.php
@@ -0,0 +1,74 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Util\StringUtil;
+
+/**
+ * Identical value token.
+ *
+ * @author Florian Voutzinos
+ */
+class IdenticalValueToken implements TokenInterface
+{
+ private $value;
+ private $string;
+ private $util;
+
+ /**
+ * Initializes token.
+ *
+ * @param mixed $value
+ * @param StringUtil $util
+ */
+ public function __construct($value, StringUtil $util = null)
+ {
+ $this->value = $value;
+ $this->util = $util ?: new StringUtil();
+ }
+
+ /**
+ * Scores 11 if argument matches preset value.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return $argument === $this->value ? 11 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (null === $this->string) {
+ $this->string = sprintf('identical(%s)', $this->util->stringify($this->value));
+ }
+
+ return $this->string;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php
new file mode 100644
index 0000000000..4ee1b25e11
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalAndToken.php
@@ -0,0 +1,80 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Logical AND token.
+ *
+ * @author Boris Mikhaylov
+ */
+class LogicalAndToken implements TokenInterface
+{
+ private $tokens = array();
+
+ /**
+ * @param array $arguments exact values or tokens
+ */
+ public function __construct(array $arguments)
+ {
+ foreach ($arguments as $argument) {
+ if (!$argument instanceof TokenInterface) {
+ $argument = new ExactValueToken($argument);
+ }
+ $this->tokens[] = $argument;
+ }
+ }
+
+ /**
+ * Scores maximum score from scores returned by tokens for this argument if all of them score.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if (0 === count($this->tokens)) {
+ return false;
+ }
+
+ $maxScore = 0;
+ foreach ($this->tokens as $token) {
+ $score = $token->scoreArgument($argument);
+ if (false === $score) {
+ return false;
+ }
+ $maxScore = max($score, $maxScore);
+ }
+
+ return $maxScore;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return boolean
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('bool(%s)', implode(' AND ', $this->tokens));
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php
new file mode 100644
index 0000000000..623efa57a7
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/LogicalNotToken.php
@@ -0,0 +1,73 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Logical NOT token.
+ *
+ * @author Boris Mikhaylov
+ */
+class LogicalNotToken implements TokenInterface
+{
+ /** @var \Prophecy\Argument\Token\TokenInterface */
+ private $token;
+
+ /**
+ * @param mixed $value exact value or token
+ */
+ public function __construct($value)
+ {
+ $this->token = $value instanceof TokenInterface? $value : new ExactValueToken($value);
+ }
+
+ /**
+ * Scores 4 when preset token does not match the argument.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ return false === $this->token->scoreArgument($argument) ? 4 : false;
+ }
+
+ /**
+ * Returns true if preset token is last.
+ *
+ * @return bool|int
+ */
+ public function isLast()
+ {
+ return $this->token->isLast();
+ }
+
+ /**
+ * Returns originating token.
+ *
+ * @return TokenInterface
+ */
+ public function getOriginatingToken()
+ {
+ return $this->token;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('not(%s)', $this->token);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php
new file mode 100644
index 0000000000..d771077676
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php
@@ -0,0 +1,104 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use SebastianBergmann\Comparator\ComparisonFailure;
+use Prophecy\Comparator\Factory as ComparatorFactory;
+use Prophecy\Util\StringUtil;
+
+/**
+ * Object state-checker token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ObjectStateToken implements TokenInterface
+{
+ private $name;
+ private $value;
+ private $util;
+ private $comparatorFactory;
+
+ /**
+ * Initializes token.
+ *
+ * @param string $methodName
+ * @param mixed $value Expected return value
+ * @param null|StringUtil $util
+ * @param ComparatorFactory $comparatorFactory
+ */
+ public function __construct(
+ $methodName,
+ $value,
+ StringUtil $util = null,
+ ComparatorFactory $comparatorFactory = null
+ ) {
+ $this->name = $methodName;
+ $this->value = $value;
+ $this->util = $util ?: new StringUtil;
+
+ $this->comparatorFactory = $comparatorFactory ?: ComparatorFactory::getInstance();
+ }
+
+ /**
+ * Scores 8 if argument is an object, which method returns expected value.
+ *
+ * @param mixed $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ if (is_object($argument) && method_exists($argument, $this->name)) {
+ $actual = call_user_func(array($argument, $this->name));
+
+ $comparator = $this->comparatorFactory->getComparatorFor(
+ $this->value, $actual
+ );
+
+ try {
+ $comparator->assertEquals($this->value, $actual);
+ return 8;
+ } catch (ComparisonFailure $failure) {
+ return false;
+ }
+ }
+
+ if (is_object($argument) && property_exists($argument, $this->name)) {
+ return $argument->{$this->name} === $this->value ? 8 : false;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('state(%s(), %s)',
+ $this->name,
+ $this->util->stringify($this->value)
+ );
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php
new file mode 100644
index 0000000000..24ff8c2ecf
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/StringContainsToken.php
@@ -0,0 +1,67 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * String contains token.
+ *
+ * @author Peter Mitchell
+ */
+class StringContainsToken implements TokenInterface
+{
+ private $value;
+
+ /**
+ * Initializes token.
+ *
+ * @param string $value
+ */
+ public function __construct($value)
+ {
+ $this->value = $value;
+ }
+
+ public function scoreArgument($argument)
+ {
+ return strpos($argument, $this->value) !== false ? 6 : false;
+ }
+
+ /**
+ * Returns preset value against which token checks arguments.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('contains("%s")', $this->value);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php
new file mode 100644
index 0000000000..625d3bad22
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TokenInterface.php
@@ -0,0 +1,43 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+/**
+ * Argument token interface.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface TokenInterface
+{
+ /**
+ * Calculates token match score for provided argument.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument);
+
+ /**
+ * Returns true if this token prevents check of other tokens (is last one).
+ *
+ * @return bool|int
+ */
+ public function isLast();
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString();
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php
new file mode 100644
index 0000000000..cb65132ca0
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Argument/Token/TypeToken.php
@@ -0,0 +1,76 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Argument\Token;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Value type token.
+ *
+ * @author Konstantin Kudryashov
+ */
+class TypeToken implements TokenInterface
+{
+ private $type;
+
+ /**
+ * @param string $type
+ */
+ public function __construct($type)
+ {
+ $checker = "is_{$type}";
+ if (!function_exists($checker) && !interface_exists($type) && !class_exists($type)) {
+ throw new InvalidArgumentException(sprintf(
+ 'Type or class name expected as an argument to TypeToken, but got %s.', $type
+ ));
+ }
+
+ $this->type = $type;
+ }
+
+ /**
+ * Scores 5 if argument has the same type this token was constructed with.
+ *
+ * @param $argument
+ *
+ * @return bool|int
+ */
+ public function scoreArgument($argument)
+ {
+ $checker = "is_{$this->type}";
+ if (function_exists($checker)) {
+ return call_user_func($checker, $argument) ? 5 : false;
+ }
+
+ return $argument instanceof $this->type ? 5 : false;
+ }
+
+ /**
+ * Returns false.
+ *
+ * @return bool
+ */
+ public function isLast()
+ {
+ return false;
+ }
+
+ /**
+ * Returns string representation for token.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return sprintf('type(%s)', $this->type);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php b/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php
new file mode 100644
index 0000000000..2f3fbadb1a
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Call/Call.php
@@ -0,0 +1,127 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Call;
+
+use Exception;
+
+/**
+ * Call object.
+ *
+ * @author Konstantin Kudryashov
+ */
+class Call
+{
+ private $methodName;
+ private $arguments;
+ private $returnValue;
+ private $exception;
+ private $file;
+ private $line;
+
+ /**
+ * Initializes call.
+ *
+ * @param string $methodName
+ * @param array $arguments
+ * @param mixed $returnValue
+ * @param Exception $exception
+ * @param null|string $file
+ * @param null|int $line
+ */
+ public function __construct($methodName, array $arguments, $returnValue,
+ Exception $exception = null, $file, $line)
+ {
+ $this->methodName = $methodName;
+ $this->arguments = $arguments;
+ $this->returnValue = $returnValue;
+ $this->exception = $exception;
+
+ if ($file) {
+ $this->file = $file;
+ $this->line = intval($line);
+ }
+ }
+
+ /**
+ * Returns called method name.
+ *
+ * @return string
+ */
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+
+ /**
+ * Returns called method arguments.
+ *
+ * @return array
+ */
+ public function getArguments()
+ {
+ return $this->arguments;
+ }
+
+ /**
+ * Returns called method return value.
+ *
+ * @return null|mixed
+ */
+ public function getReturnValue()
+ {
+ return $this->returnValue;
+ }
+
+ /**
+ * Returns exception that call thrown.
+ *
+ * @return null|Exception
+ */
+ public function getException()
+ {
+ return $this->exception;
+ }
+
+ /**
+ * Returns callee filename.
+ *
+ * @return string
+ */
+ public function getFile()
+ {
+ return $this->file;
+ }
+
+ /**
+ * Returns callee line number.
+ *
+ * @return int
+ */
+ public function getLine()
+ {
+ return $this->line;
+ }
+
+ /**
+ * Returns short notation for callee place.
+ *
+ * @return string
+ */
+ public function getCallPlace()
+ {
+ if (null === $this->file) {
+ return 'unknown';
+ }
+
+ return sprintf('%s:%d', $this->file, $this->line);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php b/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php
new file mode 100644
index 0000000000..53b80f058b
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php
@@ -0,0 +1,171 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Call;
+
+use Prophecy\Exception\Prophecy\MethodProphecyException;
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Argument\ArgumentsWildcard;
+use Prophecy\Util\StringUtil;
+use Prophecy\Exception\Call\UnexpectedCallException;
+
+/**
+ * Calls receiver & manager.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallCenter
+{
+ private $util;
+
+ /**
+ * @var Call[]
+ */
+ private $recordedCalls = array();
+
+ /**
+ * Initializes call center.
+ *
+ * @param StringUtil $util
+ */
+ public function __construct(StringUtil $util = null)
+ {
+ $this->util = $util ?: new StringUtil;
+ }
+
+ /**
+ * Makes and records specific method call for object prophecy.
+ *
+ * @param ObjectProphecy $prophecy
+ * @param string $methodName
+ * @param array $arguments
+ *
+ * @return mixed Returns null if no promise for prophecy found or promise return value.
+ *
+ * @throws \Prophecy\Exception\Call\UnexpectedCallException If no appropriate method prophecy found
+ */
+ public function makeCall(ObjectProphecy $prophecy, $methodName, array $arguments)
+ {
+ // For efficiency exclude 'args' from the generated backtrace
+ if (PHP_VERSION_ID >= 50400) {
+ // Limit backtrace to last 3 calls as we don't use the rest
+ // Limit argument was introduced in PHP 5.4.0
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
+ } elseif (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) {
+ // DEBUG_BACKTRACE_IGNORE_ARGS was introduced in PHP 5.3.6
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
+ } else {
+ $backtrace = debug_backtrace();
+ }
+
+ $file = $line = null;
+ if (isset($backtrace[2]) && isset($backtrace[2]['file'])) {
+ $file = $backtrace[2]['file'];
+ $line = $backtrace[2]['line'];
+ }
+
+ // If no method prophecies defined, then it's a dummy, so we'll just return null
+ if ('__destruct' === $methodName || 0 == count($prophecy->getMethodProphecies())) {
+ $this->recordedCalls[] = new Call($methodName, $arguments, null, null, $file, $line);
+
+ return null;
+ }
+
+ // There are method prophecies, so it's a fake/stub. Searching prophecy for this call
+ $matches = array();
+ foreach ($prophecy->getMethodProphecies($methodName) as $methodProphecy) {
+ if (0 < $score = $methodProphecy->getArgumentsWildcard()->scoreArguments($arguments)) {
+ $matches[] = array($score, $methodProphecy);
+ }
+ }
+
+ // If fake/stub doesn't have method prophecy for this call - throw exception
+ if (!count($matches)) {
+ throw $this->createUnexpectedCallException($prophecy, $methodName, $arguments);
+ }
+
+ // Sort matches by their score value
+ @usort($matches, function ($match1, $match2) { return $match2[0] - $match1[0]; });
+
+ // If Highest rated method prophecy has a promise - execute it or return null instead
+ $methodProphecy = $matches[0][1];
+ $returnValue = null;
+ $exception = null;
+ if ($promise = $methodProphecy->getPromise()) {
+ try {
+ $returnValue = $promise->execute($arguments, $prophecy, $methodProphecy);
+ } catch (\Exception $e) {
+ $exception = $e;
+ }
+ }
+
+ if ($methodProphecy->hasReturnVoid() && $returnValue !== null) {
+ throw new MethodProphecyException(
+ "The method \"$methodName\" has a void return type, but the promise returned a value",
+ $methodProphecy
+ );
+ }
+
+ $this->recordedCalls[] = new Call(
+ $methodName, $arguments, $returnValue, $exception, $file, $line
+ );
+
+ if (null !== $exception) {
+ throw $exception;
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Searches for calls by method name & arguments wildcard.
+ *
+ * @param string $methodName
+ * @param ArgumentsWildcard $wildcard
+ *
+ * @return Call[]
+ */
+ public function findCalls($methodName, ArgumentsWildcard $wildcard)
+ {
+ return array_values(
+ array_filter($this->recordedCalls, function (Call $call) use ($methodName, $wildcard) {
+ return $methodName === $call->getMethodName()
+ && 0 < $wildcard->scoreArguments($call->getArguments())
+ ;
+ })
+ );
+ }
+
+ private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName,
+ array $arguments)
+ {
+ $classname = get_class($prophecy->reveal());
+ $argstring = implode(', ', array_map(array($this->util, 'stringify'), $arguments));
+ $expected = implode("\n", array_map(function (MethodProphecy $methodProphecy) {
+ return sprintf(' - %s(%s)',
+ $methodProphecy->getMethodName(),
+ $methodProphecy->getArgumentsWildcard()
+ );
+ }, call_user_func_array('array_merge', $prophecy->getMethodProphecies())));
+
+ return new UnexpectedCallException(
+ sprintf(
+ "Method call:\n".
+ " - %s(%s)\n".
+ "on %s was not expected, expected calls were:\n%s",
+
+ $methodName, $argstring, $classname, $expected
+ ),
+ $prophecy, $methodName, $arguments
+ );
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/ClosureComparator.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/ClosureComparator.php
new file mode 100644
index 0000000000..874e474cc3
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Comparator/ClosureComparator.php
@@ -0,0 +1,42 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Comparator;
+
+use SebastianBergmann\Comparator\Comparator;
+use SebastianBergmann\Comparator\ComparisonFailure;
+
+/**
+ * Closure comparator.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class ClosureComparator extends Comparator
+{
+ public function accepts($expected, $actual)
+ {
+ return is_object($expected) && $expected instanceof \Closure
+ && is_object($actual) && $actual instanceof \Closure;
+ }
+
+ public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)
+ {
+ throw new ComparisonFailure(
+ $expected,
+ $actual,
+ // we don't need a diff
+ '',
+ '',
+ false,
+ 'all closures are born different'
+ );
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php
new file mode 100644
index 0000000000..2070db142b
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php
@@ -0,0 +1,47 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Comparator;
+
+use SebastianBergmann\Comparator\Factory as BaseFactory;
+
+/**
+ * Prophecy comparator factory.
+ *
+ * @author Konstantin Kudryashov
+ */
+final class Factory extends BaseFactory
+{
+ /**
+ * @var Factory
+ */
+ private static $instance;
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->register(new ClosureComparator());
+ $this->register(new ProphecyComparator());
+ }
+
+ /**
+ * @return Factory
+ */
+ public static function getInstance()
+ {
+ if (self::$instance === null) {
+ self::$instance = new Factory;
+ }
+
+ return self::$instance;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php
new file mode 100644
index 0000000000..298a8e3568
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php
@@ -0,0 +1,28 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Comparator;
+
+use Prophecy\Prophecy\ProphecyInterface;
+use SebastianBergmann\Comparator\ObjectComparator;
+
+class ProphecyComparator extends ObjectComparator
+{
+ public function accepts($expected, $actual)
+ {
+ return is_object($expected) && is_object($actual) && $actual instanceof ProphecyInterface;
+ }
+
+ public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
+ {
+ parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
new file mode 100644
index 0000000000..d6b6b1a9e0
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
@@ -0,0 +1,68 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler;
+
+use ReflectionClass;
+
+/**
+ * Cached class doubler.
+ * Prevents mirroring/creation of the same structure twice.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CachedDoubler extends Doubler
+{
+ private $classes = array();
+
+ /**
+ * {@inheritdoc}
+ */
+ public function registerClassPatch(ClassPatch\ClassPatchInterface $patch)
+ {
+ $this->classes[] = array();
+
+ parent::registerClassPatch($patch);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function createDoubleClass(ReflectionClass $class = null, array $interfaces)
+ {
+ $classId = $this->generateClassId($class, $interfaces);
+ if (isset($this->classes[$classId])) {
+ return $this->classes[$classId];
+ }
+
+ return $this->classes[$classId] = parent::createDoubleClass($class, $interfaces);
+ }
+
+ /**
+ * @param ReflectionClass $class
+ * @param ReflectionClass[] $interfaces
+ *
+ * @return string
+ */
+ private function generateClassId(ReflectionClass $class = null, array $interfaces)
+ {
+ $parts = array();
+ if (null !== $class) {
+ $parts[] = $class->getName();
+ }
+ foreach ($interfaces as $interface) {
+ $parts[] = $interface->getName();
+ }
+ sort($parts);
+
+ return md5(implode('', $parts));
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php
new file mode 100644
index 0000000000..d6d196850c
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ClassPatchInterface.php
@@ -0,0 +1,48 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+
+/**
+ * Class patch interface.
+ * Class patches extend doubles functionality or help
+ * Prophecy to avoid some internal PHP bugs.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface ClassPatchInterface
+{
+ /**
+ * Checks if patch supports specific class node.
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node);
+
+ /**
+ * Applies patch to the specific class node.
+ *
+ * @param ClassNode $node
+ * @return void
+ */
+ public function apply(ClassNode $node);
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return int Priority number (higher - earlier)
+ */
+ public function getPriority();
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php
new file mode 100644
index 0000000000..61998fc462
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/DisableConstructorPatch.php
@@ -0,0 +1,72 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+use Prophecy\Doubler\Generator\Node\MethodNode;
+
+/**
+ * Disable constructor.
+ * Makes all constructor arguments optional.
+ *
+ * @author Konstantin Kudryashov
+ */
+class DisableConstructorPatch implements ClassPatchInterface
+{
+ /**
+ * Checks if class has `__construct` method.
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node)
+ {
+ return true;
+ }
+
+ /**
+ * Makes all class constructor arguments optional.
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ if (!$node->hasMethod('__construct')) {
+ $node->addMethod(new MethodNode('__construct', ''));
+
+ return;
+ }
+
+ $constructor = $node->getMethod('__construct');
+ foreach ($constructor->getArguments() as $argument) {
+ $argument->setDefault(null);
+ }
+
+ $constructor->setCode(<<
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+
+/**
+ * Exception patch for HHVM to remove the stubs from special methods
+ *
+ * @author Christophe Coevoet
+ */
+class HhvmExceptionPatch implements ClassPatchInterface
+{
+ /**
+ * Supports exceptions on HHVM.
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node)
+ {
+ if (!defined('HHVM_VERSION')) {
+ return false;
+ }
+
+ return 'Exception' === $node->getParentClass() || is_subclass_of($node->getParentClass(), 'Exception');
+ }
+
+ /**
+ * Removes special exception static methods from the doubled methods.
+ *
+ * @param ClassNode $node
+ *
+ * @return void
+ */
+ public function apply(ClassNode $node)
+ {
+ if ($node->hasMethod('setTraceOptions')) {
+ $node->getMethod('setTraceOptions')->useParentCode();
+ }
+ if ($node->hasMethod('getTraceOptions')) {
+ $node->getMethod('getTraceOptions')->useParentCode();
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getPriority()
+ {
+ return -50;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php
new file mode 100644
index 0000000000..b0d9793aa4
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/KeywordPatch.php
@@ -0,0 +1,135 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+
+/**
+ * Remove method functionality from the double which will clash with php keywords.
+ *
+ * @author Milan Magudia
+ */
+class KeywordPatch implements ClassPatchInterface
+{
+ /**
+ * Support any class
+ *
+ * @param ClassNode $node
+ *
+ * @return boolean
+ */
+ public function supports(ClassNode $node)
+ {
+ return true;
+ }
+
+ /**
+ * Remove methods that clash with php keywords
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ $methodNames = array_keys($node->getMethods());
+ $methodsToRemove = array_intersect($methodNames, $this->getKeywords());
+ foreach ($methodsToRemove as $methodName) {
+ $node->removeMethod($methodName);
+ }
+ }
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return int Priority number (higher - earlier)
+ */
+ public function getPriority() {
+ return 49;
+ }
+
+ /**
+ * Returns array of php keywords.
+ *
+ * @return array
+ */
+ private function getKeywords() {
+
+ return array(
+ '__halt_compiler',
+ 'abstract',
+ 'and',
+ 'array',
+ 'as',
+ 'break',
+ 'callable',
+ 'case',
+ 'catch',
+ 'class',
+ 'clone',
+ 'const',
+ 'continue',
+ 'declare',
+ 'default',
+ 'die',
+ 'do',
+ 'echo',
+ 'else',
+ 'elseif',
+ 'empty',
+ 'enddeclare',
+ 'endfor',
+ 'endforeach',
+ 'endif',
+ 'endswitch',
+ 'endwhile',
+ 'eval',
+ 'exit',
+ 'extends',
+ 'final',
+ 'finally',
+ 'for',
+ 'foreach',
+ 'function',
+ 'global',
+ 'goto',
+ 'if',
+ 'implements',
+ 'include',
+ 'include_once',
+ 'instanceof',
+ 'insteadof',
+ 'interface',
+ 'isset',
+ 'list',
+ 'namespace',
+ 'new',
+ 'or',
+ 'print',
+ 'private',
+ 'protected',
+ 'public',
+ 'require',
+ 'require_once',
+ 'return',
+ 'static',
+ 'switch',
+ 'throw',
+ 'trait',
+ 'try',
+ 'unset',
+ 'use',
+ 'var',
+ 'while',
+ 'xor',
+ 'yield',
+ );
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php
new file mode 100644
index 0000000000..5f2c607719
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php
@@ -0,0 +1,89 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+use Prophecy\Doubler\Generator\Node\MethodNode;
+use Prophecy\PhpDocumentor\ClassAndInterfaceTagRetriever;
+use Prophecy\PhpDocumentor\MethodTagRetrieverInterface;
+
+/**
+ * Discover Magical API using "@method" PHPDoc format.
+ *
+ * @author Thomas Tourlourat
+ * @author Kévin Dunglas
+ * @author Théo FIDRY
+ */
+class MagicCallPatch implements ClassPatchInterface
+{
+ private $tagRetriever;
+
+ public function __construct(MethodTagRetrieverInterface $tagRetriever = null)
+ {
+ $this->tagRetriever = null === $tagRetriever ? new ClassAndInterfaceTagRetriever() : $tagRetriever;
+ }
+
+ /**
+ * Support any class
+ *
+ * @param ClassNode $node
+ *
+ * @return boolean
+ */
+ public function supports(ClassNode $node)
+ {
+ return true;
+ }
+
+ /**
+ * Discover Magical API
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ $types = array_filter($node->getInterfaces(), function ($interface) {
+ return 0 !== strpos($interface, 'Prophecy\\');
+ });
+ $types[] = $node->getParentClass();
+
+ foreach ($types as $type) {
+ $reflectionClass = new \ReflectionClass($type);
+ $tagList = $this->tagRetriever->getTagList($reflectionClass);
+
+ foreach($tagList as $tag) {
+ $methodName = $tag->getMethodName();
+
+ if (empty($methodName)) {
+ continue;
+ }
+
+ if (!$reflectionClass->hasMethod($methodName)) {
+ $methodNode = new MethodNode($methodName);
+ $methodNode->setStatic($tag->isStatic());
+ $node->addMethod($methodNode);
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return integer Priority number (higher - earlier)
+ */
+ public function getPriority()
+ {
+ return 50;
+ }
+}
+
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php
new file mode 100644
index 0000000000..fc2cc4de48
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php
@@ -0,0 +1,104 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+use Prophecy\Doubler\Generator\Node\MethodNode;
+use Prophecy\Doubler\Generator\Node\ArgumentNode;
+
+/**
+ * Add Prophecy functionality to the double.
+ * This is a core class patch for Prophecy.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ProphecySubjectPatch implements ClassPatchInterface
+{
+ /**
+ * Always returns true.
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node)
+ {
+ return true;
+ }
+
+ /**
+ * Apply Prophecy functionality to class node.
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ $node->addInterface('Prophecy\Prophecy\ProphecySubjectInterface');
+ $node->addProperty('objectProphecy', 'private');
+
+ foreach ($node->getMethods() as $name => $method) {
+ if ('__construct' === strtolower($name)) {
+ continue;
+ }
+
+ if ($method->getReturnType() === 'void') {
+ $method->setCode(
+ '$this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());'
+ );
+ } else {
+ $method->setCode(
+ 'return $this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());'
+ );
+ }
+ }
+
+ $prophecySetter = new MethodNode('setProphecy');
+ $prophecyArgument = new ArgumentNode('prophecy');
+ $prophecyArgument->setTypeHint('Prophecy\Prophecy\ProphecyInterface');
+ $prophecySetter->addArgument($prophecyArgument);
+ $prophecySetter->setCode('$this->objectProphecy = $prophecy;');
+
+ $prophecyGetter = new MethodNode('getProphecy');
+ $prophecyGetter->setCode('return $this->objectProphecy;');
+
+ if ($node->hasMethod('__call')) {
+ $__call = $node->getMethod('__call');
+ } else {
+ $__call = new MethodNode('__call');
+ $__call->addArgument(new ArgumentNode('name'));
+ $__call->addArgument(new ArgumentNode('arguments'));
+
+ $node->addMethod($__call);
+ }
+
+ $__call->setCode(<<getProphecy(), func_get_arg(0)
+);
+PHP
+ );
+
+ $node->addMethod($prophecySetter);
+ $node->addMethod($prophecyGetter);
+ }
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return int Priority number (higher - earlier)
+ */
+ public function getPriority()
+ {
+ return 0;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php
new file mode 100644
index 0000000000..9166aeefac
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php
@@ -0,0 +1,57 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+
+/**
+ * ReflectionClass::newInstance patch.
+ * Makes first argument of newInstance optional, since it works but signature is misleading
+ *
+ * @author Florian Klein
+ */
+class ReflectionClassNewInstancePatch implements ClassPatchInterface
+{
+ /**
+ * Supports ReflectionClass
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node)
+ {
+ return 'ReflectionClass' === $node->getParentClass();
+ }
+
+ /**
+ * Updates newInstance's first argument to make it optional
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ foreach ($node->getMethod('newInstance')->getArguments() as $argument) {
+ $argument->setDefault(null);
+ }
+ }
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return int Priority number (higher = earlier)
+ */
+ public function getPriority()
+ {
+ return 50;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php
new file mode 100644
index 0000000000..eba82980d0
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php
@@ -0,0 +1,105 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+use Prophecy\Doubler\Generator\Node\MethodNode;
+
+/**
+ * SplFileInfo patch.
+ * Makes SplFileInfo and derivative classes usable with Prophecy.
+ *
+ * @author Konstantin Kudryashov
+ */
+class SplFileInfoPatch implements ClassPatchInterface
+{
+ /**
+ * Supports everything that extends SplFileInfo.
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node)
+ {
+ if (null === $node->getParentClass()) {
+ return false;
+ }
+
+ return 'SplFileInfo' === $node->getParentClass()
+ || is_subclass_of($node->getParentClass(), 'SplFileInfo')
+ ;
+ }
+
+ /**
+ * Updated constructor code to call parent one with dummy file argument.
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ if ($node->hasMethod('__construct')) {
+ $constructor = $node->getMethod('__construct');
+ } else {
+ $constructor = new MethodNode('__construct');
+ $node->addMethod($constructor);
+ }
+
+ if ($this->nodeIsDirectoryIterator($node)) {
+ $constructor->setCode('return parent::__construct("' . __DIR__ . '");');
+
+ return;
+ }
+
+ if ($this->nodeIsSplFileObject($node)) {
+ $constructor->setCode('return parent::__construct("' . __FILE__ .'");');
+
+ return;
+ }
+
+ $constructor->useParentCode();
+ }
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return int Priority number (higher - earlier)
+ */
+ public function getPriority()
+ {
+ return 50;
+ }
+
+ /**
+ * @param ClassNode $node
+ * @return boolean
+ */
+ private function nodeIsDirectoryIterator(ClassNode $node)
+ {
+ $parent = $node->getParentClass();
+
+ return 'DirectoryIterator' === $parent
+ || is_subclass_of($parent, 'DirectoryIterator');
+ }
+
+ /**
+ * @param ClassNode $node
+ * @return boolean
+ */
+ private function nodeIsSplFileObject(ClassNode $node)
+ {
+ $parent = $node->getParentClass();
+
+ return 'SplFileObject' === $parent
+ || is_subclass_of($parent, 'SplFileObject');
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php
new file mode 100644
index 0000000000..eea0202825
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php
@@ -0,0 +1,83 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\ClassPatch;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+use Prophecy\Doubler\Generator\Node\MethodNode;
+
+/**
+ * Traversable interface patch.
+ * Forces classes that implement interfaces, that extend Traversable to also implement Iterator.
+ *
+ * @author Konstantin Kudryashov
+ */
+class TraversablePatch implements ClassPatchInterface
+{
+ /**
+ * Supports nodetree, that implement Traversable, but not Iterator or IteratorAggregate.
+ *
+ * @param ClassNode $node
+ *
+ * @return bool
+ */
+ public function supports(ClassNode $node)
+ {
+ if (in_array('Iterator', $node->getInterfaces())) {
+ return false;
+ }
+ if (in_array('IteratorAggregate', $node->getInterfaces())) {
+ return false;
+ }
+
+ foreach ($node->getInterfaces() as $interface) {
+ if ('Traversable' !== $interface && !is_subclass_of($interface, 'Traversable')) {
+ continue;
+ }
+ if ('Iterator' === $interface || is_subclass_of($interface, 'Iterator')) {
+ continue;
+ }
+ if ('IteratorAggregate' === $interface || is_subclass_of($interface, 'IteratorAggregate')) {
+ continue;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Forces class to implement Iterator interface.
+ *
+ * @param ClassNode $node
+ */
+ public function apply(ClassNode $node)
+ {
+ $node->addInterface('Iterator');
+
+ $node->addMethod(new MethodNode('current'));
+ $node->addMethod(new MethodNode('key'));
+ $node->addMethod(new MethodNode('next'));
+ $node->addMethod(new MethodNode('rewind'));
+ $node->addMethod(new MethodNode('valid'));
+ }
+
+ /**
+ * Returns patch priority, which determines when patch will be applied.
+ *
+ * @return int Priority number (higher - earlier)
+ */
+ public function getPriority()
+ {
+ return 100;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php
new file mode 100644
index 0000000000..699be3a2ad
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/DoubleInterface.php
@@ -0,0 +1,22 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler;
+
+/**
+ * Core double interface.
+ * All doubled classes will implement this one.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface DoubleInterface
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php
new file mode 100644
index 0000000000..a378ae2790
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php
@@ -0,0 +1,146 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler;
+
+use Doctrine\Instantiator\Instantiator;
+use Prophecy\Doubler\ClassPatch\ClassPatchInterface;
+use Prophecy\Doubler\Generator\ClassMirror;
+use Prophecy\Doubler\Generator\ClassCreator;
+use Prophecy\Exception\InvalidArgumentException;
+use ReflectionClass;
+
+/**
+ * Cached class doubler.
+ * Prevents mirroring/creation of the same structure twice.
+ *
+ * @author Konstantin Kudryashov
+ */
+class Doubler
+{
+ private $mirror;
+ private $creator;
+ private $namer;
+
+ /**
+ * @var ClassPatchInterface[]
+ */
+ private $patches = array();
+
+ /**
+ * @var \Doctrine\Instantiator\Instantiator
+ */
+ private $instantiator;
+
+ /**
+ * Initializes doubler.
+ *
+ * @param ClassMirror $mirror
+ * @param ClassCreator $creator
+ * @param NameGenerator $namer
+ */
+ public function __construct(ClassMirror $mirror = null, ClassCreator $creator = null,
+ NameGenerator $namer = null)
+ {
+ $this->mirror = $mirror ?: new ClassMirror;
+ $this->creator = $creator ?: new ClassCreator;
+ $this->namer = $namer ?: new NameGenerator;
+ }
+
+ /**
+ * Returns list of registered class patches.
+ *
+ * @return ClassPatchInterface[]
+ */
+ public function getClassPatches()
+ {
+ return $this->patches;
+ }
+
+ /**
+ * Registers new class patch.
+ *
+ * @param ClassPatchInterface $patch
+ */
+ public function registerClassPatch(ClassPatchInterface $patch)
+ {
+ $this->patches[] = $patch;
+
+ @usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) {
+ return $patch2->getPriority() - $patch1->getPriority();
+ });
+ }
+
+ /**
+ * Creates double from specific class or/and list of interfaces.
+ *
+ * @param ReflectionClass $class
+ * @param ReflectionClass[] $interfaces Array of ReflectionClass instances
+ * @param array $args Constructor arguments
+ *
+ * @return DoubleInterface
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ public function double(ReflectionClass $class = null, array $interfaces, array $args = null)
+ {
+ foreach ($interfaces as $interface) {
+ if (!$interface instanceof ReflectionClass) {
+ throw new InvalidArgumentException(sprintf(
+ "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n".
+ "a second argument to `Doubler::double(...)`, but got %s.",
+ is_object($interface) ? get_class($interface).' class' : gettype($interface)
+ ));
+ }
+ }
+
+ $classname = $this->createDoubleClass($class, $interfaces);
+ $reflection = new ReflectionClass($classname);
+
+ if (null !== $args) {
+ return $reflection->newInstanceArgs($args);
+ }
+ if ((null === $constructor = $reflection->getConstructor())
+ || ($constructor->isPublic() && !$constructor->isFinal())) {
+ return $reflection->newInstance();
+ }
+
+ if (!$this->instantiator) {
+ $this->instantiator = new Instantiator();
+ }
+
+ return $this->instantiator->instantiate($classname);
+ }
+
+ /**
+ * Creates double class and returns its FQN.
+ *
+ * @param ReflectionClass $class
+ * @param ReflectionClass[] $interfaces
+ *
+ * @return string
+ */
+ protected function createDoubleClass(ReflectionClass $class = null, array $interfaces)
+ {
+ $name = $this->namer->name($class, $interfaces);
+ $node = $this->mirror->reflect($class, $interfaces);
+
+ foreach ($this->patches as $patch) {
+ if ($patch->supports($node)) {
+ $patch->apply($node);
+ }
+ }
+
+ $this->creator->create($name, $node);
+
+ return $name;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php
new file mode 100644
index 0000000000..fc1079c5ac
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php
@@ -0,0 +1,145 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator;
+
+/**
+ * Class code creator.
+ * Generates PHP code for specific class node tree.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ClassCodeGenerator
+{
+ /**
+ * Generates PHP code for class node.
+ *
+ * @param string $classname
+ * @param Node\ClassNode $class
+ *
+ * @return string
+ */
+ public function generate($classname, Node\ClassNode $class)
+ {
+ $parts = explode('\\', $classname);
+ $classname = array_pop($parts);
+ $namespace = implode('\\', $parts);
+
+ $code = sprintf("class %s extends \%s implements %s {\n",
+ $classname, $class->getParentClass(), implode(', ',
+ array_map(function ($interface) {return '\\'.$interface;}, $class->getInterfaces())
+ )
+ );
+
+ foreach ($class->getProperties() as $name => $visibility) {
+ $code .= sprintf("%s \$%s;\n", $visibility, $name);
+ }
+ $code .= "\n";
+
+ foreach ($class->getMethods() as $method) {
+ $code .= $this->generateMethod($method)."\n";
+ }
+ $code .= "\n}";
+
+ return sprintf("namespace %s {\n%s\n}", $namespace, $code);
+ }
+
+ private function generateMethod(Node\MethodNode $method)
+ {
+ $php = sprintf("%s %s function %s%s(%s)%s {\n",
+ $method->getVisibility(),
+ $method->isStatic() ? 'static' : '',
+ $method->returnsReference() ? '&':'',
+ $method->getName(),
+ implode(', ', $this->generateArguments($method->getArguments())),
+ $this->getReturnType($method)
+ );
+ $php .= $method->getCode()."\n";
+
+ return $php.'}';
+ }
+
+ /**
+ * @return string
+ */
+ private function getReturnType(Node\MethodNode $method)
+ {
+ if (version_compare(PHP_VERSION, '7.1', '>=')) {
+ if ($method->hasReturnType()) {
+ return $method->hasNullableReturnType()
+ ? sprintf(': ?%s', $method->getReturnType())
+ : sprintf(': %s', $method->getReturnType());
+ }
+ }
+
+ if (version_compare(PHP_VERSION, '7.0', '>=')) {
+ return $method->hasReturnType() && $method->getReturnType() !== 'void'
+ ? sprintf(': %s', $method->getReturnType())
+ : '';
+ }
+
+ return '';
+ }
+
+ private function generateArguments(array $arguments)
+ {
+ return array_map(function (Node\ArgumentNode $argument) {
+ $php = '';
+
+ if (version_compare(PHP_VERSION, '7.1', '>=')) {
+ $php .= $argument->isNullable() ? '?' : '';
+ }
+
+ if ($hint = $argument->getTypeHint()) {
+ switch ($hint) {
+ case 'array':
+ case 'callable':
+ $php .= $hint;
+ break;
+
+ case 'iterable':
+ if (version_compare(PHP_VERSION, '7.1', '>=')) {
+ $php .= $hint;
+ break;
+ }
+
+ $php .= '\\'.$hint;
+ break;
+
+ case 'string':
+ case 'int':
+ case 'float':
+ case 'bool':
+ if (version_compare(PHP_VERSION, '7.0', '>=')) {
+ $php .= $hint;
+ break;
+ }
+ // Fall-through to default case for PHP 5.x
+
+ default:
+ $php .= '\\'.$hint;
+ }
+ }
+
+ $php .= ' '.($argument->isPassedByReference() ? '&' : '');
+
+ $php .= $argument->isVariadic() ? '...' : '';
+
+ $php .= '$'.$argument->getName();
+
+ if ($argument->isOptional() && !$argument->isVariadic()) {
+ $php .= ' = '.var_export($argument->getDefault(), true);
+ }
+
+ return $php;
+ }, $arguments);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php
new file mode 100644
index 0000000000..882a4a4b7f
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php
@@ -0,0 +1,67 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator;
+
+use Prophecy\Exception\Doubler\ClassCreatorException;
+
+/**
+ * Class creator.
+ * Creates specific class in current environment.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ClassCreator
+{
+ private $generator;
+
+ /**
+ * Initializes creator.
+ *
+ * @param ClassCodeGenerator $generator
+ */
+ public function __construct(ClassCodeGenerator $generator = null)
+ {
+ $this->generator = $generator ?: new ClassCodeGenerator;
+ }
+
+ /**
+ * Creates class.
+ *
+ * @param string $classname
+ * @param Node\ClassNode $class
+ *
+ * @return mixed
+ *
+ * @throws \Prophecy\Exception\Doubler\ClassCreatorException
+ */
+ public function create($classname, Node\ClassNode $class)
+ {
+ $code = $this->generator->generate($classname, $class);
+ $return = eval($code);
+
+ if (!class_exists($classname, false)) {
+ if (count($class->getInterfaces())) {
+ throw new ClassCreatorException(sprintf(
+ 'Could not double `%s` and implement interfaces: [%s].',
+ $class->getParentClass(), implode(', ', $class->getInterfaces())
+ ), $class);
+ }
+
+ throw new ClassCreatorException(
+ sprintf('Could not double `%s`.', $class->getParentClass()),
+ $class
+ );
+ }
+
+ return $return;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php
new file mode 100644
index 0000000000..9f99239f69
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php
@@ -0,0 +1,258 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator;
+
+use Prophecy\Exception\InvalidArgumentException;
+use Prophecy\Exception\Doubler\ClassMirrorException;
+use ReflectionClass;
+use ReflectionMethod;
+use ReflectionParameter;
+
+/**
+ * Class mirror.
+ * Core doubler class. Mirrors specific class and/or interfaces into class node tree.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ClassMirror
+{
+ private static $reflectableMethods = array(
+ '__construct',
+ '__destruct',
+ '__sleep',
+ '__wakeup',
+ '__toString',
+ '__call',
+ '__invoke'
+ );
+
+ /**
+ * Reflects provided arguments into class node.
+ *
+ * @param ReflectionClass $class
+ * @param ReflectionClass[] $interfaces
+ *
+ * @return Node\ClassNode
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ public function reflect(ReflectionClass $class = null, array $interfaces)
+ {
+ $node = new Node\ClassNode;
+
+ if (null !== $class) {
+ if (true === $class->isInterface()) {
+ throw new InvalidArgumentException(sprintf(
+ "Could not reflect %s as a class, because it\n".
+ "is interface - use the second argument instead.",
+ $class->getName()
+ ));
+ }
+
+ $this->reflectClassToNode($class, $node);
+ }
+
+ foreach ($interfaces as $interface) {
+ if (!$interface instanceof ReflectionClass) {
+ throw new InvalidArgumentException(sprintf(
+ "[ReflectionClass \$interface1 [, ReflectionClass \$interface2]] array expected as\n".
+ "a second argument to `ClassMirror::reflect(...)`, but got %s.",
+ is_object($interface) ? get_class($interface).' class' : gettype($interface)
+ ));
+ }
+ if (false === $interface->isInterface()) {
+ throw new InvalidArgumentException(sprintf(
+ "Could not reflect %s as an interface, because it\n".
+ "is class - use the first argument instead.",
+ $interface->getName()
+ ));
+ }
+
+ $this->reflectInterfaceToNode($interface, $node);
+ }
+
+ $node->addInterface('Prophecy\Doubler\Generator\ReflectionInterface');
+
+ return $node;
+ }
+
+ private function reflectClassToNode(ReflectionClass $class, Node\ClassNode $node)
+ {
+ if (true === $class->isFinal()) {
+ throw new ClassMirrorException(sprintf(
+ 'Could not reflect class %s as it is marked final.', $class->getName()
+ ), $class);
+ }
+
+ $node->setParentClass($class->getName());
+
+ foreach ($class->getMethods(ReflectionMethod::IS_ABSTRACT) as $method) {
+ if (false === $method->isProtected()) {
+ continue;
+ }
+
+ $this->reflectMethodToNode($method, $node);
+ }
+
+ foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
+ if (0 === strpos($method->getName(), '_')
+ && !in_array($method->getName(), self::$reflectableMethods)) {
+ continue;
+ }
+
+ if (true === $method->isFinal()) {
+ $node->addUnextendableMethod($method->getName());
+ continue;
+ }
+
+ $this->reflectMethodToNode($method, $node);
+ }
+ }
+
+ private function reflectInterfaceToNode(ReflectionClass $interface, Node\ClassNode $node)
+ {
+ $node->addInterface($interface->getName());
+
+ foreach ($interface->getMethods() as $method) {
+ $this->reflectMethodToNode($method, $node);
+ }
+ }
+
+ private function reflectMethodToNode(ReflectionMethod $method, Node\ClassNode $classNode)
+ {
+ $node = new Node\MethodNode($method->getName());
+
+ if (true === $method->isProtected()) {
+ $node->setVisibility('protected');
+ }
+
+ if (true === $method->isStatic()) {
+ $node->setStatic();
+ }
+
+ if (true === $method->returnsReference()) {
+ $node->setReturnsReference();
+ }
+
+ if (version_compare(PHP_VERSION, '7.0', '>=') && $method->hasReturnType()) {
+ $returnType = (string) $method->getReturnType();
+ $returnTypeLower = strtolower($returnType);
+
+ if ('self' === $returnTypeLower) {
+ $returnType = $method->getDeclaringClass()->getName();
+ }
+ if ('parent' === $returnTypeLower) {
+ $returnType = $method->getDeclaringClass()->getParentClass()->getName();
+ }
+
+ $node->setReturnType($returnType);
+
+ if (version_compare(PHP_VERSION, '7.1', '>=') && $method->getReturnType()->allowsNull()) {
+ $node->setNullableReturnType(true);
+ }
+ }
+
+ if (is_array($params = $method->getParameters()) && count($params)) {
+ foreach ($params as $param) {
+ $this->reflectArgumentToNode($param, $node);
+ }
+ }
+
+ $classNode->addMethod($node);
+ }
+
+ private function reflectArgumentToNode(ReflectionParameter $parameter, Node\MethodNode $methodNode)
+ {
+ $name = $parameter->getName() == '...' ? '__dot_dot_dot__' : $parameter->getName();
+ $node = new Node\ArgumentNode($name);
+
+ $node->setTypeHint($this->getTypeHint($parameter));
+
+ if ($this->isVariadic($parameter)) {
+ $node->setAsVariadic();
+ }
+
+ if ($this->hasDefaultValue($parameter)) {
+ $node->setDefault($this->getDefaultValue($parameter));
+ }
+
+ if ($parameter->isPassedByReference()) {
+ $node->setAsPassedByReference();
+ }
+
+ $methodNode->addArgument($node);
+ }
+
+ private function hasDefaultValue(ReflectionParameter $parameter)
+ {
+ if ($this->isVariadic($parameter)) {
+ return false;
+ }
+
+ if ($parameter->isDefaultValueAvailable()) {
+ return true;
+ }
+
+ return $parameter->isOptional() || $this->isNullable($parameter);
+ }
+
+ private function getDefaultValue(ReflectionParameter $parameter)
+ {
+ if (!$parameter->isDefaultValueAvailable()) {
+ return null;
+ }
+
+ return $parameter->getDefaultValue();
+ }
+
+ private function getTypeHint(ReflectionParameter $parameter)
+ {
+ if (null !== $className = $this->getParameterClassName($parameter)) {
+ return $className;
+ }
+
+ if (true === $parameter->isArray()) {
+ return 'array';
+ }
+
+ if (version_compare(PHP_VERSION, '5.4', '>=') && true === $parameter->isCallable()) {
+ return 'callable';
+ }
+
+ if (version_compare(PHP_VERSION, '7.0', '>=') && true === $parameter->hasType()) {
+ return (string) $parameter->getType();
+ }
+
+ return null;
+ }
+
+ private function isVariadic(ReflectionParameter $parameter)
+ {
+ return PHP_VERSION_ID >= 50600 && $parameter->isVariadic();
+ }
+
+ private function isNullable(ReflectionParameter $parameter)
+ {
+ return $parameter->allowsNull() && null !== $this->getTypeHint($parameter);
+ }
+
+ private function getParameterClassName(ReflectionParameter $parameter)
+ {
+ try {
+ return $parameter->getClass() ? $parameter->getClass()->getName() : null;
+ } catch (\ReflectionException $e) {
+ preg_match('/\[\s\<\w+?>\s([\w,\\\]+)/s', $parameter, $matches);
+
+ return isset($matches[1]) ? $matches[1] : null;
+ }
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php
new file mode 100644
index 0000000000..dd29b68fca
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ArgumentNode.php
@@ -0,0 +1,102 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator\Node;
+
+/**
+ * Argument node.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ArgumentNode
+{
+ private $name;
+ private $typeHint;
+ private $default;
+ private $optional = false;
+ private $byReference = false;
+ private $isVariadic = false;
+ private $isNullable = false;
+
+ /**
+ * @param string $name
+ */
+ public function __construct($name)
+ {
+ $this->name = $name;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function getTypeHint()
+ {
+ return $this->typeHint;
+ }
+
+ public function setTypeHint($typeHint = null)
+ {
+ $this->typeHint = $typeHint;
+ }
+
+ public function hasDefault()
+ {
+ return $this->isOptional() && !$this->isVariadic();
+ }
+
+ public function getDefault()
+ {
+ return $this->default;
+ }
+
+ public function setDefault($default = null)
+ {
+ $this->optional = true;
+ $this->default = $default;
+ }
+
+ public function isOptional()
+ {
+ return $this->optional;
+ }
+
+ public function setAsPassedByReference($byReference = true)
+ {
+ $this->byReference = $byReference;
+ }
+
+ public function isPassedByReference()
+ {
+ return $this->byReference;
+ }
+
+ public function setAsVariadic($isVariadic = true)
+ {
+ $this->isVariadic = $isVariadic;
+ }
+
+ public function isVariadic()
+ {
+ return $this->isVariadic;
+ }
+
+ public function isNullable()
+ {
+ return $this->isNullable;
+ }
+
+ public function setAsNullable($isNullable = true)
+ {
+ $this->isNullable = $isNullable;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php
new file mode 100644
index 0000000000..1499a1d325
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ClassNode.php
@@ -0,0 +1,166 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator\Node;
+
+use Prophecy\Exception\Doubler\MethodNotExtendableException;
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Class node.
+ *
+ * @author Konstantin Kudryashov
+ */
+class ClassNode
+{
+ private $parentClass = 'stdClass';
+ private $interfaces = array();
+ private $properties = array();
+ private $unextendableMethods = array();
+
+ /**
+ * @var MethodNode[]
+ */
+ private $methods = array();
+
+ public function getParentClass()
+ {
+ return $this->parentClass;
+ }
+
+ /**
+ * @param string $class
+ */
+ public function setParentClass($class)
+ {
+ $this->parentClass = $class ?: 'stdClass';
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getInterfaces()
+ {
+ return $this->interfaces;
+ }
+
+ /**
+ * @param string $interface
+ */
+ public function addInterface($interface)
+ {
+ if ($this->hasInterface($interface)) {
+ return;
+ }
+
+ array_unshift($this->interfaces, $interface);
+ }
+
+ /**
+ * @param string $interface
+ *
+ * @return bool
+ */
+ public function hasInterface($interface)
+ {
+ return in_array($interface, $this->interfaces);
+ }
+
+ public function getProperties()
+ {
+ return $this->properties;
+ }
+
+ public function addProperty($name, $visibility = 'public')
+ {
+ $visibility = strtolower($visibility);
+
+ if (!in_array($visibility, array('public', 'private', 'protected'))) {
+ throw new InvalidArgumentException(sprintf(
+ '`%s` property visibility is not supported.', $visibility
+ ));
+ }
+
+ $this->properties[$name] = $visibility;
+ }
+
+ /**
+ * @return MethodNode[]
+ */
+ public function getMethods()
+ {
+ return $this->methods;
+ }
+
+ public function addMethod(MethodNode $method)
+ {
+ if (!$this->isExtendable($method->getName())){
+ $message = sprintf(
+ 'Method `%s` is not extendable, so can not be added.', $method->getName()
+ );
+ throw new MethodNotExtendableException($message, $this->getParentClass(), $method->getName());
+ }
+ $this->methods[$method->getName()] = $method;
+ }
+
+ public function removeMethod($name)
+ {
+ unset($this->methods[$name]);
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return MethodNode|null
+ */
+ public function getMethod($name)
+ {
+ return $this->hasMethod($name) ? $this->methods[$name] : null;
+ }
+
+ /**
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function hasMethod($name)
+ {
+ return isset($this->methods[$name]);
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getUnextendableMethods()
+ {
+ return $this->unextendableMethods;
+ }
+
+ /**
+ * @param string $unextendableMethod
+ */
+ public function addUnextendableMethod($unextendableMethod)
+ {
+ if (!$this->isExtendable($unextendableMethod)){
+ return;
+ }
+ $this->unextendableMethods[] = $unextendableMethod;
+ }
+
+ /**
+ * @param string $method
+ * @return bool
+ */
+ public function isExtendable($method)
+ {
+ return !in_array($method, $this->unextendableMethods);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php
new file mode 100644
index 0000000000..71aabfa940
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/MethodNode.php
@@ -0,0 +1,207 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator\Node;
+
+use Prophecy\Exception\InvalidArgumentException;
+
+/**
+ * Method node.
+ *
+ * @author Konstantin Kudryashov
+ */
+class MethodNode
+{
+ private $name;
+ private $code;
+ private $visibility = 'public';
+ private $static = false;
+ private $returnsReference = false;
+ private $returnType;
+ private $nullableReturnType = false;
+
+ /**
+ * @var ArgumentNode[]
+ */
+ private $arguments = array();
+
+ /**
+ * @param string $name
+ * @param string $code
+ */
+ public function __construct($name, $code = null)
+ {
+ $this->name = $name;
+ $this->code = $code;
+ }
+
+ public function getVisibility()
+ {
+ return $this->visibility;
+ }
+
+ /**
+ * @param string $visibility
+ */
+ public function setVisibility($visibility)
+ {
+ $visibility = strtolower($visibility);
+
+ if (!in_array($visibility, array('public', 'private', 'protected'))) {
+ throw new InvalidArgumentException(sprintf(
+ '`%s` method visibility is not supported.', $visibility
+ ));
+ }
+
+ $this->visibility = $visibility;
+ }
+
+ public function isStatic()
+ {
+ return $this->static;
+ }
+
+ public function setStatic($static = true)
+ {
+ $this->static = (bool) $static;
+ }
+
+ public function returnsReference()
+ {
+ return $this->returnsReference;
+ }
+
+ public function setReturnsReference()
+ {
+ $this->returnsReference = true;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function addArgument(ArgumentNode $argument)
+ {
+ $this->arguments[] = $argument;
+ }
+
+ /**
+ * @return ArgumentNode[]
+ */
+ public function getArguments()
+ {
+ return $this->arguments;
+ }
+
+ public function hasReturnType()
+ {
+ return null !== $this->returnType;
+ }
+
+ /**
+ * @param string $type
+ */
+ public function setReturnType($type = null)
+ {
+ switch ($type) {
+ case '':
+ $this->returnType = null;
+ break;
+
+ case 'string';
+ case 'float':
+ case 'int':
+ case 'bool':
+ case 'array':
+ case 'callable':
+ case 'iterable':
+ case 'void':
+ $this->returnType = $type;
+ break;
+
+ case 'double':
+ case 'real':
+ $this->returnType = 'float';
+ break;
+
+ case 'boolean':
+ $this->returnType = 'bool';
+ break;
+
+ case 'integer':
+ $this->returnType = 'int';
+ break;
+
+ default:
+ $this->returnType = '\\' . ltrim($type, '\\');
+ }
+ }
+
+ public function getReturnType()
+ {
+ return $this->returnType;
+ }
+
+ /**
+ * @param bool $bool
+ */
+ public function setNullableReturnType($bool = true)
+ {
+ $this->nullableReturnType = (bool) $bool;
+ }
+
+ /**
+ * @return bool
+ */
+ public function hasNullableReturnType()
+ {
+ return $this->nullableReturnType;
+ }
+
+ /**
+ * @param string $code
+ */
+ public function setCode($code)
+ {
+ $this->code = $code;
+ }
+
+ public function getCode()
+ {
+ if ($this->returnsReference)
+ {
+ return "throw new \Prophecy\Exception\Doubler\ReturnByReferenceException('Returning by reference not supported', get_class(\$this), '{$this->name}');";
+ }
+
+ return (string) $this->code;
+ }
+
+ public function useParentCode()
+ {
+ $this->code = sprintf(
+ 'return parent::%s(%s);', $this->getName(), implode(', ',
+ array_map(array($this, 'generateArgument'), $this->arguments)
+ )
+ );
+ }
+
+ private function generateArgument(ArgumentNode $arg)
+ {
+ $argument = '$'.$arg->getName();
+
+ if ($arg->isVariadic()) {
+ $argument = '...'.$argument;
+ }
+
+ return $argument;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php
new file mode 100644
index 0000000000..d720b15159
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ReflectionInterface.php
@@ -0,0 +1,22 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler\Generator;
+
+/**
+ * Reflection interface.
+ * All reflected classes implement this interface.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface ReflectionInterface
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php
new file mode 100644
index 0000000000..8a99c4ce86
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php
@@ -0,0 +1,127 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler;
+
+use Prophecy\Exception\Doubler\DoubleException;
+use Prophecy\Exception\Doubler\ClassNotFoundException;
+use Prophecy\Exception\Doubler\InterfaceNotFoundException;
+use ReflectionClass;
+
+/**
+ * Lazy double.
+ * Gives simple interface to describe double before creating it.
+ *
+ * @author Konstantin Kudryashov
+ */
+class LazyDouble
+{
+ private $doubler;
+ private $class;
+ private $interfaces = array();
+ private $arguments = null;
+ private $double;
+
+ /**
+ * Initializes lazy double.
+ *
+ * @param Doubler $doubler
+ */
+ public function __construct(Doubler $doubler)
+ {
+ $this->doubler = $doubler;
+ }
+
+ /**
+ * Tells doubler to use specific class as parent one for double.
+ *
+ * @param string|ReflectionClass $class
+ *
+ * @throws \Prophecy\Exception\Doubler\ClassNotFoundException
+ * @throws \Prophecy\Exception\Doubler\DoubleException
+ */
+ public function setParentClass($class)
+ {
+ if (null !== $this->double) {
+ throw new DoubleException('Can not extend class with already instantiated double.');
+ }
+
+ if (!$class instanceof ReflectionClass) {
+ if (!class_exists($class)) {
+ throw new ClassNotFoundException(sprintf('Class %s not found.', $class), $class);
+ }
+
+ $class = new ReflectionClass($class);
+ }
+
+ $this->class = $class;
+ }
+
+ /**
+ * Tells doubler to implement specific interface with double.
+ *
+ * @param string|ReflectionClass $interface
+ *
+ * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException
+ * @throws \Prophecy\Exception\Doubler\DoubleException
+ */
+ public function addInterface($interface)
+ {
+ if (null !== $this->double) {
+ throw new DoubleException(
+ 'Can not implement interface with already instantiated double.'
+ );
+ }
+
+ if (!$interface instanceof ReflectionClass) {
+ if (!interface_exists($interface)) {
+ throw new InterfaceNotFoundException(
+ sprintf('Interface %s not found.', $interface),
+ $interface
+ );
+ }
+
+ $interface = new ReflectionClass($interface);
+ }
+
+ $this->interfaces[] = $interface;
+ }
+
+ /**
+ * Sets constructor arguments.
+ *
+ * @param array $arguments
+ */
+ public function setArguments(array $arguments = null)
+ {
+ $this->arguments = $arguments;
+ }
+
+ /**
+ * Creates double instance or returns already created one.
+ *
+ * @return DoubleInterface
+ */
+ public function getInstance()
+ {
+ if (null === $this->double) {
+ if (null !== $this->arguments) {
+ return $this->double = $this->doubler->double(
+ $this->class, $this->interfaces, $this->arguments
+ );
+ }
+
+ $this->double = $this->doubler->double($this->class, $this->interfaces);
+ }
+
+ return $this->double;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php
new file mode 100644
index 0000000000..d67ec6a4db
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/NameGenerator.php
@@ -0,0 +1,52 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Doubler;
+
+use ReflectionClass;
+
+/**
+ * Name generator.
+ * Generates classname for double.
+ *
+ * @author Konstantin Kudryashov
+ */
+class NameGenerator
+{
+ private static $counter = 1;
+
+ /**
+ * Generates name.
+ *
+ * @param ReflectionClass $class
+ * @param ReflectionClass[] $interfaces
+ *
+ * @return string
+ */
+ public function name(ReflectionClass $class = null, array $interfaces)
+ {
+ $parts = array();
+
+ if (null !== $class) {
+ $parts[] = $class->getName();
+ } else {
+ foreach ($interfaces as $interface) {
+ $parts[] = $interface->getShortName();
+ }
+ }
+
+ if (!count($parts)) {
+ $parts[] = 'stdClass';
+ }
+
+ return sprintf('Double\%s\P%d', implode('\\', $parts), self::$counter++);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php
new file mode 100644
index 0000000000..48ed22542d
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Call/UnexpectedCallException.php
@@ -0,0 +1,40 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Call;
+
+use Prophecy\Exception\Prophecy\ObjectProphecyException;
+use Prophecy\Prophecy\ObjectProphecy;
+
+class UnexpectedCallException extends ObjectProphecyException
+{
+ private $methodName;
+ private $arguments;
+
+ public function __construct($message, ObjectProphecy $objectProphecy,
+ $methodName, array $arguments)
+ {
+ parent::__construct($message, $objectProphecy);
+
+ $this->methodName = $methodName;
+ $this->arguments = $arguments;
+ }
+
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+
+ public function getArguments()
+ {
+ return $this->arguments;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php
new file mode 100644
index 0000000000..822918a294
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassCreatorException.php
@@ -0,0 +1,31 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+use Prophecy\Doubler\Generator\Node\ClassNode;
+
+class ClassCreatorException extends \RuntimeException implements DoublerException
+{
+ private $node;
+
+ public function __construct($message, ClassNode $node)
+ {
+ parent::__construct($message);
+
+ $this->node = $node;
+ }
+
+ public function getClassNode()
+ {
+ return $this->node;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php
new file mode 100644
index 0000000000..8fc53b8b52
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassMirrorException.php
@@ -0,0 +1,31 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+use ReflectionClass;
+
+class ClassMirrorException extends \RuntimeException implements DoublerException
+{
+ private $class;
+
+ public function __construct($message, ReflectionClass $class)
+ {
+ parent::__construct($message);
+
+ $this->class = $class;
+ }
+
+ public function getReflectedClass()
+ {
+ return $this->class;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php
new file mode 100644
index 0000000000..5bc826d75e
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ClassNotFoundException.php
@@ -0,0 +1,33 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+class ClassNotFoundException extends DoubleException
+{
+ private $classname;
+
+ /**
+ * @param string $message
+ * @param string $classname
+ */
+ public function __construct($message, $classname)
+ {
+ parent::__construct($message);
+
+ $this->classname = $classname;
+ }
+
+ public function getClassname()
+ {
+ return $this->classname;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php
new file mode 100644
index 0000000000..6642a58f20
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoubleException.php
@@ -0,0 +1,18 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+use RuntimeException;
+
+class DoubleException extends RuntimeException implements DoublerException
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php
new file mode 100644
index 0000000000..9d6be17969
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/DoublerException.php
@@ -0,0 +1,18 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+use Prophecy\Exception\Exception;
+
+interface DoublerException extends Exception
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php
new file mode 100644
index 0000000000..e344dead2b
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/InterfaceNotFoundException.php
@@ -0,0 +1,20 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+class InterfaceNotFoundException extends ClassNotFoundException
+{
+ public function getInterfaceName()
+ {
+ return $this->getClassname();
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php
new file mode 100644
index 0000000000..56f47b1105
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php
@@ -0,0 +1,41 @@
+methodName = $methodName;
+ $this->className = $className;
+ }
+
+
+ /**
+ * @return string
+ */
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+
+ /**
+ * @return string
+ */
+ public function getClassName()
+ {
+ return $this->className;
+ }
+
+ }
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php
new file mode 100644
index 0000000000..b113941fc9
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotFoundException.php
@@ -0,0 +1,60 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+class MethodNotFoundException extends DoubleException
+{
+ /**
+ * @var string
+ */
+ private $classname;
+
+ /**
+ * @var string
+ */
+ private $methodName;
+
+ /**
+ * @var array
+ */
+ private $arguments;
+
+ /**
+ * @param string $message
+ * @param string $classname
+ * @param string $methodName
+ * @param null|Argument\ArgumentsWildcard|array $arguments
+ */
+ public function __construct($message, $classname, $methodName, $arguments = null)
+ {
+ parent::__construct($message);
+
+ $this->classname = $classname;
+ $this->methodName = $methodName;
+ $this->arguments = $arguments;
+ }
+
+ public function getClassname()
+ {
+ return $this->classname;
+ }
+
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+
+ public function getArguments()
+ {
+ return $this->arguments;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php
new file mode 100644
index 0000000000..6303049700
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/ReturnByReferenceException.php
@@ -0,0 +1,41 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Doubler;
+
+class ReturnByReferenceException extends DoubleException
+{
+ private $classname;
+ private $methodName;
+
+ /**
+ * @param string $message
+ * @param string $classname
+ * @param string $methodName
+ */
+ public function __construct($message, $classname, $methodName)
+ {
+ parent::__construct($message);
+
+ $this->classname = $classname;
+ $this->methodName = $methodName;
+ }
+
+ public function getClassname()
+ {
+ return $this->classname;
+ }
+
+ public function getMethodName()
+ {
+ return $this->methodName;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php
new file mode 100644
index 0000000000..ac9fe4dd99
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Exception.php
@@ -0,0 +1,26 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception;
+
+/**
+ * Core Prophecy exception interface.
+ * All Prophecy exceptions implement it.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface Exception
+{
+ /**
+ * @return string
+ */
+ public function getMessage();
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php
new file mode 100644
index 0000000000..bc91c690fa
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/InvalidArgumentException.php
@@ -0,0 +1,16 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception;
+
+class InvalidArgumentException extends \InvalidArgumentException implements Exception
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php
new file mode 100644
index 0000000000..44b598a440
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/AggregateException.php
@@ -0,0 +1,50 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prediction;
+
+use Prophecy\Prophecy\ObjectProphecy;
+
+class AggregateException extends \RuntimeException implements PredictionException
+{
+ private $exceptions = array();
+ private $objectProphecy;
+
+ public function append(PredictionException $exception)
+ {
+ $message = $exception->getMessage();
+ $message = ' '.strtr($message, array("\n" => "\n "))."\n";
+
+ $this->message = rtrim($this->message.$message);
+ $this->exceptions[] = $exception;
+ }
+
+ /**
+ * @return PredictionException[]
+ */
+ public function getExceptions()
+ {
+ return $this->exceptions;
+ }
+
+ public function setObjectProphecy(ObjectProphecy $objectProphecy)
+ {
+ $this->objectProphecy = $objectProphecy;
+ }
+
+ /**
+ * @return ObjectProphecy
+ */
+ public function getObjectProphecy()
+ {
+ return $this->objectProphecy;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php
new file mode 100644
index 0000000000..bbbbc3d97a
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/FailedPredictionException.php
@@ -0,0 +1,24 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prediction;
+
+use RuntimeException;
+
+/**
+ * Basic failed prediction exception.
+ * Use it for custom prediction failures.
+ *
+ * @author Konstantin Kudryashov
+ */
+class FailedPredictionException extends RuntimeException implements PredictionException
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php
new file mode 100644
index 0000000000..05ea4aad86
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php
@@ -0,0 +1,18 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prediction;
+
+use Prophecy\Exception\Prophecy\MethodProphecyException;
+
+class NoCallsException extends MethodProphecyException implements PredictionException
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php
new file mode 100644
index 0000000000..2596b1ef1f
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/PredictionException.php
@@ -0,0 +1,18 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prediction;
+
+use Prophecy\Exception\Exception;
+
+interface PredictionException extends Exception
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php
new file mode 100644
index 0000000000..9d905431f8
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsCountException.php
@@ -0,0 +1,31 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prediction;
+
+use Prophecy\Prophecy\MethodProphecy;
+
+class UnexpectedCallsCountException extends UnexpectedCallsException
+{
+ private $expectedCount;
+
+ public function __construct($message, MethodProphecy $methodProphecy, $count, array $calls)
+ {
+ parent::__construct($message, $methodProphecy, $calls);
+
+ $this->expectedCount = intval($count);
+ }
+
+ public function getExpectedCount()
+ {
+ return $this->expectedCount;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php
new file mode 100644
index 0000000000..7a99c2d796
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/UnexpectedCallsException.php
@@ -0,0 +1,32 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prediction;
+
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Exception\Prophecy\MethodProphecyException;
+
+class UnexpectedCallsException extends MethodProphecyException implements PredictionException
+{
+ private $calls = array();
+
+ public function __construct($message, MethodProphecy $methodProphecy, array $calls)
+ {
+ parent::__construct($message, $methodProphecy);
+
+ $this->calls = $calls;
+ }
+
+ public function getCalls()
+ {
+ return $this->calls;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php
new file mode 100644
index 0000000000..1b03eaf472
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/MethodProphecyException.php
@@ -0,0 +1,34 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prophecy;
+
+use Prophecy\Prophecy\MethodProphecy;
+
+class MethodProphecyException extends ObjectProphecyException
+{
+ private $methodProphecy;
+
+ public function __construct($message, MethodProphecy $methodProphecy)
+ {
+ parent::__construct($message, $methodProphecy->getObjectProphecy());
+
+ $this->methodProphecy = $methodProphecy;
+ }
+
+ /**
+ * @return MethodProphecy
+ */
+ public function getMethodProphecy()
+ {
+ return $this->methodProphecy;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php
new file mode 100644
index 0000000000..e345402e01
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ObjectProphecyException.php
@@ -0,0 +1,34 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prophecy;
+
+use Prophecy\Prophecy\ObjectProphecy;
+
+class ObjectProphecyException extends \RuntimeException implements ProphecyException
+{
+ private $objectProphecy;
+
+ public function __construct($message, ObjectProphecy $objectProphecy)
+ {
+ parent::__construct($message);
+
+ $this->objectProphecy = $objectProphecy;
+ }
+
+ /**
+ * @return ObjectProphecy
+ */
+ public function getObjectProphecy()
+ {
+ return $this->objectProphecy;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php
new file mode 100644
index 0000000000..9157332872
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Prophecy/ProphecyException.php
@@ -0,0 +1,18 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Exception\Prophecy;
+
+use Prophecy\Exception\Exception;
+
+interface ProphecyException extends Exception
+{
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php
new file mode 100644
index 0000000000..209821ce91
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassAndInterfaceTagRetriever.php
@@ -0,0 +1,69 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\PhpDocumentor;
+
+use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag;
+use phpDocumentor\Reflection\DocBlock\Tags\Method;
+
+/**
+ * @author Théo FIDRY
+ *
+ * @internal
+ */
+final class ClassAndInterfaceTagRetriever implements MethodTagRetrieverInterface
+{
+ private $classRetriever;
+
+ public function __construct(MethodTagRetrieverInterface $classRetriever = null)
+ {
+ if (null !== $classRetriever) {
+ $this->classRetriever = $classRetriever;
+
+ return;
+ }
+
+ $this->classRetriever = class_exists('phpDocumentor\Reflection\DocBlockFactory') && class_exists('phpDocumentor\Reflection\Types\ContextFactory')
+ ? new ClassTagRetriever()
+ : new LegacyClassTagRetriever()
+ ;
+ }
+
+ /**
+ * @param \ReflectionClass $reflectionClass
+ *
+ * @return LegacyMethodTag[]|Method[]
+ */
+ public function getTagList(\ReflectionClass $reflectionClass)
+ {
+ return array_merge(
+ $this->classRetriever->getTagList($reflectionClass),
+ $this->getInterfacesTagList($reflectionClass)
+ );
+ }
+
+ /**
+ * @param \ReflectionClass $reflectionClass
+ *
+ * @return LegacyMethodTag[]|Method[]
+ */
+ private function getInterfacesTagList(\ReflectionClass $reflectionClass)
+ {
+ $interfaces = $reflectionClass->getInterfaces();
+ $tagList = array();
+
+ foreach($interfaces as $interface) {
+ $tagList = array_merge($tagList, $this->classRetriever->getTagList($interface));
+ }
+
+ return $tagList;
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php
new file mode 100644
index 0000000000..1d2da8f03e
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php
@@ -0,0 +1,52 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\PhpDocumentor;
+
+use phpDocumentor\Reflection\DocBlock\Tags\Method;
+use phpDocumentor\Reflection\DocBlockFactory;
+use phpDocumentor\Reflection\Types\ContextFactory;
+
+/**
+ * @author Théo FIDRY
+ *
+ * @internal
+ */
+final class ClassTagRetriever implements MethodTagRetrieverInterface
+{
+ private $docBlockFactory;
+ private $contextFactory;
+
+ public function __construct()
+ {
+ $this->docBlockFactory = DocBlockFactory::createInstance();
+ $this->contextFactory = new ContextFactory();
+ }
+
+ /**
+ * @param \ReflectionClass $reflectionClass
+ *
+ * @return Method[]
+ */
+ public function getTagList(\ReflectionClass $reflectionClass)
+ {
+ try {
+ $phpdoc = $this->docBlockFactory->create(
+ $reflectionClass,
+ $this->contextFactory->createFromReflector($reflectionClass)
+ );
+
+ return $phpdoc->getTagsByName('method');
+ } catch (\InvalidArgumentException $e) {
+ return array();
+ }
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php
new file mode 100644
index 0000000000..c0dec3de82
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php
@@ -0,0 +1,35 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\PhpDocumentor;
+
+use phpDocumentor\Reflection\DocBlock;
+use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag;
+
+/**
+ * @author Théo FIDRY
+ *
+ * @internal
+ */
+final class LegacyClassTagRetriever implements MethodTagRetrieverInterface
+{
+ /**
+ * @param \ReflectionClass $reflectionClass
+ *
+ * @return LegacyMethodTag[]
+ */
+ public function getTagList(\ReflectionClass $reflectionClass)
+ {
+ $phpdoc = new DocBlock($reflectionClass->getDocComment());
+
+ return $phpdoc->getTagsByName('method');
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php
new file mode 100644
index 0000000000..d3989dad58
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php
@@ -0,0 +1,30 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\PhpDocumentor;
+
+use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag;
+use phpDocumentor\Reflection\DocBlock\Tags\Method;
+
+/**
+ * @author Théo FIDRY
+ *
+ * @internal
+ */
+interface MethodTagRetrieverInterface
+{
+ /**
+ * @param \ReflectionClass $reflectionClass
+ *
+ * @return LegacyMethodTag[]|Method[]
+ */
+ public function getTagList(\ReflectionClass $reflectionClass);
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php
new file mode 100644
index 0000000000..b478736695
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php
@@ -0,0 +1,86 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Prediction;
+
+use Prophecy\Call\Call;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Argument\ArgumentsWildcard;
+use Prophecy\Argument\Token\AnyValuesToken;
+use Prophecy\Util\StringUtil;
+use Prophecy\Exception\Prediction\NoCallsException;
+
+/**
+ * Call prediction.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallPrediction implements PredictionInterface
+{
+ private $util;
+
+ /**
+ * Initializes prediction.
+ *
+ * @param StringUtil $util
+ */
+ public function __construct(StringUtil $util = null)
+ {
+ $this->util = $util ?: new StringUtil;
+ }
+
+ /**
+ * Tests that there was at least one call.
+ *
+ * @param Call[] $calls
+ * @param ObjectProphecy $object
+ * @param MethodProphecy $method
+ *
+ * @throws \Prophecy\Exception\Prediction\NoCallsException
+ */
+ public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
+ {
+ if (count($calls)) {
+ return;
+ }
+
+ $methodCalls = $object->findProphecyMethodCalls(
+ $method->getMethodName(),
+ new ArgumentsWildcard(array(new AnyValuesToken))
+ );
+
+ if (count($methodCalls)) {
+ throw new NoCallsException(sprintf(
+ "No calls have been made that match:\n".
+ " %s->%s(%s)\n".
+ "but expected at least one.\n".
+ "Recorded `%s(...)` calls:\n%s",
+
+ get_class($object->reveal()),
+ $method->getMethodName(),
+ $method->getArgumentsWildcard(),
+ $method->getMethodName(),
+ $this->util->stringifyCalls($methodCalls)
+ ), $method);
+ }
+
+ throw new NoCallsException(sprintf(
+ "No calls have been made that match:\n".
+ " %s->%s(%s)\n".
+ "but expected at least one.",
+
+ get_class($object->reveal()),
+ $method->getMethodName(),
+ $method->getArgumentsWildcard()
+ ), $method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php
new file mode 100644
index 0000000000..31c6c575ac
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php
@@ -0,0 +1,107 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Prediction;
+
+use Prophecy\Call\Call;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Argument\ArgumentsWildcard;
+use Prophecy\Argument\Token\AnyValuesToken;
+use Prophecy\Util\StringUtil;
+use Prophecy\Exception\Prediction\UnexpectedCallsCountException;
+
+/**
+ * Prediction interface.
+ * Predictions are logical test blocks, tied to `should...` keyword.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallTimesPrediction implements PredictionInterface
+{
+ private $times;
+ private $util;
+
+ /**
+ * Initializes prediction.
+ *
+ * @param int $times
+ * @param StringUtil $util
+ */
+ public function __construct($times, StringUtil $util = null)
+ {
+ $this->times = intval($times);
+ $this->util = $util ?: new StringUtil;
+ }
+
+ /**
+ * Tests that there was exact amount of calls made.
+ *
+ * @param Call[] $calls
+ * @param ObjectProphecy $object
+ * @param MethodProphecy $method
+ *
+ * @throws \Prophecy\Exception\Prediction\UnexpectedCallsCountException
+ */
+ public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
+ {
+ if ($this->times == count($calls)) {
+ return;
+ }
+
+ $methodCalls = $object->findProphecyMethodCalls(
+ $method->getMethodName(),
+ new ArgumentsWildcard(array(new AnyValuesToken))
+ );
+
+ if (count($calls)) {
+ $message = sprintf(
+ "Expected exactly %d calls that match:\n".
+ " %s->%s(%s)\n".
+ "but %d were made:\n%s",
+
+ $this->times,
+ get_class($object->reveal()),
+ $method->getMethodName(),
+ $method->getArgumentsWildcard(),
+ count($calls),
+ $this->util->stringifyCalls($calls)
+ );
+ } elseif (count($methodCalls)) {
+ $message = sprintf(
+ "Expected exactly %d calls that match:\n".
+ " %s->%s(%s)\n".
+ "but none were made.\n".
+ "Recorded `%s(...)` calls:\n%s",
+
+ $this->times,
+ get_class($object->reveal()),
+ $method->getMethodName(),
+ $method->getArgumentsWildcard(),
+ $method->getMethodName(),
+ $this->util->stringifyCalls($methodCalls)
+ );
+ } else {
+ $message = sprintf(
+ "Expected exactly %d calls that match:\n".
+ " %s->%s(%s)\n".
+ "but none were made.",
+
+ $this->times,
+ get_class($object->reveal()),
+ $method->getMethodName(),
+ $method->getArgumentsWildcard()
+ );
+ }
+
+ throw new UnexpectedCallsCountException($message, $method, $this->times, $calls);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php
new file mode 100644
index 0000000000..44bc782c8a
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php
@@ -0,0 +1,65 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Prediction;
+
+use Prophecy\Call\Call;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Exception\InvalidArgumentException;
+use Closure;
+
+/**
+ * Callback prediction.
+ *
+ * @author Konstantin Kudryashov
+ */
+class CallbackPrediction implements PredictionInterface
+{
+ private $callback;
+
+ /**
+ * Initializes callback prediction.
+ *
+ * @param callable $callback Custom callback
+ *
+ * @throws \Prophecy\Exception\InvalidArgumentException
+ */
+ public function __construct($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new InvalidArgumentException(sprintf(
+ 'Callable expected as an argument to CallbackPrediction, but got %s.',
+ gettype($callback)
+ ));
+ }
+
+ $this->callback = $callback;
+ }
+
+ /**
+ * Executes preset callback.
+ *
+ * @param Call[] $calls
+ * @param ObjectProphecy $object
+ * @param MethodProphecy $method
+ */
+ public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
+ {
+ $callback = $this->callback;
+
+ if ($callback instanceof Closure && method_exists('Closure', 'bind')) {
+ $callback = Closure::bind($callback, $object);
+ }
+
+ call_user_func($callback, $calls, $object, $method);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php
new file mode 100644
index 0000000000..46ac5bfc06
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php
@@ -0,0 +1,68 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Prediction;
+
+use Prophecy\Call\Call;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Prophecy\MethodProphecy;
+use Prophecy\Util\StringUtil;
+use Prophecy\Exception\Prediction\UnexpectedCallsException;
+
+/**
+ * No calls prediction.
+ *
+ * @author Konstantin Kudryashov
+ */
+class NoCallsPrediction implements PredictionInterface
+{
+ private $util;
+
+ /**
+ * Initializes prediction.
+ *
+ * @param null|StringUtil $util
+ */
+ public function __construct(StringUtil $util = null)
+ {
+ $this->util = $util ?: new StringUtil;
+ }
+
+ /**
+ * Tests that there were no calls made.
+ *
+ * @param Call[] $calls
+ * @param ObjectProphecy $object
+ * @param MethodProphecy $method
+ *
+ * @throws \Prophecy\Exception\Prediction\UnexpectedCallsException
+ */
+ public function check(array $calls, ObjectProphecy $object, MethodProphecy $method)
+ {
+ if (!count($calls)) {
+ return;
+ }
+
+ $verb = count($calls) === 1 ? 'was' : 'were';
+
+ throw new UnexpectedCallsException(sprintf(
+ "No calls expected that match:\n".
+ " %s->%s(%s)\n".
+ "but %d %s made:\n%s",
+ get_class($object->reveal()),
+ $method->getMethodName(),
+ $method->getArgumentsWildcard(),
+ count($calls),
+ $verb,
+ $this->util->stringifyCalls($calls)
+ ), $method, $calls);
+ }
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php b/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php
new file mode 100644
index 0000000000..f7fb06a996
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Prediction/PredictionInterface.php
@@ -0,0 +1,37 @@
+
+ * Marcello Duarte
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Prophecy\Prediction;
+
+use Prophecy\Call\Call;
+use Prophecy\Prophecy\ObjectProphecy;
+use Prophecy\Prophecy\MethodProphecy;
+
+/**
+ * Prediction interface.
+ * Predictions are logical test blocks, tied to `should...` keyword.
+ *
+ * @author Konstantin Kudryashov
+ */
+interface PredictionInterface
+{
+ /**
+ * Tests that double fulfilled prediction.
+ *
+ * @param Call[] $calls
+ * @param ObjectProphecy $object
+ * @param MethodProphecy $method
+ *
+ * @throws object
+ * @return void
+ */
+ public function check(array $calls, ObjectProphecy $object, MethodProphecy $method);
+}
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php b/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php
new file mode 100644
index 0000000000..5f406bf7a8
--- /dev/null
+++ b/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php
@@ -0,0 +1,66 @@
+
+ * Marcello Duarte