Skip to content

Commit c33822c

Browse files
committed
Fix PHP-CS-Fixer lint issues
- Add proper use imports instead of backslash-prefixed class names - Add trailing commas to multi-line function parameters - Affected files: Checkend.php, Client.php, IgnoreFilter.php, LaravelQueueHandler.php, Notice.php
1 parent df1f20b commit c33822c

5 files changed

Lines changed: 21 additions & 13 deletions

File tree

src/Checkend.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Checkend;
66

7+
use ErrorException;
78
use Throwable;
89

910
/**
@@ -247,12 +248,12 @@ public static function shutdown(): void
247248
// Check for fatal errors
248249
$error = error_get_last();
249250
if ($error !== null && in_array($error['type'], [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR], true)) {
250-
$exception = new \ErrorException(
251+
$exception = new ErrorException(
251252
$error['message'],
252253
0,
253254
$error['type'],
254255
$error['file'],
255-
$error['line']
256+
$error['line'],
256257
);
257258
self::notify($exception);
258259
}
@@ -300,7 +301,7 @@ private static function buildNotice(Throwable $exception, array $options): Notic
300301
$mergedUser,
301302
$mergedRequest,
302303
$options['fingerprint'] ?? null,
303-
$options['tags'] ?? []
304+
$options['tags'] ?? [],
304305
);
305306
}
306307

src/Client.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace Checkend;
66

7+
use Exception;
8+
use RuntimeException;
9+
710
/**
811
* HTTP client for sending notices to Checkend.
912
*/
@@ -36,7 +39,7 @@ public function send(Notice $notice): ?array
3639
$response = $this->post($payload);
3740
$this->configuration->log('debug', 'Notice sent successfully: ' . json_encode($response));
3841
return $response;
39-
} catch (\Exception $e) {
42+
} catch (Exception $e) {
4043
$this->configuration->log('error', 'Failed to send notice: ' . $e->getMessage());
4144
return null;
4245
}
@@ -50,7 +53,7 @@ private function post(array $payload): array
5053
{
5154
$data = json_encode($payload);
5255
if ($data === false) {
53-
throw new \RuntimeException('Failed to encode payload');
56+
throw new RuntimeException('Failed to encode payload');
5457
}
5558

5659
$context = $this->createStreamContext($data);
@@ -64,16 +67,16 @@ private function post(array $payload): array
6467

6568
if ($statusCode !== 201) {
6669
$this->handleHttpError($statusCode, $response ?: '');
67-
throw new \RuntimeException('HTTP error: ' . $statusCode);
70+
throw new RuntimeException('HTTP error: ' . $statusCode);
6871
}
6972

7073
if ($response === false) {
71-
throw new \RuntimeException('Failed to read response');
74+
throw new RuntimeException('Failed to read response');
7275
}
7376

7477
$decoded = json_decode($response, true);
7578
if (!is_array($decoded)) {
76-
throw new \RuntimeException('Failed to decode response');
79+
throw new RuntimeException('Failed to decode response');
7780
}
7881

7982
return $decoded;

src/Filters/IgnoreFilter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Checkend\Filters;
66

7+
use ReflectionClass;
78
use Throwable;
89

910
/**
@@ -43,7 +44,7 @@ public function shouldIgnore(Throwable $exception): bool
4344
}
4445

4546
// Check short class name
46-
$shortName = (new \ReflectionClass($exception))->getShortName();
47+
$shortName = (new ReflectionClass($exception))->getShortName();
4748
if ($shortName === $pattern) {
4849
return true;
4950
}

src/Integrations/LaravelQueueHandler.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
use Checkend\Checkend;
88
use Checkend\Filters\SanitizeFilter;
9+
use ReflectionClass;
10+
use ReflectionProperty;
11+
use Throwable;
912

1013
/**
1114
* Laravel Queue integration for capturing job failures.
@@ -210,10 +213,10 @@ private static function extractJobData(string $serializedCommand): ?array
210213
}
211214

212215
// Get public properties
213-
$reflection = new \ReflectionClass($command);
216+
$reflection = new ReflectionClass($command);
214217
$data = [];
215218

216-
foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
219+
foreach ($reflection->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
217220
$name = $property->getName();
218221
$value = $property->getValue($command);
219222

@@ -241,7 +244,7 @@ private static function extractJobData(string $serializedCommand): ?array
241244
}
242245

243246
return $data;
244-
} catch (\Throwable) {
247+
} catch (Throwable) {
245248
return null;
246249
}
247250
}

src/Notice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(
4949
array $user = [],
5050
string $environment = 'development',
5151
?string $occurredAt = null,
52-
array $notifier = []
52+
array $notifier = [],
5353
) {
5454
$this->errorClass = $errorClass;
5555
$this->message = $message;

0 commit comments

Comments
 (0)