From 40cd3cc91b955a43f06255070cd20f78fe053dba Mon Sep 17 00:00:00 2001 From: Deeka Wong Date: Wed, 20 Dec 2023 12:21:16 +0800 Subject: [PATCH] Support customized local configuration files for PHPStan and PHPUnit (#502) * Support customized local configuration files for PHPStan and PHPUnit * Optimize * Fix return type declarations in Kafka and Log facades * Refactor array and collection mixins * Update type hint for process method in TaskHandleListener * Update CacheInterface and Cache class * Refactor ParameterParser class by removing unused code * Refactor Etcd and Nacos drivers, and fix EnvWriter return statement * Fix type hinting in exception handling functions * Fix column value retrieval in FastPaginate.php * Refactor validation rules in ValidationAspect.php * Update helper functions and fix deprecated functions * Refactor log writer to use null coalescing operator for default values * Fix code formatting and remove unused code * Update variable type in ResponseSequence class and fix factory function in Functions.php * Fix code inconsistencies and improve code readability * Update phpstan.neon.dist to include phpstan-baseline.neon This commit updates the phpstan.neon.dist file to include the phpstan-baseline.neon file. The previous include statement for vendor/phpstan/phpstan-deprecation-rules/rules.neon has been commented out. This change ensures that the phpstan-baseline.neon file is included in the analysis performed by vendor/bin/phpstan. * Update PHPStan configuration file * Fix isInstanceCall method logic * Refactor access log message formatting --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com> --- src/Functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Functions.php b/src/Functions.php index 9f79f7b..6a52d8e 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -26,12 +26,12 @@ */ function factory(string $class) { - $container = ApplicationContext::getContainer(); - - if (is_null($container)) { + if (! ApplicationContext::hasContainer()) { return null; } + $container = ApplicationContext::getContainer(); + $factory = $container->get(Factory::class); $arguments = func_get_args();