Passed
Push — master ( 3eb4db...99d5ff )
by Kirill
03:12
created
src/Boot/tests/Fixtures/BrokenCore.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,13 @@
 block discarded – undo
43 43
      */
44 44
     protected function mapDirectories(array $directories): array
45 45
     {
46
-        if (!isset($directories['root'])) {
46
+        if (!isset($directories['root']))
47
+        {
47 48
             throw new BootException('Missing required directory `root`.');
48 49
         }
49 50
 
50
-        if (!isset($directories['app'])) {
51
+        if (!isset($directories['app']))
52
+        {
51 53
             $directories['app'] = $directories['root'] . '/app/';
52 54
         }
53 55
 
Please login to merge, or discard this patch.
src/Boot/tests/Fixtures/TestCore.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,13 @@
 block discarded – undo
43 43
      */
44 44
     protected function mapDirectories(array $directories): array
45 45
     {
46
-        if (!isset($directories['root'])) {
46
+        if (!isset($directories['root']))
47
+        {
47 48
             throw new BootException('Missing required directory `root`.');
48 49
         }
49 50
 
50
-        if (!isset($directories['app'])) {
51
+        if (!isset($directories['app']))
52
+        {
51 53
             $directories['app'] = $directories['root'] . '/app/';
52 54
         }
53 55
 
Please login to merge, or discard this patch.
src/Boot/tests/KernelTest.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@  discard block
 block discarded – undo
44 44
             'root' => __DIR__,
45 45
         ]);
46 46
 
47
-        $d = new class() implements DispatcherInterface {
47
+        $d = new class() implements DispatcherInterface
48
+        {
48 49
             public $fired = false;
49 50
 
50 51
             public function canServe(): bool
@@ -73,7 +74,8 @@  discard block
 block discarded – undo
73 74
             'root' => __DIR__,
74 75
         ]);
75 76
 
76
-        $d = new class() implements DispatcherInterface {
77
+        $d = new class() implements DispatcherInterface
78
+        {
77 79
             public function canServe(): bool
78 80
             {
79 81
                 return true;
Please login to merge, or discard this patch.
src/Boot/src/BootloadManager.php 1 patch
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -77,21 +77,25 @@  discard block
 block discarded – undo
77 77
      */
78 78
     protected function boot(array $classes): void
79 79
     {
80
-        foreach ($classes as $class => $options) {
80
+        foreach ($classes as $class => $options)
81
+        {
81 82
             // default bootload syntax as simple array
82
-            if (is_string($options)) {
83
+            if (is_string($options))
84
+            {
83 85
                 $class = $options;
84 86
                 $options = [];
85 87
             }
86 88
 
87
-            if (in_array($class, $this->classes)) {
89
+            if (in_array($class, $this->classes))
90
+            {
88 91
                 continue;
89 92
             }
90 93
 
91 94
             $this->classes[] = $class;
92 95
             $bootloader = $this->container->get($class);
93 96
 
94
-            if (!$bootloader instanceof BootloaderInterface) {
97
+            if (!$bootloader instanceof BootloaderInterface)
98
+            {
95 99
                 continue;
96 100
             }
97 101
 
@@ -107,17 +111,20 @@  discard block
 block discarded – undo
107 111
      */
108 112
     protected function initBootloader(BootloaderInterface $bootloader, array $options = []): void
109 113
     {
110
-        if ($bootloader instanceof DependedInterface) {
114
+        if ($bootloader instanceof DependedInterface)
115
+        {
111 116
             $this->boot($bootloader->defineDependencies());
112 117
         }
113 118
 
114 119
         $this->initBindings($bootloader->defineBindings(), $bootloader->defineSingletons());
115 120
 
116
-        if ((new \ReflectionClass($bootloader))->hasMethod('boot')) {
121
+        if ((new \ReflectionClass($bootloader))->hasMethod('boot'))
122
+        {
117 123
             $boot = new \ReflectionMethod($bootloader, 'boot');
118 124
 
119 125
             $args = $this->container->resolveArguments($boot, $options);
120
-            if (!isset($args['boot'])) {
126
+            if (!isset($args['boot']))
127
+            {
121 128
                 $args['boot'] = $options;
122 129
             }
123 130
 
@@ -133,11 +140,13 @@  discard block
 block discarded – undo
133 140
      */
134 141
     protected function initBindings(array $bindings, array $singletons): void
135 142
     {
136
-        foreach ($bindings as $aliases => $resolver) {
143
+        foreach ($bindings as $aliases => $resolver)
144
+        {
137 145
             $this->container->bind($aliases, $resolver);
138 146
         }
139 147
 
140
-        foreach ($singletons as $aliases => $resolver) {
148
+        foreach ($singletons as $aliases => $resolver)
149
+        {
141 150
             $this->container->bindSingleton($aliases, $resolver);
142 151
         }
143 152
     }
Please login to merge, or discard this patch.
src/Boot/src/Environment.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function getID(): string
44 44
     {
45
-        if (empty($this->id)) {
45
+        if (empty($this->id))
46
+        {
46 47
             $this->id = md5(serialize($this->values));
47 48
         }
48 49
 
@@ -65,7 +66,8 @@  discard block
 block discarded – undo
65 66
      */
66 67
     public function get(string $name, $default = null)
67 68
     {
68
-        if (isset($this->values[$name])) {
69
+        if (isset($this->values[$name]))
70
+        {
69 71
             return $this->normalize($this->values[$name]);
70 72
         }
71 73
 
@@ -81,7 +83,8 @@  discard block
 block discarded – undo
81 83
     {
82 84
         $result = [];
83 85
 
84
-        foreach ($this->values as $key => $value) {
86
+        foreach ($this->values as $key => $value)
87
+        {
85 88
             $result[$key] = $this->normalize($value);
86 89
         }
87 90
 
@@ -94,12 +97,14 @@  discard block
 block discarded – undo
94 97
      */
95 98
     protected function normalize($value)
96 99
     {
97
-        if (!is_string($value)) {
100
+        if (!is_string($value))
101
+        {
98 102
             return $value;
99 103
         }
100 104
 
101 105
         $alias = strtolower($value);
102
-        if (isset(self::VALUE_MAP[$alias])) {
106
+        if (isset(self::VALUE_MAP[$alias]))
107
+        {
103 108
             return self::VALUE_MAP[$alias];
104 109
         }
105 110
 
Please login to merge, or discard this patch.
src/Boot/src/Finalizer.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
      */
30 30
     public function finalize(bool $terminate = false): void
31 31
     {
32
-        foreach ($this->finalizers as $finalizer) {
32
+        foreach ($this->finalizers as $finalizer)
33
+        {
33 34
             call_user_func($finalizer, $terminate);
34 35
         }
35 36
     }
Please login to merge, or discard this patch.
src/Boot/src/Directories.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function __construct(array $directories)
25 25
     {
26
-        foreach ($directories as $name => $directory) {
26
+        foreach ($directories as $name => $directory)
27
+        {
27 28
             $this->set($name, $directory);
28 29
         }
29 30
     }
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
      */
53 54
     public function get(string $name): string
54 55
     {
55
-        if (!$this->has($name)) {
56
+        if (!$this->has($name))
57
+        {
56 58
             throw new DirectoryException("Undefined directory '{$name}'");
57 59
         }
58 60
 
Please login to merge, or discard this patch.
src/Boot/src/Memory.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,13 +44,17 @@
 block discarded – undo
44 44
     {
45 45
         $filename = $this->getFilename($section);
46 46
 
47
-        if (!file_exists($filename)) {
47
+        if (!file_exists($filename))
48
+        {
48 49
             return null;
49 50
         }
50 51
 
51
-        try {
52
+        try
53
+        {
52 54
             return include($filename);
53
-        } catch (\Throwable $e) {
55
+        }
56
+        catch (\Throwable $e)
57
+        {
54 58
             return null;
55 59
         }
56 60
     }
Please login to merge, or discard this patch.
src/Boot/src/ExceptionHandler.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,8 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public static function handleShutdown(): void
52 52
     {
53
-        if (!empty($error = error_get_last())) {
53
+        if (!empty($error = error_get_last()))
54
+        {
54 55
             self::handleException(
55 56
                 new FatalException(
56 57
                     $error['message'],
@@ -85,9 +86,12 @@  discard block
 block discarded – undo
85 86
      */
86 87
     public static function handleException(\Throwable $e): void
87 88
     {
88
-        if (php_sapi_name() == 'cli') {
89
+        if (php_sapi_name() == 'cli')
90
+        {
89 91
             $handler = new ConsoleHandler(self::$output);
90
-        } else {
92
+        }
93
+        else
94
+        {
91 95
             $handler = new HtmlHandler(HtmlHandler::INVERTED);
92 96
         }
93 97
 
Please login to merge, or discard this patch.