Skip to content

Commit dbc56be

Browse files
committed
Merge remote-tracking branch 'origin/2.13.x' into 2.14.x
2 parents 3022305 + ab9334a commit dbc56be

27 files changed

+63
-132
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
.gitignore export-ignore
55
phpunit.xml.dist export-ignore
66
phpcs.xml.dist export-ignore
7-
psalm.xml.dist export-ignore
7+
phpstan-baseline.neon export-ignore
8+
phpstan.neon.dist export-ignore
89
/docs export-ignore
910
/tests export-ignore
1011
.symfony.bundle.yaml export-ignore

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,6 @@ on:
1010
- "*.x"
1111

1212
jobs:
13-
static-analysis-psalm:
14-
name: "Static Analysis with Psalm"
15-
runs-on: "ubuntu-latest"
16-
17-
steps:
18-
- name: "Checkout code"
19-
uses: "actions/checkout@v4"
20-
21-
- name: "Install PHP"
22-
uses: "shivammathur/setup-php@v2"
23-
with:
24-
coverage: "none"
25-
php-version: "8.2"
26-
27-
- name: "Enforce using stable dependencies"
28-
run: "composer config minimum-stability stable"
29-
30-
- name: "Install dependencies with Composer"
31-
uses: "ramsey/composer-install@v3"
32-
33-
- name: "Run a static analysis with vimeo/psalm"
34-
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --find-unused-psalm-suppress"
13+
static-analysis:
14+
name: "Static Analysis"
15+
uses: "doctrine/.github/.github/workflows/[email protected]"

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@
5050
"doctrine/deprecations": "^1.0",
5151
"doctrine/orm": "^2.17 || ^3.0",
5252
"friendsofphp/proxy-manager-lts": "^1.0",
53+
"phpstan/phpstan": "2.1.1",
54+
"phpstan/phpstan-phpunit": "2.0.3",
55+
"phpstan/phpstan-strict-rules": "^2",
5356
"phpunit/phpunit": "^9.5.26",
54-
"psalm/plugin-phpunit": "^0.18.4",
55-
"psalm/plugin-symfony": "^5",
5657
"psr/log": "^1.1.4 || ^2.0 || ^3.0",
5758
"symfony/phpunit-bridge": "^6.1 || ^7.0",
5859
"symfony/property-info": "^5.4 || ^6.0 || ^7.0",
@@ -65,8 +66,7 @@
6566
"symfony/var-exporter": "^5.4 || ^6.2 || ^7.0",
6667
"symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0",
6768
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
68-
"twig/twig": "^1.34 || ^2.12 || ^3.0",
69-
"vimeo/psalm": "^5.15"
69+
"twig/twig": "^1.34 || ^2.12 || ^3.0"
7070
},
7171
"conflict": {
7272
"doctrine/annotations": ">=3.0",

phpstan.neon.dist

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parameters:
2+
level: 1
3+
paths:
4+
- src
5+
- tests
6+
7+
excludePaths:
8+
- src/Command/Proxy/ConvertMappingDoctrineCommand.php
9+
- src/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php

psalm.xml.dist

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

src/Command/CreateDatabaseDoctrineCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6363

6464
// Need to get rid of _every_ occurrence of dbname from connection configuration as we have already extracted all relevant info from url
6565
/** @psalm-suppress InvalidArrayOffset Need to be compatible with DBAL < 4, which still has `$params['url']` */
66+
/** @phpstan-ignore unset.offset */
6667
unset($params['dbname'], $params['path'], $params['url']);
6768

6869
if ($connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {

src/Command/DoctrineCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function __construct(ManagerRegistry $doctrine)
3434
*/
3535
protected function getEntityGenerator()
3636
{
37+
/** @phpstan-ignore class.notFound */
3738
$entityGenerator = new EntityGenerator();
3839
$entityGenerator->setGenerateAnnotations(false);
3940
$entityGenerator->setGenerateStubMethods(true);

src/Command/DropDatabaseDoctrineCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7474
}
7575

7676
/** @psalm-suppress InvalidArrayOffset Need to be compatible with DBAL < 4, which still has `$params['url']` */
77+
/* @phpstan-ignore unset.offset */
7778
unset($params['dbname'], $params['url']);
7879

7980
if ($connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {

src/Command/ImportMappingDoctrineCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
109109
}
110110
}
111111

112+
/* @phpstan-ignore class.notFound */
112113
$cme = new ClassMetadataExporter();
113114
$exporter = $cme->getExporter($type);
114115
$exporter->setOverwriteExistingFiles($input->getOption('force'));
@@ -126,6 +127,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
126127
$emName = $input->getOption('em');
127128
$emName = $emName ? $emName : 'default';
128129

130+
/* @phpstan-ignore class.notFound */
129131
$cmf = new DisconnectedClassMetadataFactory();
130132
$cmf->setEntityManager($em);
131133
$metadata = $cmf->getAllMetadata();

src/Command/Proxy/DoctrineCommandHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ public static function setApplicationEntityManager(Application $application, $em
2929
assert($em instanceof EntityManagerInterface);
3030
$helperSet = $application->getHelperSet();
3131
/** @psalm-suppress InvalidArgument ORM < 3 specific */
32+
/* @phpstan-ignore class.notFound */
3233
$helperSet->set(new EntityManagerHelper($em), 'em');
3334

3435
trigger_deprecation(
3536
'doctrine/doctrine-bundle',
3637
'2.7',
3738
'Providing an EntityManager using "%s" is deprecated. Use an instance of "%s" instead.',
39+
/* @phpstan-ignore class.notFound */
3840
EntityManagerHelper::class,
3941
EntityManagerProvider::class,
4042
);

0 commit comments

Comments
 (0)