Skip to content

Commit 85ad223

Browse files
committed
phpcs fixes
1 parent 5c1aac0 commit 85ad223

File tree

7 files changed

+21
-11
lines changed

7 files changed

+21
-11
lines changed

README.md

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

33
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cdc12dbceac04dc8bbece4012222cd3d)](https://app.codacy.com/gh/clegginabox/airlock-php/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
44
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/cdc12dbceac04dc8bbece4012222cd3d)](https://app.codacy.com/gh/clegginabox/airlock-php/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)
5-
![PHPCS](https://img.shields.io/github/actions/workflow/status/clegginabox/airlock/tests.yaml?label=phpcs)
6-
![PHPUnit](https://img.shields.io/github/actions/workflow/status/clegginabox/airlock/tests.yaml?label=tests)
7-
![E2E](https://img.shields.io/github/actions/workflow/status/clegginabox/airlock/tests.yaml?label=e2e)
5+
![PHPCS](https://img.shields.io/github/actions/workflow/status/clegginabox/airlock-php/tests.yaml?label=phpcs)
6+
![PHPUnit](https://img.shields.io/github/actions/workflow/status/clegginabox/airlock-php/tests.yaml?label=tests)
7+
![E2E](https://img.shields.io/github/actions/workflow/status/clegginabox/airlock-php/tests.yaml?label=e2e)
88

99
<img width="830" height="453" alt="airlock-php-red" src="https://github.com/user-attachments/assets/361fb9d2-00a4-4a11-b8cf-cde4fc951b9f" />
1010

examples/01-lock/handler.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Example 01: Double-click prevention / single-flight.
5+
*
6+
* The lock is acquired in start.php (HTTP layer) for instant feedback.
7+
* This handler receives the serialized key, does the work, and releases the lock.
8+
*/
9+
310
declare(strict_types=1);
411

512
use Clegginabox\Airlock\Bridge\Symfony\Seal\SymfonyLockSeal;
@@ -8,12 +15,6 @@
815
use Symfony\Component\Lock\LockFactory;
916
use Symfony\Component\Lock\Store\RedisStore;
1017

11-
/**
12-
* Example 01: Double-click prevention / single-flight.
13-
*
14-
* The lock is acquired in start.php (HTTP layer) for instant feedback.
15-
* This handler receives the serialized key, does the work, and releases the lock.
16-
*/
1718
return static function (Redis $redis, array $job, callable $setStatus): void {
1819
$example = '01-lock';
1920
$clientId = (string)($job['clientId'] ?? 'anonymous');

examples/01-lock/start.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
// phpcs:ignoreFile SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable
4+
35
declare(strict_types=1);
46

57
require_once __DIR__ . '/../../vendor/autoload.php';
@@ -65,4 +67,4 @@
6567
$redis->lPush('airlock:examples:jobs', json_encode($job, JSON_THROW_ON_ERROR));
6668

6769
http_response_code(202);
68-
echo json_encode(['ok' => true, 'clientId' => $clientId], JSON_THROW_ON_ERROR);
70+
echo json_encode(['ok' => true, 'clientId' => $clientId], JSON_THROW_ON_ERROR);

examples/reset.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
// phpcs:ignoreFile SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable
4+
35
declare(strict_types=1);
46

57
/**

examples/status.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
// phpcs:ignoreFile SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable
4+
35
declare(strict_types=1);
46

57
header('Content-Type: application/json');
@@ -24,4 +26,4 @@
2426
exit;
2527
}
2628

27-
echo $data;
29+
echo $data;

examples/worker.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
// phpcs:ignoreFile Generic.Files.SideEffects
4+
35
declare(strict_types=1);
46

57
require_once __DIR__ . '/../vendor/autoload.php';

phpcs.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<!-- Limit PHPCS to these directories -->
1212
<file>src</file>
13+
<file>examples</file>
1314
<file>tests</file>
1415

1516
<!-- Enforce exactly one blank line between methods -->

0 commit comments

Comments
 (0)