Skip to content

Commit fb60a60

Browse files
authored
IBX-10936: Made ProxyDomainMapperFactory lazy (#676)
1 parent d1bfbf7 commit fb60a60

File tree

15 files changed

+68
-147
lines changed

15 files changed

+68
-147
lines changed

phpstan-baseline-7.4.neon

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ parameters:
6060
count: 1
6161
path: src/bundle/Core/Features/Context/UserContext.php
6262

63-
-
64-
message: '#^PHPDoc tag @throws with type Psr\\Cache\\InvalidArgumentException is not subtype of Throwable$#'
65-
identifier: throws.notThrowable
66-
count: 1
67-
path: src/bundle/Core/Imagine/Cache/AliasGeneratorDecorator.php
68-
6963
-
7064
message: '#^Parameter \#2 \$str of function fwrite expects string, string\|false given\.$#'
7165
identifier: argument.type
@@ -191,37 +185,6 @@ parameters:
191185
identifier: argument.type
192186
count: 1
193187
path: src/lib/MVC/Symfony/Matcher/ContentBased/UrlAlias.php
194-
195-
-
196-
message: '#^PHPDoc tag @throws with type Psr\\Cache\\InvalidArgumentException is not subtype of Throwable$#'
197-
identifier: throws.notThrowable
198-
count: 1
199-
path: src/lib/Persistence/Cache/ContentTypeHandler.php
200-
201-
-
202-
message: '#^PHPDoc tag @throws with type Psr\\Cache\\CacheException is not subtype of Throwable$#'
203-
identifier: throws.notThrowable
204-
count: 1
205-
path: src/lib/Persistence/Cache/SettingHandler.php
206-
207-
-
208-
message: '#^PHPDoc tag @throws with type Psr\\Cache\\InvalidArgumentException is not subtype of Throwable$#'
209-
identifier: throws.notThrowable
210-
count: 2
211-
path: src/lib/Persistence/Cache/SettingHandler.php
212-
213-
-
214-
message: '#^PHPDoc tag @throws with type Ibexa\\Core\\Base\\Exceptions\\BadStateException\|Psr\\Cache\\InvalidArgumentException is not subtype of Throwable$#'
215-
identifier: throws.notThrowable
216-
count: 1
217-
path: src/lib/Persistence/Cache/UrlAliasHandler.php
218-
219-
-
220-
message: '#^PHPDoc tag @throws with type Psr\\Cache\\InvalidArgumentException is not subtype of Throwable$#'
221-
identifier: throws.notThrowable
222-
count: 1
223-
path: src/lib/Persistence/Cache/UrlWildcardHandler.php
224-
225188
-
226189
message: '#^Cannot access property \$ownerDocument on DOMElement\|false\.$#'
227190
identifier: property.nonObject
@@ -456,18 +419,6 @@ parameters:
456419
count: 3
457420
path: tests/integration/Core/Repository/RoleServiceTest.php
458421

459-
-
460-
message: '#^Parameter \#1 \$class of class ReflectionProperty constructor expects object\|string, class\-string\|false given\.$#'
461-
identifier: argument.type
462-
count: 4
463-
path: tests/integration/Core/Repository/SearchServiceLocationTest.php
464-
465-
-
466-
message: '#^Parameter \#1 \$class of class ReflectionProperty constructor expects object\|string, class\-string\|false given\.$#'
467-
identifier: argument.type
468-
count: 4
469-
path: tests/integration/Core/Repository/SearchServiceTest.php
470-
471422
-
472423
message: '#^Parameter \#1 \$str of function md5 expects string, int\<1, max\> given\.$#'
473424
identifier: argument.type
@@ -480,12 +431,6 @@ parameters:
480431
count: 1
481432
path: tests/lib/MVC/Symfony/Security/UserWrappedTest.php
482433

483-
-
484-
message: '#^Method Ibexa\\Tests\\Core\\MVC\\Symfony\\Templating\\Twig\\Extension\\FileSystemTwigIntegrationTestCase\:\:doIntegrationTest\(\) has no return type specified\.$#'
485-
identifier: missingType.return
486-
count: 1
487-
path: tests/lib/MVC/Symfony/Templating/Twig/Extension/FileSystemTwigIntegrationTestCase.php
488-
489434
-
490435
message: '#^Parameter \#1 \$function of function call_user_func_array expects callable\(\)\: mixed, array\{mixed, string\} given\.$#'
491436
identifier: argument.type

phpstan-baseline-gte-8.0.neon

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -413,19 +413,6 @@ parameters:
413413
identifier: argument.type
414414
count: 1
415415
path: tests/integration/Core/Repository/RoleServiceTest.php
416-
417-
-
418-
message: '#^Parameter \#1 \$class of class ReflectionProperty constructor expects object\|string, class\-string\|false given\.$#'
419-
identifier: argument.type
420-
count: 4
421-
path: tests/integration/Core/Repository/SearchServiceLocationTest.php
422-
423-
-
424-
message: '#^Parameter \#1 \$class of class ReflectionProperty constructor expects object\|string, class\-string\|false given\.$#'
425-
identifier: argument.type
426-
count: 4
427-
path: tests/integration/Core/Repository/SearchServiceTest.php
428-
429416
-
430417
message: '#^Parameter \#1 \$string of function md5 expects string, int\<1, max\> given\.$#'
431418
identifier: argument.type

phpstan-baseline.neon

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18060,12 +18060,6 @@ parameters:
1806018060
count: 1
1806118061
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php
1806218062

18063-
-
18064-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt1 \(int\) on left side of \?\? is not nullable\.$#'
18065-
identifier: nullCoalesce.property
18066-
count: 1
18067-
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/AuthorConverter.php
18068-
1806918063
-
1807018064
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldValue\:\:\$sortKeyString \(string\) does not accept bool\|float\|int\|string\|null\.$#'
1807118065
identifier: assign.propertyType
@@ -18523,7 +18517,7 @@ parameters:
1852318517
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php
1852418518

1852518519
-
18526-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt3 \(int\) does not accept array\|bool\|float\|int\|string\|null\.$#'
18520+
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt3 \(int\|null\) does not accept array\|bool\|float\|int\|string\|null\.$#'
1852718521
identifier: assign.propertyType
1852818522
count: 1
1852918523
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php
@@ -18534,6 +18528,12 @@ parameters:
1853418528
count: 1
1853518529
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php
1853618530

18531+
-
18532+
message: '#^Strict comparison using \=\=\= between false and false will always evaluate to true\.$#'
18533+
identifier: identical.alwaysTrue
18534+
count: 1
18535+
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/IntegerConverter.php
18536+
1853718537
-
1853818538
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\Content\\FieldValue\\Converter\\KeywordConverter\:\:toFieldDefinition\(\) has no return type specified\.$#'
1853918539
identifier: missingType.return
@@ -18918,18 +18918,6 @@ parameters:
1891818918
count: 1
1891918919
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.php
1892018920

18921-
-
18922-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt1 \(int\) in isset\(\) is not nullable\.$#'
18923-
identifier: isset.property
18924-
count: 1
18925-
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.php
18926-
18927-
-
18928-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt2 \(int\) in isset\(\) is not nullable\.$#'
18929-
identifier: isset.property
18930-
count: 1
18931-
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/TextLineConverter.php
18932-
1893318921
-
1893418922
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataText1 \(string\) does not accept array\|bool\|float\|int\|string\|null\.$#'
1893518923
identifier: assign.propertyType
@@ -19002,12 +18990,6 @@ parameters:
1900218990
count: 1
1900318991
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/UrlConverter.php
1900418992

19005-
-
19006-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt2 \(int\) does not accept null\.$#'
19007-
identifier: assign.propertyType
19008-
count: 1
19009-
path: src/lib/Persistence/Legacy/Content/FieldValue/Converter/UserConverter.php
19010-
1901118993
-
1901218994
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\Content\\FieldValue\\ConverterRegistry\:\:__construct\(\) has parameter \$converterMap with no value type specified in iterable type array\.$#'
1901318995
identifier: missingType.iterableValue
@@ -21006,30 +20988,6 @@ parameters:
2100620988
count: 1
2100720989
path: src/lib/Persistence/Legacy/Content/Type/Mapper.php
2100820990

21009-
-
21010-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt1 \(int\) does not accept int\|null\.$#'
21011-
identifier: assign.propertyType
21012-
count: 1
21013-
path: src/lib/Persistence/Legacy/Content/Type/Mapper.php
21014-
21015-
-
21016-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt2 \(int\) does not accept int\|null\.$#'
21017-
identifier: assign.propertyType
21018-
count: 1
21019-
path: src/lib/Persistence/Legacy/Content/Type/Mapper.php
21020-
21021-
-
21022-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt3 \(int\) does not accept int\|null\.$#'
21023-
identifier: assign.propertyType
21024-
count: 1
21025-
path: src/lib/Persistence/Legacy/Content/Type/Mapper.php
21026-
21027-
-
21028-
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataInt4 \(int\) does not accept int\|null\.$#'
21029-
identifier: assign.propertyType
21030-
count: 1
21031-
path: src/lib/Persistence/Legacy/Content/Type/Mapper.php
21032-
2103320991
-
2103420992
message: '#^Method Ibexa\\Core\\Persistence\\Legacy\\Content\\Type\\MemoryCachingHandler\:\:getSearchableFieldMap\(\) should return array\<mixed\> but returns array\|object\.$#'
2103520993
identifier: return.type

src/bundle/Core/Imagine/Cache/AliasGeneratorDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function __construct(
6969
*
7070
* @return \Ibexa\Contracts\Core\Variation\Values\Variation
7171
*
72-
* @throws \Psr\Cache\InvalidArgumentException
72+
* @throws \Psr\Cache\InvalidArgumentException&\Throwable
7373
*/
7474
public function getVariation(Field $field, VersionInfo $versionInfo, $variationName, array $parameters = [])
7575
{

src/lib/Persistence/Cache/ContentTypeHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ function () {
612612
*
613613
* @return \Ibexa\Contracts\Core\Persistence\Content\Type
614614
*
615-
* @throws \Psr\Cache\InvalidArgumentException
615+
* @throws \Psr\Cache\InvalidArgumentException&\Throwable
616616
*/
617617
public function removeContentTypeTranslation(int $contentTypeId, string $languageCode): Type
618618
{

src/lib/Persistence/Cache/SettingHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function create(string $group, string $identifier, string $serializedValu
2121
}
2222

2323
/**
24-
* @throws \Psr\Cache\InvalidArgumentException
24+
* @throws \Psr\Cache\InvalidArgumentException&\Throwable
2525
*/
2626
public function update(string $group, string $identifier, string $serializedValue): Setting
2727
{
@@ -35,7 +35,7 @@ public function update(string $group, string $identifier, string $serializedValu
3535
}
3636

3737
/**
38-
* @throws \Psr\Cache\CacheException
38+
* @throws \Psr\Cache\CacheException&\Throwable
3939
*/
4040
public function load(string $group, string $identifier): Setting
4141
{
@@ -57,7 +57,7 @@ public function load(string $group, string $identifier): Setting
5757
}
5858

5959
/**
60-
* @throws \Psr\Cache\InvalidArgumentException
60+
* @throws (\Psr\Cache\InvalidArgumentException&\Throwable)
6161
*/
6262
public function delete(string $group, string $identifier): void
6363
{

src/lib/Persistence/Cache/UrlAliasHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ public function deleteCorruptedUrlAliases()
490490
* @param int $locationId
491491
*
492492
* @throws \Ibexa\Core\Base\Exceptions\BadStateException
493-
* @throws \Psr\Cache\InvalidArgumentException
493+
* @throws \Psr\Cache\InvalidArgumentException&\Throwable
494494
*/
495495
public function repairBrokenUrlAliasesForLocation(int $locationId)
496496
{

src/lib/Persistence/Cache/UrlWildcardHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function create($sourceUrl, $destinationUrl, $forward = false)
4545
/**
4646
* {@inheritdoc}
4747
*
48-
* @throws \Psr\Cache\InvalidArgumentException
48+
* @throws \Psr\Cache\InvalidArgumentException&\Throwable
4949
*/
5050
public function update(
5151
int $id,

src/lib/Persistence/Legacy/Content/StorageFieldDefinition.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ class StorageFieldDefinition extends ValueObject
4141
/**
4242
* Data int 1.
4343
*
44-
* @var int
44+
* @var int|null
4545
*/
4646
public $dataInt1;
4747

4848
/**
4949
* Data int 2.
5050
*
51-
* @var int
51+
* @var int|null
5252
*/
5353
public $dataInt2;
5454

5555
/**
5656
* Data int 3.
5757
*
58-
* @var int
58+
* @var int|null
5959
*/
6060
public $dataInt3;
6161

6262
/**
6363
* Data int 4.
6464
*
65-
* @var int
65+
* @var int|null
6666
*/
6767
public $dataInt4;
6868

src/lib/Repository/Mapper/ContentDomainMapper.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,9 @@ public function buildContentDomainObjectsOnSearchResult(SearchResult $result, ar
639639
} else {
640640
$missingContentList[] = $hit->valueObject;
641641
unset($result->searchHits[$key]);
642-
--$result->totalCount;
642+
if ($result->totalCount !== null) {
643+
--$result->totalCount;
644+
}
643645
}
644646
}
645647

@@ -684,7 +686,9 @@ public function buildLocationDomainObjectsOnSearchResult(SearchResult $result, a
684686
} else {
685687
$missingLocations[] = $hit->valueObject;
686688
unset($result->searchHits[$key]);
687-
--$result->totalCount;
689+
if ($result->totalCount !== null) {
690+
--$result->totalCount;
691+
}
688692
}
689693
}
690694

0 commit comments

Comments
 (0)