Skip to content

Commit

Permalink
Upgrade types dependency + dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
iquito committed Dec 16, 2022
1 parent 0fdf791 commit 3e53944
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 18 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"symfony/finder": "^5.0|^6.0",
"squirrelphp/debug": "^2.0",
"squirrelphp/queries": "^1.2",
"squirrelphp/types": "^0.5.2"
"squirrelphp/types": "^1.0"
},
"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": "^9.5",
"mockery/mockery": "^1.0"
},
"suggest": {
Expand Down
75 changes: 75 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,61 @@ parameters:
count: 1
path: src/Builder/SelectIterator.php

-
message: "#^Cannot call method getObjectToTableFields\\(\\) on mixed\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Cannot call method getObjectTypes\\(\\) on mixed\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Cannot call method getObjectTypesNullable\\(\\) on mixed\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Cannot call method getTableName\\(\\) on mixed\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Match expression does not handle remaining value\\: mixed$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Method Squirrel\\\\Entities\\\\MultiRepositoryReadOnly\\:\\:fetchAllAndFlatten\\(\\) should return array\\<bool\\|float\\|int\\|string\\|null\\> but returns array\\<int, mixed\\>\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Offset 'where' on array\\{repositories\\: array, tables\\?\\: array, where\\: array, lock\\?\\: bool\\} in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$object of method ReflectionProperty\\:\\:getValue\\(\\) expects object\\|null, mixed given\\.$#"
count: 2
path: src/MultiRepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\<T of object\\>\\|T of object, mixed given\\.$#"
count: 1
path: src/MultiRepositoryReadOnly.php

-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 2
path: src/RepositoryReadOnly.php

-
message: "#^Cannot access offset mixed on mixed\\.$#"
count: 1
path: src/RepositoryReadOnly.php

-
message: "#^Match expression does not handle remaining value\\: mixed$#"
count: 1
Expand All @@ -55,6 +100,36 @@ parameters:
count: 1
path: src/RepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$array of function array_values expects array, mixed given\\.$#"
count: 1
path: src/RepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$orderOptions of method Squirrel\\\\Entities\\\\RepositoryReadOnly\\:\\:preprocessOrder\\(\\) expects array\\<int\\|string, mixed\\>, mixed given\\.$#"
count: 1
path: src/RepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$query of method Squirrel\\\\Queries\\\\DBInterface\\:\\:fetchAll\\(\\) expects array\\{fields\\?\\: array\\<int\\|string, string\\>, field\\?\\: string, tables\\?\\: array\\<int\\|string, mixed\\>, table\\?\\: string, where\\?\\: array\\<int\\|string, mixed\\>, group\\?\\: array\\<int\\|string, string\\>, order\\?\\: array\\<int\\|string, string\\>, limit\\?\\: int, \\.\\.\\.\\}\\|string, array\\<string, mixed\\> given\\.$#"
count: 2
path: src/RepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$query of method Squirrel\\\\Queries\\\\DBInterface\\:\\:select\\(\\) expects array\\{fields\\?\\: array\\<int\\|string, string\\>, field\\?\\: string, tables\\?\\: array\\<int\\|string, mixed\\>, table\\?\\: string, where\\?\\: array\\<int\\|string, mixed\\>, group\\?\\: array\\<int\\|string, string\\>, order\\?\\: array\\<int\\|string, string\\>, limit\\?\\: int, \\.\\.\\.\\}\\|string, array\\<string, mixed\\> given\\.$#"
count: 1
path: src/RepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
count: 3
path: src/RepositoryReadOnly.php

-
message: "#^Parameter \\#1 \\$where of method Squirrel\\\\Entities\\\\RepositoryReadOnly\\:\\:preprocessWhere\\(\\) expects array\\<int\\|string, mixed\\>, mixed given\\.$#"
count: 1
path: src/RepositoryReadOnly.php

-
message: "#^Result of && is always false\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ includes:
- phpstan-baseline.neon

parameters:
level: 8
level: max
paths:
- src
- bin
Expand Down
19 changes: 14 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.23.0@f1fe6ff483bf325c803df9f510d09a03fd796f88">
<files psalm-version="5.2.0@fb685a16df3050d4c18d8a4100fe83abe6458cba">
<file src="src/Builder/SelectEntries.php">
<MissingTemplateParam occurrences="1">
<code>\IteratorAggregate</code>
</MissingTemplateParam>
</file>
<file src="src/Builder/SelectIterator.php">
<MissingTemplateParam occurrences="1">
<code>\Iterator</code>
</MissingTemplateParam>
</file>
<file src="src/MultiRepositoryReadOnly.php">
<MissingConstructor occurrences="2">
<code>$db</code>
Expand All @@ -8,17 +18,16 @@
<PossiblyInvalidArgument occurrences="1">
<code>$sanitizedOptions['query']</code>
</PossiblyInvalidArgument>
<RedundantCondition occurrences="2">
<code>\strval(\floatval($value)) !== $value</code>
<code>\strval(\intval($value)) !== $value</code>
</RedundantCondition>
</file>
<file src="src/RepositoryReadOnly.php">
<ArgumentTypeCoercion occurrences="3">
<code>$sanitizedQuery</code>
<code>$sanitizedQuery</code>
<code>$sanitizedQuery</code>
</ArgumentTypeCoercion>
<InvalidArrayOffset occurrences="1">
<code>$query['limit']</code>
</InvalidArrayOffset>
</file>
<file src="tests/MultiRepositoryReadOnlyTest.php">
<ArgumentTypeCoercion occurrences="1"/>
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
8 changes: 2 additions & 6 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ public function __construct(
*/
public static function withRepositories(array $repositories): self
{
/**
* Connection to use for transaction
*
* @var DBInterface|null $connection
*/
// Connection to use for transaction
$connection = null;

// Go through all repositories
Expand Down Expand Up @@ -89,7 +85,7 @@ public static function withRepositories(array $repositories): self
}

// No connection found, meaning no repositories were defined in arguments
if (!isset($connection)) {
if (!isset($connection) || !($connection instanceof DBInterface)) {
throw Debug::createException(
DBInvalidOptionException::class,
'No repositories for transaction defined',
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/phpcs/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"squizlabs/php_codesniffer": "^3.5",
"slevomat/coding-standard": "^7.0"
"slevomat/coding-standard": "^8.0"
},
"config": {
"allow-plugins": {
Expand Down
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 3e53944

Please sign in to comment.