Completed
Push — master ( fb21bc...46b7df )
by Emily
02:00
created
src/Factory/Reflection/ReflectionPropertyFactory.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Spaark\CompositeUtils\Model\Reflection\ReflectionComposite;
6 6
 use Spaark\CompositeUtils\Model\Reflection\ReflectionProperty;
7
-use Spaark\CompositeUtils\Model\Reflection\ReflectionParameter;
8 7
 use Spaark\CompositeUtils\Model\Reflection\Type\BooleanType;
9 8
 use Spaark\CompositeUtils\Model\Reflection\Type\CollectionType;
10 9
 use Spaark\CompositeUtils\Model\Reflection\Type\IntegerType;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public static function fromName($class, $property)
28 28
     {
29
-        return new static(new PHPNativeReflectionProperty
30
-        (
29
+        return new static(new PHPNativeReflectionProperty(
31 30
             $class, $property
32 31
         ));
33 32
     }
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
     {
37 36
         $this->accessor->setRawValue('owner', $parent);
38 37
         $this->accessor->setRawValue('defaultValue', $default);
39
-        $this->accessor->setRawValue
40
-        (
38
+        $this->accessor->setRawValue(
41 39
             'name',
42 40
             $this->reflector->getName()
43 41
         );
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
         if ($value{0} !== '?')
53 53
         {
54 54
             $nullable = false;
55
-        }
56
-        else
55
+        } else
57 56
         {
58 57
             $nullable = true;
59 58
             $value = substr($value, 1);
@@ -62,8 +61,7 @@  discard block
 block discarded – undo
62 61
         if (substr($value, -2) !== '[]')
63 62
         {
64 63
             $collection = false;
65
-        }
66
-        else
64
+        } else
67 65
         {
68 66
             $collection = true;
69 67
             $value = substr($value, 0, -2);
Please login to merge, or discard this patch.
src/Factory/Reflection/ReflectorFactory.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     {
40 40
         preg_match_all
41 41
         (
42
-              '/^'
42
+                '/^'
43 43
             .     '[ \t]*\*[ \t]*'
44 44
             .     '@([a-zA-Z]+)'
45 45
             .     '(.*)'
Please login to merge, or discard this patch.
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     protected function parseDocComment()
39 39
     {
40
-        preg_match_all
41
-        (
40
+        preg_match_all(
42 41
               '/^'
43 42
             .     '[ \t]*\*[ \t]*'
44 43
             .     '@([a-zA-Z]+)'
@@ -55,8 +54,7 @@  discard block
 block discarded – undo
55 54
 
56 55
             if (isset($this->acceptedParams[$name]))
57 56
             {
58
-                call_user_func
59
-                (
57
+                call_user_func(
60 58
                     array($this, $this->acceptedParams[$name]),
61 59
                     $name, $value
62 60
                 );
@@ -66,7 +64,7 @@  discard block
 block discarded – undo
66 64
 
67 65
     protected function setBool($name, $value)
68 66
     {
69
-        switch(strtolower($value))
67
+        switch (strtolower($value))
70 68
         {
71 69
             case '':
72 70
             case 'true':
Please login to merge, or discard this patch.
src/Factory/Reflection/ReflectionMethodFactory.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,17 +13,15 @@
 block discarded – undo
13 13
 
14 14
     public static function fromName($class, $method)
15 15
     {
16
-        return new static(new PHPNativeReflectionMethod
17
-        (
16
+        return new static(new PHPNativeReflectionMethod(
18 17
             $class, $method
19 18
         ));
20 19
     }
21 20
 
22
-    public function build(?ReflectionComposite $parent = null)
21
+    public function build(? ReflectionComposite $parent = null)
23 22
     {
24 23
         $this->accessor->setRawValue('owner', $parent);
25
-        $this->accessor->setRawValue
26
-        (
24
+        $this->accessor->setRawValue(
27 25
             'name',
28 26
             $this->reflector->getName()
29 27
         );
Please login to merge, or discard this patch.
src/Model/Reflection/Reflector.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
         if ($this->locked)
24 24
         {
25 25
             return parent::__set($var, $val);
26
-        }
27
-        else
26
+        } else
28 27
         {
29 28
             $this->$var = $val;
30 29
         }
Please login to merge, or discard this patch.
src/Model/Collection/Set.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     private function getScalar($value)
28 28
     {
29 29
         return
30
-              (is_object($value) ? spl_object_hash($value)
30
+                (is_object($value) ? spl_object_hash($value)
31 31
             : (is_array($value)  ? implode($value)
32 32
             : (                    (string)$value)));
33 33
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
     {
29 29
         return
30 30
               (is_object($value) ? spl_object_hash($value)
31
-            : (is_array($value)  ? implode($value)
32
-            : (                    (string)$value)));
31
+            : (is_array($value) ? implode($value)
32
+            : ((string)$value)));
33 33
     }
34 34
 
35 35
     /**
Please login to merge, or discard this patch.
src/Model/Collection/Stack.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@
 block discarded – undo
43 43
      */
44 44
     public function popMultiple($i = 1)
45 45
     {
46
-        if ($i < 1) return NULL;
46
+        if ($i < 1) {
47
+            return NULL;
48
+        }
47 49
 
48 50
         $ret = array_slice($this->data, -1 * $i);
49 51
         $this->data = array_slice($this->data, 0, -1 * $i);
Please login to merge, or discard this patch.
src/Exception/NonExistentPropertyException.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     {
11 11
         parent::__construct
12 12
         (
13
-              'Cannot ' . static::ACCESS_TYPE . ' non existent '
13
+                'Cannot ' . static::ACCESS_TYPE . ' non existent '
14 14
             . 'property: ' . $class . '::$' . $property,
15 15
             0,
16 16
             $previous
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
 
9 9
     public function __construct($class, $property, $previous = null)
10 10
     {
11
-        parent::__construct
12
-        (
11
+        parent::__construct(
13 12
               'Cannot ' . static::ACCESS_TYPE . ' non existent '
14 13
             . 'property: ' . $class . '::$' . $property,
15 14
             0,
Please login to merge, or discard this patch.
src/Model/Collection/HashMap.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     private function getScalar($value)
28 28
     {
29 29
         return
30
-              (is_object($value) ? spl_object_hash($value)
30
+                (is_object($value) ? spl_object_hash($value)
31 31
             : (is_array($value)  ? implode($value)
32 32
             : (                    (string)$value)));
33 33
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
     {
25 25
         return
26 26
               (is_object($value) ? spl_object_hash($value)
27
-            : (is_array($value)  ? implode($value)
28
-            : (                    (string)$value)));
27
+            : (is_array($value) ? implode($value)
28
+            : ((string)$value)));
29 29
     }
30 30
 
31 31
     public function key()
Please login to merge, or discard this patch.
src/Factory/Reflection/ReflectionCompositeFactory.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Spaark\CompositeUtils\Factory\Reflection;
4 4
 
5
-use Spaark\CompositeUtils\Factory\BaseFactory;
6 5
 use Spaark\CompositeUtils\Model\Reflection\ReflectionComposite;
7 6
 use \ReflectionClass as PHPNativeReflectionClass;
8 7
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
             (new ReflectionFileFactory($this->reflector->getFileName()))
22 22
                 ->build();
23 23
         $this->accessor->setRawValue('file', $file);
24
-        $this->accessor->setRawValue
25
-        (
24
+        $this->accessor->setRawValue(
26 25
             'namespace',
27 26
             $file->namespaces[$this->reflector->getNamespaceName()]
28 27
         );
@@ -48,15 +47,13 @@  discard block
 block discarded – undo
48 47
 
49 48
     protected function buildProperty($reflect)
50 49
     {
51
-        $properties = $this->accessor->getRawValue
52
-        (
50
+        $properties = $this->accessor->getRawValue(
53 51
             'properties'
54 52
         );
55 53
 
56 54
         $properties[$reflect->getName()] = 
57 55
             (new ReflectionPropertyFactory($reflect))
58
-                ->build
59
-                (
56
+                ->build(
60 57
                     $this->object,
61 58
                     $this->reflector
62 59
                         ->getDefaultProperties()[$reflect->getName()]
@@ -65,8 +62,7 @@  discard block
 block discarded – undo
65 62
 
66 63
     protected function buildMethod($reflect)
67 64
     {
68
-        $this->accessor->rawAddToValue
69
-        (
65
+        $this->accessor->rawAddToValue(
70 66
             'methods',
71 67
             (new ReflectionMethodFactory($reflect))
72 68
                 ->build($this->object)
Please login to merge, or discard this patch.