Passed
Branch 2.0.0 (c5bb78)
by Chubarov
09:06
created
src/Actions/Create.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 use agoalofalife\bpm\Assistants\QueryBuilder;
5 5
 use agoalofalife\bpm\Contracts\Action;
6 6
 use agoalofalife\bpm\Contracts\ActionSet;
7
-use agoalofalife\bpm\Contracts\Authentication;
8 7
 use agoalofalife\bpm\KernelBpm;
9 8
 
10 9
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
         $this->headers()->getCookie()->body()->httpErrorsFalse()->get();
62 62
         $response   =  $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
63
-                       $this->headers()->getCookie()->body()->httpErrorsFalse()->get()
63
+                        $this->headers()->getCookie()->body()->httpErrorsFalse()->get()
64 64
         );
65 65
         $body       = $response->getBody();
66 66
         $this->kernel->getHandler()->parse($body->getContents());
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
     {
56 56
         $parameters = str_replace(' ', '%20', $this->url);
57 57
 
58
-        $url        = $this->kernel->getCollection() . $parameters;
59
-        $urlHome    = config($this->kernel->getPrefixConfig() . '.UrlHome');
58
+        $url        = $this->kernel->getCollection().$parameters;
59
+        $urlHome    = config($this->kernel->getPrefixConfig().'.UrlHome');
60 60
 
61 61
         $this->headers()->getCookie()->body()->httpErrorsFalse()->get();
62
-        $response   =  $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
62
+        $response   = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url,
63 63
                        $this->headers()->getCookie()->body()->httpErrorsFalse()->get()
64 64
         );
65 65
         $body       = $response->getBody();
Please login to merge, or discard this patch.
src/Actions/Delete.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     }
44 44
 
45 45
     /**
46
-     * @return \agoalofalife\bpm\Contracts\Handler
46
+     * @return \Illuminate\Container\Container
47 47
      */
48 48
     public function processData()
49 49
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use agoalofalife\bpm\Assistants\QueryBuilder;
6 6
 use agoalofalife\bpm\Contracts\Action;
7 7
 use agoalofalife\bpm\Contracts\ActionGet;
8
-use agoalofalife\bpm\Contracts\Authentication;
9 8
 use agoalofalife\bpm\KernelBpm;
10 9
 
11 10
 /**
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
 
70 70
         $response =  $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
71
-                     $this->headers()->getCookie()->httpErrorsFalse()->get()
71
+                        $this->headers()->getCookie()->httpErrorsFalse()->get()
72 72
         );
73 73
 
74 74
         $body = $response->getBody();
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,18 +63,18 @@
 block discarded – undo
63 63
     {
64 64
         $parameters = str_replace(' ', '%20', $this->url);
65 65
 
66
-        $url        = $this->kernel->getCollection() . $parameters;
67
-        $urlHome    = config($this->kernel->getPrefixConfig() . '.UrlHome');
66
+        $url        = $this->kernel->getCollection().$parameters;
67
+        $urlHome    = config($this->kernel->getPrefixConfig().'.UrlHome');
68 68
 
69 69
 
70
-        $response =  $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
70
+        $response = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url,
71 71
                      $this->headers()->getCookie()->httpErrorsFalse()->get()
72 72
         );
73 73
 
74 74
         $body = $response->getBody();
75 75
         $this->kernel->getHandler()->parse($body->getContents());
76 76
 
77
-        if ( $response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized' )
77
+        if ($response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized')
78 78
         {
79 79
             $this->kernel->authentication();
80 80
             $this->query();
Please login to merge, or discard this patch.
src/Actions/Read.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     }
50 50
 
51 51
     /**
52
-     * @return array url -> string , http_type -> string
52
+     * @return \Illuminate\Container\Container url -> string , http_type -> string
53 53
      */
54 54
     public function processData()
55 55
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             }
102 102
             $ParameterQuery.=  " ".$param;
103 103
         }
104
-         $this->concatenationUrlCurl($ParameterQuery);
104
+            $this->concatenationUrlCurl($ParameterQuery);
105 105
 
106 106
         return $this;
107 107
     }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $urlHome      = config($this->kernel->getPrefixConfig() . '.UrlHome');
148 148
 
149 149
         $response     = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
150
-                         $this->debug()->headers()->getCookie()->httpErrorsFalse()->get()
150
+                            $this->debug()->headers()->getCookie()->httpErrorsFalse()->get()
151 151
         );
152 152
         $body         = $response->getBody();
153 153
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function filterConstructor($strRequest)
77 77
     {
78
-        $ParameterQuery =  '$filter=';
79
-        $ParameterQuery.=  $strRequest;
78
+        $ParameterQuery = '$filter=';
79
+        $ParameterQuery .= $strRequest;
80 80
         $this->concatenationUrlCurl($ParameterQuery);
81 81
         return $this;
82 82
     }
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
     public function orderBy($whatSort, $param = 'asc')
94 94
     {
95 95
         $ParameterQuery = '$orderby=';
96
-        $ParameterQuery.=  ucfirst($whatSort);
96
+        $ParameterQuery .= ucfirst($whatSort);
97 97
 
98
-        if ( empty($param) === false ) {
98
+        if (empty($param) === false) {
99 99
             if ($param != 'desc' && $param != 'asc') {
100 100
                 throw new \Exception('no valid orderby parameters');
101 101
             }
102
-            $ParameterQuery.=  " ".$param;
102
+            $ParameterQuery .= " ".$param;
103 103
         }
104 104
          $this->concatenationUrlCurl($ParameterQuery);
105 105
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function amount($amountMax = null)
132 132
     {
133
-        Assert::that($amountMax,'You must specify a numeric parameter for the amount of the method')->integer();
133
+        Assert::that($amountMax, 'You must specify a numeric parameter for the amount of the method')->integer();
134 134
         $ParameterQuery = '$top='.$amountMax;
135 135
         $this->concatenationUrlCurl($ParameterQuery);
136 136
         return $this;
@@ -143,17 +143,17 @@  discard block
 block discarded – undo
143 143
     private function query()
144 144
     {
145 145
         $parameters   = str_replace(' ', '%20', $this->url);
146
-        $url          = $this->kernel->getCollection() . $parameters;
147
-        $urlHome      = config($this->kernel->getPrefixConfig() . '.UrlHome');
146
+        $url          = $this->kernel->getCollection().$parameters;
147
+        $urlHome      = config($this->kernel->getPrefixConfig().'.UrlHome');
148 148
 
149
-        $response     = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
149
+        $response     = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url,
150 150
                          $this->debug()->headers()->getCookie()->httpErrorsFalse()->get()
151 151
         );
152 152
         $body         = $response->getBody();
153 153
 
154 154
         $this->kernel->getHandler()->parse($body->getContents());
155 155
 
156
-        if ( $response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized' )
156
+        if ($response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized')
157 157
         {
158 158
             $this->kernel->authentication();
159 159
             $this->query();
Please login to merge, or discard this patch.
src/Actions/Update.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     }
59 59
 
60 60
     /**
61
-     * @return \agoalofalife\bpm\Contracts\Handler
61
+     * @return \Illuminate\Container\Container
62 62
      */
63 63
     public function processData()
64 64
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use agoalofalife\bpm\Contracts\Action;
7 7
 use agoalofalife\bpm\Contracts\ActionGet;
8 8
 use agoalofalife\bpm\Contracts\ActionSet;
9
-use agoalofalife\bpm\Contracts\Authentication;
10 9
 use agoalofalife\bpm\KernelBpm;
11 10
 
12 11
 /**
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
         $urlHome    = config($this->kernel->getPrefixConfig() . '.UrlHome');
85 85
 
86 86
         $response   =  $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
87
-                       $this->headers()->getCookie()->body()->httpErrorsFalse()->get()
87
+                        $this->headers()->getCookie()->body()->httpErrorsFalse()->get()
88 88
         );
89 89
         $body       = $response->getBody();
90 90
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,17 +80,17 @@
 block discarded – undo
80 80
     private function query()
81 81
     {
82 82
         $parameters = str_replace(' ', '%20', $this->url);
83
-        $url        = $this->kernel->getCollection() . $parameters;
84
-        $urlHome    = config($this->kernel->getPrefixConfig() . '.UrlHome');
83
+        $url        = $this->kernel->getCollection().$parameters;
84
+        $urlHome    = config($this->kernel->getPrefixConfig().'.UrlHome');
85 85
 
86
-        $response   =  $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome . $url,
86
+        $response   = $this->kernel->getCurl()->request($this->HTTP_TYPE, $urlHome.$url,
87 87
                        $this->headers()->getCookie()->body()->httpErrorsFalse()->get()
88 88
         );
89 89
         $body       = $response->getBody();
90 90
 
91 91
         $this->kernel->getHandler()->parse($body->getContents());
92 92
 
93
-        if ( $response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized' )
93
+        if ($response->getStatusCode() == 401 && $response->getReasonPhrase() == 'Unauthorized')
94 94
         {
95 95
             $this->kernel->authentication();
96 96
             $this->query();
Please login to merge, or discard this patch.
src/KernelBpm.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     }
125 125
 
126 126
     /**
127
-     * @return Handler
127
+     * @return \Illuminate\Container\Container
128 128
      */
129 129
     public function getHandler()
130 130
     {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     /**
135 135
      * Set the response handler
136 136
      * @param string $typeHandler default xml
137
-     * @return Action
137
+     * @return \Illuminate\Container\Container
138 138
      */
139 139
     public function setHandler($typeHandler = 'xml')
140 140
     {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     }
153 153
 
154 154
     /**
155
-     * @param $typeAction string
155
+     * @param string $typeAction string
156 156
      * @return Action
157 157
      */
158 158
     public function setAction($typeAction)
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     /**
199 199
      * Set collection for correct query
200 200
      * @param string $collection
201
-     * @return mixed
201
+     * @return string
202 202
      * @throws \Exception
203 203
      */
204 204
     public function setCollection($collection)
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         return app()->make(ClientInterface::class);
229 229
     }
230 230
     /**
231
-     * @param $action
231
+     * @param string $action
232 232
      * @return array
233 233
      */
234 234
     private function splitAction($action)
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
  */
37 37
 class KernelBpm
38 38
 {
39
-    const PATH_LOG = __DIR__ . '/resource/logs/bpm.log';
39
+    const PATH_LOG = __DIR__.'/resource/logs/bpm.log';
40 40
 
41 41
     protected $action = [
42 42
         'create' =>  Create::class,
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function loadConfiguration(SourceConfiguration $configuration)
111 111
     {
112
-        config()->set(  $this->prefixConfiguration = $configuration->getName(), $configuration->get());
112
+        config()->set($this->prefixConfiguration = $configuration->getName(), $configuration->get());
113 113
     }
114 114
 
115 115
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     {
160 160
         Assertion::keyIsset($this->action, $typeAction);
161 161
 
162
-        $this->currentAction  =  app()->make( $this->action[$typeAction] );
162
+        $this->currentAction = app()->make($this->action[$typeAction]);
163 163
 
164 164
         return $this->currentAction;
165 165
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
          extract($this->splitAction($action));
177 177
 
178
-         $action  = $this->setAction($action);
178
+         $action = $this->setAction($action);
179 179
          $this->setHandler($handler);
180 180
 
181 181
         $action->injectionKernel($this);
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
     {
206 206
         try {
207 207
             Assertion::regex($collection, '/[A-z]+Collection$/');
208
-        } catch(AssertionFailedException $e) {
209
-           throw new \Exception("Expected word 'Collection' in parameter method setCollection received : " .  $e->getValue());
208
+        } catch (AssertionFailedException $e) {
209
+           throw new \Exception("Expected word 'Collection' in parameter method setCollection received : ".$e->getValue());
210 210
         }
211 211
 
212 212
         return $this->collection = $collection;
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 
238 238
         // verification values
239 239
         Assertion::between(count($split), 2, 2);
240
-        Assertion::keyExists( $this->action, $split[0]);
241
-        Assertion::keyExists( $this->handlers, $split[1]);
240
+        Assertion::keyExists($this->action, $split[0]);
241
+        Assertion::keyExists($this->handlers, $split[1]);
242 242
 
243 243
         return ['action' => $split[0], 'handler' => $split[1]];
244 244
     }
Please login to merge, or discard this patch.
helpers/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Illuminate\Container\Container;
4 4
 
5
-if (! function_exists('config')) {
5
+if (!function_exists('config')) {
6 6
     /**
7 7
      * Get / set the specified configuration value.
8 8
      *
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     }
27 27
 }
28 28
 
29
-if (! function_exists('app')) {
29
+if (!function_exists('app')) {
30 30
     /**
31 31
      * Get the available container instance.
32 32
      *
Please login to merge, or discard this patch.
src/ServiceProviders/LoggerServiceProvider.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     {
15 15
         app()->bind(Logger::class, function(){
16 16
             $log = new Logger(KernelBpm::class);
17
-           return  $log->pushHandler(new StreamHandler(KernelBpm::PATH_LOG, Logger::DEBUG));
17
+            return  $log->pushHandler(new StreamHandler(KernelBpm::PATH_LOG, Logger::DEBUG));
18 18
         });
19 19
     }
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function register()
14 14
     {
15
-        app()->bind(Logger::class, function(){
15
+        app()->bind(Logger::class, function() {
16 16
             $log = new Logger(KernelBpm::class);
17 17
            return  $log->pushHandler(new StreamHandler(KernelBpm::PATH_LOG, Logger::DEBUG));
18 18
         });
Please login to merge, or discard this patch.
src/Assistants/QueryBuilder.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@
 block discarded – undo
66 66
         $body = [
67 67
             'body' => $this->kernel->getHandler()->create($this->data)
68 68
         ];
69
-         $this->merge($body);
70
-         return $this;
69
+            $this->merge($body);
70
+            return $this;
71 71
     }
72 72
 
73 73
     private function merge(array $newParameters)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
     public function getCookie()
13 13
     {
14
-        $curl = ['curl' => [ CURLOPT_COOKIEFILE => app(Authentication::class)->getPathCookieFile()]];
14
+        $curl = ['curl' => [CURLOPT_COOKIEFILE => app(Authentication::class)->getPathCookieFile()]];
15 15
         $this->merge($curl);
16 16
         return $this;
17 17
     }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     public function debug()
41 41
     {
42
-        $debug  = ['on_stats' => function (TransferStats $stats) {
42
+        $debug = ['on_stats' => function(TransferStats $stats) {
43 43
             app(Logger::class)->debug('api',
44 44
                 [
45 45
                     'time'    =>  $stats->getTransferTime(),
Please login to merge, or discard this patch.