Skip to content

Commit 05d353c

Browse files
authored
Fixed case sensitivity for URLWildcard references (#597)
For more details see #597 Key changes: * Fixed case sensitivity for URLWildcard references
1 parent 68b2e3b commit 05d353c

File tree

5 files changed

+11
-55
lines changed

5 files changed

+11
-55
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6714,12 +6714,6 @@ parameters:
67146714
count: 1
67156715
path: src/contracts/Repository/Decorator/SettingServiceDecorator.php
67166716

6717-
-
6718-
message: '#^Class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\URLWildcard referenced with incorrect case\: Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\UrlWildcard\.$#'
6719-
identifier: class.nameCase
6720-
count: 4
6721-
path: src/contracts/Repository/Decorator/URLWildcardServiceDecorator.php
6722-
67236717
-
67246718
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\Decorator\\UserServiceDecorator\:\:createUser\(\) has parameter \$parentGroups with no value type specified in iterable type array\.$#'
67256719
identifier: missingType.iterableValue
@@ -8328,12 +8322,6 @@ parameters:
83288322
count: 1
83298323
path: src/contracts/Repository/Strategy/ContentThumbnail/ThumbnailStrategy.php
83308324

8331-
-
8332-
message: '#^Class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\URLWildcard referenced with incorrect case\: Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\UrlWildcard\.$#'
8333-
identifier: class.nameCase
8334-
count: 4
8335-
path: src/contracts/Repository/URLWildcardService.php
8336-
83378325
-
83388326
message: '#^Method Ibexa\\Contracts\\Core\\Repository\\UserService\:\:createUser\(\) has parameter \$parentGroups with no value type specified in iterable type array\.$#'
83398327
identifier: missingType.iterableValue
@@ -10386,12 +10374,6 @@ parameters:
1038610374
count: 1
1038710375
path: src/lib/Event/TokenService.php
1038810376

10389-
-
10390-
message: '#^Class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\URLWildcard referenced with incorrect case\: Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\UrlWildcard\.$#'
10391-
identifier: class.nameCase
10392-
count: 2
10393-
path: src/lib/Event/URLWildcardService.php
10394-
1039510377
-
1039610378
message: '#^Method Ibexa\\Core\\Event\\UserService\:\:createUser\(\) has parameter \$parentGroups with no value type specified in iterable type array\.$#'
1039710379
identifier: missingType.iterableValue
@@ -25860,12 +25842,6 @@ parameters:
2586025842
count: 2
2586125843
path: src/lib/Repository/URLWildcardService.php
2586225844

25863-
-
25864-
message: '#^Class Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\URLWildcard referenced with incorrect case\: Ibexa\\Contracts\\Core\\Repository\\Values\\Content\\UrlWildcard\.$#'
25865-
identifier: class.nameCase
25866-
count: 4
25867-
path: src/lib/Repository/URLWildcardService.php
25868-
2586925845
-
2587025846
message: '#^Method Ibexa\\Core\\Repository\\URLWildcardService\:\:__construct\(\) has parameter \$settings with no value type specified in iterable type array\.$#'
2587125847
identifier: missingType.iterableValue

src/contracts/Repository/Decorator/URLWildcardServiceDecorator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function create(
2929
string $sourceUrl,
3030
string $destinationUrl,
3131
bool $forward = false
32-
): UrlWildcard {
32+
): URLWildcard {
3333
return $this->innerService->create($sourceUrl, $destinationUrl, $forward);
3434
}
3535

@@ -45,7 +45,7 @@ public function remove(URLWildcard $urlWildcard): void
4545
$this->innerService->remove($urlWildcard);
4646
}
4747

48-
public function load(int $id): UrlWildcard
48+
public function load(int $id): URLWildcard
4949
{
5050
return $this->innerService->load($id);
5151
}

src/contracts/Repository/URLWildcardService.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,8 @@ interface URLWildcardService
2929
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException if the number of "*" patterns in $sourceUrl and
3030
* the number of {\d} placeholders in $destinationUrl doesn't match or
3131
* if the placeholders aren't a valid number sequence({1}/{2}/{3}), starting with 1.
32-
*
33-
* @param string $sourceUrl
34-
* @param string $destinationUrl
35-
* @param bool $forward
36-
*
37-
* @return \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard
3832
*/
39-
public function create(string $sourceUrl, string $destinationUrl, bool $forward = false): UrlWildcard;
33+
public function create(string $sourceUrl, string $destinationUrl, bool $forward = false): URLWildcard;
4034

4135
/**
4236
* Update an url wildcard.
@@ -61,28 +55,24 @@ public function update(
6155
*
6256
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to remove url wildcards
6357
*
64-
* @param \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard $urlWildcard the url wildcard to remove
58+
* @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard $urlWildcard the url wildcard to remove
6559
*/
6660
public function remove(URLWildcard $urlWildcard): void;
6761

6862
/**
6963
* Loads a url wild card.
7064
*
7165
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the url wild card was not found
72-
*
73-
* @param int $id
74-
*
75-
* @return \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard
7666
*/
77-
public function load(int $id): UrlWildcard;
67+
public function load(int $id): URLWildcard;
7868

7969
/**
8070
* Loads all url wild card (paged).
8171
*
8272
* @param int $offset
8373
* @param int $limit
8474
*
85-
* @return \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard[]
75+
* @return \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard[]
8676
*/
8777
public function loadAll(int $offset = 0, int $limit = -1): iterable;
8878

src/lib/Event/URLWildcardService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function create(
4141
string $sourceUrl,
4242
string $destinationUrl,
4343
bool $forward = false
44-
): UrlWildcard {
44+
): URLWildcard {
4545
$eventData = [
4646
$sourceUrl,
4747
$destinationUrl,

src/lib/Repository/URLWildcardService.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,8 @@ public function __construct(
7070
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to create url wildcards
7171
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\ContentValidationException if the number of "*" patterns in $sourceUrl and
7272
* the numbers in {\d} placeholders in $destinationUrl does not match.
73-
*
74-
* @param string $sourceUrl
75-
* @param string $destinationUrl
76-
* @param bool $forward
77-
*
78-
* @return \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard
7973
*/
80-
public function create(string $sourceUrl, string $destinationUrl, bool $forward = false): UrlWildcard
74+
public function create(string $sourceUrl, string $destinationUrl, bool $forward = false): URLWildcard
8175
{
8276
if (false === $this->permissionResolver->hasAccess('content', 'urltranslator')) {
8377
throw new UnauthorizedException('content', 'urltranslator');
@@ -142,7 +136,7 @@ public function update(
142136
}
143137

144138
/**
145-
* @param \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard $urlWildcard the url wildcard to remove
139+
* @param \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard $urlWildcard the url wildcard to remove
146140
*
147141
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
148142
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to remove url wildcards
@@ -169,15 +163,11 @@ public function remove(URLWildcard $urlWildcard): void
169163
/**
170164
* Loads a url wild card.
171165
*
172-
* @param int $id
173-
*
174-
* @return \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard
175-
*
176166
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException if the url wild card was not found
177167
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
178168
* @throws \Ibexa\Core\Base\Exceptions\UnauthorizedException
179169
*/
180-
public function load(int $id): UrlWildcard
170+
public function load(int $id): URLWildcard
181171
{
182172
return $this->buildUrlWildcardDomainObject(
183173
$this->urlWildcardHandler->load($id)
@@ -190,7 +180,7 @@ public function load(int $id): UrlWildcard
190180
* @param int $offset
191181
* @param int $limit
192182
*
193-
* @return \Ibexa\Contracts\Core\Repository\Values\Content\UrlWildcard[]
183+
* @return \Ibexa\Contracts\Core\Repository\Values\Content\URLWildcard[]
194184
*
195185
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
196186
* @throws \Ibexa\Core\Base\Exceptions\UnauthorizedException

0 commit comments

Comments
 (0)