@@ -46,6 +46,6 @@ |
||
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 | } |
@@ -66,7 +66,7 @@ |
||
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> */ |
@@ -36,7 +36,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -38,7 +38,7 @@ discard block |
||
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 |
||
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 |
@@ -29,7 +29,7 @@ discard block |
||
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 |
||
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 |
@@ -46,7 +46,7 @@ discard block |
||
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 |
||
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 |
@@ -37,7 +37,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function __construct( |
25 | 25 | private readonly string $jsonSchemaDir = '', |
26 | 26 | private readonly string $jsonValidateDir = '', |
27 | - AbstractModule|null $module = null, |
|
27 | + AbstractModule | null $module = null, |
|
28 | 28 | ) { |
29 | 29 | parent::__construct($module); |
30 | 30 | } |
@@ -17,9 +17,9 @@ |
||
17 | 17 | /** @param string $jsonSchemaHost Json-schema host name ex) https://example.com/schema/ */ |
18 | 18 | public function __construct( |
19 | 19 | private readonly string $jsonSchemaHost, |
20 | - AbstractModule|null $module = null, |
|
20 | + AbstractModule | null $module = null, |
|
21 | 21 | ) { |
22 | - if (! filter_var($jsonSchemaHost, FILTER_VALIDATE_URL)) { |
|
22 | + if (!filter_var($jsonSchemaHost, FILTER_VALIDATE_URL)) { |
|
23 | 23 | throw new InvalidSchemaUriException($jsonSchemaHost); |
24 | 24 | } |
25 | 25 |