Skip to content

Commit

Permalink
update PHPStan to 0.12.96 and fix access to private static
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Aug 22, 2021
1 parent f0e6d77 commit 3361400
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
"marc-mabe/php-enum": "~3.0",
"mockery/mockery": "~1.2",
"phpstan/extension-installer": "1.1.0",
"phpstan/phpstan": "0.12.94",
"phpstan/phpstan": "0.12.96",
"phpstan/phpstan-deprecation-rules": "0.12.6",
"phpstan/phpstan-nette": "0.12.21",
"phpstan/phpstan-mockery": "0.12.14",
"phpstan/phpstan-strict-rules": "0.12.10",
"phpstan/phpstan-strict-rules": "0.12.11",
"nextras/orm-phpstan": "dev-master",
"marc-mabe/php-enum-phpstan": "dev-master",
"tracy/tracy": "~2.3"
Expand Down
8 changes: 4 additions & 4 deletions src/Model/MetadataStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class MetadataStorage

public static function get(string $className): EntityMetadata
{
if (!isset(static::$metadata[$className])) {
if (static::$metadata === []) {
if (!isset(self::$metadata[$className])) {
if (self::$metadata === []) {
throw new InvalidStateException("MetadataStorage::get() called too early. You have to instantiate your model first.");
}
throw new InvalidArgumentException("Entity metadata for '{$className}' does not exist.");
}
return static::$metadata[$className];
return self::$metadata[$className];
}


Expand Down Expand Up @@ -85,6 +85,6 @@ function (&$dp) use ($entityClassesMap, $metadataParserFactory, $repositoryLoade
}
}

static::$metadata += $metadata;
self::$metadata += $metadata;
}
}
2 changes: 1 addition & 1 deletion src/Repository/RemovalHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function getCascadeQueueAndSetNulls(

[$pre, $post, $nulls] = static::getRelationships($entity);
$prePersist = [];
static::setNulls($entity, $nulls, $model, $prePersist, $queueRemove);
self::setNulls($entity, $nulls, $model, $prePersist, $queueRemove);

if (!$withCascade) {
$queueRemove[$entityHash] = $entity;
Expand Down

0 comments on commit 3361400

Please sign in to comment.