Skip to content

Commit

Permalink
fix: restore factory collection type (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil committed Apr 3, 2024
1 parent cf400d0 commit b66ed4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 70 deletions.
31 changes: 3 additions & 28 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ parameters:
count: 1
path: src/Configuration.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\Factory\\:\\:__call\\(\\) should return array\\<int, \\(TObject of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\> but returns array\\<int, \\(TObject of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\|Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\>\\>\\.$#"
count: 1
path: src/Factory.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\Factory\\:\\:createAndUnproxify\\(\\) should return TObject of object but returns object\\.$#"
count: 1
Expand All @@ -31,7 +26,7 @@ parameters:
path: src/Factory.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\FactoryCollection\\:\\:create\\(\\) should return array\\<int, \\(TObject of object\\)\\|Zenstruck\\\\Foundry\\\\Proxy\\<TObject of object\\>\\> but returns array\\<int\\<0, max\\>, \\(TObject of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\>\\.$#"
message: "#^Method Zenstruck\\\\Foundry\\\\FactoryCollection\\:\\:create\\(\\) should return array\\<int, TObject of object\\> but returns array\\<int\\<0, max\\>, \\(TObject of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\>\\.$#"
count: 1
path: src/FactoryCollection.php

Expand Down Expand Up @@ -61,12 +56,12 @@ parameters:
path: src/Instantiator.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\ObjectFactory\\:\\:__callStatic\\(\\) should return array\\<int, TModel of object\\> but returns array\\<int, \\(TModel of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\|Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\>\\>\\.$#"
message: "#^Method Zenstruck\\\\Foundry\\\\ObjectFactory\\:\\:__callStatic\\(\\) should return array\\<int, TModel of object\\> but returns array\\<int, \\(TModel of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\>\\.$#"
count: 1
path: src/ObjectFactory.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\ObjectFactory\\:\\:createSequence\\(\\) should return array\\<int, TModel of object\\> but returns array\\<int, \\(TModel of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\|Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\>\\>\\.$#"
message: "#^Method Zenstruck\\\\Foundry\\\\ObjectFactory\\:\\:createSequence\\(\\) should return array\\<int, TModel of object\\> but returns array\\<int, \\(TModel of object\\)\\|Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\>\\.$#"
count: 1
path: src/ObjectFactory.php

Expand All @@ -80,16 +75,6 @@ parameters:
count: 1
path: src/ObjectFactory.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\Persistence\\\\PersistentProxyObjectFactory\\:\\:__callStatic\\(\\) should return array\\<int, Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\> but returns array\\<int, Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\>\\>\\.$#"
count: 1
path: src/Persistence/PersistentProxyObjectFactory.php

-
message: "#^Method Zenstruck\\\\Foundry\\\\Persistence\\\\PersistentProxyObjectFactory\\:\\:createSequence\\(\\) should return array\\<int, Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\> but returns array\\<int, Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TModel of object\\>\\>\\>\\.$#"
count: 1
path: src/Persistence/PersistentProxyObjectFactory.php

-
message: "#^Should not use function \"debug_backtrace\", please change the code\\.$#"
count: 1
Expand Down Expand Up @@ -164,13 +149,3 @@ parameters:
message: "#^Parameter \\#1 \\$configuration of static method Zenstruck\\\\Foundry\\\\Factory\\<object\\>\\:\\:boot\\(\\) expects Zenstruck\\\\Foundry\\\\Configuration, object\\|null given\\.$#"
count: 1
path: src/ZenstruckFoundryBundle.php

-
message: "#^Function Zenstruck\\\\Foundry\\\\create_many\\(\\) should return array\\<int, Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\> but returns array\\<int, Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\>\\>\\.$#"
count: 1
path: src/functions.php

-
message: "#^Function Zenstruck\\\\Foundry\\\\instantiate_many\\(\\) should return array\\<int, Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\> but returns array\\<int, Zenstruck\\\\Foundry\\\\Proxy\\<Zenstruck\\\\Foundry\\\\Persistence\\\\Proxy\\<TObject of object\\>\\>\\>\\.$#"
count: 1
path: src/functions.php
2 changes: 1 addition & 1 deletion src/FactoryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function sequence(Factory $factory, iterable $sequence): self
}

/**
* @return ($noProxy is true ? list<TObject> : list<Proxy<TObject>>)
* @return list<TObject>
*/
public function create(
array|callable $attributes = [],
Expand Down
41 changes: 0 additions & 41 deletions utils/phpstan/tests/FoundryRuleTest.php

This file was deleted.

0 comments on commit b66ed4c

Please sign in to comment.