Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/bundle/ApiPlatform/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public function __construct(
?array $output = null,
$mercure = null,
$messenger = null,
?bool $elasticsearch = null,
?int $urlGenerationStrategy = null,
?bool $read = null,
?bool $deserialize = null,
Expand Down Expand Up @@ -172,7 +171,6 @@ class: $class,
output: $output,
mercure: $mercure,
messenger: $messenger,
elasticsearch: $elasticsearch,
urlGenerationStrategy: $urlGenerationStrategy,
read: $read,
deserialize: $deserialize,
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ ibexa.rest.delete_object_state:

ibexa.rest.get_object_states_for_content:
path: /content/objects/{contentId}/objectstates
controller: Ibexa\Rest\Server\Controller\ObjectState\ObjectStatesForContnetListController::getObjectStatesForContent
controller: Ibexa\Rest\Server\Controller\ObjectState\ObjectStatesForContentListController::getObjectStatesForContent
methods: [GET]
requirements:
contentId: \d+
Expand Down Expand Up @@ -788,7 +788,7 @@ ibexa.rest.delete_url_wildcard:

ibexa.rest.list_policies_for_user:
path: /user/policies
controller: Ibexa\Rest\Server\Controller\Role::listPoliciesForUser
controller: Ibexa\Rest\Server\Controller\Role\RolePoliciesForUserListController::listPoliciesForUser
methods: [GET]

# Roles
Expand Down
1 change: 0 additions & 1 deletion src/lib/Server/Controller/Role/RoleBaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace Ibexa\Rest\Server\Controller\Role;

use ApiPlatform\Metadata\Get;
use Ibexa\Contracts\Core\Repository\LocationService;
use Ibexa\Contracts\Core\Repository\RoleService;
use Ibexa\Contracts\Core\Repository\UserService;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Server/Controller/Role/RoleListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use ApiPlatform\OpenApi\Factory\OpenApiFactory;
use ApiPlatform\OpenApi\Model;
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException as APINotFoundException;
use Ibexa\Rest\Server\Values;
use Ibexa\Rest\Server\Values\RoleList;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

Expand Down Expand Up @@ -64,7 +64,7 @@ class RoleListController extends RoleBaseController
/**
* Loads list of roles.
*/
public function listRoles(Request $request): \Ibexa\Rest\Server\Values\RoleList
public function listRoles(Request $request): RoleList
{
$roles = [];
if ($request->query->has('identifier')) {
Expand All @@ -90,6 +90,6 @@ public function listRoles(Request $request): \Ibexa\Rest\Server\Values\RoleList
);
}

return new Values\RoleList($roles, $request->getPathInfo());
return new RoleList($roles, $request->getPathInfo());
}
}
2 changes: 1 addition & 1 deletion src/lib/Server/Input/Parser/ContentTypeCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher): Conten
throw new Exceptions\Parser("Missing '_href' attribute for the User element in ContentTypeCreate.");
}

$contentTypeCreateStruct->creatorId = $this->uriParser->getAttributeFromUri($data['User']['_href'], 'userId');
$contentTypeCreateStruct->creatorId = (int)$this->uriParser->getAttributeFromUri($data['User']['_href'], 'userId');
}

if (!array_key_exists('FieldDefinitions', $data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Input/Parser/ContentTypeGroupInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher): Conten
throw new Exceptions\Parser("Missing '_href' attribute for the User element in ContentTypeGroupInput.");
}

$contentTypeGroupCreateStruct->creatorId = $this->uriParser->getAttributeFromUri($data['User']['_href'], 'userId');
$contentTypeGroupCreateStruct->creatorId = (int)$this->uriParser->getAttributeFromUri($data['User']['_href'], 'userId');
}

return $contentTypeGroupCreateStruct;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Input/Parser/ContentTypeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher): Conten
throw new Exceptions\Parser("Missing '_href' attribute for the User element in ContentTypeUpdate.");
}

$contentTypeUpdateStruct->modifierId = $this->uriParser->getAttributeFromUri($data['User']['_href'], 'userId');
$contentTypeUpdateStruct->modifierId = (int)$this->uriParser->getAttributeFromUri($data['User']['_href'], 'userId');
}

return $contentTypeUpdateStruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ protected function getBasicFieldDefinitionList(): FieldDefinitionList
return new FieldDefinitionList(
new Values\ContentType\ContentType(
[
'id' => 'contentTypeId',
'id' => 12,
'status' => Values\ContentType\ContentType::STATUS_DEFINED,
'fieldDefinitions' => new Values\ContentType\FieldDefinitionCollection(),
]
),
[
new Values\ContentType\FieldDefinition(
['id' => 'fieldDefinitionId_1']
['id' => 1]
),
new Values\ContentType\FieldDefinition(
['id' => 'fieldDefinitionId_2']
['id' => 2]
),
]
);
Expand All @@ -81,7 +81,7 @@ public function provideXpathAssertions(): array
{
return [
[
'/FieldDefinitions[@href="/content/types/contentTypeId/fieldDefinitions"]',
'/FieldDefinitions[@href="/content/types/12/fieldDefinitions"]',
],
[
'/FieldDefinitions[@media-type="application/vnd.ibexa.api.FieldDefinitionList+xml"]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ protected function getBasicContentType(): RestContentType
return new RestContentType(
new Values\ContentType\ContentType(
[
'id' => 'contentTypeId',
'id' => 123,
'status' => Values\ContentType\ContentType::STATUS_DEFINED,
'identifier' => 'contentTypeIdentifier',
'creationDate' => new \DateTime('2012-09-06 19:30 Europe/Berlin'),
'modificationDate' => new \DateTime('2012-09-06 19:32 Europe/Berlin'),
'creatorId' => 'creatorId',
'modifierId' => 'modifierId',
'creatorId' => 123,
'modifierId' => 34,
'remoteId' => 'remoteId',
'urlAliasSchema' => 'urlAliasSchema',
'nameSchema' => 'nameSchema',
Expand All @@ -111,7 +111,7 @@ protected function getBasicContentType(): RestContentType
*/
public function testContentTypeHref(\DOMDocument $dom): void
{
$this->assertXPath($dom, '/ContentType[@href="/content/types/contentTypeId"]');
$this->assertXPath($dom, '/ContentType[@href="/content/types/123"]');
}

/**
Expand All @@ -127,7 +127,7 @@ public function testContentTypeMediaType(\DOMDocument $dom): void
*/
public function testId(\DOMDocument $dom): void
{
$this->assertXPath($dom, '/ContentType/id[text()="contentTypeId"]');
$this->assertXPath($dom, '/ContentType/id[text()="123"]');
}

/**
Expand Down Expand Up @@ -199,7 +199,7 @@ public function testModificationDate(\DOMDocument $dom): void
*/
public function testCreatorHref(\DOMDocument $dom): void
{
$this->assertXPath($dom, '/ContentType/Creator[@href="/user/users/creatorId"]');
$this->assertXPath($dom, '/ContentType/Creator[@href="/user/users/123"]');
}

/**
Expand All @@ -215,7 +215,7 @@ public function testCreatorMediaType(\DOMDocument $dom): void
*/
public function testModifierHref(\DOMDocument $dom): void
{
$this->assertXPath($dom, '/ContentType/Modifier[@href="/user/users/modifierId"]');
$this->assertXPath($dom, '/ContentType/Modifier[@href="/user/users/34"]');
}

/**
Expand All @@ -231,7 +231,7 @@ public function testModifierMediaType(\DOMDocument $dom): void
*/
public function testDraftHref(\DOMDocument $dom): void
{
$this->assertXPath($dom, '/ContentType/Draft[@href="/content/types/contentTypeId/draft"]');
$this->assertXPath($dom, '/ContentType/Draft[@href="/content/types/123/draft"]');
}

/**
Expand All @@ -247,7 +247,7 @@ public function testDraftType(\DOMDocument $dom): void
*/
public function testGroupsHref(\DOMDocument $dom): void
{
$this->assertXPath($dom, '/ContentType/Groups[@href="/content/types/contentTypeId/groups"]');
$this->assertXPath($dom, '/ContentType/Groups[@href="/content/types/123/groups"]');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testVisitRestFieldDefinition(): \DOMDocument

public function testVisitRestFieldDefinitionWithPath(): \DOMDocument
{
return $this->generateDomDocument('/content/types/contentTypeId/fieldDefinition/title');
return $this->generateDomDocument('/content/types/123/fieldDefinition/title');
}

protected function generateDomDocument(?string $path = null): \DOMDocument
Expand Down Expand Up @@ -84,14 +84,14 @@ protected function getBasicRestFieldDefinition(?string $path = null): Server\Val
return new Server\Values\RestFieldDefinition(
new Values\ContentType\ContentType(
[
'id' => 'contentTypeId',
'id' => 123,
'status' => Values\ContentType\ContentType::STATUS_DEFINED,
'fieldDefinitions' => new Values\ContentType\FieldDefinitionCollection(),
]
),
new Values\ContentType\FieldDefinition(
[
'id' => 'fieldDefinitionId_23',
'id' => 23,
'fieldSettings' => ['setting' => 'foo'],
'validatorConfiguration' => ['validator' => 'bar'],
'identifier' => 'title',
Expand All @@ -114,15 +114,15 @@ protected function getBasicRestFieldDefinition(?string $path = null): Server\Val
public function provideXpathAssertions(): array
{
$xpathAssertions = $this->getXpathAssertions();
$xpathAssertions[] = '/FieldDefinition[@href="/content/types/contentTypeId/fieldDefinitions/fieldDefinitionId_23"]';
$xpathAssertions[] = '/FieldDefinition[@href="/content/types/123/fieldDefinitions/23"]';

return $this->prepareXPathAssertions($xpathAssertions);
}

public function provideXpathAssertionsPath(): array
{
$xpathAssertions = $this->getXpathAssertions();
$xpathAssertions[] = '/FieldDefinition[@href="/content/types/contentTypeId/fieldDefinition/title"]';
$xpathAssertions[] = '/FieldDefinition[@href="/content/types/123/fieldDefinition/title"]';

return $this->prepareXPathAssertions($xpathAssertions);
}
Expand All @@ -141,7 +141,7 @@ protected function getXpathAssertions(): array
{
return [
'/FieldDefinition[@media-type="application/vnd.ibexa.api.FieldDefinition+xml"]',
'/FieldDefinition/id[text()="fieldDefinitionId_23"]',
'/FieldDefinition/id[text()="23"]',
'/FieldDefinition/identifier[text()="title"]',
'/FieldDefinition/fieldType[text()="my-field-type"]',
'/FieldDefinition/fieldGroup[text()="abstract-field-group"]',
Expand Down
Loading