Skip to content

Commit d88640b

Browse files
authored
Merge pull request #490 from symfony-cmf/cs-fixer
Cs fixer
2 parents 389449f + f2ca0bb commit d88640b

Some content is hidden

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

53 files changed

+375
-735
lines changed

.github/workflows/static.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Static analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- '[0-9]+.x'
7+
- '[0-9]+.[0-9]+'
8+
- '[0-9]+.[0-9]+.x'
9+
pull_request:
10+
11+
jobs:
12+
phpstan:
13+
name: PHPStan
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.3'
21+
extensions: "curl,dom,json,xml,dom"
22+
coverage: none
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
# have to install phpstan ourselves here, the phpstan-ga fails at composer install with weird errors
28+
# composer require --no-update jackalope/jackalope-doctrine-dbal jackalope/jackalope-jackrabbit phpstan/phpstan
29+
- name: Install phpstan
30+
run: |
31+
32+
composer update
33+
34+
- name: PHPStan
35+
run: vendor/bin/phpstan analyze --no-progress
36+
37+
php-cs-fixer:
38+
name: PHP-CS-Fixer
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: PHP-CS-Fixer
46+
uses: docker://oskarstark/php-cs-fixer-ga
47+
with:
48+
args: --dry-run --diff

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ phpunit.xml
22
composer.lock
33
vendor
44
tests/Fixtures/App/var/
5-
.phpunit.result.cache
5+
.phpunit.result.cache
6+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests')
6+
->exclude('tests/Fixtures/App/var/')
7+
->name('*.php')
8+
;
9+
10+
$config = new PhpCsFixer\Config();
11+
12+
return $config
13+
->setRiskyAllowed(true)
14+
->setRules([
15+
'@Symfony' => true,
16+
'single_line_throw' => false,
17+
])
18+
->setFinder($finder)
19+
;

.styleci.yml

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

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"doctrine/phpcr-bundle": "^3.0",
2727
"doctrine/phpcr-odm": "^2.0",
2828
"jackalope/jackalope-doctrine-dbal": "^2.0",
29+
"phpstan/phpstan": "^1.10",
30+
"phpstan/phpstan-doctrine": "^1.3",
31+
"phpstan/phpstan-phpunit": "^1.3",
32+
"phpstan/phpstan-symfony": "^1.3",
33+
"phpunit/phpunit": "^9.5.28",
2934
"matthiasnoback/symfony-dependency-injection-test": "^4.1.0 || ^5.1.0",
3035
"matthiasnoback/symfony-config-test": "^4.1.0 || ^5.1.0",
3136
"symfony/phpunit-bridge": "^7.0.3",
@@ -47,6 +52,7 @@
4752
"conflict": {
4853
"doctrine/common": "<3.1.1",
4954
"doctrine/persistence": "<1.3.0",
55+
"doctrine/phpcr-odm": "<2.0",
5056
"symfony/doctrine-bridge": "<6.4.0",
5157
"symfony/security-core": "<6.4.0"
5258
},

phpstan.neon.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
includes:
2+
- vendor/phpstan/phpstan-doctrine/extension.neon
3+
- vendor/phpstan/phpstan-doctrine/rules.neon
4+
- vendor/phpstan/phpstan-phpunit/extension.neon
5+
- vendor/phpstan/phpstan-symfony/extension.neon
6+
- vendor/phpstan/phpstan-symfony/rules.neon
7+
parameters:
8+
level: 2
9+
paths:
10+
- src/
11+
- tests/
12+
excludePaths:
13+
- tests/Fixtures/App/var/
14+
- tests/Fixtures/App/config/
15+
- tests/Fixtures/fixtures/config/

src/DependencyInjection/CmfRoutingExtension.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
*/
2828
final class CmfRoutingExtension extends Extension
2929
{
30-
/**
31-
* {@inheritdoc}
32-
*/
3330
public function load(array $configs, ContainerBuilder $container): void
3431
{
3532
$config = $this->processConfiguration(new Configuration(), $configs);

src/Doctrine/Orm/ContentRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ protected function getModelAndId(string $identifier): array
3737
}
3838

3939
/**
40-
* {@inheritdoc}
41-
*
4240
* @param string $id The ID contains both model name and id, separated by a colon
4341
*/
4442
public function findById(mixed $id): ?object

src/Doctrine/Orm/RedirectRoute.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public function setParameters(array $parameters): void
5252
$this->serialisedParameters = json_encode($parameters, \JSON_THROW_ON_ERROR);
5353
}
5454

55-
/**
56-
* {@inheritdoc}
57-
*/
5855
public function getParameters(): array
5956
{
6057
if (!isset($this->serialisedParameters)) {
@@ -65,9 +62,6 @@ public function getParameters(): array
6562
return \is_array($params) ? $params : [];
6663
}
6764

68-
/**
69-
* {@inheritdoc}
70-
*/
7165
public function getPath(): string
7266
{
7367
$pattern = parent::getPath();
@@ -78,9 +72,6 @@ public function getPath(): string
7872
return $pattern;
7973
}
8074

81-
/**
82-
* {@inheritdoc}
83-
*/
8475
protected function isBooleanOption(string $name): bool
8576
{
8677
return 'add_trailing_slash' === $name || parent::isBooleanOption($name);

src/Doctrine/Orm/Route.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public function getPosition(): int
5858
return $this->position;
5959
}
6060

61-
/**
62-
* {@inheritdoc}
63-
*/
6461
public function getRouteKey(): string
6562
{
6663
return $this->getName();

0 commit comments

Comments
 (0)