From 543aa17958b43373e9d6db1ed1cf217ef59e3a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 12 Jun 2013 22:55:23 +0200 Subject: [PATCH 1/5] Resolved merge conflicts from commit 83ba3cf --- src/ArrayObject/PhpReferenceCompatibility.php | 6 +----- src/Hydrator/AbstractHydrator.php | 4 +--- src/Hydrator/Aggregate/AggregateHydrator.php | 4 +--- src/PriorityQueue.php | 5 +---- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/ArrayObject/PhpReferenceCompatibility.php b/src/ArrayObject/PhpReferenceCompatibility.php index 8a4a4bc22..e25257c76 100644 --- a/src/ArrayObject/PhpReferenceCompatibility.php +++ b/src/ArrayObject/PhpReferenceCompatibility.php @@ -23,11 +23,7 @@ * are unable to unset multi-dimensional arrays because you * need to fetch the properties / lists as references. */ -abstract class PhpReferenceCompatibility implements - IteratorAggregate, - ArrayAccess, - Serializable, - Countable +abstract class PhpReferenceCompatibility implements IteratorAggregate, ArrayAccess, Serializable, Countable { /** * Properties of the object have their normal functionality diff --git a/src/Hydrator/AbstractHydrator.php b/src/Hydrator/AbstractHydrator.php index da317ea08..4cb9a4356 100644 --- a/src/Hydrator/AbstractHydrator.php +++ b/src/Hydrator/AbstractHydrator.php @@ -15,9 +15,7 @@ use Zend\Stdlib\Hydrator\StrategyEnabledInterface; use Zend\Stdlib\Hydrator\Strategy\StrategyInterface; -abstract class AbstractHydrator implements - HydratorInterface, - StrategyEnabledInterface +abstract class AbstractHydrator implements HydratorInterface, StrategyEnabledInterface { /** * The list with strategies that this hydrator has. diff --git a/src/Hydrator/Aggregate/AggregateHydrator.php b/src/Hydrator/Aggregate/AggregateHydrator.php index 456df5e0c..bdcf1eb0a 100644 --- a/src/Hydrator/Aggregate/AggregateHydrator.php +++ b/src/Hydrator/Aggregate/AggregateHydrator.php @@ -19,9 +19,7 @@ /** * Aggregate hydrator that composes multiple hydrators via events */ -class AggregateHydrator implements - HydratorInterface, - EventManagerAwareInterface +class AggregateHydrator implements HydratorInterface, EventManagerAwareInterface { const DEFAULT_PRIORITY = 1; diff --git a/src/PriorityQueue.php b/src/PriorityQueue.php index f9b227020..bf6a624ac 100644 --- a/src/PriorityQueue.php +++ b/src/PriorityQueue.php @@ -25,10 +25,7 @@ * "inner" iterator in the form of an SplPriorityQueue object for performing * the actual iteration. */ -class PriorityQueue implements - Countable, - IteratorAggregate, - Serializable +class PriorityQueue implements Countable, IteratorAggregate, Serializable { const EXTR_DATA = 0x00000001; const EXTR_PRIORITY = 0x00000002; From 41e7304e163eecaf5fdc497148ada6aeaa077c81 Mon Sep 17 00:00:00 2001 From: mouhamed Date: Sat, 29 Jun 2013 16:14:07 +0200 Subject: [PATCH 2/5] Doc comment fixes --- src/Hydrator/HydratorAwareTrait.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Hydrator/HydratorAwareTrait.php b/src/Hydrator/HydratorAwareTrait.php index 32fbade11..5ccd84191 100644 --- a/src/Hydrator/HydratorAwareTrait.php +++ b/src/Hydrator/HydratorAwareTrait.php @@ -25,7 +25,8 @@ trait HydratorAwareTrait * Set hydrator * * @param HydratorInterface $hydrator - * @return HydratorAwareInterface + * @return self + * @access public */ public function setHydrator(HydratorInterface $hydrator) { @@ -37,7 +38,9 @@ public function setHydrator(HydratorInterface $hydrator) /** * Retrieve hydrator * - * @return HydratorInterface + * @param void + * @return null|HydratorInterface + * @access public */ public function getHydrator() { From 767ea04f2312819d620c4f8c56c753ba3178f364 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 2 Jul 2013 14:08:40 -0500 Subject: [PATCH 3/5] [zendframework/zf2#4764] CS fix - one argument per line --- src/Hydrator/FilterEnabledInterface.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Hydrator/FilterEnabledInterface.php b/src/Hydrator/FilterEnabledInterface.php index 90bfd1d01..e2b055fb6 100644 --- a/src/Hydrator/FilterEnabledInterface.php +++ b/src/Hydrator/FilterEnabledInterface.php @@ -20,14 +20,16 @@ interface FilterEnabledInterface extends FilterProviderInterface * To exclude e.g. the method getServiceLocator: * * - * $composite->addFilter("servicelocator", + * $composite->addFilter( + * "servicelocator", * function($property) { * list($class, $method) = explode('::', $property); * if ($method === 'getServiceLocator') { * return false; * } * return true; - * }, FilterComposite::CONDITION_AND + * }, + * FilterComposite::CONDITION_AND * ); * * From 982d6ea63c9c587e06edc1da8fb2ff24ed4ec3fe Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Wed, 31 Jul 2013 23:18:11 +0200 Subject: [PATCH 4/5] Removing notices from the Reflection hydrator --- src/Hydrator/Reflection.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Hydrator/Reflection.php b/src/Hydrator/Reflection.php index 1c093c88b..e95fcde85 100644 --- a/src/Hydrator/Reflection.php +++ b/src/Hydrator/Reflection.php @@ -78,8 +78,9 @@ protected static function getReflProperties($input) } if (!isset(static::$reflProperties[$input])) { - $reflClass = new ReflectionClass($input); - $reflProperties = $reflClass->getProperties(); + static::$reflProperties[$input] = array(); + $reflClass = new ReflectionClass($input); + $reflProperties = $reflClass->getProperties(); foreach ($reflProperties as $property) { $property->setAccessible(true); From 817e8673445ed10320ae91ca8d0803b2c8b3d30f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 19 Aug 2013 16:33:40 -0500 Subject: [PATCH 5/5] [zendframework/zf2#4919] Cleanup for consistency - Updated docblocks to remove `@static` annotation and to align properties (to be consistent with rest of class). - Return early when cached values are present, thus promoting the meat of the method to the method body. --- src/Hydrator/Reflection.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Hydrator/Reflection.php b/src/Hydrator/Reflection.php index e95fcde85..fae361aab 100644 --- a/src/Hydrator/Reflection.php +++ b/src/Hydrator/Reflection.php @@ -64,8 +64,7 @@ public function hydrate(array $data, $object) * Get a reflection properties from in-memory cache and lazy-load if * class has not been loaded. * - * @static - * @param string|object $input + * @param string|object $input * @throws Exception\InvalidArgumentException * @return array */ @@ -77,15 +76,17 @@ protected static function getReflProperties($input) throw new Exception\InvalidArgumentException('Input must be a string or an object.'); } - if (!isset(static::$reflProperties[$input])) { - static::$reflProperties[$input] = array(); - $reflClass = new ReflectionClass($input); - $reflProperties = $reflClass->getProperties(); + if (isset(static::$reflProperties[$input])) { + return static::$reflProperties[$input]; + } - foreach ($reflProperties as $property) { - $property->setAccessible(true); - static::$reflProperties[$input][$property->getName()] = $property; - } + static::$reflProperties[$input] = array(); + $reflClass = new ReflectionClass($input); + $reflProperties = $reflClass->getProperties(); + + foreach ($reflProperties as $property) { + $property->setAccessible(true); + static::$reflProperties[$input][$property->getName()] = $property; } return static::$reflProperties[$input];