diff --git a/src/circuit-breaker/src/Annotation/CircuitBreaker.php b/src/circuit-breaker/src/Annotation/CircuitBreaker.php index d2aac57ec..8304eb951 100644 --- a/src/circuit-breaker/src/Annotation/CircuitBreaker.php +++ b/src/circuit-breaker/src/Annotation/CircuitBreaker.php @@ -12,50 +12,35 @@ declare(strict_types=1); namespace Hyperf\CircuitBreaker\Annotation; use Attribute; -use Doctrine\Common\Annotations\Annotation\Target; use Hyperf\CircuitBreaker\Handler\TimeoutHandler; use Hyperf\Di\Annotation\AbstractAnnotation; /** - * @Annotation - * @Target({"METHOD"}) * @property float $timeout */ #[Attribute(Attribute::TARGET_METHOD)] class CircuitBreaker extends AbstractAnnotation { - /** - * @var string - */ - public $handler = TimeoutHandler::class; + public string $handler = TimeoutHandler::class; - /** - * @var string - */ - public $fallback; + public ?string $fallback = null; /** * The duration required to reset to a half open or close state. - * @var float */ - public $duration = 10; + public float $duration = 10; /** * The counter required to reset to a close state. - * @var int */ - public $successCounter = 10; + public int $successCounter = 10; /** - * The counter required to reset to a open state. - * @var int + * The counter required to reset to an open state. */ - public $failCounter = 10; + public int $failCounter = 10; - /** - * @var array - */ - public $value; + public array $value; public function __construct(...$value) { diff --git a/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php b/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php index 17a5eb633..9b8af145a 100644 --- a/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php +++ b/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php @@ -18,20 +18,15 @@ use Hyperf\Di\Aop\AbstractAspect; use Hyperf\Di\Aop\ProceedingJoinPoint; use Psr\Container\ContainerInterface; -/** - * @Aspect - */ +#[Aspect] class BreakerAnnotationAspect extends AbstractAspect { public $annotations = [ CircuitBreaker::class, ]; - protected $container; - - public function __construct(ContainerInterface $container) + public function __construct(protected ContainerInterface $container) { - $this->container = $container; } public function process(ProceedingJoinPoint $proceedingJoinPoint) diff --git a/src/circuit-breaker/src/CircuitBreaker.php b/src/circuit-breaker/src/CircuitBreaker.php index ba631a2e8..176866ea5 100644 --- a/src/circuit-breaker/src/CircuitBreaker.php +++ b/src/circuit-breaker/src/CircuitBreaker.php @@ -15,41 +15,24 @@ use Psr\Container\ContainerInterface; class CircuitBreaker implements CircuitBreakerInterface { - /** - * @var string - */ - protected $name; + protected string $name; - /** - * @var ContainerInterface - */ - protected $container; + protected State $state; - /** - * @var State - */ - protected $state; - - /** - * @var float - */ - protected $timestamp; + protected float $timestamp; /** * Failure count. - * @var int */ - protected $failCounter; + protected int $failCounter; /** * Success count. - * @var int */ - protected $successCounter; + protected int $successCounter; - public function __construct(ContainerInterface $container, string $name) + public function __construct(protected ContainerInterface $container, string $name) { - $this->container = $container; $this->name = $name; $this->state = make(State::class); $this->init(); @@ -62,9 +45,7 @@ class CircuitBreaker implements CircuitBreakerInterface public function attempt(): bool { - /** @var Attempt $attempt */ - $attempt = $this->container->get(Attempt::class); - return $attempt->attempt(); + return $this->container->get(Attempt::class)->attempt(); } public function open(): void diff --git a/src/circuit-breaker/src/CircuitBreakerFactory.php b/src/circuit-breaker/src/CircuitBreakerFactory.php index e8e60c878..101570280 100644 --- a/src/circuit-breaker/src/CircuitBreakerFactory.php +++ b/src/circuit-breaker/src/CircuitBreakerFactory.php @@ -15,13 +15,13 @@ use Psr\Container\ContainerInterface; class CircuitBreakerFactory { - protected $container; + /** + * @var CircuitBreakerInterface[] + */ + protected array $breakers = []; - protected $breakers = []; - - public function __construct(ContainerInterface $container) + public function __construct(protected ContainerInterface $container) { - $this->container = $container; } public function get(string $name): ?CircuitBreakerInterface diff --git a/src/circuit-breaker/src/Exception/CircuitBreakerException.php b/src/circuit-breaker/src/Exception/CircuitBreakerException.php index 73c5a8f7b..45d411993 100644 --- a/src/circuit-breaker/src/Exception/CircuitBreakerException.php +++ b/src/circuit-breaker/src/Exception/CircuitBreakerException.php @@ -15,18 +15,12 @@ class CircuitBreakerException extends \RuntimeException { public $result; - /** - * @param mixed $result - */ - public function setResult($result): self + public function setResult($result): static { $this->result = $result; return $this; } - /** - * @return mixed - */ public function getResult() { return $this->result; diff --git a/src/circuit-breaker/src/Handler/AbstractHandler.php b/src/circuit-breaker/src/Handler/AbstractHandler.php index 4da353ae7..8b7cadd85 100644 --- a/src/circuit-breaker/src/Handler/AbstractHandler.php +++ b/src/circuit-breaker/src/Handler/AbstractHandler.php @@ -20,27 +20,16 @@ use Hyperf\CircuitBreaker\FallbackInterface; use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Di\Aop\ProceedingJoinPoint; use Psr\Container\ContainerInterface; +use Psr\Log\LoggerInterface; abstract class AbstractHandler implements HandlerInterface { - /** - * @var CircuitBreakerFactory - */ - protected $factory; + protected CircuitBreakerFactory $factory; - /** - * @var ContainerInterface - */ - protected $container; + protected LoggerInterface $logger; - /** - * @var StdoutLoggerInterface - */ - protected $logger; - - public function __construct(ContainerInterface $container) + public function __construct(protected ContainerInterface $container) { - $this->container = $container; $this->factory = $container->get(CircuitBreakerFactory::class); $this->logger = $container->get(StdoutLoggerInterface::class); } @@ -139,10 +128,7 @@ abstract class AbstractHandler implements HandlerInterface ); $this->logger->debug($info); $breaker->halfOpen(); - return; } - - return; } } diff --git a/src/circuit-breaker/src/State.php b/src/circuit-breaker/src/State.php index 5189aa419..ea5c8594c 100644 --- a/src/circuit-breaker/src/State.php +++ b/src/circuit-breaker/src/State.php @@ -19,7 +19,7 @@ class State public const OPEN = 2; - protected $state; + protected int $state; public function __construct() { diff --git a/src/command/src/Annotation/Command.php b/src/command/src/Annotation/Command.php index bbb777ddf..881973857 100644 --- a/src/command/src/Annotation/Command.php +++ b/src/command/src/Annotation/Command.php @@ -14,10 +14,6 @@ namespace Hyperf\Command\Annotation; use Attribute; use Hyperf\Di\Annotation\AbstractAnnotation; -/** - * @Annotation - * @Target({"CLASS"}) - */ #[Attribute(Attribute::TARGET_CLASS)] class Command extends AbstractAnnotation { diff --git a/src/command/src/Command.php b/src/command/src/Command.php index b963c9cc4..9a102a8ec 100644 --- a/src/command/src/Command.php +++ b/src/command/src/Command.php @@ -19,6 +19,7 @@ use Swoole\ExitException; use Symfony\Component\Console\Command\Command as SymfonyCommand; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Helper\TableStyle; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -32,58 +33,39 @@ abstract class Command extends SymfonyCommand /** * The name of the command. - * - * @var string */ - protected $name; + protected ?string $name = null; + + protected ?InputInterface $input = null; /** - * @var InputInterface + * @var null|SymfonyStyle */ - protected $input; - - /** - * @var SymfonyStyle - */ - protected $output; + protected ?OutputInterface $output = null; /** * The default verbosity of output commands. - * - * @var int */ - protected $verbosity = OutputInterface::VERBOSITY_NORMAL; + protected int $verbosity = OutputInterface::VERBOSITY_NORMAL; /** * Execution in a coroutine environment. - * - * @var bool */ - protected $coroutine = true; + protected bool $coroutine = true; - /** - * @var null|EventDispatcherInterface - */ - protected $eventDispatcher; + protected ?EventDispatcherInterface $eventDispatcher = null; - /** - * @var int - */ - protected $hookFlags; + protected int $hookFlags = -1; /** * The name and signature of the command. - * - * @var null|string */ - protected $signature; + protected ?string $signature = null; /** - * The mapping between human readable verbosity levels and Symfony's OutputInterface. - * - * @var array + * The mapping between human-readable verbosity levels and Symfony's OutputInterface. */ - protected $verbosityMap + protected array $verbosityMap = [ 'v' => OutputInterface::VERBOSITY_VERBOSE, 'vv' => OutputInterface::VERBOSITY_VERY_VERBOSE, @@ -94,25 +76,21 @@ abstract class Command extends SymfonyCommand /** * The exit code of the command. - * - * @var int */ - protected $exitCode = 0; + protected int $exitCode = 0; public function __construct(string $name = null) { - if (! $name && $this->name) { - $name = $this->name; - } + $this->name = $name ?? $this->name; - if (! is_int($this->hookFlags)) { + if ($this->hookFlags < 0) { $this->hookFlags = swoole_hook_flags(); } if (isset($this->signature)) { $this->configureUsingFluentDefinition(); } else { - parent::__construct($name); + parent::__construct($this->name); } $this->addEnableDispatcherOption(); @@ -138,18 +116,16 @@ abstract class Command extends SymfonyCommand /** * Prompt the user for input. - * - * @param null|mixed $default */ - public function ask(string $question, $default = null) + public function ask(string $question, string $default = null) { return $this->output->ask($question, $default); } /** - * Prompt the user for input with auto completion. + * Prompt the user for input with auto-completion. * - * @param null|mixed $default + * @param null|bool|float|int|string $default */ public function anticipate(string $question, array $choices, $default = null) { @@ -157,9 +133,9 @@ abstract class Command extends SymfonyCommand } /** - * Prompt the user for input with auto completion. + * Prompt the user for input with auto-completion. * - * @param null|mixed $default + * @param null|bool|float|int|string $default */ public function askWithCompletion(string $question, array $choices, $default = null) { @@ -184,7 +160,7 @@ abstract class Command extends SymfonyCommand /** * Give the user a multiple choice from an array of answers. - * @param null|mixed $default + * @param mixed $default */ public function choiceMultiple( string $question, @@ -202,7 +178,7 @@ abstract class Command extends SymfonyCommand /** * Give the user a single choice from an array of answers. * - * @param null|mixed $default + * @param mixed $default */ public function choice( string $question, @@ -215,11 +191,8 @@ abstract class Command extends SymfonyCommand /** * Format input to textual table. - * - * @param mixed $rows - * @param mixed $tableStyle */ - public function table(array $headers, $rows, $tableStyle = 'default', array $columnStyles = []): void + public function table(array $headers, array|Arrayable $rows, TableStyle|string $tableStyle = 'default', array $columnStyles = []): void { $table = new Table($this->output); @@ -227,7 +200,7 @@ abstract class Command extends SymfonyCommand $rows = $rows->toArray(); } - $table->setHeaders((array) $headers)->setRows($rows)->setStyle($tableStyle); + $table->setHeaders($headers)->setRows($rows)->setStyle($tableStyle); foreach ($columnStyles as $columnIndex => $columnStyle) { $table->setColumnStyle($columnIndex, $columnStyle); @@ -375,7 +348,7 @@ abstract class Command extends SymfonyCommand } /** - * Get all of the context passed to the command. + * Get all the context passed to the command. */ protected function context(): array { @@ -395,9 +368,9 @@ abstract class Command extends SymfonyCommand */ protected function specifyParameters(): void { - // We will loop through all of the arguments and options for the command and + // We will loop through all the arguments and options for the command and // set them all on the base command instance. This specifies what can get - // passed into these commands as "parameters" to control the execution. + // past into these commands as "parameters" to control the execution. if (method_exists($this, 'getArguments')) { foreach ($this->getArguments() ?? [] as $arguments) { call_user_func_array([$this, 'addArgument'], $arguments); diff --git a/src/command/src/EnableEventDispatcher.php b/src/command/src/EnableEventDispatcher.php index e9df58679..292db0b95 100644 --- a/src/command/src/EnableEventDispatcher.php +++ b/src/command/src/EnableEventDispatcher.php @@ -26,7 +26,8 @@ trait EnableEventDispatcher public function enableDispatcher(InputInterface $input) { if ($input->getOption('enable-event-dispatcher')) { - $this->eventDispatcher = ApplicationContext::getContainer()->get(EventDispatcherInterface::class); + $dispatcher = ApplicationContext::getContainer()->get(EventDispatcherInterface::class); + $this->eventDispatcher = $dispatcher instanceof EventDispatcherInterface ? $dispatcher : null; } } } diff --git a/src/command/src/Event/Event.php b/src/command/src/Event/Event.php index 194e29e78..6d16990b0 100644 --- a/src/command/src/Event/Event.php +++ b/src/command/src/Event/Event.php @@ -15,14 +15,8 @@ use Hyperf\Command\Command; abstract class Event { - /** - * @var Command - */ - protected $command; - - public function __construct(Command $command) + public function __construct(protected Command $command) { - $this->command = $command; } public function getCommand(): Command diff --git a/src/command/src/Event/FailToHandle.php b/src/command/src/Event/FailToHandle.php index 60a338519..5a6861fe0 100644 --- a/src/command/src/Event/FailToHandle.php +++ b/src/command/src/Event/FailToHandle.php @@ -16,16 +16,9 @@ use Throwable; class FailToHandle extends Event { - /** - * @var Throwable - */ - protected $throwable; - - public function __construct(Command $command, Throwable $throwable) + public function __construct(Command $command, protected Throwable $throwable) { parent::__construct($command); - - $this->throwable = $throwable; } public function getThrowable(): Throwable diff --git a/src/command/src/Parser.php b/src/command/src/Parser.php index 89986aeca..c036bd29f 100644 --- a/src/command/src/Parser.php +++ b/src/command/src/Parser.php @@ -51,7 +51,7 @@ class Parser } /** - * Extract all of the parameters from the tokens. + * Extract all the parameters from the tokens. */ protected static function parameters(array $tokens): array { diff --git a/src/command/tests/Command/SwooleFlagsCommand.php b/src/command/tests/Command/SwooleFlagsCommand.php index fb9782e6a..f09d4930c 100644 --- a/src/command/tests/Command/SwooleFlagsCommand.php +++ b/src/command/tests/Command/SwooleFlagsCommand.php @@ -15,7 +15,7 @@ use Hyperf\Command\Command; class SwooleFlagsCommand extends Command { - protected $hookFlags = SWOOLE_HOOK_CURL | SWOOLE_HOOK_ALL; + protected int $hookFlags = SWOOLE_HOOK_CURL | SWOOLE_HOOK_ALL; public function handle() { diff --git a/src/command/tests/CommandTest.php b/src/command/tests/CommandTest.php index 25285b851..fbcd51f26 100644 --- a/src/command/tests/CommandTest.php +++ b/src/command/tests/CommandTest.php @@ -48,7 +48,7 @@ class CommandTest extends TestCase public function testExitCodeWhenThrowException() { /** @var FooExceptionCommand $command */ - $command = new ClassInvoker(new FooExceptionCommand()); + $command = new ClassInvoker(new FooExceptionCommand('foo')); $input = Mockery::mock(InputInterface::class); $input->shouldReceive('getOption')->andReturnFalse(); $exitCode = $command->execute($input, Mockery::mock(OutputInterface::class)); diff --git a/src/database/src/Commands/Migrations/FreshCommand.php b/src/database/src/Commands/Migrations/FreshCommand.php index ff14de3ef..6ead59422 100644 --- a/src/database/src/Commands/Migrations/FreshCommand.php +++ b/src/database/src/Commands/Migrations/FreshCommand.php @@ -23,10 +23,8 @@ class FreshCommand extends Command /** * The console command name. - * - * @var string */ - protected $name = 'migrate:fresh'; + protected ?string $name = 'migrate:fresh'; /** * The console command description. diff --git a/src/database/src/Commands/Migrations/InstallCommand.php b/src/database/src/Commands/Migrations/InstallCommand.php index fdf347c3f..2238a8815 100755 --- a/src/database/src/Commands/Migrations/InstallCommand.php +++ b/src/database/src/Commands/Migrations/InstallCommand.php @@ -18,10 +18,8 @@ class InstallCommand extends BaseCommand { /** * The console command name. - * - * @var string */ - protected $name = 'migrate:install'; + protected ?string $name = 'migrate:install'; /** * The console command description. diff --git a/src/database/src/Commands/Migrations/MigrateCommand.php b/src/database/src/Commands/Migrations/MigrateCommand.php index f7f146dd2..c2d131d4b 100755 --- a/src/database/src/Commands/Migrations/MigrateCommand.php +++ b/src/database/src/Commands/Migrations/MigrateCommand.php @@ -19,7 +19,7 @@ class MigrateCommand extends BaseCommand { use ConfirmableTrait; - protected $name = 'migrate'; + protected ?string $name = 'migrate'; /** * The console command description. diff --git a/src/database/src/Commands/Migrations/RefreshCommand.php b/src/database/src/Commands/Migrations/RefreshCommand.php index 371b3d87c..c7e70308c 100755 --- a/src/database/src/Commands/Migrations/RefreshCommand.php +++ b/src/database/src/Commands/Migrations/RefreshCommand.php @@ -21,10 +21,8 @@ class RefreshCommand extends Command /** * The console command name. - * - * @var string */ - protected $name = 'migrate:refresh'; + protected ?string $name = 'migrate:refresh'; /** * The console command description. diff --git a/src/database/src/Commands/Migrations/ResetCommand.php b/src/database/src/Commands/Migrations/ResetCommand.php index 37f2aefc8..ebf9999c7 100755 --- a/src/database/src/Commands/Migrations/ResetCommand.php +++ b/src/database/src/Commands/Migrations/ResetCommand.php @@ -21,10 +21,8 @@ class ResetCommand extends BaseCommand /** * The console command name. - * - * @var string */ - protected $name = 'migrate:reset'; + protected ?string $name = 'migrate:reset'; /** * The console command description. diff --git a/src/database/src/Commands/Migrations/RollbackCommand.php b/src/database/src/Commands/Migrations/RollbackCommand.php index 34d714b3c..e9a1381de 100755 --- a/src/database/src/Commands/Migrations/RollbackCommand.php +++ b/src/database/src/Commands/Migrations/RollbackCommand.php @@ -21,10 +21,8 @@ class RollbackCommand extends BaseCommand /** * The console command name. - * - * @var string */ - protected $name = 'migrate:rollback'; + protected ?string $name = 'migrate:rollback'; /** * The console command description. diff --git a/src/database/src/Commands/Migrations/StatusCommand.php b/src/database/src/Commands/Migrations/StatusCommand.php index 7081f947f..0a83eb9f4 100644 --- a/src/database/src/Commands/Migrations/StatusCommand.php +++ b/src/database/src/Commands/Migrations/StatusCommand.php @@ -19,10 +19,8 @@ class StatusCommand extends BaseCommand { /** * The console command name. - * - * @var string */ - protected $name = 'migrate:status'; + protected ?string $name = 'migrate:status'; /** * The console command description. diff --git a/src/database/src/Commands/ModelCommand.php b/src/database/src/Commands/ModelCommand.php index 0ca3a6495..9627a41dd 100644 --- a/src/database/src/Commands/ModelCommand.php +++ b/src/database/src/Commands/ModelCommand.php @@ -29,7 +29,6 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; class ModelCommand extends Command { @@ -58,16 +57,6 @@ class ModelCommand extends Command */ protected $printer; - /** - * @var SymfonyStyle - */ - protected $output; - - /** - * @var InputInterface - */ - protected $input; - public function __construct(ContainerInterface $container) { parent::__construct('gen:model'); diff --git a/src/database/src/Commands/Seeders/SeedCommand.php b/src/database/src/Commands/Seeders/SeedCommand.php index 4d9bb2803..2b64931bc 100644 --- a/src/database/src/Commands/Seeders/SeedCommand.php +++ b/src/database/src/Commands/Seeders/SeedCommand.php @@ -21,10 +21,8 @@ class SeedCommand extends BaseCommand /** * The console command name. - * - * @var string */ - protected $name = 'db:seed'; + protected ?string $name = 'db:seed'; /** * The console command description. diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php b/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php index d5384a34f..20a94bf39 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php @@ -14,10 +14,6 @@ namespace Hyperf\Cache\Annotation; use Attribute; use Hyperf\Di\Annotation\AbstractAnnotation; -/** - * @Annotation - * @Target({"METHOD"}) - */ #[Attribute(Attribute::TARGET_METHOD)] class CacheEvict extends AbstractAnnotation { diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php b/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php index 5be0de840..2691c95fe 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php @@ -14,10 +14,6 @@ namespace Hyperf\Cache\Annotation; use Attribute; use Hyperf\Di\Annotation\AbstractAnnotation; -/** - * @Annotation - * @Target({"METHOD"}) - */ #[Attribute(Attribute::TARGET_METHOD)] class CachePut extends AbstractAnnotation { diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php b/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php index a905dccaa..5cb24621a 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php @@ -14,10 +14,6 @@ namespace Hyperf\Cache\Annotation; use Attribute; use Hyperf\Di\Annotation\AbstractAnnotation; -/** - * @Annotation - * @Target({"METHOD"}) - */ #[Attribute(Attribute::TARGET_METHOD)] class Cacheable extends AbstractAnnotation { diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php b/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php index fcbe79889..5cdfa17a4 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php @@ -14,10 +14,6 @@ namespace Hyperf\Cache\Annotation; use Attribute; use Hyperf\Di\Annotation\AbstractAnnotation; -/** - * @Annotation - * @Target({"METHOD"}) - */ #[Attribute(Attribute::TARGET_METHOD)] class FailCache extends AbstractAnnotation { diff --git a/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php b/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php index 8ae91e0fd..02f1bb014 100644 --- a/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php +++ b/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php @@ -12,12 +12,9 @@ declare(strict_types=1); namespace Hyperf\CircuitBreaker\Annotation; use Attribute; -use Doctrine\Common\Annotations\Annotation\Target; use Hyperf\Di\Annotation\AbstractAnnotation; /** - * @Annotation - * @Target({"METHOD"}) * @property float $timeout */ #[Attribute(Attribute::TARGET_METHOD)] diff --git a/src/ide-helper/output/Hyperf/Command/Annotation/Command.php b/src/ide-helper/output/Hyperf/Command/Annotation/Command.php index fea8e167a..428254576 100644 --- a/src/ide-helper/output/Hyperf/Command/Annotation/Command.php +++ b/src/ide-helper/output/Hyperf/Command/Annotation/Command.php @@ -14,10 +14,6 @@ namespace Hyperf\Command\Annotation; use Attribute; use Hyperf\Di\Annotation\AbstractAnnotation; -/** - * @Annotation - * @Target({"CLASS"}) - */ #[Attribute(Attribute::TARGET_CLASS)] class Command extends AbstractAnnotation { diff --git a/src/scout/src/Console/FlushCommand.php b/src/scout/src/Console/FlushCommand.php index 23f5fb220..84ff36473 100644 --- a/src/scout/src/Console/FlushCommand.php +++ b/src/scout/src/Console/FlushCommand.php @@ -22,10 +22,8 @@ class FlushCommand extends HyperfCommand { /** * The name and signature of the console command. - * - * @var string */ - protected $name = 'scout:flush'; + protected ?string $name = 'scout:flush'; /** * The console command description. diff --git a/src/scout/src/Console/ImportCommand.php b/src/scout/src/Console/ImportCommand.php index 977fe2a98..4157cd762 100644 --- a/src/scout/src/Console/ImportCommand.php +++ b/src/scout/src/Console/ImportCommand.php @@ -22,10 +22,8 @@ class ImportCommand extends Command { /** * The name and signature of the console command. - * - * @var string */ - protected $name = 'scout:import'; + protected ?string $name = 'scout:import'; /** * The console command description. diff --git a/src/swagger/src/Command/GenCommand.php b/src/swagger/src/Command/GenCommand.php index f406d7315..9ac87a3f7 100644 --- a/src/swagger/src/Command/GenCommand.php +++ b/src/swagger/src/Command/GenCommand.php @@ -19,7 +19,7 @@ use const OpenApi\UNDEFINED; class GenCommand extends Command { - protected $name = 'swagger:gen'; + protected ?string $name = 'swagger:gen'; public function handle() { diff --git a/src/view-engine/src/Command/ViewPublishCommand.php b/src/view-engine/src/Command/ViewPublishCommand.php index 4bc9c0a88..bcd43eb53 100644 --- a/src/view-engine/src/Command/ViewPublishCommand.php +++ b/src/view-engine/src/Command/ViewPublishCommand.php @@ -15,7 +15,7 @@ use Hyperf\Command\Command as HyperfCommand; class ViewPublishCommand extends HyperfCommand { - protected $signature = 'view:publish {--f|force}'; + protected ?string $signature = 'view:publish {--f|force}'; protected $packages = [ 'hyperf/session',