Skip to content

Commit 8f52267

Browse files
committed
fixed minor phpstan issues
1 parent a5a6257 commit 8f52267

25 files changed

+81
-950
lines changed

phpstan-baseline.neon

Lines changed: 18 additions & 858 deletions
Large diffs are not rendered by default.

src/lib/FieldType/BinaryBase/BinaryBaseStorage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ public function copyLegacyField(VersionInfo $versionInfo, Field $field, Field $o
131131
*
132132
* @param mixed $fieldId
133133
* @param string $versionNo
134-
* @param array $context
135134
*/
136135
protected function removeOldFile($fieldId, $versionNo)
137136
{

src/lib/FieldType/Keyword/KeywordStorage.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ class KeywordStorage extends GatewayBasedStorage
2626
/**
2727
* @see \Ibexa\Contracts\Core\FieldType\FieldStorage
2828
*
29-
* @param \Ibexa\Contracts\Core\Persistence\Content\VersionInfo $versionInfo
30-
* @param \Ibexa\Contracts\Core\Persistence\Content\Field $field
31-
* @param array $context
32-
*
3329
* @return mixed
3430
*/
3531
public function storeFieldData(VersionInfo $versionInfo, Field $field)
@@ -45,11 +41,7 @@ public function getFieldData(VersionInfo $versionInfo, Field $field)
4541
}
4642

4743
/**
48-
* @param \Ibexa\Contracts\Core\Persistence\Content\VersionInfo $versionInfo
4944
* @param array $fieldIds
50-
* @param array $context
51-
*
52-
* @return bool
5345
*/
5446
public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds): bool
5547
{
@@ -60,11 +52,6 @@ public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds): bool
6052
return true;
6153
}
6254

63-
/**
64-
* Checks if field type has external data to deal with.
65-
*
66-
* @return bool
67-
*/
6855
public function hasFieldData(): bool
6956
{
7057
return true;

src/lib/FieldType/User/UserStorage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ public function getFieldData(VersionInfo $versionInfo, Field $field)
4646
}
4747

4848
/**
49-
* @param \Ibexa\Contracts\Core\Persistence\Content\VersionInfo $versionInfo
5049
* @param int[] $fieldIds Array of field Ids
51-
* @param array $context
5250
*
5351
* @return bool
5452
*

src/lib/Helper/PreviewLocationProvider.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
namespace Ibexa\Core\Helper;
99

1010
use Ibexa\Contracts\Core\Persistence\Content\Location\Handler as PersistenceLocationHandler;
11-
use Ibexa\Contracts\Core\Repository\ContentService;
1211
use Ibexa\Contracts\Core\Repository\LocationService;
1312
use Ibexa\Contracts\Core\Repository\Values\Content\Content as APIContent;
1413
use Ibexa\Contracts\Core\Repository\Values\Content\Location as APILocation;
@@ -22,24 +21,18 @@ class PreviewLocationProvider
2221
/** @var \Ibexa\Contracts\Core\Repository\LocationService */
2322
private $locationService;
2423

25-
/** @var \Ibexa\Contracts\Core\Repository\ContentService */
26-
private $contentService;
27-
2824
/** @var \Ibexa\Contracts\Core\Persistence\Content\Location\Handler */
2925
private $locationHandler;
3026

3127
/**
3228
* @param \Ibexa\Contracts\Core\Repository\LocationService $locationService
33-
* @param \Ibexa\Contracts\Core\Repository\ContentService $contentService
3429
* @param \Ibexa\Contracts\Core\Persistence\Content\Location\Handler $locationHandler
3530
*/
3631
public function __construct(
3732
LocationService $locationService,
38-
ContentService $contentService,
3933
PersistenceLocationHandler $locationHandler
4034
) {
4135
$this->locationService = $locationService;
42-
$this->contentService = $contentService;
4336
$this->locationHandler = $locationHandler;
4437
}
4538

src/lib/MVC/Symfony/Component/Serializer/SimplifiedRequestNormalizer.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ final class SimplifiedRequestNormalizer extends PropertyNormalizer
1616
* @param \Ibexa\Core\MVC\Symfony\Routing\SimplifiedRequest $object
1717
*
1818
* @return array{
19-
* scheme: string,
20-
* host: string,
21-
* port: string,
22-
* pathinfo: string,
23-
* queryParams: array<mixed>,
24-
* languages: string[],
25-
* headers: array{}
19+
* scheme: ?string,
20+
* host: ?string,
21+
* port: ?int,
22+
* pathinfo: ?string,
23+
* queryParams: ?array<mixed>,
24+
* languages: ?string[],
25+
* headers: ?array{}
2626
* }
2727
*
2828
* @see \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize

src/lib/MVC/Symfony/SiteAccess/Matcher/HostElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getRequest()
8383

8484
public function reverseMatch($siteAccessName)
8585
{
86-
$hostElements = explode('.', $this->request->getHost());
86+
$hostElements = explode('.', (string)$this->request->getHost());
8787
$elementNumber = $this->elementNumber - 1;
8888
if (!isset($hostElements[$elementNumber])) {
8989
return null;

src/lib/MVC/Symfony/SiteAccess/Matcher/HostText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getName(): string
3030
public function setRequest(SimplifiedRequest $request): void
3131
{
3232
if (!$this->element) {
33-
$this->setMatchElement($request->getHost());
33+
$this->setMatchElement((string)$request->getHost());
3434
}
3535

3636
parent::setRequest($request);

src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Host.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function getName(): string
2525
public function setRequest(SimplifiedRequest $request)
2626
{
2727
if (!$this->key) {
28-
$this->setMapKey($request->getHost());
28+
$this->setMapKey((string)$request->getHost());
2929
}
3030

3131
parent::setRequest($request);

src/lib/MVC/Symfony/SiteAccess/Matcher/Map/Port.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function setRequest(SimplifiedRequest $request)
3939
}
4040
}
4141

42-
$this->setMapKey($key);
42+
$this->setMapKey((string)$key);
4343
}
4444

4545
parent::setRequest($request);
@@ -49,7 +49,7 @@ public function reverseMatch($siteAccessName)
4949
{
5050
$matcher = parent::reverseMatch($siteAccessName);
5151
if ($matcher instanceof self) {
52-
$matcher->getRequest()->setPort($matcher->getMapKey());
52+
$matcher->getRequest()->setPort((int)$matcher->getMapKey());
5353
}
5454

5555
return $matcher;

0 commit comments

Comments
 (0)