Skip to content
This repository
Browse code

CS space & returning instance

CS space & returning instance
  • Loading branch information...
commit 9b1378c739d007e5f9148cc8222573c289453a66 1 parent dd24e43
Blanchon Vincent blanchonvincent authored
8 library/Zend/Paginator/AdapterPluginManager.php
@@ -54,17 +54,15 @@ protected function createFromInvokable($canonicalName, $requestedName)
54 54 if (null === $this->creationOptions
55 55 || (is_array($this->creationOptions) && empty($this->creationOptions))
56 56 ) {
57   - $instance = new $invokable();
  57 + return new $invokable();
58 58 } else {
59 59 if($canonicalName == "dbselect" && is_array($this->creationOptions)) {
60 60 $class = new \ReflectionClass($invokable);
61   - $instance = $class->newInstanceArgs($this->creationOptions);
  61 + return $class->newInstanceArgs($this->creationOptions);
62 62 } else {
63   - $instance = new $invokable($this->creationOptions);
  63 + return new $invokable($this->creationOptions);
64 64 }
65 65 }
66   -
67   - return $instance;
68 66 }
69 67
70 68 /**
8 library/Zend/Paginator/Factory.php
@@ -24,18 +24,18 @@
24 24
25 25 public static function factory($items, $adapter = null)
26 26 {
27   - if(null === $adapter) {
  27 + if (null === $adapter) {
28 28 if ($items instanceof Traversable) {
29 29 $items = ArrayUtils::iteratorToArray($items);
30 30 }
31   - if(!is_array($items)) {
  31 + if (!is_array($items)) {
32 32 throw new Exception\InvalidArgumentException(
33 33 'The factory needs an associative array '
34 34 . 'or a Traversable object as an argument when '
35 35 . "it's used with one parameter"
36 36 );
37 37 }
38   - if(!isset($items['adapter']) && !isset($items['items'])) {
  38 + if (!isset($items['adapter']) && !isset($items['items'])) {
39 39 throw new Exception\InvalidArgumentException(
40 40 'The factory needs an associative array '
41 41 . 'or a Traversable object with keys '
@@ -45,7 +45,7 @@ public static function factory($items, $adapter = null)
45 45 $adapter = $items['adapter'];
46 46 $items = $items['items'];
47 47 }
48   - if(!$adapter instanceof AdapterInterface && !$adapter instanceof AdapterAggregateInterface) {
  48 + if (!$adapter instanceof AdapterInterface && !$adapter instanceof AdapterAggregateInterface) {
49 49 $adapter = self::getAdapterPluginManager()->get($adapter, $items);
50 50 }
51 51

0 comments on commit 9b1378c

Please sign in to comment.
Something went wrong with that request. Please try again.