Completed
Push — master ( c09ce2...1f44ff )
by Emily
02:06
created
src/Service/PropertyAccessor.php 1 patch
Spacing   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,14 +36,12 @@  discard block
 block discarded – undo
36 36
     {
37 37
         if (!$this->reflect->properties->contains($property))
38 38
         {
39
-            throw new CannotWritePropertyException
40
-            (
39
+            throw new CannotWritePropertyException(
41 40
                 get_class($this->object), $property
42 41
             );
43 42
         }
44 43
 
45
-        $this->setAnyValue
46
-        (
44
+        $this->setAnyValue(
47 45
             $this->reflect->properties[$property],
48 46
             $value
49 47
         );
@@ -57,8 +55,7 @@  discard block
 block discarded – undo
57 55
         }
58 56
         else
59 57
         {
60
-            $this->setNonNullValue
61
-            (
58
+            $this->setNonNullValue(
62 59
                 $property->name,
63 60
                 $value,
64 61
                 $property->type
@@ -125,8 +122,7 @@  discard block
 block discarded – undo
125 122
         }
126 123
         elseif (is_object($value) && method_exists([$value, $method]))
127 124
         {
128
-            $this->setScalarValue
129
-            (
125
+            $this->setScalarValue(
130 126
                 $property,
131 127
                 $value->$method(),
132 128
                 $method,
@@ -165,8 +161,7 @@  discard block
 block discarded – undo
165 161
 
166 162
     private function throwError($property, $expected, $value)
167 163
     {
168
-        throw new IllegalPropertyTypeException
169
-        (
164
+        throw new IllegalPropertyTypeException(
170 165
             get_class($this->object),
171 166
             $property,
172 167
             $expected,
Please login to merge, or discard this patch.
src/Service/ConditionalPropertyAccessor.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
         }
16 16
         else
17 17
         {
18
-            throw new PropertyNotWritableException
19
-            (
18
+            throw new PropertyNotWritableException(
20 19
                 get_class($this->object),
21 20
                 $property->name
22 21
             );
@@ -27,16 +26,14 @@  discard block
 block discarded – undo
27 26
     {
28 27
         if (!$this->reflect->properties->contains($property))
29 28
         {
30
-            throw new CannotReadPropertyException
31
-            (
29
+            throw new CannotReadPropertyException(
32 30
                 get_class($this->object),
33 31
                 $property
34 32
             );
35 33
         }
36 34
         elseif (!$this->reflect->properties[$property]->readable)
37 35
         {
38
-            throw new PropertyNotReadableException
39
-            (
36
+            throw new PropertyNotReadableException(
40 37
                 get_class($this->object),
41 38
                 $property
42 39
             );
Please login to merge, or discard this patch.
src/Factory/Reflection/ReflectionCompositeFactory.php 1 patch
Spacing   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,13 +21,11 @@  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
             'classname',
27 26
             $this->reflector->name
28 27
         );
29
-        $this->accessor->setRawValue
30
-        (
28
+        $this->accessor->setRawValue(
31 29
             'namespace',
32 30
             $file->namespaces[$this->reflector->getNamespaceName()]
33 31
         );
@@ -53,15 +51,13 @@  discard block
 block discarded – undo
53 51
 
54 52
     protected function buildProperty($reflect)
55 53
     {
56
-        $properties = $this->accessor->getRawValue
57
-        (
54
+        $properties = $this->accessor->getRawValue(
58 55
             'properties'
59 56
         );
60 57
 
61 58
         $properties[$reflect->getName()] = 
62 59
             (new ReflectionPropertyFactory($reflect))
63
-                ->build
64
-                (
60
+                ->build(
65 61
                     $this->object,
66 62
                     $this->reflector
67 63
                         ->getDefaultProperties()[$reflect->getName()]
@@ -70,8 +66,7 @@  discard block
 block discarded – undo
70 66
 
71 67
     protected function buildMethod($reflect)
72 68
     {
73
-        $this->accessor->rawAddToValue
74
-        (
69
+        $this->accessor->rawAddToValue(
75 70
             'methods',
76 71
             (new ReflectionMethodFactory($reflect))
77 72
                 ->build($this->object)
Please login to merge, or discard this patch.
src/Traits/HasReflectorTrait.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
         if (!static::$reflectionComposite)
26 26
         {
27 27
             static::$reflectionComposite =
28
-                ReflectionCompositeFactory::fromClassName
29
-                (
28
+                ReflectionCompositeFactory::fromClassName(
30 29
                     get_called_class()
31 30
                 )
32 31
                 ->build();
Please login to merge, or discard this patch.
src/Traits/PropertyAccessTrait.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@
 block discarded – undo
29 29
     {
30 30
         if (!$this->accessor)
31 31
         {
32
-            $this->accessor = new ConditionalPropertyAccessor
33
-            (
32
+            $this->accessor = new ConditionalPropertyAccessor(
34 33
                 $this,
35 34
                 self::getReflectionComposite()
36 35
             );
Please login to merge, or discard this patch.
src/Factory/Reflection/ReflectionPropertyFactory.php 1 patch
Spacing   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public static function fromName($class, $property)
42 42
     {
43
-        return new static(new PHPNativeReflectionProperty
44
-        (
43
+        return new static(new PHPNativeReflectionProperty(
45 44
             $class, $property
46 45
         ));
47 46
     }
@@ -50,8 +49,7 @@  discard block
 block discarded – undo
50 49
     {
51 50
         $this->accessor->setRawValue('owner', $parent);
52 51
         $this->accessor->setRawValue('defaultValue', $default);
53
-        $this->accessor->setRawValue
54
-        (
52
+        $this->accessor->setRawValue(
55 53
             'name',
56 54
             $this->reflector->getName()
57 55
         );
@@ -138,50 +136,42 @@  discard block
 block discarded – undo
138 136
         switch ($value[0])
139 137
         {
140 138
             case 'required':
141
-                $this->accessor->setRawValue
142
-                (
139
+                $this->accessor->setRawValue(
143 140
                     'passedToConstructor',
144 141
                     true
145 142
                 );
146
-                $this->accessor->setRawValue
147
-                (
143
+                $this->accessor->setRawValue(
148 144
                     'requiredInConstructor',
149 145
                     true
150 146
                 );
151
-                $compositeAccessor->rawAddToValue
152
-                (
147
+                $compositeAccessor->rawAddToValue(
153 148
                     'requiredProperties',
154 149
                     $this->object
155 150
                 );
156 151
                 break;
157 152
             case 'new':
158
-                $this->accessor->setRawValue
159
-                (
153
+                $this->accessor->setRawValue(
160 154
                     'builtInConstructor',
161 155
                     true
162 156
                 );
163
-                $compositeAccessor->rawAddToValue
164
-                (
157
+                $compositeAccessor->rawAddToValue(
165 158
                     'builtProperties',
166 159
                     $this->object
167 160
                 );
168 161
                 break;
169 162
             case 'optional':
170
-                $this->accessor->setRawValue
171
-                (
163
+                $this->accessor->setRawValue(
172 164
                     'passedToConstructor',
173 165
                     true
174 166
                 );
175
-                $compositeAccessor->rawAddToValue
176
-                (
167
+                $compositeAccessor->rawAddToValue(
177 168
                     'optionalProperties',
178 169
                     $this->object
179 170
                 );
180 171
 
181 172
                 if (isset($value[1]) && $value[1] === 'new')
182 173
                 {
183
-                    $this->accessor->setRawValue
184
-                    (
174
+                    $this->accessor->setRawValue(
185 175
                         'builtInConstructor',
186 176
                         true
187 177
                     );
Please login to merge, or discard this patch.