Completed
Branch 2.0 (ba2d77)
by Anton
01:50
created
src/Core.php 1 patch
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -80,9 +80,12 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function serve()
82 82
     {
83
-        foreach ($this->dispatchers as $dispatcher) {
84
-            if ($dispatcher->canServe()) {
85
-                ContainerScope::runScope($this->container, function () use ($dispatcher) {
83
+        foreach ($this->dispatchers as $dispatcher)
84
+        {
85
+            if ($dispatcher->canServe())
86
+            {
87
+                ContainerScope::runScope($this->container, function () use ($dispatcher)
88
+                {
86 89
                     $dispatcher->serve();
87 90
                 });
88 91
                 return;
@@ -105,11 +108,13 @@  discard block
 block discarded – undo
105 108
      */
106 109
     protected function mapDirectories(array $directories): array
107 110
     {
108
-        if (!isset($directories['root'])) {
111
+        if (!isset($directories['root']))
112
+        {
109 113
             throw new FrameworkException("Missing required directory `root`.");
110 114
         }
111 115
 
112
-        if (!isset($directories['app'])) {
116
+        if (!isset($directories['app']))
117
+        {
113 118
             $directories['app'] = $directories['root'] . '/app/';
114 119
         }
115 120
 
@@ -152,7 +157,8 @@  discard block
 block discarded – undo
152 157
         EnvironmentInterface $environment = null,
153 158
         bool $handleErrors = true
154 159
     ): self {
155
-        if ($handleErrors) {
160
+        if ($handleErrors)
161
+        {
156 162
             ExceptionHandler::register();
157 163
         }
158 164
 
@@ -162,11 +168,15 @@  discard block
 block discarded – undo
162 168
             $environment ?? new Environment()
163 169
         );
164 170
 
165
-        try {
166
-            ContainerScope::runScope($core->container, function () use ($core) {
171
+        try
172
+        {
173
+            ContainerScope::runScope($core->container, function () use ($core)
174
+            {
167 175
                 $core->bootload()->bootstrap();
168 176
             });
169
-        } catch (\Throwable $e) {
177
+        }
178
+        catch (\Throwable $e)
179
+        {
170 180
             ExceptionHandler::handleException($e);
171 181
         }
172 182
 
Please login to merge, or discard this patch.
src/Environment.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function getID(): string
41 41
     {
42
-        if (empty($this->id)) {
42
+        if (empty($this->id))
43
+        {
43 44
             $this->id = md5(serialize($this->values));
44 45
         }
45 46
 
@@ -62,7 +63,8 @@  discard block
 block discarded – undo
62 63
      */
63 64
     public function get(string $name, $default = null)
64 65
     {
65
-        if (isset($this->values[$name])) {
66
+        if (isset($this->values[$name]))
67
+        {
66 68
             return $this->normalize($this->values[$name]);
67 69
         }
68 70
 
@@ -75,12 +77,14 @@  discard block
 block discarded – undo
75 77
      */
76 78
     protected function normalize($value): ?string
77 79
     {
78
-        if (!is_string($value)) {
80
+        if (!is_string($value))
81
+        {
79 82
             return $value;
80 83
         }
81 84
 
82 85
         $alias = strtolower($value);
83
-        if (isset(self::VALUE_MAP[$alias])) {
86
+        if (isset(self::VALUE_MAP[$alias]))
87
+        {
84 88
             return self::VALUE_MAP[$alias];
85 89
         }
86 90
 
Please login to merge, or discard this patch.