Skip to content

Commit eadb0f3

Browse files
committed
Applied CR
1 parent 7abff42 commit eadb0f3

File tree

9 files changed

+29
-18
lines changed

9 files changed

+29
-18
lines changed

src/contracts/Event/ResolveUrlAliasSchemaEvent.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ final class ResolveUrlAliasSchemaEvent extends Event
1818

1919
private Content $content;
2020

21+
/**
22+
* @var array<string, array<string>>
23+
*/
2124
private array $names = [];
2225

2326
public function __construct(

src/contracts/Repository/NameSchema/NameSchemaServiceInterface.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,28 @@ interface NameSchemaServiceInterface
2020
{
2121
public function resolveUrlAliasSchema(Content $content, ContentType $contentType = null): array;
2222

23+
/**
24+
* @param array<string, array<string, string>> $fieldMap
25+
* @param array<string> $languageCodes
26+
*
27+
* @return array
28+
*/
2329
public function resolveNameSchema(
2430
Content $content,
2531
array $fieldMap = [],
2632
array $languageCodes = [],
2733
ContentType $contentType = null
2834
): array;
2935

36+
/**
37+
* Returns the real name for a content name pattern.
38+
*
39+
* @param array<string, array<string, string>> $fieldMap
40+
* @param array<string> $languageCodes
41+
*
42+
* @return array<string>
43+
*
44+
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
45+
*/
3046
public function resolve(string $nameSchema, ContentType $contentType, array $fieldMap, array $languageCodes): array;
3147
}

src/lib/Repository/ContentService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ class ContentService implements ContentServiceInterface
8888
/** @var \Ibexa\Core\Repository\Helper\RelationProcessor */
8989
protected $relationProcessor;
9090

91-
/** @var \Ibexa\Core\Repository\Helper\NameSchemaService */
92-
protected $nameSchemaService;
91+
protected NameSchemaServiceInterface $nameSchemaService;
9392

9493
/** @var \Ibexa\Core\FieldType\FieldTypeRegistry */
9594
protected $fieldTypeRegistry;

src/lib/Repository/NameSchema/NameSchemaService.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ class NameSchemaService implements NameSchemaServiceInterface
5151

5252
protected FieldTypeRegistry $fieldTypeRegistry;
5353

54-
/** @var array */
55-
protected $settings;
54+
/**
55+
* @param array{limit?: integer, sequence?: string} $settings
56+
*/
57+
protected array $settings;
5658

5759
private EventDispatcherInterface $eventDispatcher;
5860

src/lib/Repository/Repository.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,7 @@ class Repository implements RepositoryInterface
150150
/** @var \Ibexa\Core\FieldType\FieldTypeRegistry */
151151
private $fieldTypeRegistry;
152152

153-
/**
154-
* Instance of name schema resolver service.
155-
*
156-
* @var \Ibexa\Core\Repository\Helper\NameSchemaService
157-
*/
158-
protected $nameSchemaService;
153+
protected NameSchemaServiceInterface $nameSchemaService;
159154

160155
/**
161156
* Instance of relation processor service.
@@ -731,8 +726,6 @@ public function getPermissionResolver(): PermissionResolverInterface
731726
/**
732727
* @internal
733728
* @private
734-
*
735-
* @return \Ibexa\Contracts\Core\Repository\NameSchema\NameSchemaServiceInterface
736729
*/
737730
public function getNameSchemaService(): NameSchemaServiceInterface
738731
{

src/lib/Repository/TrashService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ class TrashService implements TrashServiceInterface
5151
/** @var array */
5252
protected $settings;
5353

54-
/** @var \Ibexa\Core\Repository\Helper\NameSchemaService */
55-
protected $nameSchemaService;
54+
protected NameSchemaServiceInterface $nameSchemaService;
5655

5756
/** @var \Ibexa\Contracts\Core\Repository\PermissionCriterionResolver */
5857
private $permissionCriterionResolver;

src/lib/Repository/URLAliasService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ class URLAliasService implements URLAliasServiceInterface
3434
/** @var \Ibexa\Contracts\Core\Persistence\Content\UrlAlias\Handler */
3535
protected $urlAliasHandler;
3636

37-
/** @var \Ibexa\Contracts\Core\Repository\NameSchema\NameSchemaServiceInterface */
38-
protected $nameSchemaService;
37+
protected NameSchemaServiceInterface $nameSchemaService;
3938

4039
/** @var \Ibexa\Contracts\Core\Repository\PermissionResolver */
4140
private $permissionResolver;

tests/integration/Core/Repository/UserServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ public function testCreateUserWithStrongPassword()
13311331
}
13321332

13331333
/**
1334-
* @covers \Ibexa\Contracts\Core\Repository\UserService::loadUser()
1334+
* @covers \Ibexa\Contracts\Core\Repository\UserService::loadUser()
13351335
*
13361336
* @depends testCreateUser
13371337
*

tests/lib/Repository/NameSchema/NameSchemaServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* @covers \Ibexa\Core\Repository\NameSchema\NameSchemaService
2626
*/
27-
class NameSchemaServiceTest extends BaseServiceMockTest
27+
final class NameSchemaServiceTest extends BaseServiceMockTest
2828
{
2929
private const NAME_SCHEMA = '<name_schema>';
3030

0 commit comments

Comments
 (0)