Skip to content

Commit ec2af26

Browse files
authored
Applying Yii2 coding standards
1 parent c8bccda commit ec2af26

108 files changed

Lines changed: 319 additions & 286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/linter.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: linter
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request: &ignore-paths
8+
paths-ignore:
9+
- ".editorconfig"
10+
- ".gitattributes"
11+
- ".github/CONTRIBUTING.md"
12+
- ".github/FUNDING.yml"
13+
- ".github/SECURITY.md"
14+
- ".gitignore"
15+
- "docker-compose.yml"
16+
- "LICENSE.md"
17+
- "README.md"
18+
- "CHANGELOG.md"
19+
- "UPGRADE.md"
20+
21+
push: *ignore-paths
22+
23+
jobs:
24+
phpcs:
25+
uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master
26+
with:
27+
directories: src/ tests/
28+
extensions: 'amqp'

.github/workflows/main.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
---
21
name: build
32

43
on:
54
pull_request:
6-
paths-ignore:
5+
paths-ignore: &ignore-paths
76
- 'docs/**'
87
- 'README.md'
98
- 'CHANGELOG.md'
@@ -13,13 +12,7 @@ on:
1312

1413
push:
1514
branches: [ 'master' ]
16-
paths-ignore:
17-
- 'docs/**'
18-
- 'README.md'
19-
- 'CHANGELOG.md'
20-
- 'UPGRADE.md'
21-
- '.gitignore'
22-
- '.gitattributes'
15+
paths-ignore: *ignore-paths
2316

2417
env:
2518
COMPOSE_PROJECT_NAME: yii2-queue

.github/workflows/static.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
---
21
on:
32
pull_request:
4-
paths-ignore:
3+
paths-ignore: &ignore-paths
54
- 'docs/**'
65
- 'README.md'
76
- 'CHANGELOG.md'
@@ -12,14 +11,7 @@ on:
1211

1312
push:
1413
branches: [ 'master' ]
15-
paths-ignore:
16-
- 'docs/**'
17-
- 'README.md'
18-
- 'CHANGELOG.md'
19-
- 'UPGRADE.md'
20-
- '.gitignore'
21-
- '.gitattributes'
22-
- 'phpunit.xml.dist'
14+
paths-ignore: *ignore-paths
2315

2416
name: static analysis
2517

CHANGELOG.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ Yii2 Queue Extension Change Log
33

44
3.0.0 under development
55
---
6-
- The minimum supported PHP version is 8.3 (@s1lver)
7-
- Added PSALM for static code analysis. Error level set to 1 (@s1lver)
8-
- Added strict typing (@s1lver)
9-
- The `pda/pheanstalk` package of the Beanstalk driver has been updated to version 8.* (@s1lver)
10-
- Removed deprecated interfaces `RetryableJob`, `Job`, `Serializer` (@s1lver)
11-
- Removed deprecated classes `Signal`, `Verbose` (@s1lver)
12-
- Deprecated driver amqp has been removed (@s1lver)
13-
- Returned tests for the SQS driver (@s1lver)
14-
- All dependent packages for supported drivers have been updated to the latest versions (@s1lver)
15-
- The `opis/closure` package did not support PHP 8.1 and was replaced by the `laravel/serializable-closure` package (@s1lver)
6+
- Enh #542: The minimum supported PHP version is 8.3 (@s1lver)
7+
- Enh #503: Added PSALM for static code analysis. Error level set to 1 (@s1lver)
8+
- Enh #503: Added strict typing (@s1lver)
9+
- Enh #542: The `pda/pheanstalk` package of the Beanstalk driver has been updated to version 8.* (@s1lver)
10+
- Enh #503: Removed deprecated interfaces `RetryableJob`, `Job`, `Serializer` (@s1lver)
11+
- Enh #503: Removed deprecated classes `Signal`, `Verbose` (@s1lver)
12+
- Enh #503: Deprecated driver amqp has been removed (@s1lver)
13+
- Enh #542: Returned tests for the SQS driver (@s1lver)
14+
- Enh #503: All dependent packages for supported drivers have been updated to the latest versions (@s1lver)
15+
- Enh #503: The `opis/closure` package did not support PHP 8.1 and was replaced by the `laravel/serializable-closure` package (@s1lver)
16+
- Enh #544: Applying Yii2 coding standards (@s1lver)
1617

1718
2.3.8 January 08, 2026
1819
----------------------

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"yiisoft/yii2-redis": "~2.1.0",
2727
"yiisoft/yii2-debug": "~2.1.0",
2828
"yiisoft/yii2-gii": "~2.2.0",
29+
"yiisoft/yii2-coding-standards": "^3.0",
2930
"php-amqplib/php-amqplib": "^3.0.0",
3031
"enqueue/amqp-lib": "^0.10.0",
3132
"enqueue/amqp-bunny": "^0.10.0",
@@ -80,5 +81,9 @@
8081
"type": "composer",
8182
"url": "https://asset-packagist.org"
8283
}
83-
]
84+
],
85+
"scripts": {
86+
"phpcbf": "./vendor/bin/phpcbf -q src/ tests/",
87+
"phpcs": "./vendor/bin/phpcs -q src/ tests/"
88+
}
8489
}

phpcs.xml.dist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Yii2">
3+
<rule ref="vendor/yiisoft/yii2-coding-standards/Yii2"></rule>
4+
5+
<!-- generate relative paths -->
6+
<arg name="basepath" value="src"/>
7+
8+
<rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
9+
<exclude-pattern>/src/</exclude-pattern>
10+
<exclude-pattern>/tests/</exclude-pattern>
11+
</rule>
12+
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
13+
<exclude-pattern>/gii/form\.php$</exclude-pattern>
14+
</rule>
15+
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
16+
<exclude-pattern>/gii/default/job\.php$</exclude-pattern>
17+
</rule>
18+
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
19+
<exclude-pattern>/tests/</exclude-pattern>
20+
</rule>
21+
</ruleset>

src/ExecEvent.php

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

3-
declare(strict_types=1);
4-
53
/**
64
* @link https://www.yiiframework.com/
75
* @copyright Copyright (c) 2008 Yii Software LLC
86
* @license https://www.yiiframework.com/license/
97
*/
108

9+
declare(strict_types=1);
10+
1111
namespace yii\queue;
1212

1313
use Throwable;

src/InvalidJobException.php

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

3-
declare(strict_types=1);
4-
53
/**
64
* @link https://www.yiiframework.com/
75
* @copyright Copyright (c) 2008 Yii Software LLC
86
* @license https://www.yiiframework.com/license/
97
*/
108

9+
declare(strict_types=1);
10+
1111
namespace yii\queue;
1212

1313
use Exception;
@@ -31,11 +31,10 @@ class InvalidJobException extends Exception
3131
*/
3232
public function __construct(
3333
private readonly string $serialized,
34-
string $message = '',
35-
int $code = 0,
36-
?Throwable $previous = null
37-
)
38-
{
34+
string $message = '',
35+
int $code = 0,
36+
?Throwable $previous = null
37+
) {
3938
parent::__construct($message, $code, $previous);
4039
}
4140

0 commit comments

Comments
 (0)