Skip to content

Commit

Permalink
Remove Component namespace on action
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Oct 23, 2023
1 parent b0646fe commit 6f6617f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"autoload": {
"psr-4": {
"Sylius\\Bundle\\ResourceBundle\\": "src/Bundle/",
"Sylius\\Component\\Resource\\": "src/Component/"
"Sylius\\Component\\Resource\\": "src/Component/",
"Sylius\\Resource\\": "src/Component/src/"
}
},
"autoload-dev": {
Expand Down
11 changes: 4 additions & 7 deletions src/Component/Action/PlaceHolderAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@

namespace Sylius\Component\Resource\Action;

final class PlaceHolderAction
{
/**
* @param mixed $data
*/
public function __invoke($data = null): mixed
class_exists(\Sylius\Resource\Action\PlaceHolderAction::class);

if (false) {
final class PlaceHolderAction extends \Sylius\Resource\Action\PlaceHolderAction
{
return $data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
namespace Sylius\Component\Resource\Symfony\Routing\Factory;

use Gedmo\Sluggable\Util\Urlizer;
use Sylius\Component\Resource\Action\PlaceHolderAction;
use Sylius\Component\Resource\Metadata\HttpOperation;
use Sylius\Component\Resource\Metadata\MetadataInterface;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Resource\Action\PlaceHolderAction;
use Symfony\Component\Routing\Route;

final class OperationRouteFactory implements OperationRouteFactoryInterface
Expand Down
3 changes: 2 additions & 1 deletion src/Component/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
},
"autoload": {
"psr-4": {
"Sylius\\Component\\Resource\\": ""
"Sylius\\Component\\Resource\\": "",
"Sylius\\Resource\\": "src/"
}
},
"autoload-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Component\Resource\Action\PlaceHolderAction;
use Sylius\Component\Resource\Metadata\BulkDelete;
use Sylius\Component\Resource\Metadata\BulkUpdate;
use Sylius\Component\Resource\Metadata\Create;
Expand All @@ -28,6 +27,7 @@
use Sylius\Component\Resource\Metadata\Update;
use Sylius\Component\Resource\Symfony\Routing\Factory\OperationRouteFactory;
use Sylius\Component\Resource\Symfony\Routing\Factory\OperationRoutePathFactoryInterface;
use Sylius\Resource\Action\PlaceHolderAction;

final class OperationRouteFactorySpec extends ObjectBehavior
{
Expand Down
27 changes: 27 additions & 0 deletions src/Component/src/Action/PlaceHolderAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Sylius\Resource\Action;

final class PlaceHolderAction
{
/**
* @param mixed $data
*/
public function __invoke($data = null): mixed
{
return $data;
}
}

class_alias(PlaceHolderAction::class, \Sylius\Component\Resource\Action\PlaceHolderAction::class);

0 comments on commit 6f6617f

Please sign in to comment.