diff --git a/src/devtool/src/Generator/ModelCommand.php b/src/devtool/src/Generator/ModelCommand.php index e76b30f77..c709bb6d7 100644 --- a/src/devtool/src/Generator/ModelCommand.php +++ b/src/devtool/src/Generator/ModelCommand.php @@ -101,6 +101,7 @@ protected function getOptions(): array ['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller'], ['api', null, InputOption::VALUE_NONE, 'Indicates if the generated controller should be an API resource controller'], ['requests', 'R', InputOption::VALUE_NONE, 'Create new form request classes and use them in the resource controller'], + ['path', 'p', InputOption::VALUE_OPTIONAL, 'The path of the model.'], ]; } diff --git a/src/devtool/src/Generator/ResourceCommand.php b/src/devtool/src/Generator/ResourceCommand.php index eff2be094..29df07f51 100644 --- a/src/devtool/src/Generator/ResourceCommand.php +++ b/src/devtool/src/Generator/ResourceCommand.php @@ -38,10 +38,10 @@ protected function getDefaultNamespace(): string protected function getOptions(): array { - return [ + return array_merge(parent::getOptions(), [ ['namespace', 'N', InputOption::VALUE_OPTIONAL, 'The namespace for class.', null], ['force', 'f', InputOption::VALUE_NONE, 'Create the class even if the resource already exists'], ['collection', 'c', InputOption::VALUE_NONE, 'Create a resource collection'], - ]; + ]); } } diff --git a/src/object-pool/src/Traits/HasPoolProxy.php b/src/object-pool/src/Traits/HasPoolProxy.php index 4b2e8e357..b3a069acd 100644 --- a/src/object-pool/src/Traits/HasPoolProxy.php +++ b/src/object-pool/src/Traits/HasPoolProxy.php @@ -20,12 +20,7 @@ trait HasPoolProxy */ protected function createPoolProxy(string $driver, Closure $resolver, array $config = [], ?string $proxyClass = null): mixed { - if (! $proxyClass) { - // @phpstan-ignore function.alreadyNarrowedType (trait flexibility: using class may not define poolProxyClass) - $proxyClass = property_exists($this, 'poolProxyClass') - ? $this->poolProxyClass - : PoolProxy::class; - } + $proxyClass ??= $this->poolProxyClass; if (! is_a($proxyClass, PoolProxy::class, true)) { throw new InvalidArgumentException('The pool proxy class must be an instance of ' . PoolProxy::class);