Skip to content

Commit

Permalink
Merge pull request #7 from ibexa/ibx-1334-cross-rebranding
Browse files Browse the repository at this point in the history
IBX-1334: Rebranded ibexa/rest to use new namespaces
  • Loading branch information
Nattfarinn committed Dec 3, 2021
2 parents 1862f75 + 2fca554 commit 2939e33
Show file tree
Hide file tree
Showing 619 changed files with 3,248 additions and 3,237 deletions.
25 changes: 25 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\CodeStyle\PhpCsFixer\InternalConfigFactory;

$configFactory = new InternalConfigFactory();
$configFactory->withRules([
'declare_strict_types' => false,
]);

return $configFactory
->buildConfig()
->setFinder(
PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->files()->name('*.php')
);
10 changes: 0 additions & 10 deletions .php_cs

This file was deleted.

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
}
},
"require": {
"php": "^7.3",
"php": "^7.4",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xmlwriter": "*",
"ezsystems/ezplatform-kernel": "^4.0@dev",
"ibexa/core": "^4.0@dev",
"symfony/http-kernel": "^5.3",
"symfony/dependency-injection": "^5.3",
"symfony/routing": "^5.3",
Expand All @@ -47,17 +47,17 @@
},
"require-dev": {
"ibexa/ci-scripts": "^0.2@dev",
"ezsystems/doctrine-dbal-schema": "^4.0@dev",
"ezsystems/ezplatform-code-style": "^0.1.0",
"friendsofphp/php-cs-fixer": "^2.16.0",
"ibexa/doctrine-schema": "^4.0@dev",
"ibexa/code-style": "^1.0",
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": "^8.5",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"nyholm/psr7": "^1.1",
"symfony/http-client": "^5.3",
"symfony/browser-kit": "^5.3"
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots"
},
"extra": {
"branch-alias": {
Expand Down
18 changes: 9 additions & 9 deletions src/bundle/ApiLoader/Factory.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\ApiLoader;

use eZ\Publish\Core\MVC\ConfigResolverInterface;
use eZ\Publish\Core\MVC\Symfony\RequestStackAware;
use eZ\Publish\API\Repository\Repository;
use Ibexa\Contracts\Core\Repository\Repository;
use Ibexa\Core\MVC\ConfigResolverInterface;
use Ibexa\Core\MVC\Symfony\RequestStackAware;
use Ibexa\Rest\FieldTypeProcessor\BinaryProcessor;
use Ibexa\Rest\FieldTypeProcessor\ImageAssetFieldTypeProcessor;
use Ibexa\Rest\FieldTypeProcessor\ImageProcessor;
Expand All @@ -20,18 +20,18 @@ class Factory
use RequestStackAware;

/**
* @var \eZ\Publish\Core\MVC\ConfigResolverInterface
* @var \Ibexa\Core\MVC\ConfigResolverInterface
*/
protected $configResolver;

/**
* @var \eZ\Publish\API\Repository\Repository
* @var \Ibexa\Contracts\Core\Repository\Repository
*/
protected $repository;

/**
* @param \eZ\Publish\Core\MVC\ConfigResolverInterface $configResolver
* @param \eZ\Publish\API\Repository\Repository $repository
* @param \Ibexa\Core\MVC\ConfigResolverInterface $configResolver
* @param \Ibexa\Contracts\Core\Repository\Repository $repository
*/
public function __construct(ConfigResolverInterface $configResolver, Repository $repository)
{
Expand All @@ -57,7 +57,7 @@ public function getMediaFieldTypeProcessor()
*
* @param \Symfony\Component\Routing\RouterInterface $router
*
* @return \EzSystems\EzPlatformRest\FieldTypeProcessor\ImageProcessor
* @return \Ibexa\Rest\FieldTypeProcessor\ImageProcessor
*/
public function getImageFieldTypeProcessor(RouterInterface $router)
{
Expand Down
10 changes: 5 additions & 5 deletions src/bundle/CorsOptions/RestProvider.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\CorsOptions;

use Nelmio\CorsBundle\Options\ProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;

/**
* REST Cors Options provider.
Expand All @@ -19,11 +19,11 @@
*/
class RestProvider implements ProviderInterface
{
/** @var RequestMatcherInterface */
/** @var \Symfony\Component\Routing\Matcher\RequestMatcherInterface */
protected $requestMatcher;

/**
* @param RequestMatcherInterface $requestMatcher
* @param \Symfony\Component\Routing\Matcher\RequestMatcherInterface $requestMatcher
*/
public function __construct(RequestMatcherInterface $requestMatcher)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection\Compiler;

use eZ\Publish\Core\Base\Container\Compiler\TaggedServiceIdsIterator\BackwardCompatibleIterator;
use Ibexa\Core\Base\Container\Compiler\TaggedServiceIdsIterator\BackwardCompatibleIterator;
use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection\Compiler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection\Compiler;
Expand Down
7 changes: 4 additions & 3 deletions src/bundle/DependencyInjection/Compiler/OutputVisitorPass.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference;

/**
* Compiler pass for the ezpublish_rest.output.visitor tag.
Expand Down Expand Up @@ -64,7 +64,8 @@ public function process(ContainerBuilder $container)
foreach ($visitors as $visitor) {
foreach ($visitor['regexps'] as $regexp) {
$definition->addMethodCall(
'addVisitor', [
'addVisitor',
[
$regexp,
$visitor['reference'],
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection\Compiler;
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection;

use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Configuration as SiteAccessConfiguration;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\Configuration as SiteAccessConfiguration;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

class Configuration extends SiteAccessConfiguration
Expand Down
6 changes: 3 additions & 3 deletions src/bundle/DependencyInjection/IbexaRestExtension.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection;

use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ConfigurationProcessor;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down Expand Up @@ -63,7 +63,7 @@ public function prepend(ContainerBuilder $container)
private function prependRouterConfiguration(ContainerBuilder $container)
{
$config = ['router' => ['default_router' => ['non_siteaccess_aware_routes' => ['ezpublish_rest_']]]];
$container->prependExtensionConfig('ezpublish', $config);
$container->prependExtensionConfig('ibexa', $config);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\DependencyInjection\Security;
Expand Down
20 changes: 10 additions & 10 deletions src/bundle/EventListener/CsrfListener.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\EventListener;

use Ibexa\Bundle\Rest\RestEvents;
use Ibexa\Core\Base\Exceptions\UnauthorizedException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use eZ\Publish\Core\Base\Exceptions\UnauthorizedException;
use Ibexa\Bundle\Rest\RestEvents;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Csrf\CsrfToken;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;

Expand All @@ -21,10 +21,10 @@ class CsrfListener implements EventSubscriberInterface
/**
* Name of the HTTP header containing CSRF token.
*/
const CSRF_TOKEN_HEADER = 'X-CSRF-Token';
public const CSRF_TOKEN_HEADER = 'X-CSRF-Token';

/**
* @var CsrfTokenManagerInterface|null
* @var \Symfony\Component\Security\Csrf\CsrfTokenManagerInterface|null
*/
private $csrfTokenManager;

Expand All @@ -50,7 +50,7 @@ class CsrfListener implements EventSubscriberInterface
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
* @param bool $csrfEnabled
* @param string $csrfTokenIntention
* @param CsrfTokenManagerInterface|null $csrfTokenManager
* @param \Symfony\Component\Security\Csrf\CsrfTokenManagerInterface|null $csrfTokenManager
*/
public function __construct(
EventDispatcherInterface $eventDispatcher,
Expand Down Expand Up @@ -79,7 +79,7 @@ public static function getSubscribedEvents()
*
* @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
*
* @throws \eZ\Publish\Core\Base\Exceptions\UnauthorizedException
* @throws \Ibexa\Core\Base\Exceptions\UnauthorizedException
*/
public function onKernelRequest(RequestEvent $event)
{
Expand Down Expand Up @@ -161,7 +161,7 @@ protected function isSessionRoute($route)
/**
* Checks the validity of the request's csrf token header.
*
* @param Request $request
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return bool true/false if the token is valid/invalid, false if none was found in the request's headers
*/
Expand Down
8 changes: 4 additions & 4 deletions src/bundle/EventListener/RequestListener.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\EventListener;

use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;

/**
* REST request listener.
Expand All @@ -18,7 +18,7 @@
*/
class RequestListener implements EventSubscriberInterface
{
const REST_PREFIX_PATTERN = '/^\/api\/[a-zA-Z0-9-_]+\/v\d+(\.\d+)?\//';
public const REST_PREFIX_PATTERN = '/^\/api\/[a-zA-Z0-9-_]+\/v\d+(\.\d+)?\//';

/**
* @return array
Expand Down
8 changes: 4 additions & 4 deletions src/bundle/EventListener/ResponseListener.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

/**
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest\EventListener;

use Ibexa\Rest\Server\View\AcceptHeaderVisitorDispatcher;
use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\KernelEvents;

/**
* REST Response Listener.
Expand All @@ -20,7 +20,7 @@
class ResponseListener implements EventSubscriberInterface
{
/**
* @var AcceptHeaderVisitorDispatcher
* @var \Ibexa\Rest\Server\View\AcceptHeaderVisitorDispatcher
*/
private $viewDispatcher;

Expand Down
Loading

0 comments on commit 2939e33

Please sign in to comment.