diff --git a/composer.json b/composer.json index a7c351dc7..45e3b05af 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.23" }, "require-dev": { "zendframework/zend-eventmanager": "self.version", @@ -32,8 +32,8 @@ }, "extra": { "branch-alias": { - "dev-master": "2.2-dev", - "dev-develop": "2.3-dev" + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" } }, "autoload-dev": { diff --git a/src/ArrayObject.php b/src/ArrayObject.php index 2bebaf8dd..b4d9eb79d 100644 --- a/src/ArrayObject.php +++ b/src/ArrayObject.php @@ -9,26 +9,424 @@ namespace Zend\Stdlib; -/** - * If the version is less than 5.3.4, we'll use Zend\Stdlib\ArrayObject\PhpLegacyCompatibility - * which extends the native PHP ArrayObject implementation. For versions greater than or equal - * to 5.3.4, we'll use Zend\Stdlib\ArrayObject\PhpReferenceCompatibility, which corrects - * issues with how PHP handles references inside ArrayObject. - * - * class_alias is a global construct, so we can alias either one to Zend\Stdlib\ArrayObject, - * and from this point forward, that alias will be used. - */ -if (version_compare(PHP_VERSION, '5.3.4', 'lt')) { - class_alias('Zend\Stdlib\ArrayObject\PhpLegacyCompatibility', 'Zend\Stdlib\AbstractArrayObject'); -} else { - class_alias('Zend\Stdlib\ArrayObject\PhpReferenceCompatibility', 'Zend\Stdlib\AbstractArrayObject'); -} +use ArrayAccess; +use Countable; +use IteratorAggregate; +use Serializable; /** * Custom framework ArrayObject implementation * * Extends version-specific "abstract" implementation. */ -class ArrayObject extends AbstractArrayObject +class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable { + /** + * Properties of the object have their normal functionality + * when accessed as list (var_dump, foreach, etc.). + */ + const STD_PROP_LIST = 1; + + /** + * Entries can be accessed as properties (read and write). + */ + const ARRAY_AS_PROPS = 2; + + /** + * @var array + */ + protected $storage; + + /** + * @var int + */ + protected $flag; + + /** + * @var string + */ + protected $iteratorClass; + + /** + * @var array + */ + protected $protectedProperties; + + /** + * Constructor + * + * @param array $input + * @param int $flags + * @param string $iteratorClass + */ + public function __construct($input = array(), $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator') + { + $this->setFlags($flags); + $this->storage = $input; + $this->setIteratorClass($iteratorClass); + $this->protectedProperties = array_keys(get_object_vars($this)); + } + + /** + * Returns whether the requested key exists + * + * @param mixed $key + * @return bool + */ + public function __isset($key) + { + if ($this->flag == self::ARRAY_AS_PROPS) { + return $this->offsetExists($key); + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + + return isset($this->$key); + } + + /** + * Sets the value at the specified key to value + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function __set($key, $value) + { + if ($this->flag == self::ARRAY_AS_PROPS) { + return $this->offsetSet($key, $value); + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + $this->$key = $value; + } + + /** + * Unsets the value at the specified key + * + * @param mixed $key + * @return void + */ + public function __unset($key) + { + if ($this->flag == self::ARRAY_AS_PROPS) { + return $this->offsetUnset($key); + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + unset($this->$key); + } + + /** + * Returns the value at the specified key by reference + * + * @param mixed $key + * @return mixed + */ + public function &__get($key) + { + $ret = null; + if ($this->flag == self::ARRAY_AS_PROPS) { + $ret =& $this->offsetGet($key); + + return $ret; + } + if (in_array($key, $this->protectedProperties)) { + throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); + } + + return $this->$key; + } + + /** + * Appends the value + * + * @param mixed $value + * @return void + */ + public function append($value) + { + $this->storage[] = $value; + } + + /** + * Sort the entries by value + * + * @return void + */ + public function asort() + { + asort($this->storage); + } + + /** + * Get the number of public properties in the ArrayObject + * + * @return int + */ + public function count() + { + return count($this->storage); + } + + /** + * Exchange the array for another one. + * + * @param array|ArrayObject $data + * @return array + */ + public function exchangeArray($data) + { + if (!is_array($data) && !is_object($data)) { + throw new Exception\InvalidArgumentException('Passed variable is not an array or object, using empty array instead'); + } + + if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { + $data = $data->getArrayCopy(); + } + if (!is_array($data)) { + $data = (array) $data; + } + + $storage = $this->storage; + + $this->storage = $data; + + return $storage; + } + + /** + * Creates a copy of the ArrayObject. + * + * @return array + */ + public function getArrayCopy() + { + return $this->storage; + } + + /** + * Gets the behavior flags. + * + * @return int + */ + public function getFlags() + { + return $this->flag; + } + + /** + * Create a new iterator from an ArrayObject instance + * + * @return \Iterator + */ + public function getIterator() + { + $class = $this->iteratorClass; + + return new $class($this->storage); + } + + /** + * Gets the iterator classname for the ArrayObject. + * + * @return string + */ + public function getIteratorClass() + { + return $this->iteratorClass; + } + + /** + * Sort the entries by key + * + * @return void + */ + public function ksort() + { + ksort($this->storage); + } + + /** + * Sort an array using a case insensitive "natural order" algorithm + * + * @return void + */ + public function natcasesort() + { + natcasesort($this->storage); + } + + /** + * Sort entries using a "natural order" algorithm + * + * @return void + */ + public function natsort() + { + natsort($this->storage); + } + + /** + * Returns whether the requested key exists + * + * @param mixed $key + * @return bool + */ + public function offsetExists($key) + { + return isset($this->storage[$key]); + } + + /** + * Returns the value at the specified key + * + * @param mixed $key + * @return mixed + */ + public function &offsetGet($key) + { + $ret = null; + if (!$this->offsetExists($key)) { + return $ret; + } + $ret =& $this->storage[$key]; + + return $ret; + } + + /** + * Sets the value at the specified key to value + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value) + { + $this->storage[$key] = $value; + } + + /** + * Unsets the value at the specified key + * + * @param mixed $key + * @return void + */ + public function offsetUnset($key) + { + if ($this->offsetExists($key)) { + unset($this->storage[$key]); + } + } + + /** + * Serialize an ArrayObject + * + * @return string + */ + public function serialize() + { + return serialize(get_object_vars($this)); + } + + /** + * Sets the behavior flags + * + * @param int $flags + * @return void + */ + public function setFlags($flags) + { + $this->flag = $flags; + } + + /** + * Sets the iterator classname for the ArrayObject + * + * @param string $class + * @return void + */ + public function setIteratorClass($class) + { + if (class_exists($class)) { + $this->iteratorClass = $class; + + return ; + } + + if (strpos($class, '\\') === 0) { + $class = '\\' . $class; + if (class_exists($class)) { + $this->iteratorClass = $class; + + return ; + } + } + + throw new Exception\InvalidArgumentException('The iterator class does not exist'); + } + + /** + * Sort the entries with a user-defined comparison function and maintain key association + * + * @param callable $function + * @return void + */ + public function uasort($function) + { + if (is_callable($function)) { + uasort($this->storage, $function); + } + } + + /** + * Sort the entries by keys using a user-defined comparison function + * + * @param callable $function + * @return void + */ + public function uksort($function) + { + if (is_callable($function)) { + uksort($this->storage, $function); + } + } + + /** + * Unserialize an ArrayObject + * + * @param string $data + * @return void + */ + public function unserialize($data) + { + $ar = unserialize($data); + $this->protectedProperties = array_keys(get_object_vars($this)); + + $this->setFlags($ar['flag']); + $this->exchangeArray($ar['storage']); + $this->setIteratorClass($ar['iteratorClass']); + + foreach ($ar as $k => $v) { + switch ($k) { + case 'flag': + $this->setFlags($v); + break; + case 'storage': + $this->exchangeArray($v); + break; + case 'iteratorClass': + $this->setIteratorClass($v); + break; + case 'protectedProperties': + continue; + default: + $this->__set($k, $v); + } + } + } } diff --git a/src/ArrayObject/PhpLegacyCompatibility.php b/src/ArrayObject/PhpLegacyCompatibility.php deleted file mode 100644 index b34f21cb7..000000000 --- a/src/ArrayObject/PhpLegacyCompatibility.php +++ /dev/null @@ -1,35 +0,0 @@ - 5.3.3, we need to provide a stub for 5.3.3. This stub - * simply extends the PHP ArrayObject implementation, and provides default - * behavior in the constructor. - */ -abstract class PhpLegacyCompatibility extends PhpArrayObject -{ - /** - * Constructor - * - * @param array $input - * @param int $flags - * @param string $iteratorClass - */ - public function __construct($input = array(), $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator') - { - parent::__construct($input, $flags, $iteratorClass); - } -} diff --git a/src/ArrayObject/PhpReferenceCompatibility.php b/src/ArrayObject/PhpReferenceCompatibility.php deleted file mode 100644 index a6d7b9abb..000000000 --- a/src/ArrayObject/PhpReferenceCompatibility.php +++ /dev/null @@ -1,433 +0,0 @@ -setFlags($flags); - $this->storage = $input; - $this->setIteratorClass($iteratorClass); - $this->protectedProperties = array_keys(get_object_vars($this)); - } - - /** - * Returns whether the requested key exists - * - * @param mixed $key - * @return bool - */ - public function __isset($key) - { - if ($this->flag == self::ARRAY_AS_PROPS) { - return $this->offsetExists($key); - } - if (in_array($key, $this->protectedProperties)) { - throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); - } - - return isset($this->$key); - } - - /** - * Sets the value at the specified key to value - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - if ($this->flag == self::ARRAY_AS_PROPS) { - return $this->offsetSet($key, $value); - } - if (in_array($key, $this->protectedProperties)) { - throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); - } - $this->$key = $value; - } - - /** - * Unsets the value at the specified key - * - * @param mixed $key - * @return void - */ - public function __unset($key) - { - if ($this->flag == self::ARRAY_AS_PROPS) { - return $this->offsetUnset($key); - } - if (in_array($key, $this->protectedProperties)) { - throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); - } - unset($this->$key); - } - - /** - * Returns the value at the specified key by reference - * - * @param mixed $key - * @return mixed - */ - public function &__get($key) - { - $ret = null; - if ($this->flag == self::ARRAY_AS_PROPS) { - $ret =& $this->offsetGet($key); - - return $ret; - } - if (in_array($key, $this->protectedProperties)) { - throw new Exception\InvalidArgumentException('$key is a protected property, use a different key'); - } - - return $this->$key; - } - - /** - * Appends the value - * - * @param mixed $value - * @return void - */ - public function append($value) - { - $this->storage[] = $value; - } - - /** - * Sort the entries by value - * - * @return void - */ - public function asort() - { - asort($this->storage); - } - - /** - * Get the number of public properties in the ArrayObject - * - * @return int - */ - public function count() - { - return count($this->storage); - } - - /** - * Exchange the array for another one. - * - * @param array|ArrayObject $data - * @return array - */ - public function exchangeArray($data) - { - if (!is_array($data) && !is_object($data)) { - throw new Exception\InvalidArgumentException('Passed variable is not an array or object, using empty array instead'); - } - - if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { - $data = $data->getArrayCopy(); - } - if (!is_array($data)) { - $data = (array) $data; - } - - $storage = $this->storage; - - $this->storage = $data; - - return $storage; - } - - /** - * Creates a copy of the ArrayObject. - * - * @return array - */ - public function getArrayCopy() - { - return $this->storage; - } - - /** - * Gets the behavior flags. - * - * @return int - */ - public function getFlags() - { - return $this->flag; - } - - /** - * Create a new iterator from an ArrayObject instance - * - * @return \Iterator - */ - public function getIterator() - { - $class = $this->iteratorClass; - - return new $class($this->storage); - } - - /** - * Gets the iterator classname for the ArrayObject. - * - * @return string - */ - public function getIteratorClass() - { - return $this->iteratorClass; - } - - /** - * Sort the entries by key - * - * @return void - */ - public function ksort() - { - ksort($this->storage); - } - - /** - * Sort an array using a case insensitive "natural order" algorithm - * - * @return void - */ - public function natcasesort() - { - natcasesort($this->storage); - } - - /** - * Sort entries using a "natural order" algorithm - * - * @return void - */ - public function natsort() - { - natsort($this->storage); - } - - /** - * Returns whether the requested key exists - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key) - { - return isset($this->storage[$key]); - } - - /** - * Returns the value at the specified key - * - * @param mixed $key - * @return mixed - */ - public function &offsetGet($key) - { - $ret = null; - if (!$this->offsetExists($key)) { - return $ret; - } - $ret =& $this->storage[$key]; - - return $ret; - } - - /** - * Sets the value at the specified key to value - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value) - { - $this->storage[$key] = $value; - } - - /** - * Unsets the value at the specified key - * - * @param mixed $key - * @return void - */ - public function offsetUnset($key) - { - if ($this->offsetExists($key)) { - unset($this->storage[$key]); - } - } - - /** - * Serialize an ArrayObject - * - * @return string - */ - public function serialize() - { - return serialize(get_object_vars($this)); - } - - /** - * Sets the behavior flags - * - * @param int $flags - * @return void - */ - public function setFlags($flags) - { - $this->flag = $flags; - } - - /** - * Sets the iterator classname for the ArrayObject - * - * @param string $class - * @return void - */ - public function setIteratorClass($class) - { - if (class_exists($class)) { - $this->iteratorClass = $class; - - return ; - } - - if (strpos($class, '\\') === 0) { - $class = '\\' . $class; - if (class_exists($class)) { - $this->iteratorClass = $class; - - return ; - } - } - - throw new Exception\InvalidArgumentException('The iterator class does not exist'); - } - - /** - * Sort the entries with a user-defined comparison function and maintain key association - * - * @param callable $function - * @return void - */ - public function uasort($function) - { - if (is_callable($function)) { - uasort($this->storage, $function); - } - } - - /** - * Sort the entries by keys using a user-defined comparison function - * - * @param callable $function - * @return void - */ - public function uksort($function) - { - if (is_callable($function)) { - uksort($this->storage, $function); - } - } - - /** - * Unserialize an ArrayObject - * - * @param string $data - * @return void - */ - public function unserialize($data) - { - $ar = unserialize($data); - $this->setFlags($ar['flag']); - $this->exchangeArray($ar['storage']); - $this->setIteratorClass($ar['iteratorClass']); - foreach ($ar as $k => $v) { - switch ($k) { - case 'flag': - $this->setFlags($v); - break; - case 'storage': - $this->exchangeArray($v); - break; - case 'iteratorClass': - $this->setIteratorClass($v); - break; - case 'protectedProperties': - continue; - default: - $this->__set($k, $v); - } - } - } -} diff --git a/src/ArrayUtils.php b/src/ArrayUtils.php index 1518e22e8..8da7a9cdb 100644 --- a/src/ArrayUtils.php +++ b/src/ArrayUtils.php @@ -245,23 +245,23 @@ public static function iteratorToArray($iterator, $recursive = true) /** * Merge two arrays together. * - * If an integer key exists in both arrays, the value from the second array - * will be appended the the first array. If both values are arrays, they - * are merged together, else the value of the second array overwrites the - * one of the first array. + * If an integer key exists in both arrays and preserveNumericKeys is false, the value + * from the second array will be appended to the first array. If both values are arrays, they + * are merged together, else the value of the second array overwrites the one of the first array. * * @param array $a * @param array $b + * @param bool $preserveNumericKeys * @return array */ - public static function merge(array $a, array $b) + public static function merge(array $a, array $b, $preserveNumericKeys = false) { foreach ($b as $key => $value) { if (array_key_exists($key, $a)) { - if (is_int($key)) { + if (is_int($key) && !$preserveNumericKeys) { $a[] = $value; } elseif (is_array($value) && is_array($a[$key])) { - $a[$key] = static::merge($a[$key], $value); + $a[$key] = static::merge($a[$key], $value, $preserveNumericKeys); } else { $a[$key] = $value; } diff --git a/src/CallbackHandler.php b/src/CallbackHandler.php index 303558adf..fd74974ed 100644 --- a/src/CallbackHandler.php +++ b/src/CallbackHandler.php @@ -14,7 +14,7 @@ /** * CallbackHandler * - * A handler for a event, event, filterchain, etc. Abstracts PHP callbacks, + * A handler for an event, event, filterchain, etc. Abstracts PHP callbacks, * primarily to allow for lazy-loading and ensuring availability of default * arguments (currying). */ diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index 6a63ee22f..d3255843c 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -13,7 +13,7 @@ /** * ErrorHandler that can be used to catch internal PHP errors - * and convert to a ErrorException instance. + * and convert to an ErrorException instance. */ abstract class ErrorHandler { diff --git a/src/Extractor/ExtractionInterface.php b/src/Extractor/ExtractionInterface.php new file mode 100644 index 000000000..8913b0996 --- /dev/null +++ b/src/Extractor/ExtractionInterface.php @@ -0,0 +1,21 @@ +hasNamingStrategy()) { + $name = $this->getNamingStrategy()->extract($name, $object); + } + return $name; + } + + /** + * Converts a value for hydration. If no naming strategy exists, the plain value is returned. + * + * @param string $name The name to convert. + * @param array $data The whole data is optionally provided as context. + * @return mixed + */ + public function hydrateName($name, $data = null) + { + if ($this->hasNamingStrategy()) { + $name = $this->getNamingStrategy()->hydrate($name, $data); + } + return $name; + } + /** * Get the filter instance * @@ -194,4 +239,49 @@ public function removeFilter($name) { return $this->filterComposite->removeFilter($name); } + + /** + * Adds the given naming strategy + * + * @param NamingStrategyInterface $strategy The naming to register. + * @return self + */ + public function setNamingStrategy(NamingStrategyInterface $strategy) + { + $this->namingStrategy = $strategy; + + return $this; + } + + /** + * Gets the naming strategy. + * + * @return NamingStrategyInterface + */ + public function getNamingStrategy() + { + return $this->namingStrategy; + } + + /** + * Checks if a naming strategy exists. + * + * @return bool + */ + public function hasNamingStrategy() + { + return isset($this->namingStrategy); + } + + /** + * Removes the naming strategy + * + * @return self + */ + public function removeNamingStrategy() + { + $this->namingStrategy = null; + + return $this; + } } diff --git a/src/Hydrator/ArraySerializable.php b/src/Hydrator/ArraySerializable.php index 6331af008..7a3581107 100644 --- a/src/Hydrator/ArraySerializable.php +++ b/src/Hydrator/ArraySerializable.php @@ -32,14 +32,20 @@ public function extract($object) } $data = $object->getArrayCopy(); + $filter = $this->getFilter(); foreach ($data as $name => $value) { - if (!$this->getFilter()->filter($name)) { + if (!$filter->filter($name)) { unset($data[$name]); continue; } - - $data[$name] = $this->extractValue($name, $value); + $extractedName = $this->extractName($name, $object); + // replace the original key with extracted, if differ + if ($extractedName !== $name) { + unset($data[$name]); + $name = $extractedName; + } + $data[$name] = $this->extractValue($name, $value, $object); } return $data; @@ -58,15 +64,16 @@ public function extract($object) */ public function hydrate(array $data, $object) { - $self = $this; - array_walk($data, function (&$value, $name) use ($self) { - $value = $self->hydrateValue($name, $value); - }); + $replacement = array(); + foreach ($data as $key => $value) { + $name = $this->hydrateName($key, $data); + $replacement[$name] = $this->hydrateValue($name, $value, $data); + } if (is_callable(array($object, 'exchangeArray'))) { - $object->exchangeArray($data); + $object->exchangeArray($replacement); } elseif (is_callable(array($object, 'populate'))) { - $object->populate($data); + $object->populate($replacement); } else { throw new Exception\BadMethodCallException(sprintf( '%s expects the provided object to implement exchangeArray() or populate()', __METHOD__ diff --git a/src/Hydrator/ClassMethods.php b/src/Hydrator/ClassMethods.php index ec3fc6ffb..7ea4a248b 100644 --- a/src/Hydrator/ClassMethods.php +++ b/src/Hydrator/ClassMethods.php @@ -19,6 +19,7 @@ use Zend\Stdlib\Hydrator\Filter\IsFilter; use Zend\Stdlib\Hydrator\Filter\MethodMatchFilter; use Zend\Stdlib\Hydrator\Filter\OptionalParametersFilter; +use Zend\Stdlib\Hydrator\NamingStrategy\UnderscoreNamingStrategy; class ClassMethods extends AbstractHydrator implements HydratorOptionsInterface { @@ -77,7 +78,13 @@ public function setOptions($options) */ public function setUnderscoreSeparatedKeys($underscoreSeparatedKeys) { - $this->underscoreSeparatedKeys = $underscoreSeparatedKeys; + $this->underscoreSeparatedKeys = (bool) $underscoreSeparatedKeys; + + if ($this->underscoreSeparatedKeys) { + $this->setNamingStrategy(new UnderscoreNamingStrategy); + } elseif ($this->getNamingStrategy() instanceof UnderscoreNamingStrategy) { + $this->removeNamingStrategy(); + } return $this; } @@ -117,11 +124,6 @@ public function extract($object) $filter = $this->filterComposite; } - $transform = function ($letters) { - $letter = array_shift($letters); - - return '_' . strtolower($letter); - }; $attributes = array(); $methods = get_class_methods($object); @@ -146,9 +148,7 @@ public function extract($object) } } - if ($this->underscoreSeparatedKeys) { - $attribute = preg_replace_callback('/([A-Z])/', $transform, $attribute); - } + $attribute = $this->extractName($attribute, $object); $attributes[$attribute] = $this->extractValue($attribute, $object->$method(), $object); } @@ -173,17 +173,8 @@ public function hydrate(array $data, $object) )); } - $transform = function ($letters) { - $letter = substr(array_shift($letters), 1, 1); - - return ucfirst($letter); - }; - foreach ($data as $property => $value) { - $method = 'set' . ucfirst($property); - if ($this->underscoreSeparatedKeys) { - $method = preg_replace_callback('/(_[a-z])/i', $transform, $method); - } + $method = 'set' . ucfirst($this->hydrateName($property, $data)); if (is_callable(array($object, $method))) { $value = $this->hydrateValue($property, $value, $data); $object->$method($value); diff --git a/src/Hydrator/Filter/NumberOfParameterFilter.php b/src/Hydrator/Filter/NumberOfParameterFilter.php index 25ed587db..3d153e3ad 100644 --- a/src/Hydrator/Filter/NumberOfParameterFilter.php +++ b/src/Hydrator/Filter/NumberOfParameterFilter.php @@ -26,7 +26,7 @@ class NumberOfParameterFilter implements FilterInterface */ public function __construct($numberOfParameters = 0) { - $this->numberOfParameters = 0; + $this->numberOfParameters = (int) $numberOfParameters; } /** @@ -44,10 +44,6 @@ public function filter($property) ); } - if ($reflectionMethod->getNumberOfParameters() !== $this->numberOfParameters) { - return false; - } - - return true; + return $reflectionMethod->getNumberOfParameters() === $this->numberOfParameters; } } diff --git a/src/Hydrator/Filter/OptionalParametersFilter.php b/src/Hydrator/Filter/OptionalParametersFilter.php index b78a21b1d..464015905 100644 --- a/src/Hydrator/Filter/OptionalParametersFilter.php +++ b/src/Hydrator/Filter/OptionalParametersFilter.php @@ -25,7 +25,7 @@ class OptionalParametersFilter implements FilterInterface * * @var bool[] */ - private static $propertiesCache = array(); + protected static $propertiesCache = array(); /** * {@inheritDoc} diff --git a/src/Hydrator/FilterEnabledInterface.php b/src/Hydrator/FilterEnabledInterface.php new file mode 100644 index 000000000..04505bb2c --- /dev/null +++ b/src/Hydrator/FilterEnabledInterface.php @@ -0,0 +1,63 @@ + + * $composite->addFilter( + * "servicelocator", + * function ($property) { + * list($class, $method) = explode('::', $property); + * if ($method === 'getServiceLocator') { + * return false; + * } + * return true; + * }, + * FilterComposite::CONDITION_AND + * ); + * + * + * @param string $name Index in the composite + * @param callable|FilterInterface $filter + * @param int $condition + * @return FilterComposite + */ + public function addFilter($name, $filter, $condition = FilterComposite::CONDITION_OR); + + /** + * Check whether a specific filter exists at key $name or not + * + * @param string $name Index in the composite + * @return bool + */ + public function hasFilter($name); + + /** + * Remove a filter from the composition. + * To not extract "has" methods, you simply need to unregister it + * + * + * $filterComposite->removeFilter('has'); + * + * + * @param $name + * @return FilterComposite + */ + public function removeFilter($name); +} diff --git a/src/Hydrator/HydrationInterface.php b/src/Hydrator/HydrationInterface.php new file mode 100644 index 000000000..340a7663b --- /dev/null +++ b/src/Hydrator/HydrationInterface.php @@ -0,0 +1,22 @@ +hydrator = $hydrator; + + return $this; + } + + /** + * Retrieve hydrator + * + * @param void + * @return null|HydratorInterface + * @access public + */ + public function getHydrator() + { + return $this->hydrator; + } +} diff --git a/src/Hydrator/HydratorInterface.php b/src/Hydrator/HydratorInterface.php index 7d65bb085..8596143da 100644 --- a/src/Hydrator/HydratorInterface.php +++ b/src/Hydrator/HydratorInterface.php @@ -9,22 +9,9 @@ namespace Zend\Stdlib\Hydrator; -interface HydratorInterface +use Zend\Stdlib\Extractor\ExtractionInterface; + +interface HydratorInterface extends HydrationInterface, ExtractionInterface { - /** - * Extract values from an object - * - * @param object $object - * @return array - */ - public function extract($object); - /** - * Hydrate $object with the provided $data. - * - * @param array $data - * @param object $object - * @return object - */ - public function hydrate(array $data, $object); } diff --git a/src/Hydrator/NamingStrategy/NamingStrategyInterface.php b/src/Hydrator/NamingStrategy/NamingStrategyInterface.php new file mode 100644 index 000000000..dacca1197 --- /dev/null +++ b/src/Hydrator/NamingStrategy/NamingStrategyInterface.php @@ -0,0 +1,37 @@ +getUnderscoreToCamelCaseFilter()->filter($name)); + } + + /** + * Remove capitalized letters and prepend underscores. + * + * @param string $name + * @return string + */ + public function extract($name) + { + return $this->getCamelCaseToUnderscoreFilter()->filter($name); + } + + /** + * @return FilterChain + */ + protected function getUnderscoreToCamelCaseFilter() + { + if (static::$underscoreToCamelCaseFilter instanceof FilterChain) { + return static::$underscoreToCamelCaseFilter; + } + + $filter = new FilterChain(); + $filter->attachByName('WordUnderscoreToCamelCase'); + static::$underscoreToCamelCaseFilter = $filter; + return $filter; + } + + /** + * @return FilterChain + */ + protected function getCamelCaseToUnderscoreFilter() + { + if (static::$camelCaseToUnderscoreFilter instanceof FilterChain) { + return static::$camelCaseToUnderscoreFilter; + } + + $filter = new FilterChain(); + $filter->attachByName('WordCamelCaseToUnderscore'); + $filter->attachByName('StringToLower'); + static::$camelCaseToUnderscoreFilter = $filter; + return $filter; + } +} diff --git a/src/Hydrator/NamingStrategyEnabledInterface.php b/src/Hydrator/NamingStrategyEnabledInterface.php new file mode 100644 index 000000000..ab1ce7f1c --- /dev/null +++ b/src/Hydrator/NamingStrategyEnabledInterface.php @@ -0,0 +1,44 @@ +extractValue($name, $value); + // Replace name if extracted differ + $extracted = $this->extractName($name, $object); + if ($extracted !== $name) { + unset($data[$name]); + $name = $extracted; + } + $data[$name] = $this->extractValue($name, $value, $object); } return $data; @@ -63,7 +68,8 @@ public function hydrate(array $data, $object) '%s expects the provided $object to be a PHP object)', __METHOD__ )); } - foreach ($data as $property => $value) { + foreach ($data as $name => $value) { + $property = $this->hydrateName($name, $data); $object->$property = $this->hydrateValue($property, $value, $data); } return $object; diff --git a/src/Hydrator/Reflection.php b/src/Hydrator/Reflection.php index 3e9cfd0cc..3c066e963 100644 --- a/src/Hydrator/Reflection.php +++ b/src/Hydrator/Reflection.php @@ -30,7 +30,7 @@ public function extract($object) { $result = array(); foreach (self::getReflProperties($object) as $property) { - $propertyName = $property->getName(); + $propertyName = $this->extractName($property->getName(), $object); if (!$this->filterComposite->filter($propertyName)) { continue; } @@ -53,8 +53,9 @@ public function hydrate(array $data, $object) { $reflProperties = self::getReflProperties($object); foreach ($data as $key => $value) { - if (isset($reflProperties[$key])) { - $reflProperties[$key]->setValue($object, $this->hydrateValue($key, $value, $data)); + $name = $this->hydrateName($key, $data); + if (isset($reflProperties[$name])) { + $reflProperties[$name]->setValue($object, $this->hydrateValue($name, $value, $data)); } } return $object; diff --git a/src/Hydrator/Strategy/ClosureStrategy.php b/src/Hydrator/Strategy/ClosureStrategy.php index a5cb3413a..6360c868d 100644 --- a/src/Hydrator/Strategy/ClosureStrategy.php +++ b/src/Hydrator/Strategy/ClosureStrategy.php @@ -75,26 +75,28 @@ public function __construct($extractFunc = null, $hydrateFunc = null) /** * Converts the given value so that it can be extracted by the hydrator. * - * @param mixed $value The original value. + * @param mixed $value The original value. + * @param array $object The object is optionally provided as context. * @return mixed Returns the value that should be extracted. */ - public function extract($value) + public function extract($value, $object = null) { $func = $this->extractFunc; - return $func($value); + return $func($value, $object); } /** * Converts the given value so that it can be hydrated by the hydrator. * - * @param mixed $value The original value. + * @param mixed $value The original value. + * @param array $data The whole data is optionally provided as context. * @return mixed Returns the value that should be hydrated. */ - public function hydrate($value) + public function hydrate($value, $data = null) { $func = $this->hydrateFunc; - return $func($value); + return $func($value, $data); } } diff --git a/src/JsonSerializable.php b/src/JsonSerializable.php new file mode 100644 index 000000000..9d00b3560 --- /dev/null +++ b/src/JsonSerializable.php @@ -0,0 +1,28 @@ +offsetExists($name)) { return parent::offsetGet($name); } return null; @@ -96,7 +96,7 @@ public function offsetGet($name) */ public function get($name, $default = null) { - if (isset($this[$name])) { + if ($this->offsetExists($name)) { return parent::offsetGet($name); } return $default; diff --git a/src/PriorityList.php b/src/PriorityList.php new file mode 100644 index 000000000..1664e1932 --- /dev/null +++ b/src/PriorityList.php @@ -0,0 +1,263 @@ +sorted = false; + $this->count++; + + $this->items[$name] = array( + 'data' => $value, + 'priority' => (int) $priority, + 'serial' => $this->serial++, + ); + } + + public function setPriority($name, $priority) + { + if (!isset($this->items[$name])) { + throw new \Exception("item $name not found"); + } + $this->items[$name]['priority'] = (int) $priority; + $this->sorted = false; + return $this; + } + + /** + * Remove a item. + * + * @param string $name + * @return void + */ + public function remove($name) + { + if (!isset($this->items[$name])) { + return; + } + + $this->count--; + unset($this->items[$name]); + } + + /** + * Remove all items. + * + * @return void + */ + public function clear() + { + $this->items = array(); + $this->serial = 0; + $this->count = 0; + $this->sorted = false; + } + + /** + * Get a item. + * + * @param string $name + * @return mixed + */ + public function get($name) + { + if (!isset($this->items[$name])) { + return null; + } + + return $this->items[$name]['data']; + } + + /** + * Sort all items. + * + * @return void + */ + protected function sort() + { + if (!$this->sorted) { + uasort($this->items, array($this, 'compare')); + $this->sorted = true; + } + } + + /** + * Compare the priority of two items. + * + * @param array $item1, + * @param array $item2 + * @return int + */ + protected function compare(array $item1, array $item2) + { + return ($item1['priority'] === $item2['priority']) + ? ($item1['serial'] > $item2['serial'] ? -1 : 1) * $this->isLIFO + : ($item1['priority'] > $item2['priority'] ? -1 : 1); + } + + /** + * Get/Set serial order mode + * + * @param bool $flag + * @return bool + */ + public function isLIFO($flag = null) + { + if ($flag !== null) { + if (($flag = ($flag === true ? 1 : -1)) !== $this->isLIFO) { + $this->isLIFO = $flag; + $this->sorted = false; + } + } + return $this->isLIFO === 1; + } + + /** + * rewind(): defined by Iterator interface. + * + * @see Iterator::rewind() + * @return void + */ + public function rewind() + { + $this->sort(); + reset($this->items); + } + + /** + * current(): defined by Iterator interface. + * + * @see Iterator::current() + * @return mixed + */ + public function current() + { + $node = current($this->items); + return ($node !== false ? $node['data'] : false); + } + + /** + * key(): defined by Iterator interface. + * + * @see Iterator::key() + * @return string + */ + public function key() + { + return key($this->items); + } + + /** + * next(): defined by Iterator interface. + * + * @see Iterator::next() + * @return mixed + */ + public function next() + { + $node = next($this->items); + return ($node !== false ? $node['data'] : false); + } + + /** + * valid(): defined by Iterator interface. + * + * @see Iterator::valid() + * @return bool + */ + public function valid() + { + return ($this->current() !== false); + } + + /** + * count(): defined by Countable interface. + * + * @see Countable::count() + * @return int + */ + public function count() + { + return $this->count; + } + + /** + * Return list as array + * + * @param int $flag + * @return array + */ + public function toArray($flag = self::EXTR_DATA) + { + $this->sort(); + if ($flag == self::EXTR_BOTH) { + return $this->items; + } + return array_map( + ($flag == self::EXTR_PRIORITY) + ? function ($item) { return $item['priority']; } + : function ($item) { return $item['data']; }, + $this->items + ); + } +} diff --git a/src/StringWrapper/AbstractStringWrapper.php b/src/StringWrapper/AbstractStringWrapper.php index d3e8830d6..74d0c55f1 100644 --- a/src/StringWrapper/AbstractStringWrapper.php +++ b/src/StringWrapper/AbstractStringWrapper.php @@ -245,8 +245,6 @@ public function strPad($input, $padLength, $padString = ' ', $padType = STR_PAD_ $repeatCount = floor($lengthOfPadding / $padStringLength); if ($padType === STR_PAD_BOTH) { - $lastStringLeft = ''; - $lastStringRight = ''; $repeatCountLeft = $repeatCountRight = ($repeatCount - $repeatCount % 2) / 2; $lastStringLength = $lengthOfPadding - 2 * $repeatCountLeft * $padStringLength; diff --git a/test/ArrayObjectTest.php b/test/ArrayObjectTest.php index 09a695cfd..5685d1dda 100644 --- a/test/ArrayObjectTest.php +++ b/test/ArrayObjectTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -52,9 +52,6 @@ public function testStdPropList() public function testStdPropListCannotAccessObjectVars() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $this->setExpectedException('InvalidArgumentException'); $ar = new ArrayObject(); $ar->flag; @@ -206,9 +203,6 @@ public function testIteratorClass() public function testInvalidIteratorClassThrowsInvalidArgumentException() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $this->setExpectedException('InvalidArgumentException'); $ar = new ArrayObject(array(), ArrayObject::STD_PROP_LIST, 'InvalidArrayIterator'); } @@ -254,9 +248,6 @@ public function testOffsetExists() public function testOffsetExistsThrowsExceptionOnProtectedProperty() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $this->setExpectedException('InvalidArgumentException'); $ar = new ArrayObject(); isset($ar->protectedProperties); @@ -276,9 +267,6 @@ public function testOffsetGetOffsetSet() public function testOffsetGetThrowsExceptionOnProtectedProperty() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $this->setExpectedException('InvalidArgumentException'); $ar = new ArrayObject(); $ar->protectedProperties; @@ -286,9 +274,6 @@ public function testOffsetGetThrowsExceptionOnProtectedProperty() public function testOffsetSetThrowsExceptionOnProtectedProperty() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $this->setExpectedException('InvalidArgumentException'); $ar = new ArrayObject(); $ar->protectedProperties = null; @@ -308,9 +293,6 @@ public function testOffsetUnset() public function testOffsetUnsetMultidimensional() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $ar = new ArrayObject(); $ar['foo'] = array('bar' => array('baz' => 'boo')); unset($ar['foo']['bar']['baz']); @@ -318,9 +300,6 @@ public function testOffsetUnsetMultidimensional() public function testOffsetUnsetThrowsExceptionOnProtectedProperty() { - if (version_compare(PHP_VERSION, '5.3.4') < 0) { - $this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3'); - } $this->setExpectedException('InvalidArgumentException'); $ar = new ArrayObject(); unset($ar->protectedProperties); @@ -372,4 +351,15 @@ public function testUksort() $this->assertSame($sorted, $ar->getArrayCopy()); } + /** + * @group 6089 + */ + public function testSerializationRestoresProperties() + { + $ar = new ArrayObject(); + $ar->foo = 'bar'; + $ar['bar'] = 'foo'; + + $this->assertEquals($ar, unserialize(serialize($ar))); + } } diff --git a/test/ArrayUtilsTest.php b/test/ArrayUtilsTest.php index 1ad2fc150..3e47cc854 100644 --- a/test/ArrayUtilsTest.php +++ b/test/ArrayUtilsTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -143,20 +143,67 @@ public static function invalidArrays() public static function mergeArrays() { return array( - 'merge-integer-and-string keys' => array( + 'merge-integer-and-string-keys' => array( array( 'foo', - 3 => 'bar', - 'baz' => 'baz' + 3 => 'bar', + 'baz' => 'baz', + 4 => array( + 'a', + 1 => 'b', + 'c', + ), ), array( 'baz', + 4 => array( + 'd' => 'd', + ), ), + false, array( 0 => 'foo', 3 => 'bar', 'baz' => 'baz', - 4 => 'baz' + 4 => array( + 'a', + 1 => 'b', + 'c', + ), + 5 => 'baz', + 6 => array( + 'd' => 'd', + ), + ) + ), + 'merge-integer-and-string-keys-preserve-numeric' => array( + array( + 'foo', + 3 => 'bar', + 'baz' => 'baz', + 4 => array( + 'a', + 1 => 'b', + 'c', + ), + ), + array( + 'baz', + 4 => array( + 'd' => 'd', + ), + ), + true, + array( + 0 => 'baz', + 3 => 'bar', + 'baz' => 'baz', + 4 => array( + 'a', + 1 => 'b', + 'c', + 'd' => 'd', + ), ) ), 'merge-arrays-recursively' => array( @@ -170,6 +217,7 @@ public static function mergeArrays() 'baz' ) ), + false, array( 'foo' => array( 0 => 'baz', @@ -186,11 +234,32 @@ public static function mergeArrays() 'foo' => 'baz', 'bar' => 'bat' ), + false, array( 'foo' => 'baz', 'bar' => 'bat' ) ), + 'merge-with-null' => array( + array( + 'foo' => null, + null => 'rod', + 'cat' => 'bar', + 'god' => 'rad' + ), + array( + 'foo' => 'baz', + null => 'zad', + 'god' => null + ), + false, + array( + 'foo' => 'baz', + null => 'zad', + 'cat' => 'bar', + 'god' => null + ) + ), ); } @@ -340,9 +409,9 @@ public function testEmptyArrayReturnsFalse() /** * @dataProvider mergeArrays */ - public function testMerge($a, $b, $expected) + public function testMerge($a, $b, $preserveNumericKeys, $expected) { - $this->assertEquals($expected, ArrayUtils::merge($a, $b)); + $this->assertEquals($expected, ArrayUtils::merge($a, $b, $preserveNumericKeys)); } /** diff --git a/test/CallbackHandlerTest.php b/test/CallbackHandlerTest.php index 2a05c94c7..eb19528fe 100644 --- a/test/CallbackHandlerTest.php +++ b/test/CallbackHandlerTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/DateTimeTest.php b/test/DateTimeTest.php index 3aa542dae..f63739cad 100644 --- a/test/DateTimeTest.php +++ b/test/DateTimeTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/ErrorHandlerTest.php b/test/ErrorHandlerTest.php index 3b8343622..c91d466b1 100644 --- a/test/ErrorHandlerTest.php +++ b/test/ErrorHandlerTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/FilterCompositeTest.php b/test/FilterCompositeTest.php index 20b6c4305..9086d9a69 100644 --- a/test/FilterCompositeTest.php +++ b/test/FilterCompositeTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/FilterTest.php b/test/FilterTest.php index d7e56eaac..4682e94ca 100644 --- a/test/FilterTest.php +++ b/test/FilterTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/GlobTest.php b/test/GlobTest.php index a06651216..8b26dc9c2 100644 --- a/test/GlobTest.php +++ b/test/GlobTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Guard/ArrayOrTraversableGuardTraitTest.php b/test/Guard/ArrayOrTraversableGuardTraitTest.php new file mode 100644 index 000000000..599a1f02a --- /dev/null +++ b/test/Guard/ArrayOrTraversableGuardTraitTest.php @@ -0,0 +1,51 @@ +markTestSkipped('Only valid for php >= 5.4'); + } + } + + public function testGuardForArrayOrTraversableThrowsException() + { + $object = new GuardedObject; + $this->setExpectedException( + 'Zend\Stdlib\Exception\InvalidArgumentException', + 'Argument must be an array or Traversable, [string] given' + ); + $object->setArrayOrTraversable(''); + } + + public function testGuardForArrayOrTraversableAllowsArray() + { + $object = new GuardedObject; + $this->assertNull($object->setArrayOrTraversable(array())); + } + + public function testGuardForArrayOrTraversableAllowsTraversable() + { + $object = new GuardedObject; + $traversable = new ArrayObject; + $this->assertNull($object->setArrayOrTraversable($traversable)); + } +} diff --git a/test/Guard/EmptyGuardTraitTest.php b/test/Guard/EmptyGuardTraitTest.php new file mode 100644 index 000000000..618075480 --- /dev/null +++ b/test/Guard/EmptyGuardTraitTest.php @@ -0,0 +1,43 @@ +markTestSkipped('Only valid for php >= 5.4'); + } + } + + public function testGuardAgainstEmptyThrowsException() + { + $object = new GuardedObject; + $this->setExpectedException( + 'Zend\Stdlib\Exception\InvalidArgumentException', + 'Argument cannot be empty' + ); + $object->setNotEmpty(''); + } + + public function testGuardAgainstEmptyAllowsNonEmptyString() + { + $object = new GuardedObject; + $this->assertNull($object->setNotEmpty('foo')); + } +} diff --git a/test/Guard/GuardUtilsTest.php b/test/Guard/GuardUtilsTest.php new file mode 100644 index 000000000..7d381707c --- /dev/null +++ b/test/Guard/GuardUtilsTest.php @@ -0,0 +1,68 @@ +setExpectedException( + 'Zend\Stdlib\Exception\InvalidArgumentException', + 'Argument must be an array or Traversable, [string] given' + ); + GuardUtils::guardForArrayOrTraversable(''); + } + + public function testGuardForArrayOrTraversableAllowsArray() + { + $this->assertNull(GuardUtils::guardForArrayOrTraversable(array())); + } + + public function testGuardForArrayOrTraversableAllowsTraversable() + { + $traversable = new ArrayObject; + $this->assertNull(GuardUtils::guardForArrayOrTraversable($traversable)); + } + + public function testGuardAgainstEmptyThrowsException() + { + $this->setExpectedException( + 'Zend\Stdlib\Exception\InvalidArgumentException', + 'Argument cannot be empty' + ); + GuardUtils::guardAgainstEmpty(''); + } + + public function testGuardAgainstEmptyAllowsNonEmptyString() + { + $this->assertNull(GuardUtils::guardAgainstEmpty('foo')); + } + + public function testGuardAgainstNullThrowsException() + { + $this->setExpectedException( + 'Zend\Stdlib\Exception\InvalidArgumentException', + 'Argument cannot be null' + ); + GuardUtils::guardAgainstNull(null); + } + + public function testGuardAgainstNullAllowsNonNull() + { + $this->assertNull(GuardUtils::guardAgainstNull('foo')); + } +} diff --git a/test/Guard/NullGuardTraitTest.php b/test/Guard/NullGuardTraitTest.php new file mode 100644 index 000000000..658bbe19c --- /dev/null +++ b/test/Guard/NullGuardTraitTest.php @@ -0,0 +1,43 @@ +markTestSkipped('Only valid for php >= 5.4'); + } + } + + public function testGuardAgainstNullThrowsException() + { + $object = new GuardedObject; + $this->setExpectedException( + 'Zend\Stdlib\Exception\InvalidArgumentException', + 'Argument cannot be null' + ); + $object->setNotNull(null); + } + + public function testGuardAgainstNullAllowsNonNull() + { + $object = new GuardedObject; + $this->assertNull($object->setNotNull('foo')); + } +} diff --git a/test/Hydrator/Aggregate/AggregateHydratorFunctionalTest.php b/test/Hydrator/Aggregate/AggregateHydratorFunctionalTest.php index 58c2c2d7a..f90f58392 100644 --- a/test/Hydrator/Aggregate/AggregateHydratorFunctionalTest.php +++ b/test/Hydrator/Aggregate/AggregateHydratorFunctionalTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/Aggregate/AggregateHydratorTest.php b/test/Hydrator/Aggregate/AggregateHydratorTest.php index 1d1dbc62f..954f78143 100644 --- a/test/Hydrator/Aggregate/AggregateHydratorTest.php +++ b/test/Hydrator/Aggregate/AggregateHydratorTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/Aggregate/ExtractEventTest.php b/test/Hydrator/Aggregate/ExtractEventTest.php index d7c5c60af..a55b7aec0 100644 --- a/test/Hydrator/Aggregate/ExtractEventTest.php +++ b/test/Hydrator/Aggregate/ExtractEventTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/Aggregate/HydrateEventTest.php b/test/Hydrator/Aggregate/HydrateEventTest.php index 746229728..874abe99c 100644 --- a/test/Hydrator/Aggregate/HydrateEventTest.php +++ b/test/Hydrator/Aggregate/HydrateEventTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/Aggregate/HydratorListenerTest.php b/test/Hydrator/Aggregate/HydratorListenerTest.php index 8b450ea32..6d9366312 100644 --- a/test/Hydrator/Aggregate/HydratorListenerTest.php +++ b/test/Hydrator/Aggregate/HydratorListenerTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/ClassMethodsTest.php b/test/Hydrator/ClassMethodsTest.php index 7c1aff37f..c8dbf8fd9 100644 --- a/test/Hydrator/ClassMethodsTest.php +++ b/test/Hydrator/ClassMethodsTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/Filter/NumberOfParameterFilterTest.php b/test/Hydrator/Filter/NumberOfParameterFilterTest.php new file mode 100644 index 000000000..8d1c0cdb9 --- /dev/null +++ b/test/Hydrator/Filter/NumberOfParameterFilterTest.php @@ -0,0 +1,54 @@ +assertTrue($filter->filter(__CLASS__ . '::methodWithNoParameters')); + $this->assertFalse($filter->filter(__CLASS__ . '::methodWithOptionalParameters')); + } + + /** + * @group 6083 + */ + public function testArityOne() + { + $filter = new NumberOfParameterFilter(1); + $this->assertFalse($filter->filter(__CLASS__ . '::methodWithNoParameters')); + $this->assertTrue($filter->filter(__CLASS__ . '::methodWithOptionalParameters')); + } + + /** + * Test asset method + */ + public function methodWithOptionalParameters($parameter = 'foo') + { + } + + /** + * Test asset method + */ + public function methodWithNoParameters() + { + } +} diff --git a/test/Hydrator/Filter/OptionalParametersFilterTest.php b/test/Hydrator/Filter/OptionalParametersFilterTest.php index 8f2339fd1..542941bcf 100644 --- a/test/Hydrator/Filter/OptionalParametersFilterTest.php +++ b/test/Hydrator/Filter/OptionalParametersFilterTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/HydratorAwareTraitTest.php b/test/Hydrator/HydratorAwareTraitTest.php new file mode 100644 index 000000000..d21afdb67 --- /dev/null +++ b/test/Hydrator/HydratorAwareTraitTest.php @@ -0,0 +1,45 @@ +getObjectForTrait('\Zend\Stdlib\Hydrator\HydratorAwareTrait'); + + $this->assertAttributeEquals(null, 'hydrator', $object); + + $hydrator = $this->getMockForAbstractClass('\Zend\Stdlib\Hydrator\AbstractHydrator'); + + $object->setHydrator($hydrator); + + $this->assertAttributeEquals($hydrator, 'hydrator', $object); + } + + public function testGetHydrator() + { + $object = $this->getObjectForTrait('\Zend\Stdlib\Hydrator\HydratorAwareTrait'); + + $this->assertNull($object->getHydrator()); + + $hydrator = $this->getMockForAbstractClass('\Zend\Stdlib\Hydrator\AbstractHydrator'); + + $object->setHydrator($hydrator); + + $this->assertEquals($hydrator, $object->getHydrator()); + } +} diff --git a/test/Hydrator/HydratorManagerTest.php b/test/Hydrator/HydratorManagerTest.php index 784aa5295..66db8afcc 100644 --- a/test/Hydrator/HydratorManagerTest.php +++ b/test/Hydrator/HydratorManagerTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/NamingStrategy/UnderscoreNamingStrategyTest.php b/test/Hydrator/NamingStrategy/UnderscoreNamingStrategyTest.php new file mode 100644 index 000000000..2162ef5bd --- /dev/null +++ b/test/Hydrator/NamingStrategy/UnderscoreNamingStrategyTest.php @@ -0,0 +1,32 @@ +assertEquals('fooBarBaz', $strategy->hydrate('foo_bar_baz')); + } + + public function testNameExtractsToUnderscore() + { + $strategy = new UnderscoreNamingStrategy(); + $this->assertEquals('foo_bar_baz', $strategy->extract('fooBarBaz')); + } +} diff --git a/test/Hydrator/ReflectionTest.php b/test/Hydrator/ReflectionTest.php index 90a7ceb5f..b34fc63de 100644 --- a/test/Hydrator/ReflectionTest.php +++ b/test/Hydrator/ReflectionTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Hydrator/Strategy/ClosureStrategyTest.php b/test/Hydrator/Strategy/ClosureStrategyTest.php new file mode 100644 index 000000000..944f2057d --- /dev/null +++ b/test/Hydrator/Strategy/ClosureStrategyTest.php @@ -0,0 +1,108 @@ + 'foo', 'bar' => 'bar')), + array('foo' => 'FOO', 'bar' => 'BAR'), + ), + array( + function ($value, $data) { return isset($data['bar']) ? strtoupper($value) : $value; }, + new \ArrayObject(array('foo' => 'foo', 'bar' => 'bar')), + array('foo' => 'FOO', 'bar' => 'BAR'), + ), + array( + function ($value, $data) { return isset($data['bar']) ? strtoupper($value) : $value; }, + new \ArrayObject(array('foo' => 'foo', 'baz' => 'baz')), + array('foo' => 'foo', 'baz' => 'baz'), + ), + ); + } + + /** + * @return array + */ + public function hydrateDataProvider() + { + return array( + array( + function ($value) { return strtoupper($value); }, + array('foo' => 'foo', 'bar' => 'bar'), + array('foo' => 'FOO', 'bar' => 'BAR'), + ), + array( + function ($value, $data) { return strtoupper($value); }, + array('foo' => 'foo', 'bar' => 'bar'), + array('foo' => 'FOO', 'bar' => 'BAR'), + ), + array( + function ($value, $data) { return isset($data['bar']) ? strtoupper($value) : $value; }, + array('foo' => 'foo', 'bar' => 'bar'), + array('foo' => 'FOO', 'bar' => 'BAR'), + ), + array( + function ($value, $data) { return isset($data['bar']) ? strtoupper($value) : $value; }, + array('foo' => 'foo', 'baz' => 'baz'), + array('foo' => 'foo', 'baz' => 'baz'), + ), + ); + } + + /** + * @covers \Zend\Stdlib\Hydrator\Strategy\ClosureStrategy::extract() + * @dataProvider extractDataProvider + * + * @param Callable $extractFunc + * @param array $data + * @param array $expected + */ + public function testExtract($extractFunc, $data, $expected) + { + $strategy = new ClosureStrategy($extractFunc); + + $actual = array(); + foreach ($data as $k => $value) { + $actual[$k] = $strategy->extract($value, $data); + } + + $this->assertSame($actual, $expected); + } + + /** + * @covers \Zend\Stdlib\Hydrator\Strategy\ClosureStrategy::hydrate() + * @dataProvider hydrateDataProvider + * + * @param Callable $hydrateFunc + * @param array $data + * @param array $expected + */ + public function testHydrate($hydrateFunc, $data, $expected) + { + $strategy = new ClosureStrategy(null, $hydrateFunc); + + $actual = array(); + foreach ($data as $k => $value) { + $actual[$k] = $strategy->hydrate($value, $data); + } + + $this->assertSame($actual, $expected); + } +} diff --git a/test/HydratorClosureStrategyTest.php b/test/HydratorClosureStrategyTest.php index 5ff37c269..3595060b9 100644 --- a/test/HydratorClosureStrategyTest.php +++ b/test/HydratorClosureStrategyTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/HydratorObjectPropertyTest.php b/test/HydratorObjectPropertyTest.php index 4a1c6372e..bdee1f14e 100644 --- a/test/HydratorObjectPropertyTest.php +++ b/test/HydratorObjectPropertyTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/HydratorStrategyTest.php b/test/HydratorStrategyTest.php index 95e379250..adc8bd5be 100644 --- a/test/HydratorStrategyTest.php +++ b/test/HydratorStrategyTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/HydratorTest.php b/test/HydratorTest.php index 1e55c5942..8982d1aa3 100644 --- a/test/HydratorTest.php +++ b/test/HydratorTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/MessageTest.php b/test/MessageTest.php index f093fd5cc..f718055e0 100644 --- a/test/MessageTest.php +++ b/test/MessageTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/OptionsTest.php b/test/OptionsTest.php index 8d47f23fc..a976e531a 100644 --- a/test/OptionsTest.php +++ b/test/OptionsTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/ParametersTest.php b/test/ParametersTest.php index 86491e27a..f4ccb19fe 100644 --- a/test/ParametersTest.php +++ b/test/ParametersTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/PriorityListTest.php b/test/PriorityListTest.php new file mode 100644 index 000000000..e93688539 --- /dev/null +++ b/test/PriorityListTest.php @@ -0,0 +1,198 @@ +list = new PriorityList(); + } + + public function testInsert() + { + $this->list->insert('foo', new \stdClass(), 0); + + $this->assertEquals(1, count($this->list)); + + foreach ($this->list as $key => $value) { + $this->assertEquals('foo', $key); + } + } + + public function testRemove() + { + $this->list->insert('foo', new \stdClass(), 0); + $this->list->insert('bar', new \stdClass(), 0); + + $this->assertEquals(2, count($this->list)); + + $this->list->remove('foo'); + + $this->assertEquals(1, count($this->list)); + } + + public function testRemovingNonExistentRouteDoesNotYieldError() + { + $this->list->remove('foo'); + } + + public function testClear() + { + $this->list->insert('foo', new \stdClass(), 0); + $this->list->insert('bar', new \stdClass(), 0); + + $this->assertEquals(2, count($this->list)); + + $this->list->clear(); + + $this->assertEquals(0, count($this->list)); + $this->assertSame(false, $this->list->current()); + } + + public function testGet() + { + $route = new \stdClass(); + + $this->list->insert('foo', $route, 0); + + $this->assertEquals($route, $this->list->get('foo')); + $this->assertNull($this->list->get('bar')); + } + + public function testLIFOOnly() + { + $this->list->insert('foo', new \stdClass()); + $this->list->insert('bar', new \stdClass()); + $this->list->insert('baz', new \stdClass()); + $this->list->insert('foobar', new \stdClass()); + $this->list->insert('barbaz', new \stdClass()); + + $order = array(); + + foreach ($this->list as $key => $value) { + $orders[] = $key; + } + + $this->assertEquals(array('barbaz', 'foobar', 'baz', 'bar', 'foo'), $orders); + } + + public function testPriorityOnly() + { + $this->list->insert('foo', new \stdClass(), 1); + $this->list->insert('bar', new \stdClass(), 0); + $this->list->insert('baz', new \stdClass(), 2); + + $order = array(); + + foreach ($this->list as $key => $value) { + $orders[] = $key; + } + + $this->assertEquals(array('baz', 'foo', 'bar'), $orders); + } + + public function testLIFOWithPriority() + { + $this->list->insert('foo', new \stdClass(), 0); + $this->list->insert('bar', new \stdClass(), 0); + $this->list->insert('baz', new \stdClass(), 1); + + $orders = array(); + + foreach ($this->list as $key => $value) { + $orders[] = $key; + } + + $this->assertEquals(array('baz', 'bar', 'foo'), $orders); + } + + public function testFIFOWithPriority() + { + $this->list->isLIFO(false); + $this->list->insert('foo', new \stdClass(), 0); + $this->list->insert('bar', new \stdClass(), 0); + $this->list->insert('baz', new \stdClass(), 1); + + $order = array(); + + foreach ($this->list as $key => $value) { + $orders[] = $key; + } + + $this->assertEquals(array('baz', 'foo', 'bar'), $orders); + } + + public function testFIFOOnly() + { + $this->list->isLIFO(false); + $this->list->insert('foo', new \stdClass()); + $this->list->insert('bar', new \stdClass()); + $this->list->insert('baz', new \stdClass()); + $this->list->insert('foobar', new \stdClass()); + $this->list->insert('barbaz', new \stdClass()); + + $order = array(); + + foreach ($this->list as $key => $value) { + $orders[] = $key; + } + + $this->assertEquals(array('foo', 'bar', 'baz', 'foobar', 'barbaz'), $orders); + } + + public function testPriorityWithNegativesAndNull() + { + $this->list->insert('foo', new \stdClass(), null); + $this->list->insert('bar', new \stdClass(), 1); + $this->list->insert('baz', new \stdClass(), -1); + + $order = array(); + + foreach ($this->list as $key => $value) { + $orders[] = $key; + } + + $this->assertEquals(array('bar', 'foo', 'baz'), $orders); + } + + public function testToArray() + { + $this->list->insert('foo', 'foo_value', null); + $this->list->insert('bar', 'bar_value', 1); + $this->list->insert('baz', 'baz_value', -1); + + $this->assertEquals( + array( + 'bar' => 'bar_value', + 'foo' => 'foo_value', + 'baz' => 'baz_value' + ), + $this->list->toArray() + ); + + $this->assertEquals( + array( + 'bar' => array('data' => 'bar_value', 'priority' => 1, 'serial' => 1), + 'foo' => array('data' => 'foo_value', 'priority' => 0, 'serial' => 0), + 'baz' => array('data' => 'baz_value', 'priority' => -1, 'serial' => 2), + ), + $this->list->toArray(PriorityList::EXTR_BOTH) + ); + } +} diff --git a/test/PriorityQueueTest.php b/test/PriorityQueueTest.php index 649ee1ace..a6d062d1e 100644 --- a/test/PriorityQueueTest.php +++ b/test/PriorityQueueTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SignalHandlers/InstanceMethod.php b/test/SignalHandlers/InstanceMethod.php index f28a9a8d1..a8b4dc9b8 100644 --- a/test/SignalHandlers/InstanceMethod.php +++ b/test/SignalHandlers/InstanceMethod.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SignalHandlers/Invokable.php b/test/SignalHandlers/Invokable.php index 3e041eb3c..8028e0c3b 100644 --- a/test/SignalHandlers/Invokable.php +++ b/test/SignalHandlers/Invokable.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SignalHandlers/ObjectCallback.php b/test/SignalHandlers/ObjectCallback.php index 23392ed28..919ec3b49 100644 --- a/test/SignalHandlers/ObjectCallback.php +++ b/test/SignalHandlers/ObjectCallback.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SignalHandlers/Overloadable.php b/test/SignalHandlers/Overloadable.php index c43ead37f..6424287d4 100644 --- a/test/SignalHandlers/Overloadable.php +++ b/test/SignalHandlers/Overloadable.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SplPriorityQueueTest.php b/test/SplPriorityQueueTest.php index cfacb191a..1abc436af 100644 --- a/test/SplPriorityQueueTest.php +++ b/test/SplPriorityQueueTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SplQueueTest.php b/test/SplQueueTest.php index df42637d7..651edf1fc 100644 --- a/test/SplQueueTest.php +++ b/test/SplQueueTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/SplStackTest.php b/test/SplStackTest.php index 223e47bba..f4aed150c 100644 --- a/test/SplStackTest.php +++ b/test/SplStackTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/Strategy/SerializableStrategyTest.php b/test/Strategy/SerializableStrategyTest.php index 4c5a85700..9ae324dbc 100644 --- a/test/Strategy/SerializableStrategyTest.php +++ b/test/Strategy/SerializableStrategyTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/StringUtilsTest.php b/test/StringUtilsTest.php index e18d63bb6..20749bf8a 100644 --- a/test/StringUtilsTest.php +++ b/test/StringUtilsTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/StringWrapper/CommonStringWrapperTest.php b/test/StringWrapper/CommonStringWrapperTest.php index 7bd42e675..5703f2038 100644 --- a/test/StringWrapper/CommonStringWrapperTest.php +++ b/test/StringWrapper/CommonStringWrapperTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/StringWrapper/IconvTest.php b/test/StringWrapper/IconvTest.php index fa2cb2a7b..c7794ecb4 100644 --- a/test/StringWrapper/IconvTest.php +++ b/test/StringWrapper/IconvTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/StringWrapper/IntlTest.php b/test/StringWrapper/IntlTest.php index eda586453..a23d4771e 100644 --- a/test/StringWrapper/IntlTest.php +++ b/test/StringWrapper/IntlTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/StringWrapper/MbStringTest.php b/test/StringWrapper/MbStringTest.php index 01c9f8f41..279e57eee 100644 --- a/test/StringWrapper/MbStringTest.php +++ b/test/StringWrapper/MbStringTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/StringWrapper/NativeTest.php b/test/StringWrapper/NativeTest.php index 09ec62350..45a62a4cf 100644 --- a/test/StringWrapper/NativeTest.php +++ b/test/StringWrapper/NativeTest.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/AggregateObject.php b/test/TestAsset/AggregateObject.php index d73b2c454..eec0c93c1 100644 --- a/test/TestAsset/AggregateObject.php +++ b/test/TestAsset/AggregateObject.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ArrayObjectIterator.php b/test/TestAsset/ArrayObjectIterator.php index 5b2027a3a..eeba6495f 100644 --- a/test/TestAsset/ArrayObjectIterator.php +++ b/test/TestAsset/ArrayObjectIterator.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ArrayObjectObjectVars.php b/test/TestAsset/ArrayObjectObjectVars.php index 8448588a1..9ed7c185e 100644 --- a/test/TestAsset/ArrayObjectObjectVars.php +++ b/test/TestAsset/ArrayObjectObjectVars.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ArraySerializable.php b/test/TestAsset/ArraySerializable.php index 389ea2910..1680c4f36 100644 --- a/test/TestAsset/ArraySerializable.php +++ b/test/TestAsset/ArraySerializable.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ClassMethodsCamelCase.php b/test/TestAsset/ClassMethodsCamelCase.php index 317b24600..b1b99d2e6 100644 --- a/test/TestAsset/ClassMethodsCamelCase.php +++ b/test/TestAsset/ClassMethodsCamelCase.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ClassMethodsCamelCaseMissing.php b/test/TestAsset/ClassMethodsCamelCaseMissing.php index b140caf63..ec8882125 100644 --- a/test/TestAsset/ClassMethodsCamelCaseMissing.php +++ b/test/TestAsset/ClassMethodsCamelCaseMissing.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ClassMethodsFilterProviderInterface.php b/test/TestAsset/ClassMethodsFilterProviderInterface.php index 9e4e65cca..4149aa8ae 100644 --- a/test/TestAsset/ClassMethodsFilterProviderInterface.php +++ b/test/TestAsset/ClassMethodsFilterProviderInterface.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ClassMethodsInvalidParameter.php b/test/TestAsset/ClassMethodsInvalidParameter.php index 2a760e0e6..e8c855cfe 100644 --- a/test/TestAsset/ClassMethodsInvalidParameter.php +++ b/test/TestAsset/ClassMethodsInvalidParameter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Stdlib\TestAsset; diff --git a/test/TestAsset/ClassMethodsMagicMethodSetter.php b/test/TestAsset/ClassMethodsMagicMethodSetter.php index ff9cdd9b5..649111542 100644 --- a/test/TestAsset/ClassMethodsMagicMethodSetter.php +++ b/test/TestAsset/ClassMethodsMagicMethodSetter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Stdlib\TestAsset; @@ -14,7 +14,7 @@ class ClassMethodsMagicMethodSetter public function __call($method, $args) { - if(strlen($method) > 3 && strtolower(substr($method, 3)) == 'foo') { + if (strlen($method) > 3 && strtolower(substr($method, 3)) == 'foo') { $this->foo = $args[0]; } } diff --git a/test/TestAsset/ClassMethodsOptionalParameters.php b/test/TestAsset/ClassMethodsOptionalParameters.php index f56af51b5..19d7f9a69 100644 --- a/test/TestAsset/ClassMethodsOptionalParameters.php +++ b/test/TestAsset/ClassMethodsOptionalParameters.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ClassMethodsProtectedSetter.php b/test/TestAsset/ClassMethodsProtectedSetter.php index cff604b5d..705f0b6b2 100644 --- a/test/TestAsset/ClassMethodsProtectedSetter.php +++ b/test/TestAsset/ClassMethodsProtectedSetter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Stdlib\TestAsset; diff --git a/test/TestAsset/ClassMethodsTitleCase.php b/test/TestAsset/ClassMethodsTitleCase.php index aca681331..fd64b364f 100644 --- a/test/TestAsset/ClassMethodsTitleCase.php +++ b/test/TestAsset/ClassMethodsTitleCase.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ClassMethodsUnderscore.php b/test/TestAsset/ClassMethodsUnderscore.php index b5b083134..874e71a59 100644 --- a/test/TestAsset/ClassMethodsUnderscore.php +++ b/test/TestAsset/ClassMethodsUnderscore.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/GuardedObject.php b/test/TestAsset/GuardedObject.php new file mode 100644 index 000000000..4eeddf115 --- /dev/null +++ b/test/TestAsset/GuardedObject.php @@ -0,0 +1,32 @@ +guardForArrayOrTraversable($value); + } + + public function setNotEmpty($value) + { + $this->guardAgainstEmpty($value); + } + + public function setNotNull($value) + { + $this->guardAgainstNull($value); + } +} diff --git a/test/TestAsset/HydratorClosureStrategyEntity.php b/test/TestAsset/HydratorClosureStrategyEntity.php index 0deea416d..46f75be9b 100644 --- a/test/TestAsset/HydratorClosureStrategyEntity.php +++ b/test/TestAsset/HydratorClosureStrategyEntity.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/HydratorStrategy.php b/test/TestAsset/HydratorStrategy.php index 417d06b29..8de11588e 100644 --- a/test/TestAsset/HydratorStrategy.php +++ b/test/TestAsset/HydratorStrategy.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/HydratorStrategyContextAware.php b/test/TestAsset/HydratorStrategyContextAware.php index 8400efd5a..d4a9a42bb 100644 --- a/test/TestAsset/HydratorStrategyContextAware.php +++ b/test/TestAsset/HydratorStrategyContextAware.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/HydratorStrategyEntityA.php b/test/TestAsset/HydratorStrategyEntityA.php index 1e4f95054..9a7530cdb 100644 --- a/test/TestAsset/HydratorStrategyEntityA.php +++ b/test/TestAsset/HydratorStrategyEntityA.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/HydratorStrategyEntityB.php b/test/TestAsset/HydratorStrategyEntityB.php index adabe1fec..a9d66ef0b 100644 --- a/test/TestAsset/HydratorStrategyEntityB.php +++ b/test/TestAsset/HydratorStrategyEntityB.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ObjectProperty.php b/test/TestAsset/ObjectProperty.php index c873ddfa4..58a1c69a1 100644 --- a/test/TestAsset/ObjectProperty.php +++ b/test/TestAsset/ObjectProperty.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/Reflection.php b/test/TestAsset/Reflection.php index f2d70184f..0a39930de 100644 --- a/test/TestAsset/Reflection.php +++ b/test/TestAsset/Reflection.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/ReflectionFilter.php b/test/TestAsset/ReflectionFilter.php index 071677d08..28f3b163a 100644 --- a/test/TestAsset/ReflectionFilter.php +++ b/test/TestAsset/ReflectionFilter.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/TestOptions.php b/test/TestAsset/TestOptions.php index a2a254bfb..a24a47ae3 100644 --- a/test/TestAsset/TestOptions.php +++ b/test/TestAsset/TestOptions.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/test/TestAsset/TestOptionsNoStrict.php b/test/TestAsset/TestOptionsNoStrict.php index 4de06ebaf..58d0cd1bf 100644 --- a/test/TestAsset/TestOptionsNoStrict.php +++ b/test/TestAsset/TestOptionsNoStrict.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */