Skip to content

Commit 248bb45

Browse files
authored
Merge branch 'sascha-egerer:master' into master
2 parents ad8d06c + 0bd19c4 commit 248bb45

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

extension.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ parameters:
141141
routing: TYPO3\CMS\Core\Routing\SiteRouteResult|TYPO3\CMS\Core\Routing\PageArguments
142142
currentContentObject: TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
143143
frontend.controller: TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
144+
frontend.page.information: TYPO3\CMS\Frontend\Page\PageInformation
144145
frontend.typoscript: TYPO3\CMS\Core\TypoScript\FrontendTypoScript
145146
extbase: TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters
146147
frontend.page.information: TYPO3\CMS\Frontend\Page\PageInformation
@@ -155,7 +156,7 @@ parameters:
155156
websiteTitle: string
156157
stubFiles:
157158
- stubs/DomainObjectInterface.stub
158-
- stubs/EventDispatcher.stub
159+
- stubs/EventDispatcherInterface.stub
159160
- stubs/ObjectStorage.stub
160161
- stubs/QueryFactory.stub
161162
- stubs/QueryInterface.stub
File renamed without changes.

stubs/ObjectStorage.stub

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,43 @@ class ObjectStorage implements \Iterator, \ArrayAccess
1515
protected $storage;
1616

1717
/**
18-
* @param TEntity $value
18+
* @param TEntity|string|null $value
1919
* @param mixed $information
2020
*/
2121
public function offsetSet($value, $information);
2222

2323
/**
24-
* @param TEntity|int $value
24+
* @param TEntity|int|string $value
2525
* @return bool
2626
*/
2727
public function offsetExists($value);
2828

2929
/**
30-
* @param TEntity|int $value
30+
* @param TEntity|int|string $value
3131
*/
3232
public function offsetUnset($value);
3333

3434
/**
35-
* @param TEntity|int $value
35+
* @param TEntity|int|string $value
3636
* @return ($value is int ? TEntity|null : mixed)
3737
*/
3838
public function offsetGet($value);
3939

4040
/**
4141
* This is different from the SplObjectStorage as the key in this implementation is the object hash (string).
4242
* @phpstan-ignore-next-line See https://forge.typo3.org/issues/98146
43-
* @return string|null
43+
* @return string
4444
*/
45+
// @phpstan-ignore-next-line See https://forge.typo3.org/issues/98146
4546
public function key();
4647

4748
/**
48-
* @return array<TEntity>
49+
* @return list<TEntity>
4950
*/
5051
public function toArray();
5152

5253
/**
53-
* @return array<TEntity>
54+
* @return list<TEntity>
5455
*/
5556
public function getArray();
5657

stubs/QueryInterface.stub

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ namespace TYPO3\CMS\Extbase\Persistence;
66
*/
77
interface QueryInterface
88
{
9+
// We have to define the constants here to be able to use them in other stubs.
10+
// See https://phpstan.org/user-guide/stub-files
11+
public const ORDER_ASCENDING = 'ASC';
12+
public const ORDER_DESCENDING = 'DESC';
13+
914
/**
1015
* @param bool $returnRawQueryResult
11-
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<ModelType>|array<string, mixed>
16+
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<ModelType>|list<array<string, mixed>>
1217
*/
1318
public function execute($returnRawQueryResult = false);
1419

stubs/QueryResult.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
1010
class QueryResult implements QueryResultInterface
1111
{
1212
/**
13-
* @return null|ModelType
13+
* @return ModelType|null
1414
*/
1515
public function getFirst();
1616
}

stubs/QueryResultInterface.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ interface QueryResultInterface extends \Countable, \Iterator, \ArrayAccess
1414
public function getQuery();
1515

1616
/**
17-
* @return null|ModelType
17+
* @return ModelType|null
1818
*/
1919
public function getFirst();
2020

2121
/**
22-
* @return ModelType[]
22+
* @return list<ModelType>
2323
*/
2424
public function toArray();
2525
}

stubs/Repository.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Repository
4747
public function findByIdentifier($identifier);
4848

4949
/**
50-
* @phpstan-param array<string,string> $defaultOrderings
50+
* @phpstan-param array<non-empty-string, QueryInterface::ORDER_*> $defaultOrderings
5151
* @phpstan-return void
5252
*/
5353
public function setDefaultOrderings($defaultOrderings);

0 commit comments

Comments
 (0)