Skip to content

Commit

Permalink
Allow Symfony 7 & upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
iquito committed Dec 1, 2023
1 parent aa88370 commit 2aa476b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 28 deletions.
16 changes: 10 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,27 @@
"require": {
"php": ">=8.0",
"ext-pdo": "*",
"symfony/dependency-injection": "^5.0|^6.0",
"symfony/http-kernel": "^5.0|^6.0",
"symfony/var-dumper": "^5.0|^6.0",
"symfony/dependency-injection": "^5.0|^6.0|^7.0",
"symfony/http-kernel": "^5.0|^6.0|^7.0",
"symfony/var-dumper": "^5.0|^6.0|^7.0",
"squirrelphp/queries": "^1.0",
"jdorn/sql-formatter": "1.2.17"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.3",
"bamarni/composer-bin-plugin": "^1.8",
"captainhook/plugin-composer": "^5.0",
"phpunit/phpunit": "^9.0",
"phpunit/phpunit": "^10.0",
"twig/twig": "^3.0"
},
"suggest": {
"squirrelphp/entities-bundle": "Automatic integration of squirrelphp/entities in Symfony"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
"captainhook/plugin-composer": true
}
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Cannot cast object to string\\.$#"
count: 1
path: src/Twig/SquirrelQueriesExtension.php
23 changes: 12 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
<coverage includeUncoveredFiles="false"/>
<testsuites>
<testsuite name="Squirrel Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
12 changes: 7 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.13.1@5cf660f63b548ccd4a56f62d916ee4d6028e01a3">
<files psalm-version="5.16.0@2897ba636551a8cb61601cc26f6ccfbba6c36591">
<file src="src/DataCollector/SquirrelDataCollector.php">
<DeprecatedClass occurrences="4">
<code>$doctrineConnection-&gt;getConfiguration()-&gt;getSQLLogger()</code>
<DeprecatedClass>
<code>$logger</code>
<code>array</code>
<code>private array $loggers = [];</code>
</DeprecatedClass>
<DeprecatedMethod>
<code>getSQLLogger</code>
</DeprecatedMethod>
</file>
<file src="src/DependencyInjection/Compiler/LayersPass.php">
<DeprecatedClass occurrences="1">
<DeprecatedClass>
<code>DebugStack::class</code>
</DeprecatedClass>
</file>
<file src="tests/LayersPassTest.php">
<DeprecatedClass occurrences="1">
<DeprecatedClass>
<code>DebugStack::class</code>
</DeprecatedClass>
</file>
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
Expand Down
2 changes: 1 addition & 1 deletion ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"/>
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants"/>
Expand Down
4 changes: 1 addition & 3 deletions src/DataCollector/SquirrelDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@ private function sanitizeQueries(string $connectionName, array $queries): array
private function sanitizeQuery(string $connectionName, array $query): array
{
$query['explainable'] = true;
if ($query['params'] === null) {
$query['params'] = array();
}
$query['params'] ??= array();
if (!\is_array($query['params'])) {
$query['params'] = array($query['params']);
}
Expand Down
7 changes: 6 additions & 1 deletion vendor-bin/phpcs/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"require": {
"squizlabs/php_codesniffer": "^3.5",
"slevomat/coding-standard": "^7.0"
"slevomat/coding-standard": "^8.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
2 changes: 1 addition & 1 deletion vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"vimeo/psalm": "^4.0",
"vimeo/psalm": "^5.0",
"psalm/plugin-phpunit": "*",
"psalm/plugin-mockery": "*"
}
Expand Down

0 comments on commit 2aa476b

Please sign in to comment.