Skip to content

Commit

Permalink
Move HTTP listeners to a sub-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval authored and trasher committed Dec 11, 2024
1 parent b873ded commit efd5b72
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

use Glpi\Controller\GenericListController;
use Glpi\Controller\DropdownFormController;
use Glpi\Http\LegacyItemtypeRouteListener;
use Glpi\Http\Listener\LegacyItemtypeRouteListener;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

namespace tests\units\Glpi\Http;

use Glpi\Http\RedirectLegacyRouteListener;
use Glpi\Http\Listener\RedirectLegacyRouteListener;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\RedirectResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Application\View\TemplateRenderer;
use Glpi\Exception\Http\AccessDeniedHttpException;
use Glpi\Exception\AuthenticationFailedException;
use Glpi\Exception\RedirectException;
use Glpi\Exception\SessionExpiredException;
use Session;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Http\Firewall;
use Glpi\Security\Attribute\SecurityStrategy;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Http\LegacyRouterTrait;
use Glpi\Http\ListenersPriority;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use CommonDevice;
use CommonDropdown;
Expand All @@ -46,6 +46,7 @@
use Glpi\Controller\DropdownFormController;
use Glpi\Dropdown\Dropdown;
use Glpi\Dropdown\DropdownDefinition;
use Glpi\Http\ListenersPriority;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Controller\LegacyFileLoadController;
use Glpi\Http\LegacyRouterTrait;
use Glpi\Http\ListenersPriority;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Controller\AbstractController;
use Glpi\DependencyInjection\PluginContainer;
use Glpi\DependencyInjection\PublicService;
use Glpi\Http\ListenersPriority;
use Plugin;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Exception\RedirectException;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
* ---------------------------------------------------------------------
*/

namespace Glpi\Http;
namespace Glpi\Http\Listener;

use Glpi\Http\ListenersPriority;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down
5 changes: 5 additions & 0 deletions src/Glpi/Http/ListenersPriority.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
namespace Glpi\Http;

use Glpi\Config\LegacyConfigProviderListener;
use Glpi\Http\Listener\LegacyAssetsListener;
use Glpi\Http\Listener\LegacyItemtypeRouteListener;
use Glpi\Http\Listener\LegacyRouterListener;
use Glpi\Http\Listener\PluginsRouterListener;
use Glpi\Http\Listener\RedirectLegacyRouteListener;

final class ListenersPriority
{
Expand Down
2 changes: 1 addition & 1 deletion src/Glpi/Kernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
use Glpi\Config\ConfigProviderConsoleExclusiveInterface;
use Glpi\Config\ConfigProviderWithRequestInterface;
use Glpi\Config\LegacyConfigProviders;
use Glpi\Http\PluginsRouterListener;
use Glpi\Http\Listener\PluginsRouterListener;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\TwigBundle\TwigBundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* ---------------------------------------------------------------------
*/

namespace tests\units\Glpi\Http;
namespace tests\units\Glpi\Http\Listener;

use org\bovigo\vfs\vfsStream;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* ---------------------------------------------------------------------
*/

namespace tests\units\Glpi\Http;
namespace tests\units\Glpi\Http\Listener;

use org\bovigo\vfs\vfsStream;
use Symfony\Component\HttpFoundation\Request;
Expand Down

0 comments on commit efd5b72

Please sign in to comment.