Completed
Push — master ( 9459ba...5c21ca )
by Portey
05:54
created
src/Validator/ResolveValidator/ResolveValidator.php 2 patches
Doc Comments   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 
46 46
     /**
47 47
      * @param AbstractObjectType      $objectType
48
-     * @param Mutation|Query|AstField $field
48
+     * @param AstField $field
49 49
      *
50
-     * @return null
50
+     * @return boolean
51 51
      */
52 52
     public function objectHasField($objectType, $field)
53 53
     {
@@ -62,6 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     /**
64 64
      * @inheritdoc
65
+     * @param Query $query
65 66
      */
66 67
     public function validateArguments(FieldInterface $field, $query, Request $request)
67 68
     {
@@ -138,6 +139,9 @@  discard block
 block discarded – undo
138 139
         return true;
139 140
     }
140 141
 
142
+    /**
143
+     * @param Request $request
144
+     */
141 145
     private function processInputObject(InputObject $astObject, AbstractInputObjectType $inputObjectType, $request)
142 146
     {
143 147
         foreach ($astObject->getValue() as $name => $value) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function validateArguments(FieldInterface $field, $query, Request $request)
67 67
     {
68
-        $requiredArguments = array_filter($field->getArguments(), function (InputField $argument) {
68
+        $requiredArguments = array_filter($field->getArguments(), function(InputField $argument) {
69 69
             return $argument->getType()->getKind() == TypeMap::KIND_NON_NULL;
70 70
         });
71 71
 
72
-        $withDefaultArguments = array_filter($field->getArguments(), function (InputField $argument) {
72
+        $withDefaultArguments = array_filter($field->getArguments(), function(InputField $argument) {
73 73
             return $argument->getConfig()->get('default') !== null;
74 74
         });
75 75
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                     }
95 95
 
96 96
                     foreach ($argument->getValue()->getValue() as $item) {
97
-                        if(!$this->processInputObject($item, $argumentType, $request)) {
97
+                        if (!$this->processInputObject($item, $argumentType, $request)) {
98 98
                             return false;
99 99
                         }
100 100
                     }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     public function assertTypeImplementsInterface(AbstractType $type, AbstractInterfaceType $interface)
187 187
     {
188 188
         if (!$interface->isValidValue($type)) {
189
-            throw new ResolveException('Type ' . $type->getName() . ' does not implement ' . $interface->getName());
189
+            throw new ResolveException('Type '.$type->getName().' does not implement '.$interface->getName());
190 190
         }
191 191
     }
192 192
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         }
206 206
 
207 207
         if (!$valid) {
208
-            throw new ResolveException('Type ' . $type->getName() . ' not exist in types of ' . $unionType->getName());
208
+            throw new ResolveException('Type '.$type->getName().' not exist in types of '.$unionType->getName());
209 209
         }
210 210
     }
211 211
 
Please login to merge, or discard this patch.
src/Type/InputObject/AbstractInputObjectType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function isValidValue($value)
44 44
     {
45
-        if($value instanceof InputObject) {
45
+        if ($value instanceof InputObject) {
46 46
             $value = $value->getValue();
47 47
         }
48 48
 
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
         }
52 52
 
53 53
         $typeConfig     = $this->getConfig();
54
-        $requiredFields = array_filter($typeConfig->getFields(), function (FieldInterface $field) {
54
+        $requiredFields = array_filter($typeConfig->getFields(), function(FieldInterface $field) {
55 55
             return $field->getType()->getKind() == TypeMap::KIND_NON_NULL;
56 56
         });
57 57
 
58 58
         foreach ($value as $valueKey => $valueItem) {
59
-            if($valueItem instanceof Variable) {
59
+            if ($valueItem instanceof Variable) {
60 60
                 $valueItem = $valueItem->getValue();
61 61
             }
62 62
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $typeConfig = $this->getConfig();
88 88
         foreach ($value as $valueKey => $item) {
89
-            if($item instanceof Variable) {
89
+            if ($item instanceof Variable) {
90 90
                 $item = $item->getValue();
91 91
             }
92 92
 
Please login to merge, or discard this patch.