Skip to content

Commit

Permalink
IBX-8535: Dropped deprecated code (#131)
Browse files Browse the repository at this point in the history
* IBX-8535: Dropped refreshSessionAction

* IBX-8535: Dropped RequestParser

* Dropped deprecated methods

* Removed deprecated draft & publish role action

* CS

* regenerated baseline

* removed redeclaring uriParser property

* cast int to strings due to `getAttributeFromUri` typehinted return value

* Dropped phpdoc for union typehint

* baseline

* Fixed Role Tests

* Revert "IBX-8535: Dropped refreshSessionAction"

This reverts commit db7dd88.

* aligned deprecation version

* fixed phpstan issues

* publish test role

* dropped non existing error

* cast uri to string
  • Loading branch information
ViniTou authored Oct 7, 2024
1 parent 0955cbf commit eb879e0
Show file tree
Hide file tree
Showing 51 changed files with 165 additions and 1,416 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline-8.0.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ parameters:
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#2 \\$string of function explode expects string, string\\|null given\\.$#"
count: 1
path: src/lib/Server/Controller/Content.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, iterable\\<Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ContentType\\\\ContentType\\> given\\.$#"
count: 1
Expand Down
275 changes: 30 additions & 245 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions src/bundle/RequestParser/Router.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/bundle/Resources/config/input_parsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
Ibexa\Rest\Server\Common\Parser:
abstract: true
calls:
- [ setRequestParser, [ '@Ibexa\Bundle\Rest\RequestParser\Router' ] ]
- [ setUriParser, [ '@Ibexa\Contracts\Rest\UriParser\UriParserInterface' ] ]

Ibexa\Rest\Input\Parser\ContentObjectStates:
parent: Ibexa\Rest\Server\Common\Parser
Expand Down
8 changes: 0 additions & 8 deletions src/bundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,6 @@ ibexa.rest.binary_content.get_image_variation:

# Views

# Deprecated in favour of /views from Platform 1.0
ibexa.rest.create_content_view:
path: /content/views
defaults:
_controller: Ibexa\Rest\Server\Controller\Content:createView
methods: [POST]

# Views, Platform 1.0
ibexa.rest.views.create:
path: /views
defaults:
Expand Down
7 changes: 1 addition & 6 deletions src/bundle/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ services:
- '@ibexa.api.service.field_type'
- '@Ibexa\Rest\FieldTypeProcessorRegistry'

Ibexa\Bundle\Rest\RequestParser\Router:
arguments:
$router: '@router'
$uriParser: '@Ibexa\Contracts\Rest\UriParser\UriParserInterface'

Ibexa\Contracts\Rest\UriParser\UriParserInterface: '@Ibexa\Bundle\Rest\UriParser\UriParser'

Ibexa\Bundle\Rest\UriParser\UriParser:
Expand Down Expand Up @@ -77,7 +72,7 @@ services:
- [ setContainer, ["@service_container"] ]
- [ setInputDispatcher, ['@Ibexa\Rest\Input\Dispatcher'] ]
- [ setRouter, ["@router"] ]
- [ setRequestParser, ['@Ibexa\Bundle\Rest\RequestParser\Router'] ]
- [ setUriParser, ['@Ibexa\Contracts\Rest\UriParser\UriParserInterface'] ]
- [ setRepository, ['@ibexa.api.repository'] ]

Ibexa\Rest\Server\Controller\Root:
Expand Down
42 changes: 1 addition & 41 deletions src/bundle/Resources/config/value_object_visitors.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,7 @@
parameters:

# Errors

# Section

# URLWildcard

# URLAlias

# Content

# User group

# User

# ContentType

# Object state

# View

# Trash

# Location

# Roles

# Relation

# Field Definition

# Content type Group

# HTTP

# Cache

# Services

services:
Ibexa\Contracts\Rest\Output\ValueObjectVisitor:
calls:
- [ setRequestParser, [ '@Ibexa\Bundle\Rest\RequestParser\Router' ] ]
- [ setUriParser, [ '@Ibexa\Contracts\Rest\UriParser\UriParserInterface' ] ]
- [ setRouter, [ "@router" ] ]
- [ setTemplateRouter, [ '@Ibexa\Bundle\Core\Routing\DefaultRouter'] ]

Expand Down
15 changes: 0 additions & 15 deletions src/contracts/Output/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,21 +320,6 @@ protected function checkEndAttribute($data)
*/
abstract public function getMediaType($name);

/**
* Generates a media type from $name and $type.
*
* @deprecated 6.13.5 please start to use generateMediaTypeWithVendor()
*
* @param string $name
* @param string $type
*
* @return string
*/
protected function generateMediaType($name, $type)
{
return "application/vnd.ibexa.api.{$name}+{$type}";
}

/**
* Generates a media type from $name, $type and $vendor.
*
Expand Down
13 changes: 4 additions & 9 deletions src/contracts/Output/ValueObjectVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@

use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\User\Limitation;
use Ibexa\Rest\RequestParser;
use Ibexa\Contracts\Rest\UriParser\UriParserInterface;
use Symfony\Component\Routing\RouterInterface;

/**
* Basic ValueObjectVisitor.
*/
abstract class ValueObjectVisitor
{
/**
* URL handler for URL generation.
*
* @var \Ibexa\Rest\RequestParser
*/
protected $requestParser;
protected UriParserInterface $uriParser;

/**
* @var \Symfony\Component\Routing\RouterInterface
Expand Down Expand Up @@ -56,9 +51,9 @@ public function setTemplateRouter(RouterInterface $templateRouter)
$this->templateRouter = $templateRouter;
}

public function setRequestParser(RequestParser $requestParser)
public function setUriParser(UriParserInterface $uriParser): void
{
$this->requestParser = $requestParser;
$this->uriParser = $uriParser;
}

/**
Expand Down
13 changes: 4 additions & 9 deletions src/lib/Input/BaseParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@
namespace Ibexa\Rest\Input;

use Ibexa\Contracts\Rest\Input\Parser;
use Ibexa\Rest\RequestParser;
use Ibexa\Contracts\Rest\UriParser\UriParserInterface;

abstract class BaseParser extends Parser
{
/**
* URL handler.
*
* @var \Ibexa\Rest\RequestParser
*/
protected $requestParser;
protected UriParserInterface $uriParser;

public function setRequestParser(RequestParser $requestParser)
public function setUriParser(UriParserInterface $uriParser): void
{
$this->requestParser = $requestParser;
$this->uriParser = $uriParser;
}
}
4 changes: 2 additions & 2 deletions src/lib/Input/Parser/ContentObjectStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher)
$states[] = new RestObjectState(
new ObjectState(
[
'id' => $this->requestParser->parseHref($rawStateData['_href'], 'objectStateId'),
'id' => $this->uriParser->getAttributeFromUri($rawStateData['_href'], 'objectStateId'),
]
),
$this->requestParser->parseHref($rawStateData['_href'], 'objectStateGroupId')
$this->uriParser->getAttributeFromUri($rawStateData['_href'], 'objectStateGroupId')
);
}

Expand Down
12 changes: 0 additions & 12 deletions src/lib/Output/FieldTypeSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Ibexa\Contracts\Core\Repository\FieldType;
use Ibexa\Contracts\Core\Repository\FieldTypeService;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
use Ibexa\Contracts\Rest\Output\Generator;
use Ibexa\Rest\FieldTypeProcessorRegistry;

Expand Down Expand Up @@ -41,17 +40,6 @@ public function __construct(FieldTypeService $fieldTypeService, FieldTypeProcess
$this->fieldTypeProcessorRegistry = $fieldTypeProcessorRegistry;
}

/**
* @deprecated 4.6.0 The "FieldTypeSerializer::serializeFieldValue()" method is deprecated, will be removed in 5.0.
* Use "FieldTypeSerializer::serializeContentFieldValue()" instead.
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function serializeFieldValue(Generator $generator, ContentType $contentType, Field $field): void
{
$this->serializeContentFieldValue($generator, $field);
}

/**
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
Expand Down
45 changes: 0 additions & 45 deletions src/lib/RequestParser.php

This file was deleted.

Loading

0 comments on commit eb879e0

Please sign in to comment.