From d1cbe28bc9d129bd9fb10c7bcdf05c3ea7beb7e4 Mon Sep 17 00:00:00 2001 From: Aleksey Polyvanyi Date: Sun, 23 Jun 2024 13:09:37 +0200 Subject: [PATCH 1/4] feature/MTCE-239-Monorepo-v6-refactoring-EasySwoole --- composer.json | 3 + packages/EasyHttpClient/composer.json | 2 +- ...balConnectionNameToParamsCompilerPass.php} | 8 +- .../EasyErrorHandlerPublicCompilerPass.php} | 4 +- .../ResetEasyBatchProcessorCompilerPass.php} | 15 +-- .../SymfonyServicesResetCompilerPass.php} | 6 +- .../EasySwooleBundle.php} | 93 +++++++++---------- .../EasySwoole/bundle/Enum/ConfigParam.php | 29 ++++++ .../bundle/Enum/ConfigServiceId.php | 11 +++ packages/EasySwoole/bundle/Enum/ConfigTag.php | 13 +++ .../config/access_log.php | 19 ++-- .../config/definition.php | 0 .../Resources => bundle}/config/doctrine.php | 10 +- .../config/doctrine_coroutine_pdo.php | 13 +-- .../config/easy_admin.php | 2 +- .../config/easy_bugsnag.php} | 4 +- .../config/easy_logging.php} | 4 +- .../config/request_limits.php | 8 +- .../config/reset_services.php | 2 +- .../Resources => bundle}/config/services.php | 20 ++-- .../bundle/config/static_php_files.php | 25 +++++ packages/EasySwoole/composer.json | 29 +++--- .../src/Bridge/BridgeConstantsInterface.php | 39 -------- .../Resources/config/static_php_files.php | 24 ----- .../Adapter}/SwooleTableAdapter.php | 4 +- .../Factory}/SwooleTableAdapterFactory.php | 7 +- .../Helper}/AppCacheWarmupHelper.php | 3 +- .../Helper}/CacheTableHelper.php | 8 +- .../Checker}/AbstractAppStateChecker.php | 3 +- .../Checker}/AppStateCheckerInterface.php | 2 +- .../Checker}/RequestLimitsChecker.php | 2 +- .../src/Common/Enum/RequestAttribute.php | 15 +++ .../Enum}/SwooleTableColumnType.php | 4 +- .../Helper}/AppRuntimeHelper.php | 6 +- .../Helper}/EasySwooleEnabledHelper.php | 6 +- .../Helper}/EnvVarHelper.php | 3 +- .../Helper}/ErrorResponseHelper.php | 2 +- .../Helper}/FunctionHelper.php | 2 +- .../Helper}/HttpFoundationHelper.php | 2 +- .../Helper}/OptionHelper.php | 2 +- .../Helper}/SslCertificateHelper.php | 2 +- .../Helper}/SwooleTableHelper.php | 6 +- .../AbstractAppStateInitializer.php | 3 +- .../AppStateInitializerInterface.php | 2 +- .../Listener/AbstractExceptionListener.php} | 6 +- .../Listener/AbstractRequestListener.php} | 6 +- .../Listener/AbstractTerminateListener.php} | 6 +- .../Listener}/AccessLogListener.php | 6 +- .../ApplicationStateCheckListener.php | 14 +-- .../ApplicationStateInitListener.php | 10 +- .../ApplicationStateResetListener.php | 10 +- .../Listener}/StaticPhpFileListener.php | 4 +- .../Listener}/SwooleDdListener.php | 6 +- .../Listener}/TrustedProxiesListener.php | 4 +- .../Resetter}/AbstractAppStateResetter.php | 3 +- .../Resetter}/AppStateResetterInterface.php | 2 +- .../SymfonyServicesAppStateResetter.php | 3 +- .../Runner}/EasySwooleRunner.php | 24 ++--- .../Runtime/EasySwooleRuntime.php | 17 ++-- .../SwooleTableColumnDefinition.php | 4 +- .../Checker}/ManagersChecker.php | 4 +- .../Client/PdoClient.php} | 6 +- .../ClientConfig/PdoClientConfig.php} | 4 +- .../Connection}/DbalConnection.php | 12 ++- .../PDO => Doctrine/Driver}/DbalDriver.php | 18 ++-- .../Enum/CoroutinePdoDriverOption.php | 2 +- .../Factory}/CoroutineConnectionFactory.php | 3 +- .../Factory/PdoClientFactory.php} | 9 +- .../ManagerConnectionsInitializer.php | 4 +- .../Pool/PdoClientPool.php} | 15 +-- .../Resetter}/ManagersResetter.php | 4 +- .../PDO => Doctrine/Result}/DbalResult.php | 2 +- .../DatabaseSessionHandler.php | 2 +- .../Statement}/DbalStatement.php | 3 +- .../AdminContextAsTwigGlobalListener.php | 2 +- .../Resetter}/BatchProcessorResetter.php | 4 +- .../SwooleWorkerIdClientConfigurator.php} | 8 +- .../Processor/SwooleWorkerIdProcessor.php} | 8 +- .../Runner}/EasyScheduleSwooleRunner.php | 14 +-- .../Interfaces/RequestAttributesInterface.php | 15 --- .../Exception}/SwooleDdException.php | 2 +- .../Factory}/MonologLoggerFactory.php | 2 +- .../HttpFoundationAccessLogFormatter.php | 9 +- ...pFoundationAccessLogFormatterInterface.php | 2 +- .../Formatter}/SimpleFormatter.php | 2 +- .../functions => Logging/Function}/dump.php | 4 +- .../Helper}/OutputHelper.php | 4 +- .../Helper}/VarDumpHelper.php | 2 +- .../Symfony/Fixtures/config/default.yaml | 3 - .../tests/Fixture/config/default.php | 11 +++ .../tests/Helpers/FunctionHelperTest.php | 15 --- .../tests/Helpers/OutputHelperTest.php | 18 ---- .../Stubs => Stub/Kernel}/KernelStub.php | 7 +- .../Service}/ServicesResetterStub.php | 2 +- .../AbstractUnitTestCase.php} | 6 +- .../bundle}/AbstractSymfonyTestCase.php | 8 +- .../bundle}/ConfigurationTest.php | 6 +- .../bundle/EasySwooleBundleTest.php} | 10 +- .../src/Common/Helper}/EnvVarHelperTest.php | 10 +- .../src/Common/Helper/FunctionHelperTest.php | 15 +++ .../src/Common/Helper}/OptionHelperTest.php | 8 +- .../src/Logging/Helper/OutputHelperTest.php | 18 ++++ packages/EasyTest/composer.json | 2 +- quality/ecs.php | 2 +- quality/phpstan.neon | 23 +++-- 105 files changed, 486 insertions(+), 436 deletions(-) rename packages/EasySwoole/{src/Bridge/Symfony/DependencyInjection/Compiler/AddDoctrineDbalConnectionNameToParamsPass.php => bundle/CompilerPass/AddDoctrineDbalConnectionNameToParamsCompilerPass.php} (86%) rename packages/EasySwoole/{src/Bridge/Symfony/DependencyInjection/Compiler/EasyErrorHandlerPublicPass.php => bundle/CompilerPass/EasyErrorHandlerPublicCompilerPass.php} (84%) rename packages/EasySwoole/{src/Bridge/Symfony/DependencyInjection/Compiler/ResetEasyBatchProcessorPass.php => bundle/CompilerPass/ResetEasyBatchProcessorCompilerPass.php} (63%) rename packages/EasySwoole/{src/Bridge/Symfony/DependencyInjection/Compiler/SymfonyServicesResetPass.php => bundle/CompilerPass/SymfonyServicesResetCompilerPass.php} (85%) rename packages/EasySwoole/{src/Bridge/Symfony/EasySwooleSymfonyBundle.php => bundle/EasySwooleBundle.php} (50%) create mode 100644 packages/EasySwoole/bundle/Enum/ConfigParam.php create mode 100644 packages/EasySwoole/bundle/Enum/ConfigServiceId.php create mode 100644 packages/EasySwoole/bundle/Enum/ConfigTag.php rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/access_log.php (57%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/definition.php (100%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/doctrine.php (55%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/doctrine_coroutine_pdo.php (63%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/easy_admin.php (85%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources/config/easy_logging.php => bundle/config/easy_bugsnag.php} (66%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources/config/easy_bugsnag.php => bundle/config/easy_logging.php} (70%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/request_limits.php (55%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/reset_services.php (80%) rename packages/EasySwoole/{src/Bridge/Symfony/Resources => bundle}/config/services.php (59%) create mode 100644 packages/EasySwoole/bundle/config/static_php_files.php delete mode 100644 packages/EasySwoole/src/Bridge/BridgeConstantsInterface.php delete mode 100644 packages/EasySwoole/src/Bridge/Symfony/Resources/config/static_php_files.php rename packages/EasySwoole/src/{Bridge/Symfony/Cache => Caching/Adapter}/SwooleTableAdapter.php (97%) rename packages/EasySwoole/src/{Bridge/Symfony/Cache => Caching/Factory}/SwooleTableAdapterFactory.php (82%) rename packages/EasySwoole/src/{Helpers => Caching/Helper}/AppCacheWarmupHelper.php (92%) rename packages/EasySwoole/src/{Helpers => Caching/Helper}/CacheTableHelper.php (95%) rename packages/EasySwoole/src/{AppStateCheckers => Common/Checker}/AbstractAppStateChecker.php (74%) rename packages/EasySwoole/src/{Interfaces => Common/Checker}/AppStateCheckerInterface.php (83%) rename packages/EasySwoole/src/{AppStateCheckers => Common/Checker}/RequestLimitsChecker.php (93%) create mode 100644 packages/EasySwoole/src/Common/Enum/RequestAttribute.php rename packages/EasySwoole/src/{Enums => Common/Enum}/SwooleTableColumnType.php (75%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/AppRuntimeHelper.php (96%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/EasySwooleEnabledHelper.php (65%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/EnvVarHelper.php (96%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/ErrorResponseHelper.php (96%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/FunctionHelper.php (90%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/HttpFoundationHelper.php (99%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/OptionHelper.php (98%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/SslCertificateHelper.php (98%) rename packages/EasySwoole/src/{Helpers => Common/Helper}/SwooleTableHelper.php (87%) rename packages/EasySwoole/src/{AppStateInitializers => Common/Initializer}/AbstractAppStateInitializer.php (73%) rename packages/EasySwoole/src/{Interfaces => Common/Initializer}/AppStateInitializerInterface.php (81%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners/AbstractExceptionEventListener.php => Common/Listener/AbstractExceptionListener.php} (71%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners/AbstractRequestEventListener.php => Common/Listener/AbstractRequestListener.php} (71%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners/AbstractTerminateEventListener.php => Common/Listener/AbstractTerminateListener.php} (71%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/AccessLogListener.php (79%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/ApplicationStateCheckListener.php (72%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/ApplicationStateInitListener.php (70%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/ApplicationStateResetListener.php (71%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/StaticPhpFileListener.php (92%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/SwooleDdListener.php (75%) rename packages/EasySwoole/src/{Bridge/Symfony/Listeners => Common/Listener}/TrustedProxiesListener.php (92%) rename packages/EasySwoole/src/{AppStateResetters => Common/Resetter}/AbstractAppStateResetter.php (74%) rename packages/EasySwoole/src/{Interfaces => Common/Resetter}/AppStateResetterInterface.php (81%) rename packages/EasySwoole/src/{Bridge/Symfony/AppStateResetters => Common/Resetter}/SymfonyServicesAppStateResetter.php (93%) rename packages/EasySwoole/src/{Runtime => Common/Runner}/EasySwooleRunner.php (93%) rename packages/EasySwoole/src/{ => Common}/Runtime/EasySwooleRuntime.php (91%) rename packages/EasySwoole/src/{ValueObjects => Common/ValueObject}/SwooleTableColumnDefinition.php (71%) rename packages/EasySwoole/src/{Bridge/Doctrine/Orm => Doctrine/Checker}/ManagersChecker.php (85%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO/PDOClient.php => Doctrine/Client/PdoClient.php} (92%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO/PDOClientConfig.php => Doctrine/ClientConfig/PdoClientConfig.php} (86%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO => Doctrine/Connection}/DbalConnection.php (89%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO => Doctrine/Driver}/DbalDriver.php (84%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine => Doctrine}/Enum/CoroutinePdoDriverOption.php (86%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO => Doctrine/Factory}/CoroutineConnectionFactory.php (96%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO/PDOClientFactory.php => Doctrine/Factory/PdoClientFactory.php} (53%) rename packages/EasySwoole/src/{Bridge/Doctrine/Orm => Doctrine/Initializer}/ManagerConnectionsInitializer.php (94%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO/PDOClientPool.php => Doctrine/Pool/PdoClientPool.php} (86%) rename packages/EasySwoole/src/{Bridge/Doctrine/Orm => Doctrine/Resetter}/ManagersResetter.php (87%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO => Doctrine/Result}/DbalResult.php (97%) rename packages/EasySwoole/src/{Bridge/Doctrine/Orm => Doctrine/SessionHandler}/DatabaseSessionHandler.php (98%) rename packages/EasySwoole/src/{Bridge/Doctrine/Coroutine/PDO => Doctrine/Statement}/DbalStatement.php (94%) rename packages/EasySwoole/src/{Bridge/EasyAdmin => EasyAdmin/Listener}/AdminContextAsTwigGlobalListener.php (94%) rename packages/EasySwoole/src/{Bridge/EasyBatch => EasyBatch/Resetter}/BatchProcessorResetter.php (79%) rename packages/EasySwoole/src/{Bridge/EasyBugsnag/SwooleWorkerIdConfigurator.php => EasyBugsnag/Configurator/SwooleWorkerIdClientConfigurator.php} (77%) rename packages/EasySwoole/src/{Bridge/EasyLogging/SwooleWorkerIdProcessorConfigProvider.php => EasyLogging/Processor/SwooleWorkerIdProcessor.php} (67%) rename packages/EasySwoole/src/{Bridge/EasySchedule => EasySchedule/Runner}/EasyScheduleSwooleRunner.php (84%) delete mode 100644 packages/EasySwoole/src/Interfaces/RequestAttributesInterface.php rename packages/EasySwoole/src/{Exceptions => Logging/Exception}/SwooleDdException.php (71%) rename packages/EasySwoole/src/{AccessLog => Logging/Factory}/MonologLoggerFactory.php (91%) rename packages/EasySwoole/src/{AccessLog => Logging/Formatter}/HttpFoundationAccessLogFormatter.php (76%) rename packages/EasySwoole/src/{Interfaces => Logging/Formatter}/HttpFoundationAccessLogFormatterInterface.php (85%) rename packages/EasySwoole/src/{Bridge/Monolog => Logging/Formatter}/SimpleFormatter.php (92%) rename packages/EasySwoole/src/{Resources/functions => Logging/Function}/dump.php (79%) rename packages/EasySwoole/src/{Helpers => Logging/Helper}/OutputHelper.php (92%) rename packages/EasySwoole/src/{Helpers => Logging/Helper}/VarDumpHelper.php (96%) delete mode 100644 packages/EasySwoole/tests/Bridge/Symfony/Fixtures/config/default.yaml create mode 100644 packages/EasySwoole/tests/Fixture/config/default.php delete mode 100644 packages/EasySwoole/tests/Helpers/FunctionHelperTest.php delete mode 100644 packages/EasySwoole/tests/Helpers/OutputHelperTest.php rename packages/EasySwoole/tests/{Bridge/Symfony/Stubs => Stub/Kernel}/KernelStub.php (90%) rename packages/EasySwoole/tests/{Bridge/Symfony/Stubs => Stub/Service}/ServicesResetterStub.php (77%) rename packages/EasySwoole/tests/{AbstractTestCase.php => Unit/AbstractUnitTestCase.php} (77%) rename packages/EasySwoole/tests/{Bridge/Symfony => Unit/bundle}/AbstractSymfonyTestCase.php (68%) rename packages/EasySwoole/tests/{Bridge/Symfony => Unit/bundle}/ConfigurationTest.php (96%) rename packages/EasySwoole/tests/{Bridge/Symfony/EasySwooleSymfonyBundleTest.php => Unit/bundle/EasySwooleBundleTest.php} (55%) rename packages/EasySwoole/tests/{Helpers => Unit/src/Common/Helper}/EnvVarHelperTest.php (88%) create mode 100644 packages/EasySwoole/tests/Unit/src/Common/Helper/FunctionHelperTest.php rename packages/EasySwoole/tests/{Helpers => Unit/src/Common/Helper}/OptionHelperTest.php (94%) create mode 100644 packages/EasySwoole/tests/Unit/src/Logging/Helper/OutputHelperTest.php diff --git a/composer.json b/composer.json index 06494931ca..94dbb65613 100644 --- a/composer.json +++ b/composer.json @@ -121,6 +121,7 @@ "EonX\\EasySchedule\\": "packages/EasySchedule/src", "EonX\\EasySecurity\\": "packages/EasySecurity/src", "EonX\\EasySwoole\\": "packages/EasySwoole/src", + "EonX\\EasySwoole\\Bundle\\": "packages/EasySwoole/bundle", "EonX\\EasyTemplatingBlock\\": "packages/EasyTemplatingBlock/src", "EonX\\EasyTest\\": "packages/EasyTest/src", "EonX\\EasyUtils\\": "packages/EasyUtils/src", @@ -167,6 +168,8 @@ "EonX\\EasySchedule\\Tests\\": "packages/EasySchedule/tests", "EonX\\EasySecurity\\Tests\\": "packages/EasySecurity/tests", "EonX\\EasySwoole\\Tests\\": "packages/EasySwoole/tests", + "EonX\\EasySwoole\\Tests\\Unit\\": "packages/EasySwoole/tests/Unit/src", + "EonX\\EasySwoole\\Tests\\Unit\\Bundle\\": "packages/EasySwoole/tests/Unit/bundle", "EonX\\EasyTemplatingBlock\\Tests\\": "packages/EasyTemplatingBlock/tests", "EonX\\EasyTest\\Tests\\": "packages/EasyTest/tests", "EonX\\EasyUtils\\Tests\\": "packages/EasyUtils/tests", diff --git a/packages/EasyHttpClient/composer.json b/packages/EasyHttpClient/composer.json index b734660e28..ea7377d5a1 100644 --- a/packages/EasyHttpClient/composer.json +++ b/packages/EasyHttpClient/composer.json @@ -21,7 +21,7 @@ "mockery/mockery": "^1.6", "phpunit/phpunit": "^10.2", "symfony/amazon-sqs-messenger": "^6.4", - "symfony/contracts": "^3.4", + "symfony/contracts": "^3.5", "symfony/symfony": "^6.4" }, "autoload": { diff --git a/packages/EasySwoole/src/Bridge/Symfony/DependencyInjection/Compiler/AddDoctrineDbalConnectionNameToParamsPass.php b/packages/EasySwoole/bundle/CompilerPass/AddDoctrineDbalConnectionNameToParamsCompilerPass.php similarity index 86% rename from packages/EasySwoole/src/Bridge/Symfony/DependencyInjection/Compiler/AddDoctrineDbalConnectionNameToParamsPass.php rename to packages/EasySwoole/bundle/CompilerPass/AddDoctrineDbalConnectionNameToParamsCompilerPass.php index 314cb641a4..a5aa427932 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/DependencyInjection/Compiler/AddDoctrineDbalConnectionNameToParamsPass.php +++ b/packages/EasySwoole/bundle/CompilerPass/AddDoctrineDbalConnectionNameToParamsCompilerPass.php @@ -1,16 +1,16 @@ setArgument('$batchProcessor', new Reference(BatchProcessor::class)) - ->addTag(BridgeConstantsInterface::TAG_APP_STATE_RESETTER); + ->addTag(ConfigTag::AppStateResetter->value); $container->setDefinition(BatchProcessorResetter::class, $def); } private function isEnabled(ContainerBuilder $container): bool { - return $container->hasParameter(BridgeConstantsInterface::PARAM_RESET_EASY_BATCH_PROCESSOR) - && $container->getParameter(BridgeConstantsInterface::PARAM_RESET_EASY_BATCH_PROCESSOR); + return $container->hasParameter(ConfigParam::ResetEasyBatchProcessor->value) + && $container->getParameter(ConfigParam::ResetEasyBatchProcessor->value); } } diff --git a/packages/EasySwoole/src/Bridge/Symfony/DependencyInjection/Compiler/SymfonyServicesResetPass.php b/packages/EasySwoole/bundle/CompilerPass/SymfonyServicesResetCompilerPass.php similarity index 85% rename from packages/EasySwoole/src/Bridge/Symfony/DependencyInjection/Compiler/SymfonyServicesResetPass.php rename to packages/EasySwoole/bundle/CompilerPass/SymfonyServicesResetCompilerPass.php index 104efbad4c..e2a6efbd58 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/DependencyInjection/Compiler/SymfonyServicesResetPass.php +++ b/packages/EasySwoole/bundle/CompilerPass/SymfonyServicesResetCompilerPass.php @@ -1,14 +1,14 @@ BridgeConstantsInterface::PARAM_ACCESS_LOG_DO_NOT_LOG_PATHS, - 'timezone' => BridgeConstantsInterface::PARAM_ACCESS_LOG_TIMEZONE, + 'do_not_log_paths' => ConfigParam::AccessLogDoNotLogPaths, + 'timezone' => ConfigParam::AccessLogTimezone, ]; private const DOCTRINE_CONFIG = [ - 'reset_dbal_connections' => BridgeConstantsInterface::PARAM_RESET_DOCTRINE_DBAL_CONNECTIONS, + 'reset_dbal_connections' => ConfigParam::ResetDoctrineDbalConnections, ]; private const DOCTRINE_COROUTINE_PDO_CONFIG = [ - 'default_heartbeat' => BridgeConstantsInterface::PARAM_DOCTRINE_COROUTINE_PDO_DEFAULT_HEARTBEAT, - 'default_max_idle_time' => BridgeConstantsInterface::PARAM_DOCTRINE_COROUTINE_PDO_DEFAULT_MAX_IDLE_TIME, - 'default_pool_size' => BridgeConstantsInterface::PARAM_DOCTRINE_COROUTINE_PDO_DEFAULT_POOL_SIZE, + 'default_heartbeat' => ConfigParam::DoctrineCoroutinePdoDefaultHeartbeat, + 'default_max_idle_time' => ConfigParam::DoctrineCoroutinePdoDefaultMaxIdleTime, + 'default_pool_size' => ConfigParam::DoctrineCoroutinePdoDefaultPoolSize, ]; private const EASY_BATCH_CONFIG = [ - 'reset_batch_processor' => BridgeConstantsInterface::PARAM_RESET_EASY_BATCH_PROCESSOR, + 'reset_batch_processor' => ConfigParam::ResetEasyBatchProcessor, ]; private const REQUEST_LIMITS_CONFIG = [ - 'max' => BridgeConstantsInterface::PARAM_REQUEST_LIMITS_MAX, - 'min' => BridgeConstantsInterface::PARAM_REQUEST_LIMITS_MIN, + 'max' => ConfigParam::RequestLimitsMax, + 'min' => ConfigParam::RequestLimitsMin, ]; private const STATIC_PHP_FILES_CONFIG = [ - 'allowed_dirs' => BridgeConstantsInterface::PARAM_STATIC_PHP_FILES_ALLOWED_DIRS, - 'allowed_filenames' => BridgeConstantsInterface::PARAM_STATIC_PHP_FILES_ALLOWED_FILENAMES, + 'allowed_dirs' => ConfigParam::StaticPhpFilesAllowedDirs, + 'allowed_filenames' => ConfigParam::StaticPhpFilesAllowedFilenames, ]; - protected string $extensionAlias = 'easy_swoole'; - public function __construct() { $this->path = \realpath(__DIR__); @@ -62,107 +61,107 @@ public function __construct() public function build(ContainerBuilder $container): void { $container - ->addCompilerPass(new AddDoctrineDbalConnectionNameToParamsPass()) - ->addCompilerPass(new EasyErrorHandlerPublicPass()) - ->addCompilerPass(new ResetEasyBatchProcessorPass()) - ->addCompilerPass(new SymfonyServicesResetPass(), priority: -33); + ->addCompilerPass(new AddDoctrineDbalConnectionNameToParamsCompilerPass()) + ->addCompilerPass(new EasyErrorHandlerPublicCompilerPass()) + ->addCompilerPass(new ResetEasyBatchProcessorCompilerPass()) + ->addCompilerPass(new SymfonyServicesResetCompilerPass(), priority: -33); } public function configure(DefinitionConfigurator $definition): void { - $definition->import(__DIR__ . '/Resources/config/definition.php'); + $definition->import('config/definition.php'); } public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void { - $container->import(__DIR__ . '/Resources/config/services.php'); + $container->import('config/services.php'); $builder ->registerForAutoconfiguration(AppStateCheckerInterface::class) - ->addTag(BridgeConstantsInterface::TAG_APP_STATE_CHECKER); + ->addTag(ConfigTag::AppStateChecker->value); $builder ->registerForAutoconfiguration(AppStateInitializerInterface::class) - ->addTag(BridgeConstantsInterface::TAG_APP_STATE_INITIALIZER); + ->addTag(ConfigTag::AppStateInitializer->value); $builder ->registerForAutoconfiguration(AppStateResetterInterface::class) - ->addTag(BridgeConstantsInterface::TAG_APP_STATE_RESETTER); + ->addTag(ConfigTag::AppStateResetter->value); if ($config['access_log']['enabled'] ?? true) { foreach (self::ACCESS_LOG_CONFIG as $configName => $param) { $container ->parameters() - ->set($param, $config['access_log'][$configName]); + ->set($param->value, $config['access_log'][$configName]); } - $container->import(__DIR__ . '/Resources/config/access_log.php'); + $container->import('config/access_log.php'); } if (($config['doctrine']['enabled'] ?? true) && \interface_exists(ManagerRegistry::class)) { foreach (self::DOCTRINE_CONFIG as $configName => $param) { $container ->parameters() - ->set($param, $config['doctrine'][$configName]); + ->set($param->value, $config['doctrine'][$configName]); } if ($config['doctrine']['coroutine_pdo']['enabled'] ?? false) { foreach (self::DOCTRINE_COROUTINE_PDO_CONFIG as $configName => $param) { $container ->parameters() - ->set($param, $config['doctrine']['coroutine_pdo'][$configName]); + ->set($param->value, $config['doctrine']['coroutine_pdo'][$configName]); } - $container->import(__DIR__ . '/Resources/config/doctrine_coroutine_pdo.php'); + $container->import('config/doctrine_coroutine_pdo.php'); } - $container->import(__DIR__ . '/Resources/config/doctrine.php'); + $container->import('config/doctrine.php'); } if (($config['easy_admin']['enabled'] ?? true) && \class_exists(EA::class)) { - $container->import(__DIR__ . '/Resources/config/easy_admin.php'); + $container->import('config/easy_admin.php'); } if ($config['easy_batch']['enabled'] ?? true) { foreach (self::EASY_BATCH_CONFIG as $configName => $param) { $container ->parameters() - ->set($param, $config['easy_batch'][$configName]); + ->set($param->value, $config['easy_batch'][$configName]); } } if (($config['easy_bugsnag']['enabled'] ?? true) && \interface_exists(ClientConfiguratorInterface::class)) { - $container->import(__DIR__ . '/Resources/config/easy_bugsnag.php'); + $container->import('config/easy_bugsnag.php'); } if (($config['easy_logging']['enabled'] ?? true) && \interface_exists(ProcessorConfigProviderInterface::class)) { - $container->import(__DIR__ . '/Resources/config/easy_logging.php'); + $container->import('config/easy_logging.php'); } if ($config['request_limits']['enabled'] ?? true) { foreach (self::REQUEST_LIMITS_CONFIG as $configName => $param) { $container ->parameters() - ->set($param, $config['request_limits'][$configName]); + ->set($param->value, $config['request_limits'][$configName]); } - $container->import(__DIR__ . '/Resources/config/request_limits.php'); + $container->import('config/request_limits.php'); } if (($config['reset_services']['enabled'] ?? true) && \interface_exists(ResetInterface::class)) { - $container->import(__DIR__ . '/Resources/config/reset_services.php'); + $container->import('config/reset_services.php'); } if ($config['static_php_files']['enabled'] ?? false) { foreach (self::STATIC_PHP_FILES_CONFIG as $configName => $param) { $container ->parameters() - ->set($param, $config['static_php_files'][$configName]); + ->set($param->value, $config['static_php_files'][$configName]); } - $container->import(__DIR__ . '/Resources/config/static_php_files.php'); + $container->import('config/static_php_files.php'); } } } diff --git a/packages/EasySwoole/bundle/Enum/ConfigParam.php b/packages/EasySwoole/bundle/Enum/ConfigParam.php new file mode 100644 index 0000000000..6413a8dd33 --- /dev/null +++ b/packages/EasySwoole/bundle/Enum/ConfigParam.php @@ -0,0 +1,29 @@ +value; $services ->set(MonologLoggerFactory::class) - ->arg('$timezone', param(BridgeConstantsInterface::PARAM_ACCESS_LOG_TIMEZONE)); + ->arg('$timezone', param(ConfigParam::AccessLogTimezone->value)); $services - ->set(BridgeConstantsInterface::SERVICE_ACCESS_LOG_LOGGER, LoggerInterface::class) + ->set($loggerServiceId, LoggerInterface::class) ->factory([service(MonologLoggerFactory::class), 'create']); } @@ -39,6 +40,6 @@ $services ->set(AccessLogListener::class) ->arg('$logger', service($loggerServiceId)) - ->arg('$doNotLogPaths', param(BridgeConstantsInterface::PARAM_ACCESS_LOG_DO_NOT_LOG_PATHS)) + ->arg('$doNotLogPaths', param(ConfigParam::AccessLogDoNotLogPaths->value)) ->tag('kernel.event_listener'); }; diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/definition.php b/packages/EasySwoole/bundle/config/definition.php similarity index 100% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/definition.php rename to packages/EasySwoole/bundle/config/definition.php diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/doctrine.php b/packages/EasySwoole/bundle/config/doctrine.php similarity index 55% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/doctrine.php rename to packages/EasySwoole/bundle/config/doctrine.php index fbe9d7d7e2..261794cb3c 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/doctrine.php +++ b/packages/EasySwoole/bundle/config/doctrine.php @@ -3,10 +3,10 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\Bridge\BridgeConstantsInterface; -use EonX\EasySwoole\Bridge\Doctrine\Orm\ManagerConnectionsInitializer; -use EonX\EasySwoole\Bridge\Doctrine\Orm\ManagersChecker; -use EonX\EasySwoole\Bridge\Doctrine\Orm\ManagersResetter; +use EonX\EasySwoole\Bundle\Enum\ConfigParam; +use EonX\EasySwoole\Doctrine\Checker\ManagersChecker; +use EonX\EasySwoole\Doctrine\Initializer\ManagerConnectionsInitializer; +use EonX\EasySwoole\Doctrine\Resetter\ManagersResetter; return static function (ContainerConfigurator $container): void { $services = $container->services(); @@ -20,5 +20,5 @@ $services ->set(ManagersResetter::class) - ->arg('$resetDbalConnections', param(BridgeConstantsInterface::PARAM_RESET_DOCTRINE_DBAL_CONNECTIONS)); + ->arg('$resetDbalConnections', param(ConfigParam::ResetDoctrineDbalConnections->value)); }; diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/doctrine_coroutine_pdo.php b/packages/EasySwoole/bundle/config/doctrine_coroutine_pdo.php similarity index 63% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/doctrine_coroutine_pdo.php rename to packages/EasySwoole/bundle/config/doctrine_coroutine_pdo.php index 8fec035497..05a8ad82c9 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/doctrine_coroutine_pdo.php +++ b/packages/EasySwoole/bundle/config/doctrine_coroutine_pdo.php @@ -4,8 +4,8 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use EonX\EasyDoctrine\Bridge\AwsRds\AwsRdsConnectionParamsResolver; -use EonX\EasySwoole\Bridge\BridgeConstantsInterface; -use EonX\EasySwoole\Bridge\Doctrine\Coroutine\PDO\CoroutineConnectionFactory; +use EonX\EasySwoole\Bundle\Enum\ConfigParam; +use EonX\EasySwoole\Doctrine\Factory\CoroutineConnectionFactory; use Psr\Log\LoggerInterface; use Symfony\Component\HttpFoundation\RequestStack; @@ -19,12 +19,9 @@ ->set(CoroutineConnectionFactory::class) ->decorate('doctrine.dbal.connection_factory', priority: -1000) // Make sure it's the last decoration ->arg('$requestStack', service(RequestStack::class)) - ->arg('$defaultPoolSize', param(BridgeConstantsInterface::PARAM_DOCTRINE_COROUTINE_PDO_DEFAULT_POOL_SIZE)) - ->arg('$defaultHeartbeat', param(BridgeConstantsInterface::PARAM_DOCTRINE_COROUTINE_PDO_DEFAULT_HEARTBEAT)) - ->arg( - '$defaultMaxIdleTime', - param(BridgeConstantsInterface::PARAM_DOCTRINE_COROUTINE_PDO_DEFAULT_MAX_IDLE_TIME) - ) + ->arg('$defaultPoolSize', param(ConfigParam::DoctrineCoroutinePdoDefaultPoolSize->value)) + ->arg('$defaultHeartbeat', param(ConfigParam::DoctrineCoroutinePdoDefaultHeartbeat->value)) + ->arg('$defaultMaxIdleTime', param(ConfigParam::DoctrineCoroutinePdoDefaultMaxIdleTime->value)) ->arg('$factory', service('.inner')) ->arg('$connectionParamsResolver', service(AwsRdsConnectionParamsResolver::class)->nullOnInvalid()) ->arg('$logger', service(LoggerInterface::class)->nullOnInvalid()); diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_admin.php b/packages/EasySwoole/bundle/config/easy_admin.php similarity index 85% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_admin.php rename to packages/EasySwoole/bundle/config/easy_admin.php index ce4da289eb..03a3fe377d 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_admin.php +++ b/packages/EasySwoole/bundle/config/easy_admin.php @@ -3,7 +3,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\Bridge\EasyAdmin\AdminContextAsTwigGlobalListener; +use EonX\EasySwoole\EasyAdmin\Listener\AdminContextAsTwigGlobalListener; return static function (ContainerConfigurator $container): void { $services = $container->services(); diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_logging.php b/packages/EasySwoole/bundle/config/easy_bugsnag.php similarity index 66% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_logging.php rename to packages/EasySwoole/bundle/config/easy_bugsnag.php index 2bb5a6490f..a596e68ca4 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_logging.php +++ b/packages/EasySwoole/bundle/config/easy_bugsnag.php @@ -3,7 +3,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\Bridge\EasyLogging\SwooleWorkerIdProcessorConfigProvider; +use EonX\EasySwoole\EasyBugsnag\Configurator\SwooleWorkerIdClientConfigurator; return static function (ContainerConfigurator $container): void { $services = $container->services(); @@ -11,5 +11,5 @@ ->autoconfigure() ->autowire(); - $services->set(SwooleWorkerIdProcessorConfigProvider::class); + $services->set(SwooleWorkerIdClientConfigurator::class); }; diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_bugsnag.php b/packages/EasySwoole/bundle/config/easy_logging.php similarity index 70% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_bugsnag.php rename to packages/EasySwoole/bundle/config/easy_logging.php index f036192c83..bf07354646 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/easy_bugsnag.php +++ b/packages/EasySwoole/bundle/config/easy_logging.php @@ -3,7 +3,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\Bridge\EasyBugsnag\SwooleWorkerIdConfigurator; +use EonX\EasySwoole\EasyLogging\Processor\SwooleWorkerIdProcessor; return static function (ContainerConfigurator $container): void { $services = $container->services(); @@ -11,5 +11,5 @@ ->autoconfigure() ->autowire(); - $services->set(SwooleWorkerIdConfigurator::class); + $services->set(SwooleWorkerIdProcessor::class); }; diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/request_limits.php b/packages/EasySwoole/bundle/config/request_limits.php similarity index 55% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/request_limits.php rename to packages/EasySwoole/bundle/config/request_limits.php index fd8335787a..834d63bd05 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/request_limits.php +++ b/packages/EasySwoole/bundle/config/request_limits.php @@ -3,8 +3,8 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\AppStateCheckers\RequestLimitsChecker; -use EonX\EasySwoole\Bridge\BridgeConstantsInterface; +use EonX\EasySwoole\Bundle\Enum\ConfigParam; +use EonX\EasySwoole\Common\Checker\RequestLimitsChecker; return static function (ContainerConfigurator $container): void { $services = $container->services(); @@ -14,6 +14,6 @@ $services ->set(RequestLimitsChecker::class) - ->arg('$min', param(BridgeConstantsInterface::PARAM_REQUEST_LIMITS_MIN)) - ->arg('$max', param(BridgeConstantsInterface::PARAM_REQUEST_LIMITS_MAX)); + ->arg('$min', param(ConfigParam::RequestLimitsMin->value)) + ->arg('$max', param(ConfigParam::RequestLimitsMax->value)); }; diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/reset_services.php b/packages/EasySwoole/bundle/config/reset_services.php similarity index 80% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/reset_services.php rename to packages/EasySwoole/bundle/config/reset_services.php index 09363185b7..7265cfd7b4 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/reset_services.php +++ b/packages/EasySwoole/bundle/config/reset_services.php @@ -3,7 +3,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\Bridge\Symfony\AppStateResetters\SymfonyServicesAppStateResetter; +use EonX\EasySwoole\Common\Resetter\SymfonyServicesAppStateResetter; return static function (ContainerConfigurator $container): void { $services = $container->services(); diff --git a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/services.php b/packages/EasySwoole/bundle/config/services.php similarity index 59% rename from packages/EasySwoole/src/Bridge/Symfony/Resources/config/services.php rename to packages/EasySwoole/bundle/config/services.php index fbd02a1a0e..beb054d6d8 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Resources/config/services.php +++ b/packages/EasySwoole/bundle/config/services.php @@ -3,13 +3,13 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use EonX\EasySwoole\Bridge\BridgeConstantsInterface; -use EonX\EasySwoole\Bridge\Symfony\Cache\SwooleTableAdapterFactory; -use EonX\EasySwoole\Bridge\Symfony\Listeners\ApplicationStateCheckListener; -use EonX\EasySwoole\Bridge\Symfony\Listeners\ApplicationStateInitListener; -use EonX\EasySwoole\Bridge\Symfony\Listeners\ApplicationStateResetListener; -use EonX\EasySwoole\Bridge\Symfony\Listeners\SwooleDdListener; -use EonX\EasySwoole\Bridge\Symfony\Listeners\TrustedProxiesListener; +use EonX\EasySwoole\Bundle\Enum\ConfigTag; +use EonX\EasySwoole\Caching\Factory\SwooleTableAdapterFactory; +use EonX\EasySwoole\Common\Listener\ApplicationStateCheckListener; +use EonX\EasySwoole\Common\Listener\ApplicationStateInitListener; +use EonX\EasySwoole\Common\Listener\ApplicationStateResetListener; +use EonX\EasySwoole\Common\Listener\SwooleDdListener; +use EonX\EasySwoole\Common\Listener\TrustedProxiesListener; use Psr\Log\LoggerInterface; return static function (ContainerConfigurator $container): void { @@ -20,17 +20,17 @@ $services ->set(ApplicationStateInitListener::class) - ->arg('$appStateInitializers', tagged_iterator(BridgeConstantsInterface::TAG_APP_STATE_INITIALIZER)) + ->arg('$appStateInitializers', tagged_iterator(ConfigTag::AppStateInitializer->value)) ->tag('kernel.event_listener', ['priority' => 50000]); $services ->set(ApplicationStateResetListener::class) - ->arg('$appStateResetters', tagged_iterator(BridgeConstantsInterface::TAG_APP_STATE_RESETTER)) + ->arg('$appStateResetters', tagged_iterator(ConfigTag::AppStateResetter->value)) ->tag('kernel.event_listener', ['priority' => -10000]); $services ->set(ApplicationStateCheckListener::class) - ->arg('$appStateCheckers', tagged_iterator(BridgeConstantsInterface::TAG_APP_STATE_CHECKER)) + ->arg('$appStateCheckers', tagged_iterator(ConfigTag::AppStateChecker->value)) ->arg('$logger', service(LoggerInterface::class)->nullOnInvalid()) ->tag('kernel.event_listener', ['priority' => -10001]); diff --git a/packages/EasySwoole/bundle/config/static_php_files.php b/packages/EasySwoole/bundle/config/static_php_files.php new file mode 100644 index 0000000000..673367ff7b --- /dev/null +++ b/packages/EasySwoole/bundle/config/static_php_files.php @@ -0,0 +1,25 @@ +services(); + $services->defaults() + ->autoconfigure() + ->autowire(); + + $services->set(ConfigServiceId::Filesystem->value, Filesystem::class); + + $services + ->set(StaticPhpFileListener::class) + ->arg('$filesystem', service(ConfigServiceId::Filesystem->value)) + ->arg('$allowedDirs', param(ConfigParam::StaticPhpFilesAllowedDirs->value)) + ->arg('$allowedFilenames', param(ConfigParam::StaticPhpFilesAllowedFilenames->value)) + ->tag('kernel.event_listener', ['priority' => 30000]); +}; diff --git a/packages/EasySwoole/composer.json b/packages/EasySwoole/composer.json index f787eef184..67bc63402d 100644 --- a/packages/EasySwoole/composer.json +++ b/packages/EasySwoole/composer.json @@ -8,32 +8,38 @@ "eonx-com/easy-utils": "^5.12", "nesbot/carbon": "^2.67", "openswoole/core": "^22.1", + "symfony/cache": "^6.4", + "symfony/config": "^6.4", + "symfony/contracts": "^3.5", + "symfony/dependency-injection": "^6.4", "symfony/filesystem": "^6.4", + "symfony/framework-bundle": "^6.4", "symfony/http-foundation": "^6.4", + "symfony/http-kernel": "^6.4", "symfony/runtime": "^6.4", "symfony/string": "^6.4" }, "require-dev": { "eonx-com/easy-bugsnag": "^5.12", "eonx-com/easy-logging": "^5.12", - "monolog/monolog": "^2.9", "openswoole/ide-helper": "^22.0", "phpunit/phpunit": "^10.2", - "psr/log": "^3.0", - "symfony/symfony": "^6.4" + "symfony/twig-bundle": "^6.4" }, "autoload": { "psr-4": { "EonX\\EasySwoole\\": "src", - "EonX\\EasySwoole\\Bridge\\Symfony\\": "src/Bridge/Symfony" + "EonX\\EasySwoole\\Bundle\\": "bundle" }, "files": [ - "src/Resources/functions/dump.php" + "src/Logging/Function/dump.php" ] }, "autoload-dev": { "psr-4": { - "EonX\\EasySwoole\\Tests\\": "tests" + "EonX\\EasySwoole\\Tests\\": "tests", + "EonX\\EasySwoole\\Tests\\Unit\\": "tests/Unit/src", + "EonX\\EasySwoole\\Tests\\Unit\\Bundle\\": "tests/Unit/bundle" } }, "suggest": { @@ -41,17 +47,16 @@ "doctrine/persistence": "To use this package with Doctrine", "easycorp/easyadmin-bundle": "To use this package with EasyAdmin", "eonx-com/easy-batch": "To use this package with EasyBatch", + "eonx-com/easy-bugsnag": "To use this package with EasyBugsnag", + "eonx-com/easy-doctrine": "To use this package with EasyDoctrine", + "eonx-com/easy-error-handler": "To use this package with EasyErrorHandler", + "eonx-com/easy-logging": "To use this package with EasyLogging", "monolog/monolog": "To improve output of EonX\\EasySwoole\\Helpers\\OutputHelper", "nesbot/carbon": "To work with EasySchedule bridge", "psr/log": "To enable access logs", - "symfony/cache": "To use this package with Symfony", - "symfony/cache-contracts": "To use this package with Symfony", - "symfony/config": "To use this package with Symfony", "symfony/console": "To work with EasySchedule bridge", - "symfony/dependency-injection": "To use this package with Symfony", - "symfony/http-kernel": "To work with Symfony HttpKernel", "symfony/process": "To enable hot reload", - "symfony/service-contracts": "To use this package with Symfony", + "symfony/twig-bundle": "To use this package with Twig", "symfony/var-dumper": "To improve output of EonX\\EasySwoole\\Helpers\\VarDumpHelper" }, "config": { diff --git a/packages/EasySwoole/src/Bridge/BridgeConstantsInterface.php b/packages/EasySwoole/src/Bridge/BridgeConstantsInterface.php deleted file mode 100644 index d17c63bc19..0000000000 --- a/packages/EasySwoole/src/Bridge/BridgeConstantsInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -services(); - $services->defaults() - ->autoconfigure() - ->autowire(); - - $services->set(BridgeConstantsInterface::SERVICE_FILESYSTEM, Filesystem::class); - - $services - ->set(StaticPhpFileListener::class) - ->arg('$filesystem', service(BridgeConstantsInterface::SERVICE_FILESYSTEM)) - ->arg('$allowedDirs', param(BridgeConstantsInterface::PARAM_STATIC_PHP_FILES_ALLOWED_DIRS)) - ->arg('$allowedFilenames', param(BridgeConstantsInterface::PARAM_STATIC_PHP_FILES_ALLOWED_FILENAMES)) - ->tag('kernel.event_listener', ['priority' => 30000]); -}; diff --git a/packages/EasySwoole/src/Bridge/Symfony/Cache/SwooleTableAdapter.php b/packages/EasySwoole/src/Caching/Adapter/SwooleTableAdapter.php similarity index 97% rename from packages/EasySwoole/src/Bridge/Symfony/Cache/SwooleTableAdapter.php rename to packages/EasySwoole/src/Caching/Adapter/SwooleTableAdapter.php index 74d0a74183..d02c8cbaab 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Cache/SwooleTableAdapter.php +++ b/packages/EasySwoole/src/Caching/Adapter/SwooleTableAdapter.php @@ -1,9 +1,9 @@ attributes->getBoolean(RequestAttributesInterface::EASY_SWOOLE_ENABLED) === false; + return $request->attributes->getBoolean(RequestAttribute::EasySwooleEnabled->value) === false; } } diff --git a/packages/EasySwoole/src/Helpers/EnvVarHelper.php b/packages/EasySwoole/src/Common/Helper/EnvVarHelper.php similarity index 96% rename from packages/EasySwoole/src/Helpers/EnvVarHelper.php rename to packages/EasySwoole/src/Common/Helper/EnvVarHelper.php index 0486058b76..30dea050cf 100644 --- a/packages/EasySwoole/src/Helpers/EnvVarHelper.php +++ b/packages/EasySwoole/src/Common/Helper/EnvVarHelper.php @@ -1,8 +1,9 @@ $appStateCheckers + * @param iterable<\EonX\EasySwoole\Common\Checker\AppStateCheckerInterface> $appStateCheckers */ public function __construct( iterable $appStateCheckers, @@ -34,7 +34,7 @@ protected function doInvoke(TerminateEvent $event): void foreach ($this->appStateCheckers as $appStateChecker) { if ($appStateChecker->isApplicationStateCompromised()) { - $request->attributes->set(RequestAttributesInterface::EASY_SWOOLE_APP_STATE_COMPROMISED, true); + $request->attributes->set(RequestAttribute::EasySwooleAppStateCompromised->value, true); // If at least one check says the state is compromised, it's enough $this->logger?->debug('Application state compromised, stopping checks', [ diff --git a/packages/EasySwoole/src/Bridge/Symfony/Listeners/ApplicationStateInitListener.php b/packages/EasySwoole/src/Common/Listener/ApplicationStateInitListener.php similarity index 70% rename from packages/EasySwoole/src/Bridge/Symfony/Listeners/ApplicationStateInitListener.php rename to packages/EasySwoole/src/Common/Listener/ApplicationStateInitListener.php index 35b9224ce9..cb746379cf 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Listeners/ApplicationStateInitListener.php +++ b/packages/EasySwoole/src/Common/Listener/ApplicationStateInitListener.php @@ -1,21 +1,21 @@ $appStateInitializers + * @param iterable<\EonX\EasySwoole\Common\Initializer\AppStateInitializerInterface> $appStateInitializers */ public function __construct(iterable $appStateInitializers) { diff --git a/packages/EasySwoole/src/Bridge/Symfony/Listeners/ApplicationStateResetListener.php b/packages/EasySwoole/src/Common/Listener/ApplicationStateResetListener.php similarity index 71% rename from packages/EasySwoole/src/Bridge/Symfony/Listeners/ApplicationStateResetListener.php rename to packages/EasySwoole/src/Common/Listener/ApplicationStateResetListener.php index 485502e8e2..74ed44ac8b 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Listeners/ApplicationStateResetListener.php +++ b/packages/EasySwoole/src/Common/Listener/ApplicationStateResetListener.php @@ -1,21 +1,21 @@ $appStateResetters + * @param iterable<\EonX\EasySwoole\Common\Resetter\AppStateResetterInterface> $appStateResetters */ public function __construct(iterable $appStateResetters) { diff --git a/packages/EasySwoole/src/Bridge/Symfony/Listeners/StaticPhpFileListener.php b/packages/EasySwoole/src/Common/Listener/StaticPhpFileListener.php similarity index 92% rename from packages/EasySwoole/src/Bridge/Symfony/Listeners/StaticPhpFileListener.php rename to packages/EasySwoole/src/Common/Listener/StaticPhpFileListener.php index 5e286d0809..148982b12d 100644 --- a/packages/EasySwoole/src/Bridge/Symfony/Listeners/StaticPhpFileListener.php +++ b/packages/EasySwoole/src/Common/Listener/StaticPhpFileListener.php @@ -1,7 +1,7 @@ attributes->set(RequestAttributesInterface::EASY_SWOOLE_ENABLED, true); + $hfRequest->attributes->set(RequestAttribute::EasySwooleEnabled->value, true); $hfRequest->attributes->set( - RequestAttributesInterface::EASY_SWOOLE_REQUEST_START_TIME, + RequestAttribute::EasySwooleRequestStartTime->value, CarbonImmutable::now('UTC') ); $hfRequest->attributes->set( - RequestAttributesInterface::EASY_SWOOLE_WORKER_ID, + RequestAttribute::EasySwooleWorkerId->value, $server->getWorkerId() ); @@ -100,7 +100,7 @@ static function (Request $request, Response $response) use ($app, $server, $resp } $isAppStateCompromised = $hfRequest->attributes - ->get(RequestAttributesInterface::EASY_SWOOLE_APP_STATE_COMPROMISED, false); + ->get(RequestAttribute::EasySwooleAppStateCompromised->value, false); // Stop worker if app state compromised if ($isAppStateCompromised) { diff --git a/packages/EasySwoole/src/Runtime/EasySwooleRuntime.php b/packages/EasySwoole/src/Common/Runtime/EasySwooleRuntime.php similarity index 91% rename from packages/EasySwoole/src/Runtime/EasySwooleRuntime.php rename to packages/EasySwoole/src/Common/Runtime/EasySwooleRuntime.php index 144ed685b8..0f2abb32a8 100644 --- a/packages/EasySwoole/src/Runtime/EasySwooleRuntime.php +++ b/packages/EasySwoole/src/Common/Runtime/EasySwooleRuntime.php @@ -1,16 +1,17 @@ MySQLDriver::class, @@ -52,7 +52,7 @@ public function triggerLastUsedTime(): void */ protected function makeClient(): void { - /** @var \EonX\EasySwoole\Bridge\Doctrine\Coroutine\PDO\PDOClientConfig $config */ + /** @var \EonX\EasySwoole\Doctrine\ClientConfig\PdoClientConfig $config */ $config = $this->config; $params = $config->getParams(); diff --git a/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/PDOClientConfig.php b/packages/EasySwoole/src/Doctrine/ClientConfig/PdoClientConfig.php similarity index 86% rename from packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/PDOClientConfig.php rename to packages/EasySwoole/src/Doctrine/ClientConfig/PdoClientConfig.php index f7b3621f34..b6636f2d9c 100644 --- a/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/PDOClientConfig.php +++ b/packages/EasySwoole/src/Doctrine/ClientConfig/PdoClientConfig.php @@ -1,13 +1,13 @@ pdo ??= $this->pool->get(); } diff --git a/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/DbalDriver.php b/packages/EasySwoole/src/Doctrine/Driver/DbalDriver.php similarity index 84% rename from packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/DbalDriver.php rename to packages/EasySwoole/src/Doctrine/Driver/DbalDriver.php index 38c87b6c71..d92ab05421 100644 --- a/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/DbalDriver.php +++ b/packages/EasySwoole/src/Doctrine/Driver/DbalDriver.php @@ -1,7 +1,7 @@ requestStack->getCurrentRequest(); - if ($request?->attributes->get(RequestAttributesInterface::EASY_SWOOLE_ENABLED) !== true) { + if ($request?->attributes->get(RequestAttribute::EasySwooleEnabled->value) !== true) { $params = $this->connectionParamsResolver?->getParams($params) ?? $params; return $this->decorated->connect($params); @@ -56,9 +60,9 @@ public function connect(#[SensitiveParameter] array $params): DriverConnection if ($pool === null) { $this->logger?->debug(\sprintf('Coroutine PDO Pool "%s" not found, instantiating new one', $poolName)); - $pool = new PDOClientPool( - factory: new PDOClientFactory(), - config: new PDOClientConfig($params, $this->connectionParamsResolver, $this->logger), + $pool = new PdoClientPool( + factory: new PdoClientFactory(), + config: new PdoClientConfig($params, $this->connectionParamsResolver, $this->logger), size: $poolSize ?? $this->defaultPoolSize, heartbeat: $poolHeartbeat ?? $this->defaultHeartbeat, maxIdleTime: $poolMaxIdleTime ?? $this->defaultMaxIdleTime, diff --git a/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/Enum/CoroutinePdoDriverOption.php b/packages/EasySwoole/src/Doctrine/Enum/CoroutinePdoDriverOption.php similarity index 86% rename from packages/EasySwoole/src/Bridge/Doctrine/Coroutine/Enum/CoroutinePdoDriverOption.php rename to packages/EasySwoole/src/Doctrine/Enum/CoroutinePdoDriverOption.php index 1cbdc68d41..817ccbef00 100644 --- a/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/Enum/CoroutinePdoDriverOption.php +++ b/packages/EasySwoole/src/Doctrine/Enum/CoroutinePdoDriverOption.php @@ -1,7 +1,7 @@ pool->pop(); } - public function put(PDOClient $client): void + public function put(PdoClient $client): void { $this->pool->push($client); } diff --git a/packages/EasySwoole/src/Bridge/Doctrine/Orm/ManagersResetter.php b/packages/EasySwoole/src/Doctrine/Resetter/ManagersResetter.php similarity index 87% rename from packages/EasySwoole/src/Bridge/Doctrine/Orm/ManagersResetter.php rename to packages/EasySwoole/src/Doctrine/Resetter/ManagersResetter.php index 8b178e2b03..d6eefda640 100644 --- a/packages/EasySwoole/src/Bridge/Doctrine/Orm/ManagersResetter.php +++ b/packages/EasySwoole/src/Doctrine/Resetter/ManagersResetter.php @@ -1,11 +1,11 @@ getPipeline() ->pipe(new CallbackBridge(function (Report $report): void { $workerId = $this->requestStack->getCurrentRequest() - ?->attributes->get(RequestAttributesInterface::EASY_SWOOLE_WORKER_ID); + ?->attributes->get(RequestAttribute::EasySwooleWorkerId->value); if (\is_int($workerId)) { $report->addMetaData([ diff --git a/packages/EasySwoole/src/Bridge/EasyLogging/SwooleWorkerIdProcessorConfigProvider.php b/packages/EasySwoole/src/EasyLogging/Processor/SwooleWorkerIdProcessor.php similarity index 67% rename from packages/EasySwoole/src/Bridge/EasyLogging/SwooleWorkerIdProcessorConfigProvider.php rename to packages/EasySwoole/src/EasyLogging/Processor/SwooleWorkerIdProcessor.php index 4bde56c1ea..b3a0da5435 100644 --- a/packages/EasySwoole/src/Bridge/EasyLogging/SwooleWorkerIdProcessorConfigProvider.php +++ b/packages/EasySwoole/src/EasyLogging/Processor/SwooleWorkerIdProcessor.php @@ -1,13 +1,13 @@ requestStack->getCurrentRequest() - ?->attributes->get(RequestAttributesInterface::EASY_SWOOLE_WORKER_ID); + ?->attributes->get(RequestAttribute::EasySwooleWorkerId->value); if (\is_int($workerId)) { $record['context']['X-SWOOLE-WORKER-ID'] = $workerId; diff --git a/packages/EasySwoole/src/Bridge/EasySchedule/EasyScheduleSwooleRunner.php b/packages/EasySwoole/src/EasySchedule/Runner/EasyScheduleSwooleRunner.php similarity index 84% rename from packages/EasySwoole/src/Bridge/EasySchedule/EasyScheduleSwooleRunner.php rename to packages/EasySwoole/src/EasySchedule/Runner/EasyScheduleSwooleRunner.php index 48e811beaa..a74a3a828f 100644 --- a/packages/EasySwoole/src/Bridge/EasySchedule/EasyScheduleSwooleRunner.php +++ b/packages/EasySwoole/src/EasySchedule/Runner/EasyScheduleSwooleRunner.php @@ -1,15 +1,15 @@ headers->get('user-agent', ''), ); - $startTime = $request->attributes->get(RequestAttributesInterface::EASY_SWOOLE_REQUEST_START_TIME); + $startTime = $request->attributes->get(RequestAttribute::EasySwooleRequestStartTime->value); if ($startTime instanceof CarbonImmutable) { $accessLog .= \sprintf( ' - ReceivedAt: %s (%sms)', @@ -33,7 +32,7 @@ public function formatAccessLog(Request $request, Response $response): string ); } - $workerId = $request->attributes->get(RequestAttributesInterface::EASY_SWOOLE_WORKER_ID); + $workerId = $request->attributes->get(RequestAttribute::EasySwooleWorkerId->value); if (\is_int($workerId)) { $accessLog .= \sprintf(' | SwooleWorker: %d', $workerId); } diff --git a/packages/EasySwoole/src/Interfaces/HttpFoundationAccessLogFormatterInterface.php b/packages/EasySwoole/src/Logging/Formatter/HttpFoundationAccessLogFormatterInterface.php similarity index 85% rename from packages/EasySwoole/src/Interfaces/HttpFoundationAccessLogFormatterInterface.php rename to packages/EasySwoole/src/Logging/Formatter/HttpFoundationAccessLogFormatterInterface.php index 28b8e3a48d..096e63e3c6 100644 --- a/packages/EasySwoole/src/Interfaces/HttpFoundationAccessLogFormatterInterface.php +++ b/packages/EasySwoole/src/Logging/Formatter/HttpFoundationAccessLogFormatterInterface.php @@ -1,7 +1,7 @@ doctrine() + ->enabled(false); +}; diff --git a/packages/EasySwoole/tests/Helpers/FunctionHelperTest.php b/packages/EasySwoole/tests/Helpers/FunctionHelperTest.php deleted file mode 100644 index 97edc00281..0000000000 --- a/packages/EasySwoole/tests/Helpers/FunctionHelperTest.php +++ /dev/null @@ -1,15 +0,0 @@ -exists($var)) { $fs->remove($var); diff --git a/packages/EasySwoole/tests/Bridge/Symfony/AbstractSymfonyTestCase.php b/packages/EasySwoole/tests/Unit/bundle/AbstractSymfonyTestCase.php similarity index 68% rename from packages/EasySwoole/tests/Bridge/Symfony/AbstractSymfonyTestCase.php rename to packages/EasySwoole/tests/Unit/bundle/AbstractSymfonyTestCase.php index 0873090852..0be075ed85 100644 --- a/packages/EasySwoole/tests/Bridge/Symfony/AbstractSymfonyTestCase.php +++ b/packages/EasySwoole/tests/Unit/bundle/AbstractSymfonyTestCase.php @@ -1,13 +1,13 @@ processConfiguration( - new Configuration(subject: new EasySwooleSymfonyBundle(), container: null, alias: 'easy_swoole'), + new Configuration(subject: new EasySwooleBundle(), container: null, alias: 'easy_swoole'), $configs ); diff --git a/packages/EasySwoole/tests/Bridge/Symfony/EasySwooleSymfonyBundleTest.php b/packages/EasySwoole/tests/Unit/bundle/EasySwooleBundleTest.php similarity index 55% rename from packages/EasySwoole/tests/Bridge/Symfony/EasySwooleSymfonyBundleTest.php rename to packages/EasySwoole/tests/Unit/bundle/EasySwooleBundleTest.php index 0f2dc3aad7..5b01359967 100644 --- a/packages/EasySwoole/tests/Bridge/Symfony/EasySwooleSymfonyBundleTest.php +++ b/packages/EasySwoole/tests/Unit/bundle/EasySwooleBundleTest.php @@ -1,16 +1,16 @@ getKernel([__DIR__ . '/Fixtures/config/default.yaml']) + $container = $this->getKernel([__DIR__ . '/../../Fixture/config/default.php']) ->getContainer(); self::assertInstanceOf( diff --git a/packages/EasySwoole/tests/Helpers/EnvVarHelperTest.php b/packages/EasySwoole/tests/Unit/src/Common/Helper/EnvVarHelperTest.php similarity index 88% rename from packages/EasySwoole/tests/Helpers/EnvVarHelperTest.php rename to packages/EasySwoole/tests/Unit/src/Common/Helper/EnvVarHelperTest.php index 16df4e0ceb..5ccf59a9f1 100644 --- a/packages/EasySwoole/tests/Helpers/EnvVarHelperTest.php +++ b/packages/EasySwoole/tests/Unit/src/Common/Helper/EnvVarHelperTest.php @@ -1,14 +1,14 @@ [ 'packages/*/src/Bridge/Laravel/config/*', 'packages/*/tests/*', - 'packages/EasySwoole/src/Runtime/EasySwooleRuntime.php', + 'packages/EasySwoole/src/Common/Runtime/EasySwooleRuntime.php', 'packages/EasyUtils/src/CreditCard/CreditCardNumberValidator.php', 'packages/EasyWebhook/src/Bridge/Laravel/EasyWebhookServiceProvider.php', 'quality/ecs.php', diff --git a/quality/phpstan.neon b/quality/phpstan.neon index a258128770..3df7bf3050 100644 --- a/quality/phpstan.neon +++ b/quality/phpstan.neon @@ -162,31 +162,34 @@ parameters: # ---- EasySwoole ---- - message: '#Function swoole_(dd|dump)\(\) has parameter \$vars with no type specified#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Resources/functions/dump.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Logging/Function/dump.php - message: '#Method Swoole\\Server\:\:stop\(\) invoked with 2 parameters, 0\-1 required#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Runtime/EasySwooleRunner.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Common/Runner/EasySwooleRunner.php - message: '#Anonymous function never returns null so it can be removed from the return type#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Runtime/EasySwooleRunner.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Common/Runner/EasySwooleRunner.php - message: '#Else branch is unreachable because ternary operator condition is always true#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Runtime/EasySwooleRunner.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Common/Runner/EasySwooleRunner.php - message: '#Strict comparison using \=\=\= between true and false will always evaluate to false#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Helpers/SwooleTableHelper.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Common/Helper/SwooleTableHelper.php - message: '#Access to undefined constant OpenSwoole\\Constant\:\:SSL#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Helpers/SslCertificateHelper.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Common/Helper/SslCertificateHelper.php - message: '#Call to an undefined method OpenSwoole\\Core\\Coroutine\\Client\\PDOStatementProxy\:\:.*\(\)#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/* + path: %currentWorkingDirectory%/packages/EasySwoole/src/Doctrine/Result/DbalResult.php - - message: '#Call to an undefined method EonX\\EasySwoole\\Bridge\\Doctrine\\Coroutine\\PDO\\PDOClient\:\:.*\(\)#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/* + - message: '#Call to an undefined method OpenSwoole\\Core\\Coroutine\\Client\\PDOStatementProxy\:\:execute\(\)#' + path: %currentWorkingDirectory%/packages/EasySwoole/src/Doctrine/Statement/DbalStatement.php + + - message: '#Call to an undefined method EonX\\EasySwoole\\Doctrine\\Client\\PdoClient\:\:.*\(\)#' + path: %currentWorkingDirectory%/packages/EasySwoole/src/Doctrine/Connection/DbalConnection.php - message: '#While loop condition is always true#' - path: %currentWorkingDirectory%/packages/EasySwoole/src/Bridge/Doctrine/Coroutine/PDO/PDOClientPool.php + path: %currentWorkingDirectory%/packages/EasySwoole/src/Doctrine/Pool/PdoClientPool.php # ---- EasyTemplatingBlock ---- # ---- EasyTest ---- From 27ffbd8965d7cc27ef95d29c55ae90d6d595b754 Mon Sep 17 00:00:00 2001 From: Aleksey Polyvanyi Date: Sun, 23 Jun 2024 13:39:54 +0200 Subject: [PATCH 2/4] -tmp --- packages/EasySwoole/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/EasySwoole/composer.json b/packages/EasySwoole/composer.json index 67bc63402d..0be22adfc2 100644 --- a/packages/EasySwoole/composer.json +++ b/packages/EasySwoole/composer.json @@ -43,7 +43,7 @@ } }, "suggest": { - "doctrine/orm": "To use this package with Doctrine", + "doctrine/orm": "To use this package with Doctrine", "doctrine/persistence": "To use this package with Doctrine", "easycorp/easyadmin-bundle": "To use this package with EasyAdmin", "eonx-com/easy-batch": "To use this package with EasyBatch", From c35cd13b41071da7fffac67281e7875d503f9c47 Mon Sep 17 00:00:00 2001 From: Aleksey Polyvanyi Date: Sun, 23 Jun 2024 13:40:02 +0200 Subject: [PATCH 3/4] -cleanup --- packages/EasySwoole/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/EasySwoole/composer.json b/packages/EasySwoole/composer.json index 0be22adfc2..67bc63402d 100644 --- a/packages/EasySwoole/composer.json +++ b/packages/EasySwoole/composer.json @@ -43,7 +43,7 @@ } }, "suggest": { - "doctrine/orm": "To use this package with Doctrine", + "doctrine/orm": "To use this package with Doctrine", "doctrine/persistence": "To use this package with Doctrine", "easycorp/easyadmin-bundle": "To use this package with EasyAdmin", "eonx-com/easy-batch": "To use this package with EasyBatch", From b51335a604da9b550b2c5f9a0d2244d9063ba046 Mon Sep 17 00:00:00 2001 From: Aleksey Polyvanyi Date: Wed, 26 Jun 2024 00:00:46 +0200 Subject: [PATCH 4/4] -refactoring --- packages/EasySwoole/composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/EasySwoole/composer.json b/packages/EasySwoole/composer.json index 67bc63402d..4e11c7dcbb 100644 --- a/packages/EasySwoole/composer.json +++ b/packages/EasySwoole/composer.json @@ -51,13 +51,13 @@ "eonx-com/easy-doctrine": "To use this package with EasyDoctrine", "eonx-com/easy-error-handler": "To use this package with EasyErrorHandler", "eonx-com/easy-logging": "To use this package with EasyLogging", - "monolog/monolog": "To improve output of EonX\\EasySwoole\\Helpers\\OutputHelper", + "monolog/monolog": "To improve output of OutputHelper", "nesbot/carbon": "To work with EasySchedule bridge", "psr/log": "To enable access logs", - "symfony/console": "To work with EasySchedule bridge", + "symfony/console": "To use this package with EasySchedule", "symfony/process": "To enable hot reload", "symfony/twig-bundle": "To use this package with Twig", - "symfony/var-dumper": "To improve output of EonX\\EasySwoole\\Helpers\\VarDumpHelper" + "symfony/var-dumper": "To improve output of VarDumpHelper" }, "config": { "allow-plugins": {