Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build tools #392

Merged
merged 4 commits into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.php-cs-fixer.cache
.php-cs-fixer.php
.phpunit.result.cache
coverage
composer.lock
phpunit.xml
/.phpunit.cache/
/build/
/vendor/
!/vendor-bin/tools/composer.lock
Expand Down
3 changes: 3 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
'import_constants' => false,
'import_functions' => false,
],
'phpdoc_to_comment' => [
'ignored_tags' => ['psalm-suppress'],
],
])
->setFinder($finder)
;
Expand Down
45 changes: 10 additions & 35 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\AbstractListener\\:\\:createDateTimeField\\(\\) has parameter \\$metadata with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/EventListener/ORM/AbstractListener.php

-
message: "#^Strict comparison using \\=\\=\\= between null and ReflectionClass\\<object\\> will always evaluate to false\\.$#"
count: 1
Expand All @@ -25,41 +20,16 @@ parameters:
count: 1
path: src/EventListener/ORM/SortableListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:addSequenceGenerator\\(\\) has parameter \\$classMetadata with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:addSequenceGenerator\\(\\) has parameter \\$definition with no value type specified in iterable type array\\.$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:addSequencePrefix\\(\\) has parameter \\$classMetadata with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:addTablePrefix\\(\\) has parameter \\$classMetadata with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:evaluteMapping\\(\\) has parameter \\$classMetadata with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:evaluteMapping\\(\\) has parameter \\$mapping with no value type specified in iterable type array\\.$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\EventListener\\\\ORM\\\\TablePrefixEventListener\\:\\:isValidTable\\(\\) has parameter \\$classMetadata with generic class Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata but does not specify its types\\: T$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Offset 'sequenceName' does not exist on array\\{sequenceName\\: string, allocationSize\\: string, initialValue\\: string, quoted\\?\\: mixed\\}\\|null\\.$#"
count: 1
Expand All @@ -75,11 +45,6 @@ parameters:
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Property Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\<object\\>\\:\\:\\$idGenerator \\(Doctrine\\\\ORM\\\\Id\\\\AbstractIdGenerator\\) in isset\\(\\) is not nullable\\.$#"
count: 1
path: src/EventListener/ORM/TablePrefixEventListener.php

-
message: "#^Strict comparison using \\=\\=\\= between null and ReflectionClass\\<object\\> will always evaluate to false\\.$#"
count: 1
Expand Down Expand Up @@ -125,6 +90,16 @@ parameters:
count: 1
path: tests/Bridge/Symfony/Bundle/BundleIntegrationTest.php

-
message: "#^Call to function assert\\(\\) with true will always evaluate to true\\.$#"
count: 1
path: tests/Fixtures/DemoEntityManager.php

-
message: "#^Instanceof between Doctrine\\\\ORM\\\\EntityRepository\\<object\\> and Doctrine\\\\ORM\\\\EntityRepository will always evaluate to true\\.$#"
count: 1
path: tests/Fixtures/DemoEntityManager.php

-
message: "#^Method Nucleos\\\\Doctrine\\\\Tests\\\\Fixtures\\\\DemoEntityManager\\:\\:addOrderToQueryBuilder\\(\\) has parameter \\$aliasMapping with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
16 changes: 7 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage/>
<php>
<env name="APP_DEBUG" value="false"/>
<env name="APP_ENV" value="test"/>
Expand All @@ -16,7 +12,9 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<source>
<include>
<directory suffix=".php">./src/</directory>
</include>
</source>
</phpunit>
1 change: 1 addition & 0 deletions src/Bridge/Symfony/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function getConfigTreeBuilder(): TreeBuilder

private function addTableSection(ArrayNodeDefinition $node): void
{
/** @psalm-suppress UndefinedInterfaceMethod */
$node
->children()
->arrayNode('table')
Expand Down
1 change: 0 additions & 1 deletion src/Bridge/Symfony/Resources/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@
->args([
new Parameter('nucleos_doctrine.table.prefix'),
])

;
};
3 changes: 2 additions & 1 deletion src/Test/ORM/EntityManagerMockFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public static function create(TestCase $test, Closure $qbCallback, array $fields
private static function prepareQueryBuilder(TestCase $test, MockObject $qb): void
{
$query = $test->getMockBuilder(AbstractQuery::class)
->disableOriginalConstructor()->getMock();
->disableOriginalConstructor()->getMock()
;
$query->method('execute')->willReturn(true);

$qb->method('select')->willReturn($qb);
Expand Down
33 changes: 16 additions & 17 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
"description": "Development tools that do not conflict the project dependencies",
"type": "project",
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.3",
"jangregor/phpstan-prophecy": "^1.0",
"maglnet/composer-require-checker": "^4.0",
"friendsofphp/php-cs-fixer": "^3.16",
"maglnet/composer-require-checker": "^4.6",
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
"phpmd/phpmd": "^2.10",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.18",
"psalm/plugin-symfony": "^5.0",
"symfony/phpunit-bridge": "^6.0",
"vimeo/psalm": "^5.0"
"phpmd/phpmd": "^2.13",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10.14",
"phpstan/phpstan-doctrine": "^1.3.37",
"phpstan/phpstan-phpunit": "^1.3.11",
"phpstan/phpstan-strict-rules": "^1.5.1",
"phpstan/phpstan-symfony": "^1.3.1",
"phpunit/phpunit": "^10.1.2",
"psalm/plugin-phpunit": "^0.18.4",
"psalm/plugin-symfony": "^5.0.3",
"symfony/phpunit-bridge": "^6.2.7",
"vimeo/psalm": "^5.9"
},
"config": {
"bin-dir": "../../vendor/bin",
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"bin-dir": "../../vendor/bin"
}
}
Loading