Passed
Pull Request — 1.x (#334)
by Akihito
02:28
created
src/SemanticLog/Profile/Compact/ErrorContext.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,6 +46,6 @@
 block discarded – undo
46 46
         $crc = crc32($this->exceptionAsString);
47 47
         $crcHex = dechex($crc & 0xFFFFFFFF); // Ensure positive hex value
48 48
 
49
-        return 'e-bear-resource-' . $crcHex;
49
+        return 'e-bear-resource-'.$crcHex;
50 50
     }
51 51
 }
Please login to merge, or discard this patch.
src/SemanticLog/Profile/XHProfResult.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     public static function start(): self
34 34
     {
35
-        if (! function_exists('xhprof_enable')) {
35
+        if (!function_exists('xhprof_enable')) {
36 36
             return new self(); // @codeCoverageIgnore
37 37
         }
38 38
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     public function stop(string $uri): self
49 49
     {
50
-        if ($this->profileId === null || ! function_exists('xhprof_disable')) {
50
+        if ($this->profileId === null || !function_exists('xhprof_disable')) {
51 51
             return new self(); // @codeCoverageIgnore
52 52
         }
53 53
 
Please login to merge, or discard this patch.
src/SemanticLog/Profile/Verbose/ErrorContext.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $crc = crc32($this->exceptionAsString);
67 67
         $crcHex = dechex($crc & 0xFFFFFFFF); // Ensure positive hex value
68 68
 
69
-        return 'e-bear-resource-' . $crcHex;
69
+        return 'e-bear-resource-'.$crcHex;
70 70
     }
71 71
 
72 72
     /** @return array<string, mixed> */
Please login to merge, or discard this patch.
src/SemanticLog/Profile/XdebugTrace.php 1 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
     public static function start(): self
38 38
     {
39
-        if (! extension_loaded('xdebug') || ! function_exists('xdebug_start_trace')) {
39
+        if (!extension_loaded('xdebug') || !function_exists('xdebug_start_trace')) {
40 40
             return new self(); // @codeCoverageIgnore
41 41
         }
42 42
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $envMode = getenv('XDEBUG_MODE');
45 45
         $iniMode = ini_get('xdebug.mode');
46 46
         $xdebugMode = $envMode !== false ? $envMode : ($iniMode !== false ? $iniMode : '');
47
-        if (! str_contains($xdebugMode, 'trace')) {
47
+        if (!str_contains($xdebugMode, 'trace')) {
48 48
             return new self(); // @codeCoverageIgnore
49 49
         }
50 50
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $outputDir = sys_get_temp_dir(); // @codeCoverageIgnore
64 64
         }
65 65
 
66
-        $traceFilePrefix = rtrim($outputDir, '/') . '/' . $instance->traceId;
66
+        $traceFilePrefix = rtrim($outputDir, '/').'/'.$instance->traceId;
67 67
         xdebug_start_trace($traceFilePrefix); // @codeCoverageIgnore
68 68
 
69 69
         // Note: Return value is void, trace may fail silently if already started elsewhere
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     public function stop(): self
74 74
     {
75
-        if (! $this->canStopTrace()) {
75
+        if (!$this->canStopTrace()) {
76 76
             return new self(); // @codeCoverageIgnore
77 77
         }
78 78
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     private function canStopTrace(): bool
83 83
     {
84
-        if (! function_exists('xdebug_stop_trace')) {
84
+        if (!function_exists('xdebug_stop_trace')) {
85 85
             return false; // @codeCoverageIgnore
86 86
         }
87 87
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $iniMode = ini_get('xdebug.mode');
91 91
         $xdebugMode = $envMode !== false ? $envMode : ($iniMode !== false ? $iniMode : '');
92 92
 
93
-        if (! str_contains($xdebugMode, 'trace')) {
93
+        if (!str_contains($xdebugMode, 'trace')) {
94 94
             return false; // @codeCoverageIgnore
95 95
         }
96 96
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
         // Try to stop trace and get the trace file path
109 109
         // Suppress "Function trace was not started" error for graceful handling
110
-        set_error_handler(static function (int $errno, string $errstr): bool {
110
+        set_error_handler(static function(int $errno, string $errstr): bool {
111 111
             // Ignore specific xdebug trace errors (only handle E_NOTICE)
112 112
             return $errno === E_NOTICE && str_contains($errstr, 'Function trace was not started');
113 113
         });
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             restore_error_handler();
121 121
         }
122 122
 
123
-        if ($traceFile === false || ! is_string($traceFile) || ! file_exists($traceFile)) {
123
+        if ($traceFile === false || !is_string($traceFile) || !file_exists($traceFile)) {
124 124
             return new self(); // @codeCoverageIgnore
125 125
         }
126 126
 
Please login to merge, or discard this patch.
src/SemanticLog/server/bin/server.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@  discard block
 block discarded – undo
12 12
 
13 13
 $logDirectory = $argv[1] ?? null;
14 14
 
15
-if (! $logDirectory) {
15
+if (!$logDirectory) {
16 16
     fwrite(STDERR, "Usage: php server.php <log-directory>\n");
17 17
     exit(1);
18 18
 }
19 19
 
20
-if (! is_dir($logDirectory)) {
20
+if (!is_dir($logDirectory)) {
21 21
     fwrite(STDERR, "Directory not found: $logDirectory\n");
22 22
     exit(1);
23 23
 }
24 24
 
25 25
 // Find the latest semantic log file
26
-$pattern = rtrim($logDirectory, '/') . '/semantic-dev-*.json';
26
+$pattern = rtrim($logDirectory, '/').'/semantic-dev-*.json';
27 27
 $files = glob($pattern);
28 28
 
29 29
 if (empty($files)) {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 while ($line = fgets(STDIN)) {
45 45
     $request = json_decode(trim($line), true);
46 46
 
47
-    if (! $request) {
47
+    if (!$request) {
48 48
         continue;
49 49
     }
50 50
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         ]
108 108
     };
109 109
 
110
-    fwrite(STDOUT, json_encode($response) . "\n");
110
+    fwrite(STDOUT, json_encode($response)."\n");
111 111
 }
112 112
 
113 113
 function getLog(string $file): array
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         'content' => [
144 144
             [
145 145
                 'type' => 'text',
146
-                'text' => 'Unknown tool: ' . $toolName,
146
+                'text' => 'Unknown tool: '.$toolName,
147 147
             ],
148 148
         ],
149 149
         'isError' => true,
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     $script = $args['script'] ?? '';
156 156
     $xdebugMode = $args['xdebug_mode'] ?? 'trace';
157 157
 
158
-    if (! $script) {
158
+    if (!$script) {
159 159
         return [
160 160
             'content' => [
161 161
                 [
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         ];
168 168
     }
169 169
 
170
-    if (! file_exists($script)) {
170
+    if (!file_exists($script)) {
171 171
         return [
172 172
             'content' => [
173 173
                 [
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 
185 185
     // Execute the PHP script with profiling using php-dev.ini
186 186
     $env = "XDEBUG_MODE=$xdebugMode XDEBUG_CONFIG='compression_level=0'";
187
-    $phpDevIni = __DIR__ . '/php-dev.ini';
188
-    $command = "$env php -c " . escapeshellarg($phpDevIni) . " " . escapeshellarg($script) . ' 2>&1';
187
+    $phpDevIni = __DIR__.'/php-dev.ini';
188
+    $command = "$env php -c ".escapeshellarg($phpDevIni)." ".escapeshellarg($script).' 2>&1';
189 189
 
190 190
     $output = shell_exec($command);
191 191
 
192 192
     // Find semantic log files created during script execution
193 193
     $logDirectory = $GLOBALS['logDirectory'];
194
-    $pattern = rtrim($logDirectory, '/') . '/semantic-dev-*.json';
194
+    $pattern = rtrim($logDirectory, '/').'/semantic-dev-*.json';
195 195
 
196 196
     $files = glob($pattern);
197 197
     $newLogFiles = array_filter($files, static fn ($file) => filemtime($file) >= $beforeExecution);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         'content' => [
220 220
             [
221 221
                 'type' => 'text',
222
-                'text' => "Script executed successfully.\nLog file: $executionLog\n\nSemantic Log Data:\n" . json_encode($logData, JSON_PRETTY_PRINT),
222
+                'text' => "Script executed successfully.\nLog file: $executionLog\n\nSemantic Log Data:\n".json_encode($logData, JSON_PRETTY_PRINT),
223 223
             ],
224 224
         ],
225 225
         'isError' => false,
Please login to merge, or discard this patch.
src/OptionsMethodRequest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @psalm-suppress RedundantCondition for BC
40 40
      */
41
-    private function getParameterType(ReflectionParameter $parameter, array $paramDoc, string $name): string|null
41
+    private function getParameterType(ReflectionParameter $parameter, array $paramDoc, string $name): string | null
42 42
     {
43 43
         $hasType = method_exists($parameter, 'getType') && $parameter->getType();
44 44
         if ($hasType) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 $paramDoc[$name]['in'] = $ins[$parameter->name];
64 64
             }
65 65
 
66
-            if (! isset($paramDoc[$parameter->name])) {
66
+            if (!isset($paramDoc[$parameter->name])) {
67 67
                 $paramDoc[$name] = [];
68 68
             }
69 69
 
Please login to merge, or discard this patch.
src/Anchor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     #[Override]
30 30
     public function href(string $rel, AbstractRequest $request, array $query): array
31 31
     {
32
-        $classMethod = 'on' . ucfirst($request->method);
32
+        $classMethod = 'on'.ucfirst($request->method);
33 33
         $annotations = (new ReflectionMethod($request->resourceObject::class, $classMethod))->getAnnotations();
34 34
         foreach ($annotations as $annotation) {
35 35
             if ($this->isValidLinkAnnotation($annotation, $rel)) {
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             }
40 40
         }
41 41
 
42
-        throw new LinkException("rel:{$rel} class:" . $request->resourceObject::class, 500);
42
+        throw new LinkException("rel:{$rel} class:".$request->resourceObject::class, 500);
43 43
     }
44 44
 
45 45
     private function isValidLinkAnnotation(object $annotation, string $rel): bool
Please login to merge, or discard this patch.
src/OptionsRenderer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $ro->headers['Content-Type'] = 'application/json';
47 47
         $allows = $this->getAllows((new ReflectionClass($ro))->getMethods());
48 48
         $ro->headers['Allow'] = implode(', ', $allows);
49
-        $ro->view = $this->optionsBody ? (string) json_encode($this->getEntityBody($ro, $allows), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL : '';
49
+        $ro->view = $this->optionsBody ? (string) json_encode($this->getEntityBody($ro, $allows), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES).PHP_EOL : '';
50 50
 
51 51
         return $ro->view;
52 52
     }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $allows = [];
65 65
         foreach ($methods as $method) {
66
-            if (! in_array($method->name, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
66
+            if (!in_array($method->name, ['onGet', 'onPost', 'onPut', 'onPatch', 'onDelete', 'onHead'], true)) {
67 67
                 continue;
68 68
             }
69 69
 
Please login to merge, or discard this patch.
src/NamedParamMetas.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $method = new ReflectionMethod($callable[0], $callable[1]);
38 38
         $paramMetas = $this->getAttributeParamMetas($method);
39 39
 
40
-        if (! $paramMetas) {
40
+        if (!$paramMetas) {
41 41
             $paramMetas = $this->getAnnotationParamMetas($method);
42 42
         }
43 43
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                 $names[$annotation->param] = new AssistedResourceParam($annotation);
120 120
             }
121 121
 
122
-            if (! ($annotation instanceof Assisted)) {
122
+            if (!($annotation instanceof Assisted)) {
123 123
                 continue;
124 124
             }
125 125
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $webcontext = [];
142 142
         foreach ($annotations as $annotation) {
143
-            if (! ($annotation instanceof AbstractWebContextParam)) {
143
+            if (!($annotation instanceof AbstractWebContextParam)) {
144 144
                 continue;
145 145
             }
146 146
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     }
217 217
 
218 218
     /** @psalm-return DefaultParam<mixed>|NoDefaultParam */
219
-    private function getDefault(ReflectionParameter $parameter): DefaultParam|NoDefaultParam
219
+    private function getDefault(ReflectionParameter $parameter): DefaultParam | NoDefaultParam
220 220
     {
221 221
         return $parameter->isDefaultValueAvailable() === true ? new DefaultParam($parameter->getDefaultValue()) : new NoDefaultParam();
222 222
     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     private function getParam(ReflectionParameter $parameter): ParamInterface
247 247
     {
248 248
         $type = $parameter->getType();
249
-        if ($type instanceof ReflectionNamedType && ! $type->isBuiltin()) {
249
+        if ($type instanceof ReflectionNamedType && !$type->isBuiltin()) {
250 250
             return new ClassParam($type, $parameter);
251 251
         }
252 252
 
Please login to merge, or discard this patch.