Skip to content

Commit 3080261

Browse files
committed
[phpstan] Fixed issues reported by phpstan
1 parent 998f005 commit 3080261

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

phpstan-baseline.neon

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ parameters:
781781
path: src/lib/Query/Common/SortClauseVisitor/Field.php
782782

783783
-
784-
message: '#^Method Ibexa\\Solr\\Query\\Common\\SortClauseVisitor\\Field\:\:getSortFieldName\(\) should return array but returns string\|null\.$#'
784+
message: '#^Method Ibexa\\Solr\\Query\\Common\\SortClauseVisitor\\Field\:\:getSortFieldName\(\) should return array but returns false\|null\.$#'
785785
identifier: return.type
786786
count: 1
787787
path: src/lib/Query/Common/SortClauseVisitor/Field.php
@@ -793,7 +793,7 @@ parameters:
793793
path: src/lib/Query/Common/SortClauseVisitor/MapLocationDistance.php
794794

795795
-
796-
message: '#^Method Ibexa\\Solr\\Query\\Common\\SortClauseVisitor\\MapLocationDistance\:\:getSortFieldName\(\) should return array but returns string\|null\.$#'
796+
message: '#^Method Ibexa\\Solr\\Query\\Common\\SortClauseVisitor\\MapLocationDistance\:\:getSortFieldName\(\) should return array but returns false\|null\.$#'
797797
identifier: return.type
798798
count: 1
799799
path: src/lib/Query/Common/SortClauseVisitor/MapLocationDistance.php
@@ -1758,6 +1758,12 @@ parameters:
17581758
count: 1
17591759
path: tests/lib/Search/ResultExtractor/AggregationResultExtractor/TermAggregationResultExtractorTest.php
17601760

1761+
-
1762+
message: '#^Cannot call method fetchAll\(\) on Doctrine\\DBAL\\Result\|int\|string\.$#'
1763+
identifier: method.nonObject
1764+
count: 1
1765+
path: tests/lib/SetupFactory/LegacySetupFactory.php
1766+
17611767
-
17621768
message: '#^Parameter \#1 \$contentObjects of method Ibexa\\Solr\\Handler\:\:bulkIndexContent\(\) expects array\<Ibexa\\Contracts\\Core\\Persistence\\Content\>, iterable\<Ibexa\\Contracts\\Core\\Persistence\\Content\> given\.$#'
17631769
identifier: argument.type

phpstan.neon.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ includes:
44
- phpstan-baseline.neon
55

66
parameters:
7-
ignoreErrors:
8-
-
9-
message: "#^Cannot call method (fetchOne|fetchAll|fetchAllAssociative|fetchAssociative|fetchAllKeyValue)\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#"
10-
paths:
11-
- tests/*
127
level: 8
138
paths:
149
- src

src/bundle/IbexaSolrBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function getContainerExtension(): ?ExtensionInterface
4242
$this->extension = new IbexaSolrExtension();
4343
}
4444

45-
return $this->extension;
45+
return $this->extension ?: null;
4646
}
4747
}

src/lib/Indexer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
class Indexer extends IncrementalIndexer
2121
{
22+
/** @var \Ibexa\Solr\Handler */
2223
protected SearchHandler $searchHandler;
2324

2425
public function __construct(

0 commit comments

Comments
 (0)