File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/data Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 3535 "SaschaEgerer\\ PhpstanTypo3\\ Tests\\ " : " tests/"
3636 },
3737 "files" : [
38- " tests/Unit/Type/data/repository-stub-files.php"
38+ " tests/Unit/Type/data/repository-stub-files.php" ,
39+ " tests/Unit/Type/QueryResultToArrayDynamicReturnTypeExtension/data/query-result-to-array.php"
3940 ]
4041 },
4142 "extra" : {
Original file line number Diff line number Diff line change 44
55use TYPO3 \CMS \Extbase \DomainObject \AbstractEntity ;
66use TYPO3 \CMS \Extbase \Mvc \Controller \ActionController ;
7- use TYPO3 \CMS \Extbase \Persistence \QueryResultInterface ;
87use TYPO3 \CMS \Extbase \Persistence \Repository ;
9- use TYPO3 \CMS \Extbase \Persistence \RepositoryInterface ;
108use function PHPStan \Testing \assertType ;
119
1210/**
1311 * @extends Repository<FrontendUserGroup>
1412 */
15- class FrontendUserGroupRepository extends Repository implements RepositoryInterface
13+ class FrontendUserGroupRepository extends Repository
1614{
1715
1816}
@@ -33,10 +31,18 @@ public function __construct(FrontendUserGroupRepository $myRepository)
3331 $ this ->myRepository = $ myRepository ;
3432 }
3533
36- public function showAction ()
34+ public function showAction (): void
3735 {
36+ assertType (
37+ 'array<int, SaschaEgerer\PhpstanTypo3\Tests\Unit\Type\QueryResultToArrayDynamicReturnTypeExtension\FrontendUserGroup> ' ,
38+ $ this ->myRepository ->findAll ()->toArray ()
39+ );
40+
3841 $ queryResult = $ this ->myRepository ->findAll ();
3942 $ myObjects = $ queryResult ->toArray ();
40- assertType ('array<int, FrontendUserGroup> ' , $ myObjects );
43+ assertType (
44+ 'array<int, SaschaEgerer\PhpstanTypo3\Tests\Unit\Type\QueryResultToArrayDynamicReturnTypeExtension\FrontendUserGroup> ' ,
45+ $ myObjects
46+ );
4147 }
4248}
You can’t perform that action at this time.
0 commit comments