diff --git a/config/di-providers-web.php b/config/di-providers-web.php index fb6f882..b72d912 100644 --- a/config/di-providers-web.php +++ b/config/di-providers-web.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Yiisoft\Yii\Debug\Api\Provider\DebugApiProvider; +use Yiisoft\Yii\Debug\Api\Debug\Provider\DebugApiProvider; if (!(bool)($params['yiisoft/yii-debug-api']['enabled'] ?? false)) { return []; diff --git a/config/di-web.php b/config/di-web.php index 349acc8..20965fa 100644 --- a/config/di-web.php +++ b/config/di-web.php @@ -5,11 +5,11 @@ use Cycle\Database\DatabaseProviderInterface; use Psr\Container\ContainerInterface; use Yiisoft\Db\Connection\ConnectionInterface; +use Yiisoft\Yii\Debug\Api\Debug\Repository\CollectorRepository; +use Yiisoft\Yii\Debug\Api\Debug\Repository\CollectorRepositoryInterface; use Yiisoft\Yii\Debug\Api\Inspector\Database\ActiveRecord\ActiveRecordSchemaProvider; use Yiisoft\Yii\Debug\Api\Inspector\Database\Cycle\CycleSchemaProvider; use Yiisoft\Yii\Debug\Api\Inspector\Database\SchemaProviderInterface; -use Yiisoft\Yii\Debug\Api\Repository\CollectorRepository; -use Yiisoft\Yii\Debug\Api\Repository\CollectorRepositoryInterface; use Yiisoft\Yii\Debug\Storage\StorageInterface; /** diff --git a/config/routes.php b/config/routes.php index 3e87dbd..473b1bf 100644 --- a/config/routes.php +++ b/config/routes.php @@ -8,13 +8,13 @@ use Yiisoft\Router\Group; use Yiisoft\Router\Route; use Yiisoft\Validator\ValidatorInterface; -use Yiisoft\Yii\Debug\Api\Controller\CacheController; -use Yiisoft\Yii\Debug\Api\Controller\CommandController; -use Yiisoft\Yii\Debug\Api\Controller\ComposerController; -use Yiisoft\Yii\Debug\Api\Controller\DebugController; -use Yiisoft\Yii\Debug\Api\Controller\GitController; -use Yiisoft\Yii\Debug\Api\Controller\InspectController; -use Yiisoft\Yii\Debug\Api\Middleware\ResponseDataWrapper; +use Yiisoft\Yii\Debug\Api\Debug\Controller\DebugController; +use Yiisoft\Yii\Debug\Api\Debug\Middleware\ResponseDataWrapper; +use Yiisoft\Yii\Debug\Api\Inspector\Controller\CacheController; +use Yiisoft\Yii\Debug\Api\Inspector\Controller\CommandController; +use Yiisoft\Yii\Debug\Api\Inspector\Controller\ComposerController; +use Yiisoft\Yii\Debug\Api\Inspector\Controller\GitController; +use Yiisoft\Yii\Debug\Api\Inspector\Controller\InspectController; use Yiisoft\Yii\Middleware\CorsAllowAll; use Yiisoft\Yii\Middleware\IpFilter; diff --git a/src/Controller/DebugController.php b/src/Debug/Controller/DebugController.php similarity index 97% rename from src/Controller/DebugController.php rename to src/Debug/Controller/DebugController.php index e11e636..dc8a1fc 100644 --- a/src/Controller/DebugController.php +++ b/src/Debug/Controller/DebugController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Controller; +namespace Yiisoft\Yii\Debug\Api\Debug\Controller; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseFactoryInterface; @@ -13,11 +13,11 @@ use Yiisoft\DataResponse\DataResponse; use Yiisoft\DataResponse\DataResponseFactoryInterface; use Yiisoft\Router\CurrentRoute; -use Yiisoft\Yii\Debug\Api\Exception\NotFoundException; -use Yiisoft\Yii\Debug\Api\Exception\PackageNotInstalledException; -use Yiisoft\Yii\Debug\Api\HtmlViewProviderInterface; -use Yiisoft\Yii\Debug\Api\ModuleFederationProviderInterface; -use Yiisoft\Yii\Debug\Api\Repository\CollectorRepositoryInterface; +use Yiisoft\Yii\Debug\Api\Debug\Exception\NotFoundException; +use Yiisoft\Yii\Debug\Api\Debug\Exception\PackageNotInstalledException; +use Yiisoft\Yii\Debug\Api\Debug\HtmlViewProviderInterface; +use Yiisoft\Yii\Debug\Api\Debug\ModuleFederationProviderInterface; +use Yiisoft\Yii\Debug\Api\Debug\Repository\CollectorRepositoryInterface; use Yiisoft\Yii\Debug\Api\ServerSentEventsStream; use Yiisoft\Yii\Debug\Storage\StorageInterface; use Yiisoft\Yii\View\ViewRenderer; diff --git a/src/Exception/NotFoundException.php b/src/Debug/Exception/NotFoundException.php similarity index 63% rename from src/Exception/NotFoundException.php rename to src/Debug/Exception/NotFoundException.php index 63a651e..62b79ba 100644 --- a/src/Exception/NotFoundException.php +++ b/src/Debug/Exception/NotFoundException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Exception; +namespace Yiisoft\Yii\Debug\Api\Debug\Exception; final class NotFoundException extends \Exception { diff --git a/src/Exception/PackageNotInstalledException.php b/src/Debug/Exception/PackageNotInstalledException.php similarity index 95% rename from src/Exception/PackageNotInstalledException.php rename to src/Debug/Exception/PackageNotInstalledException.php index f597e67..a6ccfab 100644 --- a/src/Exception/PackageNotInstalledException.php +++ b/src/Debug/Exception/PackageNotInstalledException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Exception; +namespace Yiisoft\Yii\Debug\Api\Debug\Exception; use Exception; use Throwable; diff --git a/src/HtmlViewProviderInterface.php b/src/Debug/HtmlViewProviderInterface.php similarity index 92% rename from src/HtmlViewProviderInterface.php rename to src/Debug/HtmlViewProviderInterface.php index b6a00ff..daa7858 100644 --- a/src/HtmlViewProviderInterface.php +++ b/src/Debug/HtmlViewProviderInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api; +namespace Yiisoft\Yii\Debug\Api\Debug; use Yiisoft\Yii\Debug\Collector\CollectorInterface; diff --git a/src/Middleware/DebugHeaders.php b/src/Debug/Middleware/DebugHeaders.php similarity index 95% rename from src/Middleware/DebugHeaders.php rename to src/Debug/Middleware/DebugHeaders.php index 838a7b8..b5d00b4 100644 --- a/src/Middleware/DebugHeaders.php +++ b/src/Debug/Middleware/DebugHeaders.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Middleware; +namespace Yiisoft\Yii\Debug\Api\Debug\Middleware; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/Middleware/ResponseDataWrapper.php b/src/Debug/Middleware/ResponseDataWrapper.php similarity index 97% rename from src/Middleware/ResponseDataWrapper.php rename to src/Debug/Middleware/ResponseDataWrapper.php index bb11547..c7d07d8 100644 --- a/src/Middleware/ResponseDataWrapper.php +++ b/src/Debug/Middleware/ResponseDataWrapper.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Middleware; +namespace Yiisoft\Yii\Debug\Api\Debug\Middleware; use OpenApi\Annotations as OA; use Psr\Http\Message\ResponseInterface; @@ -13,7 +13,7 @@ use Yiisoft\DataResponse\DataResponseFactoryInterface; use Yiisoft\Http\Status; use Yiisoft\Router\CurrentRoute; -use Yiisoft\Yii\Debug\Api\Exception\NotFoundException; +use Yiisoft\Yii\Debug\Api\Debug\Exception\NotFoundException; /** * @OA\Schema(schema="DebugResponse", description="Yii Debug Api response") diff --git a/src/ModuleFederationAssetBundle.php b/src/Debug/ModuleFederationAssetBundle.php similarity index 94% rename from src/ModuleFederationAssetBundle.php rename to src/Debug/ModuleFederationAssetBundle.php index bd0dcb0..8f453a9 100644 --- a/src/ModuleFederationAssetBundle.php +++ b/src/Debug/ModuleFederationAssetBundle.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api; +namespace Yiisoft\Yii\Debug\Api\Debug; if (!class_exists(\Yiisoft\Assets\AssetBundle::class)) { class AssetBundle diff --git a/src/ModuleFederationProviderInterface.php b/src/Debug/ModuleFederationProviderInterface.php similarity index 92% rename from src/ModuleFederationProviderInterface.php rename to src/Debug/ModuleFederationProviderInterface.php index 8e849e4..2e0573d 100644 --- a/src/ModuleFederationProviderInterface.php +++ b/src/Debug/ModuleFederationProviderInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api; +namespace Yiisoft\Yii\Debug\Api\Debug; use Yiisoft\Yii\Debug\Collector\CollectorInterface; diff --git a/src/Provider/DebugApiProvider.php b/src/Debug/Provider/DebugApiProvider.php similarity index 87% rename from src/Provider/DebugApiProvider.php rename to src/Debug/Provider/DebugApiProvider.php index a5ada13..d62d5be 100644 --- a/src/Provider/DebugApiProvider.php +++ b/src/Debug/Provider/DebugApiProvider.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Provider; +namespace Yiisoft\Yii\Debug\Api\Debug\Provider; use Psr\Container\ContainerInterface; use Yiisoft\Di\ServiceProviderInterface; -use Yiisoft\Yii\Debug\Api\Middleware\DebugHeaders; use Yiisoft\Router\RouteCollectorInterface; +use Yiisoft\Yii\Debug\Api\Debug\Middleware\DebugHeaders; final class DebugApiProvider implements ServiceProviderInterface { diff --git a/src/Repository/CollectorRepository.php b/src/Debug/Repository/CollectorRepository.php similarity index 93% rename from src/Repository/CollectorRepository.php rename to src/Debug/Repository/CollectorRepository.php index 00500ec..e37324b 100644 --- a/src/Repository/CollectorRepository.php +++ b/src/Debug/Repository/CollectorRepository.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Repository; +namespace Yiisoft\Yii\Debug\Api\Debug\Repository; -use Yiisoft\Yii\Debug\Api\Exception\NotFoundException; +use Yiisoft\Yii\Debug\Api\Debug\Exception\NotFoundException; use Yiisoft\Yii\Debug\Storage\StorageInterface; final class CollectorRepository implements CollectorRepositoryInterface diff --git a/src/Repository/CollectorRepositoryInterface.php b/src/Debug/Repository/CollectorRepositoryInterface.php similarity index 69% rename from src/Repository/CollectorRepositoryInterface.php rename to src/Debug/Repository/CollectorRepositoryInterface.php index 0c6e938..6d97d16 100644 --- a/src/Repository/CollectorRepositoryInterface.php +++ b/src/Debug/Repository/CollectorRepositoryInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Repository; +namespace Yiisoft\Yii\Debug\Api\Debug\Repository; interface CollectorRepositoryInterface { @@ -13,7 +13,7 @@ public function getDetail(string $id): array; public function getDumpObject(string $id): array; /** - * @return array|null Returns a list with object class and it's value or null + * @return array{string, mixed}|null Returns a list with object class, and it's value or null */ public function getObject(string $id, string $objectId): array|null; } diff --git a/src/Controller/CacheController.php b/src/Inspector/Controller/CacheController.php similarity index 98% rename from src/Controller/CacheController.php rename to src/Inspector/Controller/CacheController.php index 070ef90..8c4b946 100644 --- a/src/Controller/CacheController.php +++ b/src/Inspector/Controller/CacheController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Controller; +namespace Yiisoft\Yii\Debug\Api\Inspector\Controller; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; diff --git a/src/Controller/CommandController.php b/src/Inspector/Controller/CommandController.php similarity index 98% rename from src/Controller/CommandController.php rename to src/Inspector/Controller/CommandController.php index 5d479c4..de0997b 100644 --- a/src/Controller/CommandController.php +++ b/src/Inspector/Controller/CommandController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Controller; +namespace Yiisoft\Yii\Debug\Api\Inspector\Controller; use InvalidArgumentException; use Psr\Container\ContainerInterface; diff --git a/src/Controller/ComposerController.php b/src/Inspector/Controller/ComposerController.php similarity index 98% rename from src/Controller/ComposerController.php rename to src/Inspector/Controller/ComposerController.php index 6a058b3..954cc45 100644 --- a/src/Controller/ComposerController.php +++ b/src/Inspector/Controller/ComposerController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Controller; +namespace Yiisoft\Yii\Debug\Api\Inspector\Controller; use Exception; use InvalidArgumentException; diff --git a/src/Controller/GitController.php b/src/Inspector/Controller/GitController.php similarity index 98% rename from src/Controller/GitController.php rename to src/Inspector/Controller/GitController.php index 0e328cf..60543d7 100644 --- a/src/Controller/GitController.php +++ b/src/Inspector/Controller/GitController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Controller; +namespace Yiisoft\Yii\Debug\Api\Inspector\Controller; use Gitonomy\Git\Commit; use Gitonomy\Git\Reference\Branch; diff --git a/src/Controller/InspectController.php b/src/Inspector/Controller/InspectController.php similarity index 99% rename from src/Controller/InspectController.php rename to src/Inspector/Controller/InspectController.php index 7e0b73b..860b3d0 100644 --- a/src/Controller/InspectController.php +++ b/src/Inspector/Controller/InspectController.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Yiisoft\Yii\Debug\Api\Controller; +namespace Yiisoft\Yii\Debug\Api\Inspector\Controller; use Alexkart\CurlBuilder\Command; use FilesystemIterator; @@ -28,9 +28,9 @@ use Yiisoft\Router\UrlMatcherInterface; use Yiisoft\Translator\CategorySource; use Yiisoft\VarDumper\VarDumper; +use Yiisoft\Yii\Debug\Api\Debug\Repository\CollectorRepositoryInterface; use Yiisoft\Yii\Debug\Api\Inspector\ApplicationState; use Yiisoft\Yii\Debug\Api\Inspector\Database\SchemaProviderInterface; -use Yiisoft\Yii\Debug\Api\Repository\CollectorRepositoryInterface; use Yiisoft\Yii\Debug\Collector\Web\RequestCollector; class InspectController