Skip to content

Commit

Permalink
remove internal method & fix baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Mar 26, 2022
1 parent a9cdd53 commit bc898cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
7 changes: 6 additions & 1 deletion baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.19.0@a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599">
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<file src="src/Serializer/DefaultHydrator.php">
<MixedAssignment occurrences="5">
<code>$data[$propertyMetadata['fieldName']]</code>
Expand All @@ -9,6 +9,11 @@
<code>$value</code>
</MixedAssignment>
</file>
<file src="src/Store/MultiTableStore.php">
<UnnecessaryVarAnnotation occurrences="1">
<code>array{id: string, aggregate_id: string, playhead: string, event: class-string, payload: string, recorded_on: string}|null</code>
</UnnecessaryVarAnnotation>
</file>
<file src="tests/Benchmark/BasicImplementation/Aggregate/Profile.php">
<MoreSpecificImplementedParamType occurrences="1">
<code>$payload</code>
Expand Down
9 changes: 2 additions & 7 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
parameters:
ignoreErrors:
-
message: "#^Method Patchlevel\\\\EventSourcing\\\\Console\\\\DoctrineHelper\\:\\:databaseName\\(\\) should return string but returns mixed\\.$#"
count: 2
path: src/Console/DoctrineHelper.php

-
message: "#^Unable to resolve the template type T in call to method Patchlevel\\\\EventSourcing\\\\Serializer\\\\Serializer\\:\\:deserialize\\(\\)$#"
message: "#^Cannot unset offset 'url' on array\\{charset\\?\\: string, dbname\\?\\: string, defaultTableOptions\\?\\: array\\<string, mixed\\>, default_dbname\\?\\: string, driver\\?\\: 'ibm_db2'\\|'mysqli'\\|'oci8'\\|'pdo_mysql'\\|'pdo_oci'\\|'pdo_pgsql'\\|'pdo_sqlite'\\|'pdo_sqlsrv'\\|'sqlsrv', driverClass\\?\\: class\\-string\\<Doctrine\\\\DBAL\\\\Driver\\>, driverOptions\\?\\: array, host\\?\\: string, \\.\\.\\.\\}\\.$#"
count: 1
path: src/Store/MultiTableStore.php
path: src/Console/DoctrineHelper.php

-
message: "#^While loop condition is always true\\.$#"
Expand Down
5 changes: 1 addition & 4 deletions src/Console/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ public function copyConnectionWithoutDatabase(Connection $connection): Connectio
*/
unset($params['dbname'], $params['path'], $params['url']);

$tmpConnection = DriverManager::getConnection($params);
$tmpConnection->connect();

return $tmpConnection;
return DriverManager::getConnection($params);
}

public function hasDatabase(Connection $connection, string $databaseName): bool
Expand Down
1 change: 1 addition & 0 deletions src/Store/MultiTableStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public function stream(int $fromIndex = 0): Generator
throw new AggregateNotDefined($name);
}

/** @var array{id: string, aggregate_id: string, playhead: string, event: class-string, payload: string, recorded_on: string}|null $eventData */
$eventData = $queries[$name]->current();

if ($eventData === null) {
Expand Down

0 comments on commit bc898cb

Please sign in to comment.