Passed
Push — master ( a5b774...1e2076 )
by Dmitry
06:34 queued 03:52
created
src/ApiLayer/JsonRpcExtensions/Documentation/MetadataExtractor.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     /**
27 27
      * @param MethodCollection $methodCollection
28 28
      *
29
-     * @return array
29
+     * @return string
30 30
      */
31 31
     public function extract(MethodCollection $methodCollection)
32 32
     {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Tonic\Component\ApiLayer\JsonRpcExtensions\Documentation;
4 4
 
5
-use Doctrine\Common\Annotations\PhpParser;
6 5
 use phpDocumentor\Reflection\DocBlock;
7
-use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag;
8 6
 use Tonic\Component\ApiLayer\JsonRpc\Method\MethodCollection;
9 7
 use Tonic\Component\Reflection\TypeResolver;
10 8
 
Please login to merge, or discard this patch.
src/Reflection/TypeResolver.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -53,6 +53,9 @@  discard block
 block discarded – undo
53 53
         return $type . ($isCollection ? '[]' : '');
54 54
     }
55 55
 
56
+    /**
57
+     * @param string $type
58
+     */
56 59
     private function isTypeObject($type)
57 60
     {
58 61
         switch (strtolower($type)) {
@@ -77,6 +80,9 @@  discard block
 block discarded – undo
77 80
         }
78 81
     }
79 82
 
83
+    /**
84
+     * @param string $type
85
+     */
80 86
     private function resolveClassName($type, \ReflectionClass $usingClass)
81 87
     {
82 88
         if (strpos($type, '\\') === 0 && class_exists($type)) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         $aliases = $this->phpParser->parseClass($usingClass);
91 91
         $alias = strtolower($type);
92 92
 
93
-        if (! isset($aliases[$alias])) {
93
+        if (!isset($aliases[$alias])) {
94 94
             return $usingClass->getNamespaceName() . '\\' . $type;
95 95
         }
96 96
 
Please login to merge, or discard this patch.
src/ApiLayer/JsonRpcExtensions/Security/Method/SecurableMethodInvoker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         $attributeValue = $this->propertyAccessor->getValue($requestObject, $attributeAnnotation->valueAt);
71 71
 
72 72
         $userId = $this->userProvider->getUserId();
73
-        if ((! is_array($attributeValue)) && (! $this->guard->isGranted($userId, $attributeName, $attributeValue))) {
73
+        if ((!is_array($attributeValue)) && (!$this->guard->isGranted($userId, $attributeName, $attributeValue))) {
74 74
             throw new AccessDeniedException();
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/ApiLayer/JsonRpc/Request/RequestParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             throw new ParseException(sprintf('Invalid JSON syntax: "%s"', json_last_error_msg()));
18 18
         }
19 19
 
20
-        if (! is_array($data)) {
20
+        if (!is_array($data)) {
21 21
             throw new InvalidRequestException('Request is not valid JSON');
22 22
         }
23 23
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             throw new InvalidRequestException(sprintf('Request attributes are missed: %s', join(', ', $difference)));
40 40
         }
41 41
 
42
-        if (! is_array($data['params'])) {
42
+        if (!is_array($data['params'])) {
43 43
             throw new InvalidRequestException('Parameters should have an object structure');
44 44
         }
45 45
     }
Please login to merge, or discard this patch.
src/ApiLayer/JsonRpc/Method/Loader/MutableAnnotationLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function add($service)
37 37
     {
38
-        if (! is_object($service)) {
38
+        if (!is_object($service)) {
39 39
             throw new \InvalidArgumentException('Supports only objects');
40 40
         }
41 41
 
Please login to merge, or discard this patch.
src/ApiLayer/JsonRpc/Method/MethodCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     public function get($methodName)
53 53
     {
54
-        if (! $this->has($methodName)) {
54
+        if (!$this->has($methodName)) {
55 55
             return null;
56 56
         }
57 57
 
Please login to merge, or discard this patch.
src/ApiLayer/JsonRpc/Method/MethodDispatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
     public function dispatch($methodName, array $arguments = [])
70 70
     {
71 71
         $methodCollection = $this->getMethodCollection();
72
-        if (! $methodCollection->has($methodName)) {
72
+        if (!$methodCollection->has($methodName)) {
73 73
             throw new MethodNotFoundException(sprintf('Method "%s" is not found', $methodName));
74 74
         }
75 75
 
Please login to merge, or discard this patch.
src/ApiLayer/JsonRpc/Method/ArgumentMapper/Normalizer/Normalizer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 
49 49
         $docBlock = new DocBlock($reflectionProperty->getDocComment());
50 50
         $tags = $docBlock->getTagsByName('var');
51
-        if (count($tags) == 0 ) {
51
+        if (count($tags) == 0) {
52 52
             return null;
53 53
         }
54 54
 
Please login to merge, or discard this patch.
spec/ApiLayer/JsonRpc/Method/MethodCollectionSpec.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         $this->has('sampleService.sampleMethod')->shouldBe(false);
18 18
 
19
-        $this->add('sampleService.sampleMethod', function () {});
19
+        $this->add('sampleService.sampleMethod', function() {});
20 20
 
21 21
         $this->get('sampleService.sampleMethod')->shouldBeAnInstanceOf(\Closure::class);
22 22
     }
Please login to merge, or discard this patch.