Passed
Push — master ( 1c4e8d...15285e )
by Anton
02:28
created
src/Domain/CycleInterceptor.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -45,22 +45,22 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $entities = $this->getDeclaredEntities($controller, $action);
47 47
 
48
-        foreach ($entities as $parameter => $role) {
48
+        foreach ($entities as $parameter => $role){
49 49
             $value = $this->getParameter($parameter, $parameters, count($entities) === 1);
50
-            if ($value === null) {
50
+            if ($value === null){
51 51
                 throw new ControllerException(
52 52
                     "Entity `{$parameter}` can not be found",
53 53
                     ControllerException::NOT_FOUND
54 54
                 );
55 55
             }
56 56
 
57
-            if (is_object($value)) {
57
+            if (is_object($value)){
58 58
                 // pre-filled
59 59
                 continue;
60 60
             }
61 61
 
62 62
             $entity = $this->resolveEntity($role, $value);
63
-            if ($entity === null) {
63
+            if ($entity === null){
64 64
                 throw new ControllerException(
65 65
                     "Entity `{$parameter}` can not be found",
66 66
                     ControllerException::NOT_FOUND
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     protected function getParameter(string $role, array $parameters, bool $useDefault = false)
83 83
     {
84
-        if (!$useDefault) {
84
+        if (!$useDefault){
85 85
             return $parameters[$role] ?? null;
86 86
         }
87 87
 
@@ -106,23 +106,23 @@  discard block
 block discarded – undo
106 106
     private function getDeclaredEntities(string $controller, string $action): array
107 107
     {
108 108
         $key = sprintf('%s:%s', $controller, $action);
109
-        if (array_key_exists($key, $this->cache)) {
109
+        if (array_key_exists($key, $this->cache)){
110 110
             return $this->cache[$key];
111 111
         }
112 112
 
113 113
         $this->cache[$key] = [];
114
-        try {
114
+        try{
115 115
             $method = new \ReflectionMethod($controller, $action);
116
-        } catch (\ReflectionException $e) {
116
+        }catch (\ReflectionException $e){
117 117
             return [];
118 118
         }
119 119
 
120
-        foreach ($method->getParameters() as $parameter) {
121
-            if ($parameter->getClass() === null) {
120
+        foreach ($method->getParameters() as $parameter){
121
+            if ($parameter->getClass() === null){
122 122
                 continue;
123 123
             }
124 124
 
125
-            if ($this->orm->getSchema()->defines($parameter->getClass()->getName())) {
125
+            if ($this->orm->getSchema()->defines($parameter->getClass()->getName())){
126 126
                 $this->cache[$key][$parameter->getName()] = $this->orm->resolveRole($parameter->getClass()->getName());
127 127
             }
128 128
         }
Please login to merge, or discard this patch.
Braces   +23 added lines, -11 removed lines patch added patch discarded remove patch
@@ -45,22 +45,26 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $entities = $this->getDeclaredEntities($controller, $action);
47 47
 
48
-        foreach ($entities as $parameter => $role) {
48
+        foreach ($entities as $parameter => $role)
49
+        {
49 50
             $value = $this->getParameter($parameter, $parameters, count($entities) === 1);
50
-            if ($value === null) {
51
+            if ($value === null)
52
+            {
51 53
                 throw new ControllerException(
52 54
                     "Entity `{$parameter}` can not be found",
53 55
                     ControllerException::NOT_FOUND
54 56
                 );
55 57
             }
56 58
 
57
-            if (is_object($value)) {
59
+            if (is_object($value))
60
+            {
58 61
                 // pre-filled
59 62
                 continue;
60 63
             }
61 64
 
62 65
             $entity = $this->resolveEntity($role, $value);
63
-            if ($entity === null) {
66
+            if ($entity === null)
67
+            {
64 68
                 throw new ControllerException(
65 69
                     "Entity `{$parameter}` can not be found",
66 70
                     ControllerException::NOT_FOUND
@@ -81,7 +85,8 @@  discard block
 block discarded – undo
81 85
      */
82 86
     protected function getParameter(string $role, array $parameters, bool $useDefault = false)
83 87
     {
84
-        if (!$useDefault) {
88
+        if (!$useDefault)
89
+        {
85 90
             return $parameters[$role] ?? null;
86 91
         }
87 92
 
@@ -106,23 +111,30 @@  discard block
 block discarded – undo
106 111
     private function getDeclaredEntities(string $controller, string $action): array
107 112
     {
108 113
         $key = sprintf('%s:%s', $controller, $action);
109
-        if (array_key_exists($key, $this->cache)) {
114
+        if (array_key_exists($key, $this->cache))
115
+        {
110 116
             return $this->cache[$key];
111 117
         }
112 118
 
113 119
         $this->cache[$key] = [];
114
-        try {
120
+        try
121
+        {
115 122
             $method = new \ReflectionMethod($controller, $action);
116
-        } catch (\ReflectionException $e) {
123
+        }
124
+        catch (\ReflectionException $e)
125
+        {
117 126
             return [];
118 127
         }
119 128
 
120
-        foreach ($method->getParameters() as $parameter) {
121
-            if ($parameter->getClass() === null) {
129
+        foreach ($method->getParameters() as $parameter)
130
+        {
131
+            if ($parameter->getClass() === null)
132
+            {
122 133
                 continue;
123 134
             }
124 135
 
125
-            if ($this->orm->getSchema()->defines($parameter->getClass()->getName())) {
136
+            if ($this->orm->getSchema()->defines($parameter->getClass()->getName()))
137
+            {
126 138
                 $this->cache[$key][$parameter->getName()] = $this->orm->resolveRole($parameter->getClass()->getName());
127 139
             }
128 140
         }
Please login to merge, or discard this patch.
tests/Framework/Http/RrTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         );
44 44
 
45 45
         $psr->shouldReceive('respond')->once()->with(
46
-            \Mockery::on(function ($r) {
46
+            \Mockery::on(function ($r){
47 47
                 $this->assertSame('Hello, dave.', (string)$r->getBody());
48 48
                 return true;
49 49
             })
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         );
66 66
 
67 67
         $psr->shouldReceive('respond')->once()->with(
68
-            \Mockery::on(function ($r) {
68
+            \Mockery::on(function ($r){
69 69
                 $this->assertContains('500', (string)$r->getBody());
70 70
                 return true;
71 71
             })
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $psr->shouldReceive('acceptRequest')->once()->andReturn(null);
75 75
 
76 76
         $files = $this->app->get(FilesInterface::class)->getFiles(
77
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
77
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
78 78
         );
79 79
 
80 80
         $this->assertCount(0, $files);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $this->app->get(RrDispacher::class)->serve($psr);
83 83
 
84 84
         $files = $this->app->get(FilesInterface::class)->getFiles(
85
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
85
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
86 86
         );
87 87
 
88 88
         $this->assertCount(1, $files);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         );
104 104
 
105 105
         $psr->shouldReceive('respond')->once()->with(
106
-            \Mockery::on(function ($r) {
106
+            \Mockery::on(function ($r){
107 107
                 $this->assertContains('undefined', (string)$r->getBody());
108 108
                 return true;
109 109
             })
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $psr->shouldReceive('acceptRequest')->once()->andReturn(null);
113 113
 
114 114
         $files = $this->app->get(FilesInterface::class)->getFiles(
115
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
115
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
116 116
         );
117 117
 
118 118
         $this->assertCount(0, $files);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $this->app->get(RrDispacher::class)->serve($psr);
121 121
 
122 122
         $files = $this->app->get(FilesInterface::class)->getFiles(
123
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
123
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
124 124
         );
125 125
 
126 126
         $this->assertCount(1, $files);
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  discard block
 block discarded – undo
43 43
         );
44 44
 
45 45
         $psr->shouldReceive('respond')->once()->with(
46
-            \Mockery::on(function ($r) {
46
+            \Mockery::on(function ($r)
47
+            {
47 48
                 $this->assertSame('Hello, dave.', (string)$r->getBody());
48 49
                 return true;
49 50
             })
@@ -65,7 +66,8 @@  discard block
 block discarded – undo
65 66
         );
66 67
 
67 68
         $psr->shouldReceive('respond')->once()->with(
68
-            \Mockery::on(function ($r) {
69
+            \Mockery::on(function ($r)
70
+            {
69 71
                 $this->assertContains('500', (string)$r->getBody());
70 72
                 return true;
71 73
             })
@@ -103,7 +105,8 @@  discard block
 block discarded – undo
103 105
         );
104 106
 
105 107
         $psr->shouldReceive('respond')->once()->with(
106
-            \Mockery::on(function ($r) {
108
+            \Mockery::on(function ($r)
109
+            {
107 110
                 $this->assertContains('undefined', (string)$r->getBody());
108 111
                 return true;
109 112
             })
Please login to merge, or discard this patch.
src/Http/RrDispacher.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         FinalizerInterface $finalizer,
50 50
         ContainerInterface $container,
51 51
         FactoryInterface $factory
52
-    ) {
52
+    ){
53 53
         $this->env = $env;
54 54
         $this->finalizer = $finalizer;
55 55
         $this->container = $container;
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 
76 76
         /** @var Http $http */
77 77
         $http = $this->container->get(Http::class);
78
-        while ($request = $client->acceptRequest()) {
79
-            try {
78
+        while ($request = $client->acceptRequest()){
79
+            try{
80 80
                 $client->respond($http->handle($request));
81
-            } catch (\Throwable $e) {
81
+            }catch (\Throwable $e){
82 82
                 $this->handleException($client, $e);
83
-            } finally {
83
+            }finally{
84 84
                 $this->finalizer->finalize(false);
85 85
             }
86 86
         }
@@ -94,17 +94,17 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $handler = new HtmlHandler();
96 96
 
97
-        try {
97
+        try{
98 98
             /** @var SnapshotInterface $snapshot */
99 99
             $snapshot = $this->container->get(SnapshotterInterface::class)->register($e);
100 100
             error_log($snapshot->getMessage());
101 101
 
102 102
             // on demand
103 103
             $state = $this->container->get(StateInterface::class);
104
-            if ($state !== null) {
104
+            if ($state !== null){
105 105
                 $handler = $handler->withState($state);
106 106
             }
107
-        } catch (\Throwable | ContainerExceptionInterface $se) {
107
+        }catch (\Throwable | ContainerExceptionInterface $se){
108 108
             error_log((string)$e);
109 109
         }
110 110
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,12 +75,18 @@  discard block
 block discarded – undo
75 75
 
76 76
         /** @var Http $http */
77 77
         $http = $this->container->get(Http::class);
78
-        while ($request = $client->acceptRequest()) {
79
-            try {
78
+        while ($request = $client->acceptRequest())
79
+        {
80
+            try
81
+            {
80 82
                 $client->respond($http->handle($request));
81
-            } catch (\Throwable $e) {
83
+            }
84
+            catch (\Throwable $e)
85
+            {
82 86
                 $this->handleException($client, $e);
83
-            } finally {
87
+            }
88
+            finally
89
+            {
84 90
                 $this->finalizer->finalize(false);
85 91
             }
86 92
         }
@@ -94,17 +100,21 @@  discard block
 block discarded – undo
94 100
     {
95 101
         $handler = new HtmlHandler();
96 102
 
97
-        try {
103
+        try
104
+        {
98 105
             /** @var SnapshotInterface $snapshot */
99 106
             $snapshot = $this->container->get(SnapshotterInterface::class)->register($e);
100 107
             error_log($snapshot->getMessage());
101 108
 
102 109
             // on demand
103 110
             $state = $this->container->get(StateInterface::class);
104
-            if ($state !== null) {
111
+            if ($state !== null)
112
+            {
105 113
                 $handler = $handler->withState($state);
106 114
             }
107
-        } catch (\Throwable | ContainerExceptionInterface $se) {
115
+        }
116
+        catch (\Throwable | ContainerExceptionInterface $se)
117
+        {
108 118
             error_log((string)$e);
109 119
         }
110 120
 
Please login to merge, or discard this patch.
src/Http/SapiDispatcher.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
         $http = $this->container->get(Http::class);
63 63
         $emitter = $emitter ?? $this->container->get(EmitterInterface::class);
64 64
 
65
-        try {
65
+        try{
66 66
             $response = $http->handle($this->initRequest());
67 67
             $emitter->emit($response);
68
-        } catch (\Throwable $e) {
68
+        }catch (\Throwable $e){
69 69
             $this->handleException($emitter, $e);
70
-        } finally {
70
+        }finally{
71 71
             $this->finalizer->finalize(false);
72 72
         }
73 73
     }
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $handler = new HtmlHandler();
90 90
 
91
-        try {
91
+        try{
92 92
             /** @var SnapshotInterface $snapshot */
93 93
             $this->container->get(SnapshotterInterface::class)->register($e);
94 94
 
95 95
             // on demand
96 96
             $state = $this->container->get(StateInterface::class);
97
-            if ($state !== null) {
97
+            if ($state !== null){
98 98
                 $handler = $handler->withState($state);
99 99
             }
100
-        } catch (\Throwable | ContainerExceptionInterface $se) {
100
+        }catch (\Throwable | ContainerExceptionInterface $se){
101 101
             // nothing to report
102 102
         }
103 103
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,12 +62,17 @@  discard block
 block discarded – undo
62 62
         $http = $this->container->get(Http::class);
63 63
         $emitter = $emitter ?? $this->container->get(EmitterInterface::class);
64 64
 
65
-        try {
65
+        try
66
+        {
66 67
             $response = $http->handle($this->initRequest());
67 68
             $emitter->emit($response);
68
-        } catch (\Throwable $e) {
69
+        }
70
+        catch (\Throwable $e)
71
+        {
69 72
             $this->handleException($emitter, $e);
70
-        } finally {
73
+        }
74
+        finally
75
+        {
71 76
             $this->finalizer->finalize(false);
72 77
         }
73 78
     }
@@ -88,16 +93,20 @@  discard block
 block discarded – undo
88 93
     {
89 94
         $handler = new HtmlHandler();
90 95
 
91
-        try {
96
+        try
97
+        {
92 98
             /** @var SnapshotInterface $snapshot */
93 99
             $this->container->get(SnapshotterInterface::class)->register($e);
94 100
 
95 101
             // on demand
96 102
             $state = $this->container->get(StateInterface::class);
97
-            if ($state !== null) {
103
+            if ($state !== null)
104
+            {
98 105
                 $handler = $handler->withState($state);
99 106
             }
100
-        } catch (\Throwable | ContainerExceptionInterface $se) {
107
+        }
108
+        catch (\Throwable | ContainerExceptionInterface $se)
109
+        {
101 110
             // nothing to report
102 111
         }
103 112
 
Please login to merge, or discard this patch.
src/Debug/StateCollector/EnvironmentCollector.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@
 block discarded – undo
43 43
     {
44 44
         $state->setTag('php', phpversion());
45 45
 
46
-        if ($this->container->get(DispatcherInterface::class)) {
47
-            switch (get_class($this->container->get(DispatcherInterface::class))) {
46
+        if ($this->container->get(DispatcherInterface::class)){
47
+            switch (get_class($this->container->get(DispatcherInterface::class))){
48 48
                 case RrDispacher::class:
49 49
                     $state->setTag('dispatcher', 'roadrunner');
50 50
                     break;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,10 @@
 block discarded – undo
43 43
     {
44 44
         $state->setTag('php', phpversion());
45 45
 
46
-        if ($this->container->get(DispatcherInterface::class)) {
47
-            switch (get_class($this->container->get(DispatcherInterface::class))) {
46
+        if ($this->container->get(DispatcherInterface::class))
47
+        {
48
+            switch (get_class($this->container->get(DispatcherInterface::class)))
49
+            {
48 50
                 case RrDispacher::class:
49 51
                     $state->setTag('dispatcher', 'roadrunner');
50 52
                     break;
Please login to merge, or discard this patch.
src/Debug/StateCollector/HttpCollector.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function populate(StateInterface $state): void
41 41
     {
42
-        if (!$this->request === null) {
42
+        if (!$this->request === null){
43 43
             return;
44 44
         }
45 45
 
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 
49 49
         $state->setVariable('headers', $this->request->getHeaders());
50 50
 
51
-        if ($this->request->getQueryParams() !== []) {
51
+        if ($this->request->getQueryParams() !== []){
52 52
             $state->setVariable('query', $this->request->getQueryParams());
53 53
         }
54 54
 
55
-        if ($this->request->getParsedBody() !== null) {
55
+        if ($this->request->getParsedBody() !== null){
56 56
             $state->setVariable('data', $this->request->getParsedBody());
57 57
         }
58 58
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function populate(StateInterface $state): void
41 41
     {
42
-        if (!$this->request === null) {
42
+        if (!$this->request === null)
43
+        {
43 44
             return;
44 45
         }
45 46
 
@@ -48,11 +49,13 @@  discard block
 block discarded – undo
48 49
 
49 50
         $state->setVariable('headers', $this->request->getHeaders());
50 51
 
51
-        if ($this->request->getQueryParams() !== []) {
52
+        if ($this->request->getQueryParams() !== [])
53
+        {
52 54
             $state->setVariable('query', $this->request->getQueryParams());
53 55
         }
54 56
 
55
-        if ($this->request->getParsedBody() !== null) {
57
+        if ($this->request->getParsedBody() !== null)
58
+        {
56 59
             $state->setVariable('data', $this->request->getParsedBody());
57 60
         }
58 61
     }
Please login to merge, or discard this patch.
src/Bootloader/SnapshotsBootloader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@
 block discarded – undo
46 46
         DirectoriesInterface $dirs,
47 47
         FilesInterface $files,
48 48
         LoggerInterface $logger = null
49
-    ) {
49
+    ){
50 50
         return new FileSnapshooter(
51
-            $dirs->get('runtime') . '/snapshots/',
51
+            $dirs->get('runtime').'/snapshots/',
52 52
             $env->get('SNAPSHOT_MAX_FILES', self::MAX_SNAPSHOTS),
53 53
             $env->get('SNAPSHOT_VERBOSITY', HandlerInterface::VERBOSITY_VERBOSE),
54 54
             new PlainHandler(),
Please login to merge, or discard this patch.
src/Http/ErrorHandler/PlainRenderer.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@
 block discarded – undo
40 40
     public function renderException(Request $request, int $code, string $message): Response
41 41
     {
42 42
         $response = $this->responseFactory->createResponse($code);
43
-        if ($request->getHeaderLine('Accept') == 'application/json') {
43
+        if ($request->getHeaderLine('Accept') == 'application/json'){
44 44
             $response->getBody()->write(json_encode(['status' => $code, 'error' => $message]));
45
-        } else {
45
+        }else{
46 46
             $response->getBody()->write("Error code: {$code}");
47 47
         }
48 48
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,9 +40,12 @@
 block discarded – undo
40 40
     public function renderException(Request $request, int $code, string $message): Response
41 41
     {
42 42
         $response = $this->responseFactory->createResponse($code);
43
-        if ($request->getHeaderLine('Accept') == 'application/json') {
43
+        if ($request->getHeaderLine('Accept') == 'application/json')
44
+        {
44 45
             $response->getBody()->write(json_encode(['status' => $code, 'error' => $message]));
45
-        } else {
46
+        }
47
+        else
48
+        {
46 49
             $response->getBody()->write("Error code: {$code}");
47 50
         }
48 51
 
Please login to merge, or discard this patch.
tests/Framework/GRPC/DispatcherTest.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
     public function setUp(): void
24 24
     {
25 25
         exec('protoc 2>&1', $out);
26
-        if (strpos(join("\n", $out), '--php_out') === false) {
26
+        if (strpos(join("\n", $out), '--php_out') === false){
27 27
             $this->markTestSkipped('Protoc binary is missing');
28 28
         }
29 29
 
30 30
         parent::setUp();
31 31
 
32 32
         $fs = new Files();
33
-        $proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto');
33
+        $proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto');
34 34
 
35 35
         // protoc can't figure relative paths
36 36
         $proto = str_replace('Framework/../', '', $proto);
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             'proto' => $proto
40 40
         ]);
41 41
 
42
-        file_put_contents($this->app->dir('app') . 'src/Service/EchoService.php', GenerateTest::SERVICE);
42
+        file_put_contents($this->app->dir('app').'src/Service/EchoService.php', GenerateTest::SERVICE);
43 43
     }
44 44
 
45 45
     public function tearDown(): void
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 
49 49
         $fs = new Files();
50 50
 
51
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
52
-            $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
51
+        if ($fs->isDirectory($this->app->dir('app').'src/Service')){
52
+            $fs->deleteDirectory($this->app->dir('app').'src/Service');
53 53
         }
54 54
 
55
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
56
-            $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
55
+        if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){
56
+            $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata');
57 57
         }
58 58
     }
59 59
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $msg->setMsg('hello');
80 80
 
81 81
         $w->shouldReceive('receive')->once()->with(
82
-            \Mockery::on(function (&$context) {
82
+            \Mockery::on(function (&$context){
83 83
                 $context = '{
84 84
                   "service": "service.Echo",
85 85
                   "method": "Ping",
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         )->andReturn($msg->serializeToString());
92 92
 
93 93
         $w->shouldReceive('send')->once()->with(
94
-            \Mockery::on(function ($out) {
94
+            \Mockery::on(function ($out){
95 95
                 $msg = new Message();
96 96
                 $msg->mergeFromString($out);
97 97
                 $this->assertSame('hello', $msg->getMsg());
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
         // one command only
105 105
         $w->shouldReceive('receive')->once()->with(
106
-            \Mockery::on(function (&$context) {
106
+            \Mockery::on(function (&$context){
107 107
                 $context = null;
108 108
                 return true;
109 109
             })
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $msg->setMsg('hello');
124 124
 
125 125
         $w->shouldReceive('receive')->once()->with(
126
-            \Mockery::on(function (&$context) {
126
+            \Mockery::on(function (&$context){
127 127
                 $context = '{
128 128
                   "service": "service.Echo",
129 129
                   "method": "Invalid",
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         )->andReturn($msg->serializeToString());
136 136
 
137 137
         $w->shouldReceive('error')->once()->with(
138
-            \Mockery::on(function ($out) {
138
+            \Mockery::on(function ($out){
139 139
                 $this->assertContains('Method `Invalid` not found', $out);
140 140
                 return true;
141 141
             })
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
         // one command only
145 145
         $w->shouldReceive('receive')->once()->with(
146
-            \Mockery::on(function (&$context) {
146
+            \Mockery::on(function (&$context){
147 147
                 $context = null;
148 148
                 return true;
149 149
             })
Please login to merge, or discard this patch.
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@  discard block
 block discarded – undo
23 23
     public function setUp(): void
24 24
     {
25 25
         exec('protoc 2>&1', $out);
26
-        if (strpos(join("\n", $out), '--php_out') === false) {
26
+        if (strpos(join("\n", $out), '--php_out') === false)
27
+        {
27 28
             $this->markTestSkipped('Protoc binary is missing');
28 29
         }
29 30
 
@@ -48,11 +49,13 @@  discard block
 block discarded – undo
48 49
 
49 50
         $fs = new Files();
50 51
 
51
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
52
+        if ($fs->isDirectory($this->app->dir('app') . 'src/Service'))
53
+        {
52 54
             $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
53 55
         }
54 56
 
55
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
57
+        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata'))
58
+        {
56 59
             $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
57 60
         }
58 61
     }
@@ -79,7 +82,8 @@  discard block
 block discarded – undo
79 82
         $msg->setMsg('hello');
80 83
 
81 84
         $w->shouldReceive('receive')->once()->with(
82
-            \Mockery::on(function (&$context) {
85
+            \Mockery::on(function (&$context)
86
+            {
83 87
                 $context = '{
84 88
                   "service": "service.Echo",
85 89
                   "method": "Ping",
@@ -91,7 +95,8 @@  discard block
 block discarded – undo
91 95
         )->andReturn($msg->serializeToString());
92 96
 
93 97
         $w->shouldReceive('send')->once()->with(
94
-            \Mockery::on(function ($out) {
98
+            \Mockery::on(function ($out)
99
+            {
95 100
                 $msg = new Message();
96 101
                 $msg->mergeFromString($out);
97 102
                 $this->assertSame('hello', $msg->getMsg());
@@ -103,7 +108,8 @@  discard block
 block discarded – undo
103 108
 
104 109
         // one command only
105 110
         $w->shouldReceive('receive')->once()->with(
106
-            \Mockery::on(function (&$context) {
111
+            \Mockery::on(function (&$context)
112
+            {
107 113
                 $context = null;
108 114
                 return true;
109 115
             })
@@ -123,7 +129,8 @@  discard block
 block discarded – undo
123 129
         $msg->setMsg('hello');
124 130
 
125 131
         $w->shouldReceive('receive')->once()->with(
126
-            \Mockery::on(function (&$context) {
132
+            \Mockery::on(function (&$context)
133
+            {
127 134
                 $context = '{
128 135
                   "service": "service.Echo",
129 136
                   "method": "Invalid",
@@ -135,7 +142,8 @@  discard block
 block discarded – undo
135 142
         )->andReturn($msg->serializeToString());
136 143
 
137 144
         $w->shouldReceive('error')->once()->with(
138
-            \Mockery::on(function ($out) {
145
+            \Mockery::on(function ($out)
146
+            {
139 147
                 $this->assertContains('Method `Invalid` not found', $out);
140 148
                 return true;
141 149
             })
@@ -143,7 +151,8 @@  discard block
 block discarded – undo
143 151
 
144 152
         // one command only
145 153
         $w->shouldReceive('receive')->once()->with(
146
-            \Mockery::on(function (&$context) {
154
+            \Mockery::on(function (&$context)
155
+            {
147 156
                 $context = null;
148 157
                 return true;
149 158
             })
Please login to merge, or discard this patch.