Skip to content

Commit 03db596

Browse files
Update dependencies and fix coding standards issues. (#8)
1 parent 72e5aa7 commit 03db596

9 files changed

+64
-16
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
22

3-
## 0.1.1 Under development
3+
## 0.1.1 February 27, 2024
4+
5+
- Bug #8: Update dependencies and fix coding standards issues (@terabytesoftw)
46

57
## 0.1.0 February 26, 2024
68

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Selectize::widget(
9999

100100
## Testing
101101

102-
[Check the documentation testing](/docs/testing.md) to learn about testing.
102+
[Check the documentation testing](docs/testing.md) to learn about testing.
103103

104104
## Our social networks
105105

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"php-forge/support": "^0.1",
2020
"phpunit/phpunit": "^10.5",
2121
"roave/infection-static-analysis-plugin": "^1.34",
22-
"yii2-extensions/phpstan": "dev-main"
22+
"symplify/easy-coding-standard": "^12.1",
23+
"yii2-extensions/phpstan": "^0.1"
2324
},
2425
"autoload": {
2526
"psr-4": {
@@ -47,6 +48,7 @@
4748
},
4849
"scripts": {
4950
"check-dependencies": "composer-require-checker",
51+
"ecs": "ecs check",
5052
"mutation": "roave-infection-static-analysis-plugin",
5153
"phpstan": "phpstan",
5254
"test": "phpunit"

docs/testing.md

+17
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ To run the checker, execute the following command:
1010
composer run check-dependencies
1111
```
1212

13+
## Easy coding standard
14+
15+
The code is checked with [Easy Coding Standard](https://github.com/easy-coding-standard/easy-coding-standard) and
16+
[PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer). To run it:
17+
18+
```shell
19+
composer run ecs
20+
```
21+
22+
## Mutation testing
23+
24+
Mutation testing is checked with [Infection](https://infection.github.io/). To run it:
25+
26+
```shell
27+
composer run mutation
28+
```
29+
1330
## Static analysis
1431

1532
The code is statically analyzed with [Phpstan](https://phpstan.org/). To run static analysis:

ecs.php

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
6+
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
7+
use PhpCsFixer\Fixer\ClassNotation\OrderedTraitsFixer;
8+
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
9+
use Symplify\EasyCodingStandard\Config\ECSConfig;
10+
11+
return ECSConfig::configure()
12+
->withConfiguredRule(
13+
ClassDefinitionFixer::class,
14+
[
15+
'space_before_parenthesis' => true,
16+
],
17+
)
18+
->withFileExtensions(['php'])
19+
->withPaths(
20+
[
21+
__DIR__ . '/src',
22+
__DIR__ . '/tests',
23+
],
24+
)
25+
->withPhpCsFixerSets(perCS20: true)
26+
->withPreparedSets(
27+
cleanCode: true,
28+
comments:true,
29+
docblocks: true,
30+
namespaces: true,
31+
psr12: true
32+
)
33+
->withRules(
34+
[
35+
NoUnusedImportsFixer::class,
36+
OrderedClassElementsFixer::class,
37+
OrderedTraitsFixer::class,
38+
]
39+
);
File renamed without changes.

phpstan.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ parameters:
1717
- vendor/yiisoft/yii2/Yii.php
1818

1919
yii2:
20-
config_path: %currentWorkingDirectory%/phpstan-yii-config.php
20+
config_path: %currentWorkingDirectory%/phpstan-config.php
2121

src/Asset/SelectizeAsset.php

-9
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,23 @@
1010

1111
final class SelectizeAsset extends AssetBundle
1212
{
13-
/**
14-
* @inheritdoc
15-
*/
1613
public $sourcePath = '@npm/selectize--selectize/dist';
1714

1815
/**
19-
* @inheritdoc
20-
*
2116
* @phpstan-var array<array-key, mixed>
2217
*/
2318
public $css = [
2419
'css/selectize.bootstrap5.css',
2520
];
2621

2722
/**
28-
* @inheritdoc
29-
*
3023
* @phpstan-var array<array-key, mixed>
3124
*/
3225
public $js = [
3326
'js/selectize.js',
3427
];
3528

3629
/**
37-
* @inheritdoc
38-
*
3930
* @phpstan-var array<array-key, mixed>
4031
*/
4132
public $depends = [

src/Selectize.php

-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class Selectize extends InputWidget
2020
public array $items = [];
2121
public string $type = self::TYPE_SELECT;
2222

23-
/**
24-
* @inheritdoc
25-
*/
2623
public function run(): string
2724
{
2825
$html = match ($this->type) {

0 commit comments

Comments
 (0)