Skip to content

Commit f1ce2b2

Browse files
authored
Fixed PHPDoc syntax (#311)
* URLAlias: Fix $languageCodes class property's phpdoc * AbstractInMemoryCollection.php: Fix phpstan VS phpdoc * ArrayList.php: Fix phpstan VS phpdoc * ArrayMap.php: Fix phpstan VS phpdoc * phpstan-baseline.neon: Remove fixed `Unexpected token \"languageCodes\"` in URLAlias.php * phpstan-baseline.neon: Rm related to URLAlias::$languageCodes fix * phpstan-baseline.neon: Rm related to URLAlias::$languageCodes fix --------- Co-authored-by: Adrien Dupuis <[email protected]>
1 parent 28ca460 commit f1ce2b2

File tree

5 files changed

+9
-34
lines changed

5 files changed

+9
-34
lines changed

phpstan-baseline.neon

-25
Original file line numberDiff line numberDiff line change
@@ -7375,11 +7375,6 @@ parameters:
73757375
count: 1
73767376
path: src/contracts/Repository/Values/Content/Trash/TrashItemDeleteResultList.php
73777377

7378-
-
7379-
message: "#^PHPDoc tag @property\\-read has invalid value \\(string\\[\\] languageCodes the languages for which this alias is valid\\)\\: Unexpected token \"languageCodes\", expected variable at offset 451$#"
7380-
count: 1
7381-
path: src/contracts/Repository/Values/Content/URLAlias.php
7382-
73837378
-
73847379
message: "#^Class Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLWildcard\\\\SearchResult implements generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#"
73857380
count: 1
@@ -21215,11 +21210,6 @@ parameters:
2121521210
count: 1
2121621211
path: src/lib/Repository/TrashService.php
2121721212

21218-
-
21219-
message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#"
21220-
count: 2
21221-
path: src/lib/Repository/URLAliasService.php
21222-
2122321213
-
2122421214
message: "#^Class Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\UrlAlias referenced with incorrect case\\: Ibexa\\\\Contracts\\\\Core\\\\Persistence\\\\Content\\\\URLAlias\\.$#"
2122521215
count: 7
@@ -27370,11 +27360,6 @@ parameters:
2737027360
count: 9
2737127361
path: tests/integration/Core/Repository/ContentServiceTest.php
2737227362

27373-
-
27374-
message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#"
27375-
count: 2
27376-
path: tests/integration/Core/Repository/ContentServiceTest.php
27377-
2737827363
-
2737927364
message: "#^Argument of an invalid type Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\ContentMetadataUpdateStruct supplied for foreach, only iterables are supported\\.$#"
2738027365
count: 1
@@ -38810,11 +38795,6 @@ parameters:
3881038795
count: 1
3881138796
path: tests/integration/Core/Repository/URLAliasServiceAuthorizationTest.php
3881238797

38813-
-
38814-
message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#"
38815-
count: 1
38816-
path: tests/integration/Core/Repository/URLAliasServiceTest.php
38817-
3881838798
-
3881938799
message: "#^Cannot access offset 0 on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\>\\.$#"
3882038800
count: 1
@@ -59800,11 +59780,6 @@ parameters:
5980059780
count: 1
5980159781
path: tests/lib/Repository/Service/Mock/SearchTest.php
5980259782

59803-
-
59804-
message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#"
59805-
count: 3
59806-
path: tests/lib/Repository/Service/Mock/UrlAliasTest.php
59807-
5980859783
-
5980959784
message: "#^Cannot access offset 0 on iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\>\\.$#"
5981059785
count: 3

src/contracts/Collection/AbstractInMemoryCollection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
*/
2121
abstract class AbstractInMemoryCollection implements CollectionInterface, StreamableInterface
2222
{
23-
/** @var TValue[] */
23+
/** @phpstan-var TValue[] */
2424
protected array $items;
2525

2626
/**
27-
* @param TValue[] $items
27+
* @phpstan-param TValue[] $items
2828
*/
2929
public function __construct(array $items = [])
3030
{

src/contracts/Collection/ArrayList.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class ArrayList extends AbstractInMemoryCollection implements ListInterface
2020
{
2121
/**
22-
* @param TValue[] $items
22+
* @phpstan-param TValue[] $items
2323
*/
2424
public function __construct(array $items = [])
2525
{
@@ -45,17 +45,17 @@ public function last()
4545
}
4646

4747
/**
48-
* @param TValue $value
48+
* @phpstan-param TValue $value
4949
*/
5050
public function contains($value): bool
5151
{
5252
return in_array($value, $this->items, true);
5353
}
5454

5555
/**
56-
* @param TValue[] $items
56+
* @phpstan-param TValue[] $items
5757
*
58-
* @return \Ibexa\Contracts\Core\Collection\ArrayList<TValue>
58+
* @phpstan-return \Ibexa\Contracts\Core\Collection\ArrayList<TValue>
5959
*/
6060
protected function createFrom(array $items): self
6161
{

src/contracts/Collection/ArrayMap.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function has($key): bool
3434
}
3535

3636
/**
37-
* @param TValue[] $items
37+
* @phpstan-param TValue[] $items
3838
*
39-
* @return \Ibexa\Contracts\Core\Collection\ArrayMap<TKey,TValue>
39+
* @phpstan-return \Ibexa\Contracts\Core\Collection\ArrayMap<TKey,TValue>
4040
*/
4141
protected function createFrom(array $items): self
4242
{

src/contracts/Repository/Values/Content/URLAlias.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @property-read int $type The type of the URL Alias i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL
1818
* @property-read mixed $destination If type = URLAlias::LOCATION it is a Location id otherwise a string (e.g. /content/search)
1919
* @property-read string $path the alias path
20-
* @property-read string[] languageCodes the languages for which this alias is valid
20+
* @property-read string[] $languageCodes the languages for which this alias is valid
2121
* @property-read bool $alwaysAvailable Fallback indicator for other languages
2222
* @property-read bool $isHistory Indicates that this alias was autogenerated for an in the meanwhile archived version of the content
2323
* @property-read bool $isCustom If false this alias was autogenerated otherwise manuel created

0 commit comments

Comments
 (0)