Passed
Push — master ( 95fdf8...1b835e )
by Kirill
04:44 queued 10s
created
src/Stempler/tests/BufferTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public function testIterate(): void
32 32
     {
33 33
         $out = '';
34
-        foreach ($this->buffer('abc') as $n) {
34
+        foreach ($this->buffer('abc') as $n){
35 35
             $out .= $n->char;
36 36
         }
37 37
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     private function generate(StreamInterface $src)
153 153
     {
154
-        while (!$src->isEOI()) {
154
+        while (!$src->isEOI()){
155 155
             yield new Byte($src->getOffset(), $src->peak());
156 156
         }
157 157
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@  discard block
 block discarded – undo
31 31
     public function testIterate(): void
32 32
     {
33 33
         $out = '';
34
-        foreach ($this->buffer('abc') as $n) {
34
+        foreach ($this->buffer('abc') as $n)
35
+        {
35 36
             $out .= $n->char;
36 37
         }
37 38
 
@@ -151,7 +152,8 @@  discard block
 block discarded – undo
151 152
 
152 153
     private function generate(StreamInterface $src)
153 154
     {
154
-        while (!$src->isEOI()) {
155
+        while (!$src->isEOI())
156
+        {
155 157
             yield new Byte($src->getOffset(), $src->peak());
156 158
         }
157 159
     }
Please login to merge, or discard this patch.
src/Stempler/tests/Grammar/BaseTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $parsed = $this->tokens($source);
29 29
 
30
-        if (count($tokens) !== count($parsed)) {
30
+        if (count($tokens) !== count($parsed)){
31 31
             $this->fail('Token count mismatch');
32 32
         }
33 33
 
34
-        foreach ($tokens as $index => $token) {
34
+        foreach ($tokens as $index => $token){
35 35
             $this->assertSame($token->type, $parsed[$index]->type, 'Token type mismatch');
36 36
             $this->assertSame($token->offset, $parsed[$index]->offset, 'Token offset mismatch');
37 37
             $this->assertSame($token->content, $parsed[$index]->content, 'Token content mismatch');
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
     protected function tokens(string $source): array
42 42
     {
43 43
         $lexer = new Lexer();
44
-        foreach (static::GRAMMARS as $grammar) {
44
+        foreach (static::GRAMMARS as $grammar){
45 45
             $lexer->addGrammar(new $grammar());
46 46
         }
47 47
 
48 48
         $tokens = [];
49
-        foreach ($lexer->parse(new StringStream($source)) as $t) {
49
+        foreach ($lexer->parse(new StringStream($source)) as $t){
50 50
             $tokens[] = $t;
51 51
         }
52 52
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,11 +27,13 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $parsed = $this->tokens($source);
29 29
 
30
-        if (count($tokens) !== count($parsed)) {
30
+        if (count($tokens) !== count($parsed))
31
+        {
31 32
             $this->fail('Token count mismatch');
32 33
         }
33 34
 
34
-        foreach ($tokens as $index => $token) {
35
+        foreach ($tokens as $index => $token)
36
+        {
35 37
             $this->assertSame($token->type, $parsed[$index]->type, 'Token type mismatch');
36 38
             $this->assertSame($token->offset, $parsed[$index]->offset, 'Token offset mismatch');
37 39
             $this->assertSame($token->content, $parsed[$index]->content, 'Token content mismatch');
@@ -41,12 +43,14 @@  discard block
 block discarded – undo
41 43
     protected function tokens(string $source): array
42 44
     {
43 45
         $lexer = new Lexer();
44
-        foreach (static::GRAMMARS as $grammar) {
46
+        foreach (static::GRAMMARS as $grammar)
47
+        {
45 48
             $lexer->addGrammar(new $grammar());
46 49
         }
47 50
 
48 51
         $tokens = [];
49
-        foreach ($lexer->parse(new StringStream($source)) as $t) {
52
+        foreach ($lexer->parse(new StringStream($source)) as $t)
53
+        {
50 54
             $tokens[] = $t;
51 55
         }
52 56
 
Please login to merge, or discard this patch.
src/Stempler/tests/Grammar/RawTestTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $parsed = $this->tokens($source);
35 35
 
36
-        if (count($tokens) !== count($parsed)) {
36
+        if (count($tokens) !== count($parsed)){
37 37
             $this->fail('Token count mismatch');
38 38
         }
39 39
 
40
-        foreach ($tokens as $index => $token) {
40
+        foreach ($tokens as $index => $token){
41 41
             $this->assertSame($token->type, $parsed[$index]->type, 'Token type mismatch');
42 42
             $this->assertSame($token->offset, $parsed[$index]->offset, 'Token offset mismatch');
43 43
             $this->assertSame($token->content, $parsed[$index]->content, 'Token content mismatch');
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $lexer = new Lexer();
50 50
 
51 51
         $tokens = [];
52
-        foreach ($lexer->parse(new StringStream($source)) as $t) {
52
+        foreach ($lexer->parse(new StringStream($source)) as $t){
53 53
             $tokens[] = $t;
54 54
         }
55 55
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,11 +33,13 @@  discard block
 block discarded – undo
33 33
     {
34 34
         $parsed = $this->tokens($source);
35 35
 
36
-        if (count($tokens) !== count($parsed)) {
36
+        if (count($tokens) !== count($parsed))
37
+        {
37 38
             $this->fail('Token count mismatch');
38 39
         }
39 40
 
40
-        foreach ($tokens as $index => $token) {
41
+        foreach ($tokens as $index => $token)
42
+        {
41 43
             $this->assertSame($token->type, $parsed[$index]->type, 'Token type mismatch');
42 44
             $this->assertSame($token->offset, $parsed[$index]->offset, 'Token offset mismatch');
43 45
             $this->assertSame($token->content, $parsed[$index]->content, 'Token content mismatch');
@@ -49,7 +51,8 @@  discard block
 block discarded – undo
49 51
         $lexer = new Lexer();
50 52
 
51 53
         $tokens = [];
52
-        foreach ($lexer->parse(new StringStream($source)) as $t) {
54
+        foreach ($lexer->parse(new StringStream($source)) as $t)
55
+        {
53 56
             $tokens[] = $t;
54 57
         }
55 58
 
Please login to merge, or discard this patch.
src/Stempler/tests/Directive/BaseTest.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
     protected const DIRECTIVES = [];
37 37
 
38 38
     /**
39
- * @param Template $document
40
- * @return string
41
- */
39
+     * @param Template $document
40
+     * @return string
41
+     */
42 42
     protected function compile(Template $document): string
43 43
     {
44 44
         $compiler = new Compiler();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@
 block discarded – undo
42 42
     protected function compile(Template $document): string
43 43
     {
44 44
         $compiler = new Compiler();
45
-        foreach (static::RENDERS as $renderer) {
45
+        foreach (static::RENDERS as $renderer){
46 46
             $compiler->addRenderer(new $renderer());
47 47
         }
48 48
 
49 49
         $directiveGroup = new DirectiveGroup();
50
-        foreach (static::DIRECTIVES as $directive) {
50
+        foreach (static::DIRECTIVES as $directive){
51 51
             $directiveGroup->addDirective(new $directive());
52 52
         }
53 53
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,12 +42,14 @@
 block discarded – undo
42 42
     protected function compile(Template $document): string
43 43
     {
44 44
         $compiler = new Compiler();
45
-        foreach (static::RENDERS as $renderer) {
45
+        foreach (static::RENDERS as $renderer)
46
+        {
46 47
             $compiler->addRenderer(new $renderer());
47 48
         }
48 49
 
49 50
         $directiveGroup = new DirectiveGroup();
50
-        foreach (static::DIRECTIVES as $directive) {
51
+        foreach (static::DIRECTIVES as $directive)
52
+        {
51 53
             $directiveGroup->addDirective(new $directive());
52 54
         }
53 55
 
Please login to merge, or discard this patch.
src/Stempler/tests/Syntax/BaseTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     {
31 31
         $parser = new Parser();
32 32
 
33
-        foreach (static::GRAMMARS as $grammar => $syntax) {
33
+        foreach (static::GRAMMARS as $grammar => $syntax){
34 34
             $parser->addSyntax(new $grammar(), new $syntax());
35 35
         }
36 36
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@
 block discarded – undo
30 30
     {
31 31
         $parser = new Parser();
32 32
 
33
-        foreach (static::GRAMMARS as $grammar => $syntax) {
33
+        foreach (static::GRAMMARS as $grammar => $syntax)
34
+        {
34 35
             $parser->addSyntax(new $grammar(), new $syntax());
35 36
         }
36 37
 
Please login to merge, or discard this patch.
src/AnnotatedRoutes/src/Bootloader/AnnotatedRoutesBootloader.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
         AnnotationRegistry::registerLoader('class_exists');
68 68
 
69 69
         $schema = $this->memory->loadData(self::MEMORY_SECTION);
70
-        if (empty($schema) || !$cached) {
70
+        if (empty($schema) || !$cached){
71 71
             $schema = $locator->findDeclarations();
72 72
             $this->memory->saveData(self::MEMORY_SECTION, $schema);
73 73
         }
74 74
 
75 75
         $this->configureRoutes($schema);
76 76
 
77
-        foreach ($this->groups as $group) {
77
+        foreach ($this->groups as $group){
78 78
             $group->flushRoutes();
79 79
         }
80 80
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     private function configureRoutes(array $routes): void
94 94
     {
95
-        foreach ($routes as $name => $schema) {
95
+        foreach ($routes as $name => $schema){
96 96
             $this->groups
97 97
                 ->getGroup($schema['group'])
98 98
                 ->registerRoute(
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,14 +67,16 @@  discard block
 block discarded – undo
67 67
         AnnotationRegistry::registerLoader('class_exists');
68 68
 
69 69
         $schema = $this->memory->loadData(self::MEMORY_SECTION);
70
-        if (empty($schema) || !$cached) {
70
+        if (empty($schema) || !$cached)
71
+        {
71 72
             $schema = $locator->findDeclarations();
72 73
             $this->memory->saveData(self::MEMORY_SECTION, $schema);
73 74
         }
74 75
 
75 76
         $this->configureRoutes($schema);
76 77
 
77
-        foreach ($this->groups as $group) {
78
+        foreach ($this->groups as $group)
79
+        {
78 80
             $group->flushRoutes();
79 81
         }
80 82
     }
@@ -92,7 +94,8 @@  discard block
 block discarded – undo
92 94
      */
93 95
     private function configureRoutes(array $routes): void
94 96
     {
95
-        foreach ($routes as $name => $schema) {
97
+        foreach ($routes as $name => $schema)
98
+        {
96 99
             $this->groups
97 100
                 ->getGroup($schema['group'])
98 101
                 ->registerRoute(
Please login to merge, or discard this patch.
src/AnnotatedRoutes/src/RouteGroup.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         ContainerInterface $container,
51 51
         RouterInterface $router,
52 52
         Pipeline $pipeline
53
-    ) {
53
+    ){
54 54
         $this->container = $container;
55 55
         $this->router = $router;
56 56
         $this->pipeline = $pipeline;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function setCore($core): self
80 80
     {
81
-        if (!$core instanceof CoreInterface) {
81
+        if (!$core instanceof CoreInterface){
82 82
             $core = $this->container->get($core);
83 83
         }
84 84
         $this->core = $core;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     public function addMiddleware($middleware): self
97 97
     {
98
-        if (!$middleware instanceof MiddlewareInterface) {
98
+        if (!$middleware instanceof MiddlewareInterface){
99 99
             $middleware = $this->container->get($middleware);
100 100
         }
101 101
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         array $verbs,
127 127
         array $defaults,
128 128
         array $middleware
129
-    ) {
129
+    ){
130 130
         $this->routes[$name] = [
131 131
             'pattern'    => $pattern,
132 132
             'controller' => $controller,
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function flushRoutes()
144 144
     {
145
-        foreach ($this->routes as $name => $schema) {
145
+        foreach ($this->routes as $name => $schema){
146 146
             $route = $this->createRoute($schema['pattern'], $schema['controller'], $schema['action']);
147 147
 
148
-            if ($schema['defaults'] !== []) {
148
+            if ($schema['defaults'] !== []){
149 149
                 $route = $route->withDefaults($schema['defaults']);
150 150
             }
151 151
 
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
     public function createRoute(string $pattern, string $controller, string $action): Route
166 166
     {
167 167
         $action = new Action($controller, $action);
168
-        if ($this->core !== null) {
168
+        if ($this->core !== null){
169 169
             $action = $action->withCore($this->core);
170 170
         }
171 171
 
172
-        $route = new Route($this->prefix . $pattern, $action);
172
+        $route = new Route($this->prefix.$pattern, $action);
173 173
 
174 174
         // all routes within group share the same middleware pipeline
175 175
         $route = $route->withMiddleware($this->pipeline);
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,8 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function setCore($core): self
80 80
     {
81
-        if (!$core instanceof CoreInterface) {
81
+        if (!$core instanceof CoreInterface)
82
+        {
82 83
             $core = $this->container->get($core);
83 84
         }
84 85
         $this->core = $core;
@@ -95,7 +96,8 @@  discard block
 block discarded – undo
95 96
      */
96 97
     public function addMiddleware($middleware): self
97 98
     {
98
-        if (!$middleware instanceof MiddlewareInterface) {
99
+        if (!$middleware instanceof MiddlewareInterface)
100
+        {
99 101
             $middleware = $this->container->get($middleware);
100 102
         }
101 103
 
@@ -142,10 +144,12 @@  discard block
 block discarded – undo
142 144
      */
143 145
     public function flushRoutes()
144 146
     {
145
-        foreach ($this->routes as $name => $schema) {
147
+        foreach ($this->routes as $name => $schema)
148
+        {
146 149
             $route = $this->createRoute($schema['pattern'], $schema['controller'], $schema['action']);
147 150
 
148
-            if ($schema['defaults'] !== []) {
151
+            if ($schema['defaults'] !== [])
152
+            {
149 153
                 $route = $route->withDefaults($schema['defaults']);
150 154
             }
151 155
 
@@ -165,7 +169,8 @@  discard block
 block discarded – undo
165 169
     public function createRoute(string $pattern, string $controller, string $action): Route
166 170
     {
167 171
         $action = new Action($controller, $action);
168
-        if ($this->core !== null) {
172
+        if ($this->core !== null)
173
+        {
169 174
             $action = $action->withCore($this->core);
170 175
         }
171 176
 
Please login to merge, or discard this patch.
src/AnnotatedRoutes/src/RouteLocator.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
     public function findDeclarations(): array
34 34
     {
35 35
         $result = [];
36
-        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match) {
36
+        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match)
37
+        {
37 38
             /** @var RouteAnnotation $route */
38 39
             $route = $match->getAnnotation();
39 40
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function findDeclarations(): array
34 34
     {
35 35
         $result = [];
36
-        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match) {
36
+        foreach ($this->locator->findMethods(RouteAnnotation::class) as $match){
37 37
             /** @var RouteAnnotation $route */
38 38
             $route = $match->getAnnotation();
39 39
 
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
                 'controller' => $match->getClass()->getName(),
43 43
                 'action'     => $match->getMethod()->getName(),
44 44
                 'group'      => $route->group,
45
-                'verbs'      => (array) $route->methods,
45
+                'verbs'      => (array)$route->methods,
46 46
                 'defaults'   => $route->defaults,
47
-                'middleware' => (array) $route->middleware,
47
+                'middleware' => (array)$route->middleware,
48 48
             ];
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/AnnotatedRoutes/src/GroupRegistry.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function getGroup(string $name): RouteGroup
41 41
     {
42
-        if (!isset($this->groups[$name])) {
42
+        if (!isset($this->groups[$name])){
43 43
             $this->groups[$name] = $this->factory->make(RouteGroup::class);
44 44
         }
45 45
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@
 block discarded – undo
39 39
      */
40 40
     public function getGroup(string $name): RouteGroup
41 41
     {
42
-        if (!isset($this->groups[$name])) {
42
+        if (!isset($this->groups[$name]))
43
+        {
43 44
             $this->groups[$name] = $this->factory->make(RouteGroup::class);
44 45
         }
45 46
 
Please login to merge, or discard this patch.