From fc488034b97724b1dce4a466284a302058184a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Sat, 23 Mar 2024 19:28:51 +0800 Subject: [PATCH] Format code by the latest `cs-fixer`. (#6617) --- .php-cs-fixer.php | 4 +- CHANGELOG-3.1.md | 4 + bootstrap.php | 2 +- composer.json | 2 +- phpstan.neon.dist | 2 - src/amqp/src/AMQPConnection.php | 1 + src/amqp/src/Annotation/Consumer.php | 1 + src/amqp/src/Annotation/Producer.php | 1 + src/amqp/src/Builder.php | 1 + src/amqp/src/Builder/Builder.php | 1 + src/amqp/src/Builder/ExchangeBuilder.php | 5 +- src/amqp/src/Builder/QueueBuilder.php | 1 + src/amqp/src/ConfigProvider.php | 1 + src/amqp/src/ConnectionFactory.php | 1 + src/amqp/src/Constants.php | 1 + src/amqp/src/Consumer.php | 1 + src/amqp/src/ConsumerFactory.php | 1 + src/amqp/src/ConsumerManager.php | 1 + src/amqp/src/Event/AfterConsume.php | 1 + src/amqp/src/Event/BeforeConsume.php | 1 + src/amqp/src/Event/ConsumeEvent.php | 1 + src/amqp/src/Event/FailToConsume.php | 1 + src/amqp/src/Event/WaitTimeout.php | 1 + .../src/Exception/LoopBrokenException.php | 1 + .../src/Exception/MaxConsumptionException.php | 1 + src/amqp/src/Exception/MessageException.php | 1 + .../src/Exception/NotSupportedException.php | 1 + .../Exception/SendChannelClosedException.php | 1 + .../Exception/SendChannelTimeoutException.php | 1 + src/amqp/src/Exception/TimeoutException.php | 1 + src/amqp/src/IO/IOFactory.php | 1 + src/amqp/src/IO/IOFactoryInterface.php | 1 + src/amqp/src/IO/SwooleIO.php | 1 + src/amqp/src/IO/SwowIO.php | 1 + .../BeforeMainServerStartListener.php | 1 + .../src/Listener/MainWorkerStartListener.php | 1 + .../Message/ConsumerDelayedMessageTrait.php | 1 + src/amqp/src/Message/ConsumerMessage.php | 7 +- .../src/Message/ConsumerMessageInterface.php | 5 +- src/amqp/src/Message/DynamicRpcMessage.php | 1 + src/amqp/src/Message/Message.php | 7 +- src/amqp/src/Message/MessageInterface.php | 5 +- .../Message/ProducerDelayedMessageTrait.php | 1 + src/amqp/src/Message/ProducerMessage.php | 1 + .../src/Message/ProducerMessageInterface.php | 1 + src/amqp/src/Message/RpcMessage.php | 1 + src/amqp/src/Message/RpcMessageInterface.php | 1 + src/amqp/src/Message/Type.php | 1 + src/amqp/src/Packer/Packer.php | 1 + src/amqp/src/Params.php | 1 + src/amqp/src/Producer.php | 3 +- src/amqp/src/Result.php | 1 + src/amqp/src/RpcChannel.php | 3 +- src/amqp/src/RpcClient.php | 1 + src/amqp/tests/AMQPConnectionTest.php | 1 + src/amqp/tests/ConsumerManagerTest.php | 1 + src/amqp/tests/ConsumerTest.php | 1 + src/amqp/tests/ExchangeBuilderTest.php | 1 + .../BeforeMainServerStartListenerTest.php | 1 + .../Listener/MainWorkerStartListenerTest.php | 1 + .../tests/Message/ConsumerMessageTest.php | 1 + src/amqp/tests/Message/MessageTest.php | 1 + src/amqp/tests/ParamsTest.php | 1 + src/amqp/tests/Stub/AMQPConnectionStub.php | 1 + src/amqp/tests/Stub/ContainerStub.php | 1 + src/amqp/tests/Stub/Delay2Consumer.php | 1 + src/amqp/tests/Stub/DelayConsumer.php | 1 + src/amqp/tests/Stub/DelayProducerStub.php | 3 +- src/amqp/tests/Stub/DemoConsumer.php | 1 + src/amqp/tests/Stub/DemoProducer.php | 1 + src/amqp/tests/Stub/NumsConsumer.php | 1 + src/amqp/tests/Stub/QosConsumer.php | 1 + .../src/Annotation/AsyncQueueMessage.php | 1 + src/async-queue/src/AnnotationJob.php | 1 + .../src/Aspect/AsyncQueueAspect.php | 1 + .../src/Command/FlushFailedMessageCommand.php | 1 + src/async-queue/src/Command/InfoCommand.php | 1 + .../Command/ReloadFailedMessageCommand.php | 1 + src/async-queue/src/ConfigProvider.php | 1 + src/async-queue/src/Driver/ChannelConfig.php | 1 + src/async-queue/src/Driver/Driver.php | 1 + src/async-queue/src/Driver/DriverFactory.php | 1 + .../src/Driver/DriverInterface.php | 1 + src/async-queue/src/Driver/RedisDriver.php | 1 + src/async-queue/src/Environment.php | 1 + src/async-queue/src/Event/AfterHandle.php | 1 + src/async-queue/src/Event/BeforeHandle.php | 1 + src/async-queue/src/Event/Event.php | 1 + src/async-queue/src/Event/FailedHandle.php | 1 + src/async-queue/src/Event/QueueLength.php | 1 + src/async-queue/src/Event/RetryHandle.php | 1 + .../src/Exception/InvalidDriverException.php | 1 + .../src/Exception/InvalidPackerException.php | 1 + .../src/Exception/InvalidQueueException.php | 1 + src/async-queue/src/Functions.php | 1 + src/async-queue/src/Job.php | 1 + src/async-queue/src/JobInterface.php | 1 + src/async-queue/src/JobMessage.php | 1 + .../src/Listener/QueueHandleListener.php | 1 + .../src/Listener/QueueLengthListener.php | 1 + .../src/Listener/ReloadChannelListener.php | 1 + src/async-queue/src/MessageInterface.php | 1 + .../src/Process/ConsumerProcess.php | 1 + .../tests/AsyncQueueAspectTest.php | 1 + src/async-queue/tests/DriverTest.php | 1 + src/async-queue/tests/JobMessageTest.php | 6 +- src/async-queue/tests/ListenerTest.php | 1 + src/async-queue/tests/RedisDriverTest.php | 1 + src/async-queue/tests/Stub/DemoJob.php | 1 + src/async-queue/tests/Stub/DemoModel.php | 1 + src/async-queue/tests/Stub/DemoModelMeta.php | 1 + src/async-queue/tests/Stub/FooProxy.php | 1 + src/async-queue/tests/Stub/OldJobMessage.php | 4 +- src/async-queue/tests/Stub/Redis.php | 1 + .../tests/Stub/RedisDriverStub.php | 1 + src/cache/publish/cache.php | 7 +- src/cache/src/Annotation/CacheAhead.php | 1 + src/cache/src/Annotation/CacheEvict.php | 1 + src/cache/src/Annotation/CachePut.php | 1 + src/cache/src/Annotation/Cacheable.php | 1 + src/cache/src/Annotation/FailCache.php | 1 + src/cache/src/AnnotationManager.php | 1 + src/cache/src/Aspect/CacheAheadAspect.php | 1 + src/cache/src/Aspect/CacheEvictAspect.php | 1 + src/cache/src/Aspect/CachePutAspect.php | 1 + src/cache/src/Aspect/CacheableAspect.php | 1 + src/cache/src/Aspect/FailCacheAspect.php | 1 + src/cache/src/Cache.php | 1 + src/cache/src/CacheListenerCollector.php | 1 + src/cache/src/CacheManager.php | 1 + src/cache/src/Collector/CoroutineMemory.php | 1 + .../src/Collector/CoroutineMemoryKey.php | 1 + src/cache/src/Collector/FileStorage.php | 1 + src/cache/src/Collector/Memory.php | 1 + src/cache/src/ConfigProvider.php | 1 + .../src/Driver/CoroutineMemoryDriver.php | 1 + src/cache/src/Driver/Driver.php | 1 + src/cache/src/Driver/DriverInterface.php | 1 + src/cache/src/Driver/FileSystemDriver.php | 1 + .../src/Driver/KeyCollectorInterface.php | 1 + src/cache/src/Driver/MemoryDriver.php | 1 + src/cache/src/Driver/RedisDriver.php | 1 + src/cache/src/Driver/SqliteDriver.php | 1 + src/cache/src/Exception/CacheException.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/cache/src/Exception/OverflowException.php | 1 + src/cache/src/Helper/StringHelper.php | 1 + src/cache/src/Listener/DeleteEvent.php | 1 + src/cache/src/Listener/DeleteListener.php | 1 + .../src/Listener/DeleteListenerEvent.php | 1 + src/cache/tests/Cases/AnnotationTest.php | 1 + src/cache/tests/Cases/AspectTest.php | 1 + .../tests/Cases/CoroutineMemoryDriverTest.php | 1 + .../tests/Cases/FileSystemDriverTest.php | 1 + src/cache/tests/Cases/MemoryDriverTest.php | 4 +- src/cache/tests/Cases/RedisDriverTest.php | 1 + src/cache/tests/Cases/StringHelperTest.php | 1 + src/cache/tests/Stub/ContainerStub.php | 1 + src/cache/tests/Stub/Foo.php | 1 + src/cache/tests/Stub/SerializeRedisDriver.php | 1 + src/carbon/src/Carbon.php | 3 +- src/carbon/src/ConfigProvider.php | 1 + src/carbon/src/Listener/CarbonListener.php | 1 + src/carbon/tests/CarbonTest.php | 4 +- .../src/Annotation/CircuitBreaker.php | 3 +- .../src/Aspect/BreakerAnnotationAspect.php | 1 + src/circuit-breaker/src/Attempt.php | 1 + src/circuit-breaker/src/CircuitBreaker.php | 1 + .../src/CircuitBreakerFactory.php | 1 + .../src/CircuitBreakerInterface.php | 1 + src/circuit-breaker/src/ConfigProvider.php | 1 + .../src/Exception/BadFallbackException.php | 1 + .../src/Exception/CircuitBreakerException.php | 1 + .../src/Exception/InvalidConfigException.php | 1 + .../src/Exception/TimeoutException.php | 1 + src/circuit-breaker/src/FallbackInterface.php | 1 + .../src/Handler/AbstractHandler.php | 3 +- .../src/Handler/HandlerInterface.php | 1 + .../src/Handler/TimeoutHandler.php | 1 + src/circuit-breaker/src/LoggerInterface.php | 1 + src/circuit-breaker/src/State.php | 1 + .../tests/Annotation/CircuitBreakerTest.php | 1 + .../tests/Stub/CircuitBreakerStub.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/code-parser/src/Package.php | 1 + src/code-parser/src/PhpDocReader.php | 1 + src/code-parser/src/PhpDocReaderManager.php | 1 + src/code-parser/src/PhpParser.php | 1 + src/code-parser/src/Project.php | 1 + src/code-parser/tests/PhpDocReaderTest.php | 1 + src/code-parser/tests/PhpParserTest.php | 1 + src/code-parser/tests/ProjectTest.php | 1 + src/code-parser/tests/Stub/Bar.php | 1 + src/code-parser/tests/Stub/DocFoo.php | 1 + src/code-parser/tests/Stub/Foo.php | 1 + src/code-parser/tests/Stub/FooEnum.php | 1 + src/code-parser/tests/Stub/FooEnumStruct.php | 1 + src/code-parser/tests/Stub/UnionTypeFoo.php | 1 + src/codec/src/Base62.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/codec/src/Json.php | 1 + .../src/Packer/IgbinarySerializerPacker.php | 1 + src/codec/src/Packer/JsonPacker.php | 1 + src/codec/src/Packer/PhpSerializerPacker.php | 1 + src/codec/src/Xml.php | 1 + src/codec/tests/Base62Test.php | 1 + src/codec/tests/JsonTest.php | 1 + .../Packer/IgbinarySerializerPackerTest.php | 1 + src/codec/tests/Packer/JsonPackerTest.php | 1 + src/codec/tests/Stub/Car.php | 1 + src/codec/tests/Stub/StringCodeException.php | 1 + src/codec/tests/XmlTest.php | 1 + src/collection/src/Arr.php | 17 +- src/collection/src/Collection.php | 47 ++--- src/collection/src/Functions.php | 1 + .../src/HigherOrderCollectionProxy.php | 1 + src/collection/tests/ArrTest.php | 23 ++- src/collection/tests/CollectionTest.php | 1 + src/collection/tests/FunctionsTest.php | 1 + src/command/src/Annotation/AsCommand.php | 1 + src/command/src/Annotation/Command.php | 1 + src/command/src/AsCommand.php | 1 + src/command/src/ClosureCommand.php | 3 +- src/command/src/Command.php | 1 + src/command/src/Concerns/Confirmable.php | 4 +- .../src/Concerns/DisableEventDispatcher.php | 1 + src/command/src/Concerns/HasParameters.php | 1 + src/command/src/Concerns/InteractsWithIO.php | 4 +- .../Concerns/NullDisableEventDispatcher.php | 1 + src/command/src/ConfigProvider.php | 1 + src/command/src/Console.php | 1 + src/command/src/Event/AfterExecute.php | 1 + src/command/src/Event/AfterHandle.php | 1 + src/command/src/Event/BeforeHandle.php | 1 + src/command/src/Event/Event.php | 1 + src/command/src/Event/FailToHandle.php | 1 + .../src/Listener/ClearTimerListener.php | 1 + .../src/Listener/FailToHandleListener.php | 1 + .../src/Listener/RegisterCommandListener.php | 4 +- src/command/src/ParameterParser.php | 1 + src/command/src/Parser.php | 1 + .../Command/DefaultSwooleFlagsCommand.php | 1 + src/command/tests/Command/FooCommand.php | 1 + .../tests/Command/FooExceptionCommand.php | 1 + src/command/tests/Command/FooExitCommand.php | 1 + src/command/tests/Command/FooTraitCommand.php | 5 +- .../tests/Command/SwooleFlagsCommand.php | 1 + src/command/tests/Command/Traits/Foo.php | 1 + src/command/tests/CommandParserTest.php | 1 + src/command/tests/CommandTest.php | 7 +- src/conditionable/src/Conditionable.php | 13 +- .../src/HigherOrderWhenProxy.php | 1 + src/conditionable/tests/ConditionableTest.php | 1 + src/config-aliyun-acm/src/AliyunAcmDriver.php | 1 + src/config-aliyun-acm/src/Client.php | 1 + src/config-aliyun-acm/src/ClientInterface.php | 1 + src/config-aliyun-acm/src/ConfigProvider.php | 1 + src/config-apollo/src/ApolloDriver.php | 1 + src/config-apollo/src/Client.php | 4 +- src/config-apollo/src/ClientFactory.php | 3 +- src/config-apollo/src/ClientInterface.php | 1 + src/config-apollo/src/ConfigProvider.php | 1 + src/config-apollo/src/Option.php | 1 + src/config-apollo/src/PullMode.php | 1 + src/config-apollo/tests/ClientTest.php | 1 + src/config-apollo/tests/OptionTest.php | 4 +- src/config-center/publish/config_center.php | 24 ++- src/config-center/src/AbstractDriver.php | 4 +- src/config-center/src/ConfigProvider.php | 1 + .../src/Contract/ClientInterface.php | 1 + .../src/Contract/DriverInterface.php | 1 + .../src/Contract/PipeMessageInterface.php | 1 + src/config-center/src/DriverFactory.php | 1 + src/config-center/src/Event/ConfigChanged.php | 1 + .../CreateMessageFetcherLoopListener.php | 1 + .../Listener/FetchConfigOnBootListener.php | 1 + .../src/Listener/OnPipeMessageListener.php | 1 + src/config-center/src/Mode.php | 1 + src/config-center/src/PipeMessage.php | 1 + .../src/Process/ConfigFetcherProcess.php | 1 + .../tests/AbstractDriverTest.php | 6 +- src/config-center/tests/ContainerStub.php | 1 + .../CreateMessageFetcherLoopListenerTest.php | 1 + .../Listener/OnPipeMessageListenerTest.php | 1 + .../Process/ConfigFetcherProcessTest.php | 6 +- src/config-etcd/src/Client.php | 1 + src/config-etcd/src/ClientFactory.php | 1 + src/config-etcd/src/ClientInterface.php | 1 + src/config-etcd/src/ConfigProvider.php | 1 + src/config-etcd/src/EtcdDriver.php | 1 + src/config-etcd/src/KV.php | 1 + src/config-etcd/src/KVFactory.php | 1 + src/config-etcd/src/KVInterface.php | 1 + src/config-etcd/tests/KVFactoryTest.php | 1 + src/config-nacos/composer.json | 3 +- src/config-nacos/src/Client.php | 22 +-- src/config-nacos/src/ClientInterface.php | 1 + src/config-nacos/src/ConfigProvider.php | 1 + src/config-nacos/src/Constants.php | 1 + src/config-nacos/src/NacosClient.php | 1 + src/config-nacos/src/NacosClientFactory.php | 1 + src/config-nacos/src/NacosDriver.php | 1 + src/config-nacos/tests/ClientTest.php | 1 + src/config-nacos/tests/ContainerStub.php | 1 + src/config-nacos/tests/HandlerMockery.php | 1 + src/config-zookeeper/src/Client.php | 1 + src/config-zookeeper/src/ClientInterface.php | 1 + src/config-zookeeper/src/ConfigProvider.php | 1 + src/config-zookeeper/src/ZookeeperDriver.php | 1 + src/config-zookeeper/tests/ClientTest.php | 1 + src/config-zookeeper/tests/Stub/Server.php | 1 + src/config/src/Annotation/Value.php | 1 + src/config/src/Annotation/ValueAspect.php | 1 + src/config/src/Config.php | 1 + src/config/src/ConfigFactory.php | 1 + src/config/src/ConfigProvider.php | 1 + src/config/src/Functions.php | 1 + .../RegisterPropertyHandlerListener.php | 1 + src/config/src/ProviderConfig.php | 1 + src/config/tests/ConfigFactoryTest.php | 1 + src/config/tests/ConfigTest.php | 1 + src/config/tests/ProviderConfigTest.php | 1 + src/config/tests/Stub/Foo.php | 1 + src/config/tests/Stub/FooConfigProvider.php | 1 + src/config/tests/Stub/ProviderConfig.php | 1 + src/constants/src/AbstractConstants.php | 1 + src/constants/src/Annotation/Constants.php | 1 + src/constants/src/AnnotationReader.php | 1 + src/constants/src/ConfigProvider.php | 1 + src/constants/src/ConstantsCollector.php | 1 + src/constants/src/ConstantsTrait.php | 3 +- src/constants/src/EnumConstantsTrait.php | 9 +- .../src/Exception/ConstantsException.php | 1 + src/constants/src/GetterTrait.php | 5 +- src/constants/tests/AnnotationReaderTest.php | 1 + src/constants/tests/Stub/ErrorCodeStub.php | 1 + src/consul/src/Agent.php | 1 + src/consul/src/AgentInterface.php | 1 + src/consul/src/Catalog.php | 1 + src/consul/src/CatalogInterface.php | 1 + src/consul/src/Client.php | 1 + src/consul/src/ConfigProvider.php | 1 + src/consul/src/ConsulResponse.php | 1 + src/consul/src/Exception/ClientException.php | 1 + src/consul/src/Exception/ConsulException.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/consul/src/Exception/ServerException.php | 1 + src/consul/src/Health.php | 1 + src/consul/src/HealthInterface.php | 1 + src/consul/src/KV.php | 1 + src/consul/src/KVInterface.php | 1 + src/consul/src/Session.php | 1 + src/consul/src/SessionInterface.php | 1 + src/consul/src/Utils.php | 1 + src/consul/tests/AgentTest.php | 4 +- src/consul/tests/ClientTest.php | 8 +- src/consul/tests/KVTest.php | 4 +- src/consul/tests/Stub/Client.php | 1 + src/context/src/ApplicationContext.php | 1 + src/context/src/Context.php | 1 + src/context/src/RequestContext.php | 1 + src/context/src/ResponseContext.php | 1 + src/context/src/Traits/CoroutineProxy.php | 1 + src/context/tests/ApplicationContextTest.php | 1 + src/context/tests/ContextTest.php | 1 + .../tests/Traits/CoroutineProxyTest.php | 1 + src/contract/src/ApplicationInterface.php | 1 + src/contract/src/Arrayable.php | 1 + src/contract/src/Castable.php | 1 + src/contract/src/CastsAttributes.php | 1 + src/contract/src/CastsInboundAttributes.php | 1 + src/contract/src/CompressInterface.php | 1 + src/contract/src/ConfigInterface.php | 1 + src/contract/src/ConnectionInterface.php | 1 + src/contract/src/ContainerInterface.php | 8 +- src/contract/src/DispatcherInterface.php | 1 + src/contract/src/FrequencyInterface.php | 1 + src/contract/src/IPReaderInterface.php | 1 + src/contract/src/IdGeneratorInterface.php | 1 + src/contract/src/JsonDeSerializable.php | 1 + src/contract/src/Jsonable.php | 1 + .../src/LengthAwarePaginatorInterface.php | 1 + src/contract/src/MessageBag.php | 1 + src/contract/src/MessageProvider.php | 1 + .../src/MiddlewareInitializerInterface.php | 1 + src/contract/src/NormalizerInterface.php | 1 + src/contract/src/OnCloseInterface.php | 1 + src/contract/src/OnHandShakeInterface.php | 1 + src/contract/src/OnMessageInterface.php | 1 + src/contract/src/OnOpenInterface.php | 1 + src/contract/src/OnPacketInterface.php | 1 + src/contract/src/OnReceiveInterface.php | 1 + src/contract/src/OnRequestInterface.php | 1 + src/contract/src/PackerInterface.php | 1 + src/contract/src/PaginatorInterface.php | 1 + src/contract/src/PoolInterface.php | 1 + src/contract/src/PoolOptionInterface.php | 1 + src/contract/src/ProcessInterface.php | 1 + src/contract/src/ResponseEmitterInterface.php | 1 + src/contract/src/SessionInterface.php | 1 + src/contract/src/StdoutLoggerInterface.php | 1 + src/contract/src/Synchronized.php | 1 + src/contract/src/TranslatorInterface.php | 1 + .../src/TranslatorLoaderInterface.php | 1 + src/contract/src/UnCompressInterface.php | 1 + src/contract/src/ValidatorInterface.php | 1 + src/contract/src/Xmlable.php | 1 + src/coordinator/src/Constants.php | 1 + src/coordinator/src/Coordinator.php | 1 + src/coordinator/src/CoordinatorManager.php | 1 + .../ResumeExitCoordinatorListener.php | 1 + src/coordinator/src/Timer.php | 1 + src/coordinator/tests/CoordinatorTest.php | 1 + src/coordinator/tests/TimerTest.php | 1 + src/coroutine/src/Channel/Caller.php | 1 + src/coroutine/src/Channel/Manager.php | 1 + src/coroutine/src/Channel/Pool.php | 1 + src/coroutine/src/Concurrent.php | 1 + src/coroutine/src/Coroutine.php | 3 +- .../src/Exception/ChannelClosedException.php | 1 + .../src/Exception/ExceptionThrower.php | 1 + .../Exception/InvalidArgumentException.php | 1 + .../Exception/ParallelExecutionException.php | 1 + .../src/Exception/TimeoutException.php | 1 + .../src/Exception/WaitTimeoutException.php | 1 + src/coroutine/src/Functions.php | 6 +- src/coroutine/src/Locker.php | 1 + src/coroutine/src/Parallel.php | 1 + src/coroutine/src/WaitGroup.php | 1 + src/coroutine/src/Waiter.php | 1 + src/coroutine/tests/Channel/CallerTest.php | 1 + .../tests/Channel/ChannelManagerTest.php | 1 + src/coroutine/tests/ConcurrentTest.php | 1 + src/coroutine/tests/ContainerTest.php | 1 + src/coroutine/tests/CoroutineTest.php | 4 +- src/coroutine/tests/FunctionTest.php | 4 +- src/coroutine/tests/LockerTest.php | 1 + src/coroutine/tests/ParallelTest.php | 4 +- src/coroutine/tests/Stub/Bar.php | 1 + src/coroutine/tests/Stub/Foo.php | 1 + src/coroutine/tests/WaitGroupTest.php | 1 + src/coroutine/tests/WaiterTest.php | 1 + src/crontab/src/Annotation/Crontab.php | 5 +- src/crontab/src/Command/RunCommand.php | 1 + src/crontab/src/ConfigProvider.php | 1 + src/crontab/src/Crontab.php | 5 +- src/crontab/src/CrontabManager.php | 1 + src/crontab/src/Event/AfterExecute.php | 1 + src/crontab/src/Event/BeforeExecute.php | 1 + .../src/Event/CrontabDispatcherStarted.php | 1 + src/crontab/src/Event/Event.php | 1 + src/crontab/src/Event/FailToExecute.php | 1 + .../Exception/InvalidArgumentException.php | 1 + .../src/Listener/CrontabRegisterListener.php | 1 + .../src/Listener/OnPipeMessageListener.php | 1 + src/crontab/src/LoggerInterface.php | 1 + src/crontab/src/ManagesFrequencies.php | 1 + src/crontab/src/Mutex/RedisServerMutex.php | 3 +- src/crontab/src/Mutex/RedisTaskMutex.php | 1 + src/crontab/src/Mutex/ServerMutex.php | 1 + src/crontab/src/Mutex/ServerNodeInterface.php | 1 + src/crontab/src/Mutex/TaskMutex.php | 1 + src/crontab/src/Parser.php | 3 +- src/crontab/src/PipeMessage.php | 1 + .../src/Process/CrontabDispatcherProcess.php | 1 + src/crontab/src/Schedule.php | 1 + src/crontab/src/Scheduler.php | 1 + src/crontab/src/Strategy/AbstractStrategy.php | 1 + .../src/Strategy/CoroutineStrategy.php | 1 + src/crontab/src/Strategy/Executor.php | 4 +- src/crontab/src/Strategy/ProcessStrategy.php | 1 + .../src/Strategy/StrategyInterface.php | 1 + .../src/Strategy/TaskWorkerStrategy.php | 1 + src/crontab/src/Strategy/WorkerStrategy.php | 1 + src/crontab/tests/CrontabAnnotationTest.php | 1 + src/crontab/tests/CrontabManagerTest.php | 1 + .../tests/CrontabRegisterListenerTest.php | 1 + src/crontab/tests/CrontabTest.php | 1 + src/crontab/tests/DispatcherTest.php | 1 + src/crontab/tests/ExecutorTest.php | Bin 5747 -> 5748 bytes src/crontab/tests/FrequencyTest.php | 1 + src/crontab/tests/ParserCronNumberTest.php | 1 + src/crontab/tests/ParserTest.php | 1 + src/crontab/tests/SchedulerTest.php | 1 + src/crontab/tests/Stub/FooCron.php | 1 + src/crontab/tests/Stub/FooCron2.php | 1 + src/dag/src/Dag.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/dag/src/Runner.php | 1 + src/dag/src/Vertex.php | 1 + src/dag/tests/DagTest.php | 39 ++-- ...PostgreSqlSwooleExtManagesTransactions.php | 1 + src/database-pgsql/src/ConfigProvider.php | 1 + .../src/Connectors/PostgresConnector.php | 1 + .../PostgresSqlSwooleExtConnector.php | 1 + src/database-pgsql/src/DBAL/Connection.php | 1 + src/database-pgsql/src/DBAL/Exception.php | 4 +- .../src/DBAL/PostgresDriver.php | 1 + src/database-pgsql/src/DBAL/Result.php | 7 +- src/database-pgsql/src/DBAL/Statement.php | 4 +- .../Listener/RegisterConnectionListener.php | 1 + .../src/PostgreSqlConnection.php | 4 +- .../src/PostgreSqlSwooleExtConnection.php | 4 +- .../src/Query/Grammars/PostgresGrammar.php | 3 +- .../Grammars/PostgresSqlSwooleExtGrammar.php | 1 + .../Query/Processors/PostgresProcessor.php | 1 + .../src/Schema/ForeignIdColumnDefinition.php | 6 +- .../src/Schema/Grammars/PostgresGrammar.php | 4 +- .../Grammars/PostgresSqlSwooleExtGrammar.php | 1 + .../src/Schema/PostgresBuilder.php | 1 + .../Cases/DatabasePostgresBuilderTest.php | 1 + .../Cases/DatabasePostgresProcessorTest.php | 1 + .../DatabasePostgresQueryGrammarTest.php | 1 + .../DatabasePostgresSchemaGrammarTest.php | 1 + .../tests/Cases/PostgreSqlProcessorTest.php | 1 + .../PostgreSqlSwooleExtConnectionTest.php | 1 + .../tests/DBAL/ConnectionTest.php | 1 + .../tests/Stubs/ContainerStub.php | 1 + src/database-sqlite/src/ConfigProvider.php | 1 + .../src/Connectors/SQLiteConnector.php | 1 + .../Listener/RegisterConnectionListener.php | 1 + .../src/Query/Grammars/SQLiteGrammar.php | 1 + .../src/Query/Processors/SQLiteProcessor.php | 1 + src/database-sqlite/src/SQLiteConnection.php | 13 +- .../src/Schema/Grammars/SQLiteGrammar.php | 3 +- .../src/Schema/SQLiteBuilder.php | 1 + .../tests/DatabaseSQLiteBuilderTest.php | 1 + .../tests/DatabaseSQLiteProcessorTest.php | 1 + .../tests/DatabaseSQLiteQueryGrammarTest.php | 1 + .../tests/DatabaseSQLiteSchemaGrammarTest.php | 1 + src/database/ide/ModelIDE.php | 19 +- .../Annotations/RewriteReturnType.php | 1 + .../src/Commands/Ast/AbstractVisitor.php | 1 + .../Commands/Ast/GenerateModelIDEVisitor.php | 5 +- .../Ast/ModelRewriteConnectionVisitor.php | 1 + .../Ast/ModelRewriteGetterSetterVisitor.php | 1 + .../Ast/ModelRewriteInheritanceVisitor.php | 1 + .../Ast/ModelRewriteKeyInfoVisitor.php | 1 + .../Ast/ModelRewriteSoftDeletesVisitor.php | 1 + .../Ast/ModelRewriteTimestampsVisitor.php | 1 + .../src/Commands/Ast/ModelUpdateVisitor.php | 1 + .../src/Commands/CommandCollector.php | 1 + .../src/Commands/Migrations/BaseCommand.php | 1 + .../src/Commands/Migrations/FreshCommand.php | 1 + .../Commands/Migrations/GenMigrateCommand.php | 1 + .../Commands/Migrations/InstallCommand.php | 1 + .../Commands/Migrations/MigrateCommand.php | 1 + .../Commands/Migrations/RefreshCommand.php | 1 + .../src/Commands/Migrations/ResetCommand.php | 1 + .../Commands/Migrations/RollbackCommand.php | 1 + .../src/Commands/Migrations/StatusCommand.php | 3 +- .../src/Commands/Migrations/TableGuesser.php | 1 + src/database/src/Commands/ModelCommand.php | 1 + src/database/src/Commands/ModelData.php | 1 + src/database/src/Commands/ModelOption.php | 1 + .../src/Commands/Seeders/BaseCommand.php | 1 + .../src/Commands/Seeders/GenSeederCommand.php | 1 + .../src/Commands/Seeders/SeedCommand.php | 1 + src/database/src/Concerns/BuildsQueries.php | 1 + .../src/Concerns/ManagesTransactions.php | 1 + src/database/src/Connection.php | 24 +-- src/database/src/ConnectionInterface.php | 1 + src/database/src/ConnectionResolver.php | 5 +- .../src/ConnectionResolverInterface.php | 1 + .../src/Connectors/ConnectionFactory.php | 3 +- src/database/src/Connectors/Connector.php | 1 + .../src/Connectors/ConnectorInterface.php | 1 + .../src/Connectors/MySqlConnector.php | 1 + .../src/DBAL/Concerns/ConnectsToDatabase.php | 1 + src/database/src/DBAL/Connection.php | 1 + src/database/src/DBAL/MySqlDriver.php | 1 + src/database/src/DetectsDeadlocks.php | 1 + src/database/src/DetectsLostConnections.php | 1 + src/database/src/Events/ConnectionEvent.php | 1 + src/database/src/Events/QueryExecuted.php | 1 + src/database/src/Events/StatementPrepared.php | 1 + .../src/Events/TransactionBeginning.php | 1 + .../src/Events/TransactionCommitted.php | 1 + .../src/Events/TransactionRolledBack.php | 1 + .../Exception/InvalidArgumentException.php | 1 + .../src/Exception/InvalidBindingException.php | 1 + .../src/Exception/InvalidCastException.php | 1 + src/database/src/Exception/QueryException.php | 1 + src/database/src/Grammar.php | 1 + .../DatabaseMigrationRepository.php | 10 +- src/database/src/Migrations/Migration.php | 1 + .../src/Migrations/MigrationCreator.php | 1 + .../MigrationRepositoryInterface.php | 3 +- src/database/src/Migrations/Migrator.php | 1 + src/database/src/Model/Booted.php | 1 + src/database/src/Model/Builder.php | 63 +++---- src/database/src/Model/CastsValue.php | 1 + src/database/src/Model/Collection.php | 15 +- src/database/src/Model/CollectionMeta.php | 1 + src/database/src/Model/Concerns/CamelCase.php | 1 + .../src/Model/Concerns/GuardsAttributes.php | 1 + .../src/Model/Concerns/HasAttributes.php | 5 +- src/database/src/Model/Concerns/HasEvents.php | 1 + .../src/Model/Concerns/HasGlobalScopes.php | 9 +- .../src/Model/Concerns/HasRelationships.php | 49 ++--- .../src/Model/Concerns/HasTimestamps.php | 1 + src/database/src/Model/Concerns/HasUlids.php | 1 + src/database/src/Model/Concerns/HasUuids.php | 1 + .../src/Model/Concerns/HidesAttributes.php | 1 + .../Model/Concerns/QueriesRelationships.php | 29 ++- src/database/src/Model/EnumCollector.php | 1 + src/database/src/Model/Events/Booted.php | 1 + src/database/src/Model/Events/Booting.php | 1 + src/database/src/Model/Events/Created.php | 1 + src/database/src/Model/Events/Creating.php | 1 + src/database/src/Model/Events/Deleted.php | 1 + src/database/src/Model/Events/Deleting.php | 1 + src/database/src/Model/Events/Event.php | 1 + .../src/Model/Events/ForceDeleted.php | 1 + .../src/Model/Events/ForceDeleting.php | 1 + src/database/src/Model/Events/Restored.php | 1 + src/database/src/Model/Events/Restoring.php | 1 + src/database/src/Model/Events/Retrieved.php | 1 + src/database/src/Model/Events/Saved.php | 1 + src/database/src/Model/Events/Saving.php | 1 + src/database/src/Model/Events/Updated.php | 1 + src/database/src/Model/Events/Updating.php | 1 + src/database/src/Model/Factory.php | 6 +- src/database/src/Model/FactoryBuilder.php | 17 +- src/database/src/Model/GlobalScope.php | 1 + src/database/src/Model/IgnoreOnTouch.php | 1 + .../src/Model/JsonEncodingException.php | 1 + .../src/Model/MassAssignmentException.php | 1 + src/database/src/Model/Model.php | 58 +++--- src/database/src/Model/ModelMeta.php | 1 + .../src/Model/ModelNotFoundException.php | 3 +- src/database/src/Model/Register.php | 1 + .../src/Model/RelationNotFoundException.php | 1 + .../src/Model/Relations/BelongsTo.php | 15 +- .../src/Model/Relations/BelongsToMany.php | 36 ++-- .../src/Model/Relations/Concerns/AsPivot.php | 11 +- .../Concerns/InteractsWithPivotTable.php | 17 +- .../Concerns/SupportsDefaultModels.php | 5 +- .../src/Model/Relations/Constraint.php | 1 + src/database/src/Model/Relations/HasMany.php | 1 + .../src/Model/Relations/HasManyThrough.php | 34 ++-- src/database/src/Model/Relations/HasOne.php | 3 +- .../src/Model/Relations/HasOneOrMany.php | 21 +-- .../src/Model/Relations/HasOneThrough.php | 3 +- .../src/Model/Relations/MorphMany.php | 1 + src/database/src/Model/Relations/MorphOne.php | 3 +- .../src/Model/Relations/MorphOneOrMany.php | 3 +- .../src/Model/Relations/MorphPivot.php | 9 +- src/database/src/Model/Relations/MorphTo.php | 15 +- .../src/Model/Relations/MorphToMany.php | 5 +- src/database/src/Model/Relations/Pivot.php | 1 + src/database/src/Model/Relations/Relation.php | 21 +-- src/database/src/Model/Scope.php | 4 +- src/database/src/Model/SoftDeletes.php | 1 + src/database/src/Model/SoftDeletingScope.php | 17 +- src/database/src/Model/TraitInitializers.php | 1 + src/database/src/MySqlBitConnection.php | 1 + src/database/src/MySqlConnection.php | 4 +- src/database/src/Query/Builder.php | 156 ++++++++-------- src/database/src/Query/Expression.php | 1 + src/database/src/Query/Grammars/Grammar.php | 6 +- .../src/Query/Grammars/MySqlGrammar.php | 5 +- src/database/src/Query/JoinClause.php | 20 ++- src/database/src/Query/JsonExpression.php | 1 + .../src/Query/Processors/MySqlProcessor.php | 1 + .../src/Query/Processors/Processor.php | 1 + src/database/src/Schema/Blueprint.php | 122 ++++++------- src/database/src/Schema/Builder.php | 7 +- src/database/src/Schema/Column.php | 1 + src/database/src/Schema/ColumnDefinition.php | 1 + .../src/Schema/ForeignIdColumnDefinition.php | 1 + .../src/Schema/ForeignKeyDefinition.php | 1 + .../src/Schema/Grammars/ChangeColumn.php | 15 +- src/database/src/Schema/Grammars/Grammar.php | 7 +- .../src/Schema/Grammars/MySqlGrammar.php | 1 + .../src/Schema/Grammars/RenameColumn.php | 8 +- src/database/src/Schema/MySqlBuilder.php | 1 + src/database/src/Schema/Schema.php | 1 + src/database/src/Seeders/Seed.php | 1 + src/database/src/Seeders/Seeder.php | 1 + src/database/src/Seeders/SeederCreator.php | 1 + src/database/tests/ConnectionTest.php | 1 + src/database/tests/DatabaseConnectionTest.php | 1 + .../tests/DatabaseGenMigrationCommandTest.php | 1 + .../tests/DatabaseMigrationCreatorTest.php | 1 + .../DatabaseMigrationInstallCommandTest.php | 1 + .../DatabaseMigrationMigrateCommandTest.php | 3 +- .../tests/DatabaseMigrationRepositoryTest.php | 1 + .../DatabaseMigrationResetCommandTest.php | 1 + .../DatabaseMigrationRollbackCommandTest.php | 1 + .../tests/DatabaseMigratorIntegrationTest.php | 1 + .../tests/DatabaseModelCustomCastingTest.php | 1 + .../tests/DatabaseMySqlQueryGrammarTest.php | 1 + .../tests/DatabaseQueryBuilderTest.php | 1 + src/database/tests/GenModelTest.php | 6 +- src/database/tests/GrammarTest.php | 1 + src/database/tests/Model/CollectionTest.php | 1 + src/database/tests/ModelBuilderTest.php | 21 ++- src/database/tests/ModelCollectionTest.php | 1 + .../tests/ModelDynamicRelationsTest.php | 1 + src/database/tests/ModelGenerateTest.php | 1 + .../tests/ModelMorphEagerLoadingTest.php | 1 + src/database/tests/ModelRealBuilderTest.php | 11 +- src/database/tests/ModelTest.php | 7 +- src/database/tests/MySqlProcessorTest.php | 1 + src/database/tests/MySqlSchemaGrammarTest.php | 1 + src/database/tests/ProcessorTest.php | 3 +- src/database/tests/QueryBuilderTest.php | 4 +- src/database/tests/Stubs/ContainerStub.php | 1 + src/database/tests/Stubs/DateModelStub.php | 1 + .../Stubs/DifferentConnectionModelStub.php | 1 + src/database/tests/Stubs/ExceptionPDO.php | 1 + src/database/tests/Stubs/FooBarTrait.php | 1 + src/database/tests/Stubs/IntegerStatus.php | 1 + src/database/tests/Stubs/KeyTypeModelStub.php | 1 + .../Stubs/MigrationCreatorFakeMigration.php | 1 + src/database/tests/Stubs/Model/Book.php | 7 +- src/database/tests/Stubs/Model/Gender.php | 1 + src/database/tests/Stubs/Model/Image.php | 7 +- src/database/tests/Stubs/Model/Model.php | 1 + src/database/tests/Stubs/Model/Role.php | 7 +- .../Stubs/Model/TestGenerateIdeModel.php | 7 +- src/database/tests/Stubs/Model/TestModel.php | 7 +- .../tests/Stubs/Model/TestVersionModel.php | 6 +- src/database/tests/Stubs/Model/User.php | 7 +- src/database/tests/Stubs/Model/UserBit.php | 7 +- src/database/tests/Stubs/Model/UserEnum.php | 7 +- src/database/tests/Stubs/Model/UserExt.php | 7 +- .../tests/Stubs/Model/UserExtCamel.php | 6 +- .../tests/Stubs/Model/UserExtEmpty.php | 1 + src/database/tests/Stubs/Model/UserRole.php | 7 +- .../tests/Stubs/Model/UserRoleMorphPivot.php | 1 + .../tests/Stubs/Model/UserRolePivot.php | 1 + src/database/tests/Stubs/ModelAppendsStub.php | 1 + .../tests/Stubs/ModelBootingTestStub.php | 1 + src/database/tests/Stubs/ModelCamelStub.php | 1 + src/database/tests/Stubs/ModelCastingStub.php | 1 + src/database/tests/Stubs/ModelDestroyStub.php | 1 + .../tests/Stubs/ModelDynamicHiddenStub.php | 1 + .../tests/Stubs/ModelDynamicVisibleStub.php | 1 + .../tests/Stubs/ModelEventListenerStub.php | 1 + .../tests/Stubs/ModelEventObjectStub.php | 1 + .../tests/Stubs/ModelFindWithWritePdoStub.php | 1 + .../tests/Stubs/ModelGetMutatorsStub.php | 1 + .../tests/Stubs/ModelHydrateRawStub.php | 1 + .../tests/Stubs/ModelNamespacedStub.php | 1 + .../tests/Stubs/ModelNonIncrementingStub.php | 1 + .../tests/Stubs/ModelObserverStub.php | 1 + src/database/tests/Stubs/ModelSaveStub.php | 1 + .../tests/Stubs/ModelSavingEventStub.php | 1 + src/database/tests/Stubs/ModelStub.php | 1 + .../tests/Stubs/ModelStubWithTrait.php | 1 + .../tests/Stubs/ModelStubWithUlid.php | 1 + .../tests/Stubs/ModelStubWithUuid.php | 1 + src/database/tests/Stubs/ModelWithStub.php | 1 + .../tests/Stubs/ModelWithoutRelationStub.php | 1 + .../tests/Stubs/ModelWithoutTableStub.php | 1 + .../tests/Stubs/NoConnectionModelStub.php | 1 + src/database/tests/Stubs/StringStatus.php | 1 + .../tests/Stubs/TestAnotherObserverStub.php | 1 + src/database/tests/Stubs/TestObserverStub.php | 1 + src/database/tests/Stubs/User.php | 1 + .../publish/DbQueryExecutedListener.php | 1 + src/db-connection/publish/databases.php | 4 +- .../src/Annotation/Transactional.php | 1 + .../src/Aspect/TransactionAspect.php | 1 + .../src/Collector/TableCollector.php | 1 + src/db-connection/src/ConfigProvider.php | 1 + src/db-connection/src/Connection.php | 1 + src/db-connection/src/ConnectionResolver.php | 1 + .../DatabaseMigrationRepositoryFactory.php | 1 + src/db-connection/src/Db.php | 1 + src/db-connection/src/Frequency.php | 1 + .../Listener/InitTableCollectorListener.php | 1 + .../Listener/InitUidOnCreatingListener.php | 1 + .../RegisterConnectionResolverListener.php | 1 + .../UnsetContextInTaskWorkerListener.php | 1 + src/db-connection/src/Model/Model.php | 1 + .../src/Model/Relations/MorphPivot.php | 1 + .../src/Model/Relations/Pivot.php | 1 + src/db-connection/src/Pool/DbPool.php | 1 + src/db-connection/src/Pool/PoolFactory.php | 1 + src/db-connection/src/Traits/DbConnection.php | 1 + src/db-connection/src/Traits/HasContainer.php | 1 + .../src/Traits/HasRepository.php | 1 + src/db-connection/tests/ConnectionTest.php | 1 + src/db-connection/tests/FooModel.php | 1 + src/db-connection/tests/FrequencyTest.php | 1 + src/db-connection/tests/RelationTest.php | 1 + .../tests/Stubs/ConnectionStub.php | 1 + .../tests/Stubs/ContainerStub.php | 1 + .../tests/Stubs/FrequencyStub.php | 1 + .../tests/Stubs/MySqlConnectorStub.php | 1 + .../tests/Stubs/PDOStatementStub.php | 1 + .../tests/Stubs/PDOStatementStubPHP8.php | 1 + src/db-connection/tests/Stubs/PDOStub.php | 1 + .../tests/TableCollectorTest.php | 1 + src/db-connection/tests/TransactionalTest.php | 1 + src/db/src/AbstractConnection.php | 1 + src/db/src/ConfigProvider.php | 1 + src/db/src/ConnectionInterface.php | 1 + src/db/src/DB.php | 1 + src/db/src/DetectsLostConnections.php | 1 + .../src/Exception/DriverNotFoundException.php | 1 + .../src/Exception/InvalidDriverException.php | 1 + src/db/src/Exception/QueryException.php | 1 + src/db/src/Exception/RuntimeException.php | 1 + src/db/src/Frequency.php | 1 + src/db/src/ManagesTransactions.php | 1 + src/db/src/MySQLConnection.php | 1 + src/db/src/PgSQL/PgSQLConnection.php | 1 + src/db/src/PgSQL/PgSQLPool.php | 1 + src/db/src/Pool/MySQLPool.php | 1 + src/db/src/Pool/Pool.php | 1 + src/db/src/Pool/PoolFactory.php | 1 + src/db/tests/Cases/AbstractTestCase.php | 1 + src/db/tests/Cases/CustomDriverTest.php | 1 + src/db/tests/Cases/DBTest.php | 1 + src/db/tests/Cases/MySQLDriverTest.php | 1 + src/db/tests/Cases/PgSQL/PgSQLTest.php | 1 + src/devtool/src/Adapter/AbstractAdapter.php | 1 + src/devtool/src/Adapter/Aspects.php | 1 + src/devtool/src/ConfigProvider.php | 1 + src/devtool/src/Describe/AspectsCommand.php | 1 + src/devtool/src/Describe/ListenersCommand.php | 1 + src/devtool/src/Describe/RoutesCommand.php | 1 + .../src/Generator/AmqpConsumerCommand.php | 1 + .../src/Generator/AmqpProducerCommand.php | 1 + src/devtool/src/Generator/AspectCommand.php | 1 + src/devtool/src/Generator/ClassCommand.php | 1 + src/devtool/src/Generator/CommandCommand.php | 1 + src/devtool/src/Generator/ConstantCommand.php | 1 + .../src/Generator/ControllerCommand.php | 1 + .../src/Generator/GeneratorCommand.php | 1 + src/devtool/src/Generator/JobCommand.php | 1 + .../src/Generator/KafkaConsumerCommand.php | 1 + src/devtool/src/Generator/ListenerCommand.php | 1 + .../src/Generator/MiddlewareCommand.php | 1 + .../src/Generator/NatsConsumerCommand.php | 1 + .../src/Generator/NsqConsumerCommand.php | 1 + src/devtool/src/Generator/ProcessCommand.php | 1 + src/devtool/src/Generator/RequestCommand.php | 1 + src/devtool/src/Generator/ResourceCommand.php | 1 + src/devtool/src/Info.php | 1 + src/devtool/src/InfoCommand.php | 1 + src/devtool/src/VendorPublishCommand.php | 1 + .../tests/Describe/RoutesCommandTest.php | 1 + src/devtool/tests/Stub/ContainerStub.php | 1 + src/devtool/tests/Stub/IndexController.php | 1 + .../AbstractCallableDefinitionCollector.php | 1 + src/di/src/Annotation/AbstractAnnotation.php | 1 + .../Annotation/AbstractMultipleAnnotation.php | 1 + src/di/src/Annotation/AnnotationCollector.php | 1 + src/di/src/Annotation/AnnotationInterface.php | 1 + src/di/src/Annotation/AnnotationReader.php | 1 + src/di/src/Annotation/Aspect.php | 1 + src/di/src/Annotation/AspectCollector.php | 1 + src/di/src/Annotation/AspectLoader.php | 1 + src/di/src/Annotation/Debug.php | 1 + src/di/src/Annotation/Inject.php | 1 + src/di/src/Annotation/InjectAspect.php | 1 + src/di/src/Annotation/MultipleAnnotation.php | 1 + .../MultipleAnnotationInterface.php | 1 + src/di/src/Annotation/RelationCollector.php | 1 + src/di/src/Annotation/ScanConfig.php | 1 + src/di/src/Annotation/Scanner.php | 1 + src/di/src/Aop/AbstractAspect.php | 1 + src/di/src/Aop/AnnotationMetadata.php | 1 + src/di/src/Aop/AroundInterface.php | 1 + src/di/src/Aop/Aspect.php | 1 + src/di/src/Aop/AspectManager.php | 1 + src/di/src/Aop/Ast.php | 1 + src/di/src/Aop/AstVisitorRegistry.php | 1 + src/di/src/Aop/Pipeline.php | 1 + src/di/src/Aop/ProceedingJoinPoint.php | 1 + src/di/src/Aop/PropertyHandlerTrait.php | 1 + src/di/src/Aop/PropertyHandlerVisitor.php | 4 +- src/di/src/Aop/ProxyCallVisitor.php | 3 +- src/di/src/Aop/ProxyManager.php | 1 + src/di/src/Aop/ProxyTrait.php | 1 + .../src/Aop/RegisterInjectPropertyHandler.php | 1 + src/di/src/Aop/RewriteCollection.php | 1 + src/di/src/Aop/VisitorMetadata.php | 1 + src/di/src/ClassLoader.php | 1 + src/di/src/ClosureDefinitionCollector.php | 1 + .../ClosureDefinitionCollectorInterface.php | 1 + src/di/src/ConfigProvider.php | 1 + src/di/src/Container.php | 1 + src/di/src/Definition/DefinitionInterface.php | 1 + src/di/src/Definition/DefinitionSource.php | 1 + .../Definition/DefinitionSourceFactory.php | 1 + .../Definition/DefinitionSourceInterface.php | 1 + src/di/src/Definition/FactoryDefinition.php | 1 + src/di/src/Definition/MethodInjection.php | 1 + src/di/src/Definition/ObjectDefinition.php | 3 +- src/di/src/Definition/PriorityDefinition.php | 1 + src/di/src/Definition/PropertyDefinition.php | 1 + .../src/Definition/PropertyHandlerManager.php | 1 + src/di/src/Definition/Reference.php | 1 + .../SelfResolvingDefinitionInterface.php | 1 + src/di/src/Exception/AnnotationException.php | 1 + .../Exception/CircularDependencyException.php | 1 + .../Exception/ConflictAnnotationException.php | 1 + src/di/src/Exception/DependencyException.php | 1 + .../Exception/DirectoryNotExistException.php | 1 + src/di/src/Exception/Exception.php | 1 + .../Exception/InvalidArgumentException.php | 1 + .../Exception/InvalidDefinitionException.php | 1 + src/di/src/Exception/NotCallableException.php | 1 + src/di/src/Exception/NotFoundException.php | 1 + .../LazyLoader/AbstractLazyProxyBuilder.php | 1 + .../src/LazyLoader/ClassLazyProxyBuilder.php | 1 + .../LazyLoader/FallbackLazyProxyBuilder.php | 1 + .../LazyLoader/InterfaceLazyProxyBuilder.php | 1 + src/di/src/LazyLoader/LazyLoader.php | 1 + src/di/src/LazyLoader/LazyProxyTrait.php | 1 + src/di/src/LazyLoader/PublicMethodVisitor.php | 1 + src/di/src/MetadataCacheCollector.php | 1 + src/di/src/MetadataCollector.php | 1 + src/di/src/MetadataCollectorInterface.php | 1 + src/di/src/MethodDefinitionCollector.php | 1 + .../MethodDefinitionCollectorInterface.php | 1 + src/di/src/ReflectionManager.php | 1 + src/di/src/ReflectionType.php | 1 + src/di/src/Resolver/DepthGuard.php | 1 + src/di/src/Resolver/FactoryResolver.php | 1 + src/di/src/Resolver/ObjectResolver.php | 1 + src/di/src/Resolver/ParameterResolver.php | 4 +- src/di/src/Resolver/ResolverDispatcher.php | 1 + src/di/src/Resolver/ResolverInterface.php | 1 + src/di/src/ScanHandler/NullScanHandler.php | 1 + src/di/src/ScanHandler/PcntlScanHandler.php | 1 + src/di/src/ScanHandler/ProcScanHandler.php | 1 + .../src/ScanHandler/ScanHandlerInterface.php | 1 + src/di/src/ScanHandler/Scanned.php | 1 + src/di/tests/Annotation/AspectLoaderTest.php | 1 + src/di/tests/Annotation/ScannerTest.php | 4 +- src/di/tests/AnnotationReaderTest.php | 1 + src/di/tests/AnnotationTest.php | 1 + src/di/tests/Aop/PipelineTest.php | 1 + src/di/tests/Aop/ProxyCallVisitorTest.php | 1 + src/di/tests/AopAspectTest.php | 1 + src/di/tests/AstTest.php | 1 + src/di/tests/ClassLazyProxyBuilderTest.php | 1 + src/di/tests/ClassLoaderTest.php | 1 + src/di/tests/ClosureDefinitionTest.php | 1 + src/di/tests/ContainerTest.php | 1 + .../tests/Definition/DefinitionSourceTest.php | 1 + .../Definition/PriorityDefinitionTest.php | 1 + src/di/tests/DefinitionSourceTest.php | 1 + .../ExceptionStub/DemoInjectException.php | 1 + src/di/tests/InjectTest.php | 20 ++- .../tests/InterfaceLazyProxyBuilderTest.php | 1 + src/di/tests/LazyProxyTraitTest.php | 1 + src/di/tests/MakeTest.php | 4 +- src/di/tests/MetadataCollectorTest.php | 1 + src/di/tests/MethodDefinitionTest.php | 1 + src/di/tests/ProceedingJoinPointTest.php | 1 + src/di/tests/ProxyTraitTest.php | 1 + src/di/tests/PublicMethodVisitorTest.php | 1 + src/di/tests/ReflectionTest.php | 1 + src/di/tests/ResolverDispatcherTest.php | 1 + src/di/tests/Stub/AnnotationCollector.php | 1 + src/di/tests/Stub/Aspect/Debug1Aspect.php | 1 + src/di/tests/Stub/Aspect/Debug2Aspect.php | 1 + src/di/tests/Stub/Aspect/Debug3Aspect.php | 1 + .../tests/Stub/Aspect/DebugLoaderAspect.php | 1 + src/di/tests/Stub/Aspect/GetNameAspect.php | 1 + src/di/tests/Stub/Aspect/GetParamsAspect.php | 1 + src/di/tests/Stub/Aspect/IncrAspect.php | 1 + .../Stub/Aspect/IncrAspectAnnotation.php | 1 + src/di/tests/Stub/Aspect/NoProcessAspect.php | 1 + src/di/tests/Stub/AspectCollector.php | 1 + src/di/tests/Stub/Ast/Abs.php | 1 + src/di/tests/Stub/Ast/AbsAspect.php | 1 + src/di/tests/Stub/Ast/Bar.php | 1 + src/di/tests/Stub/Ast/Bar2.php | 1 + src/di/tests/Stub/Ast/Bar3.php | 1 + src/di/tests/Stub/Ast/Bar4.php | 1 + src/di/tests/Stub/Ast/Bar5.php | 1 + src/di/tests/Stub/Ast/BarAspect.php | 1 + src/di/tests/Stub/Ast/BarInterface.php | 1 + src/di/tests/Stub/Ast/Chi.php | 1 + src/di/tests/Stub/Ast/Foo.php | 1 + src/di/tests/Stub/Ast/FooTrait.php | 1 + src/di/tests/Stub/Bar.php | 1 + .../Stub/Container/Container1HasInterface.php | 1 + .../Stub/Container/Container2HasInterface.php | 1 + .../tests/Stub/Container/ContainerProxy.php | 1 + src/di/tests/Stub/Demo.php | 1 + src/di/tests/Stub/DemoAnnotation.php | 1 + src/di/tests/Stub/DemoInject.php | 1 + src/di/tests/Stub/EmptyVarValue.php | 1 + src/di/tests/Stub/Foo.php | 1 + src/di/tests/Stub/Foo2Aspect.php | 1 + src/di/tests/Stub/FooAspect.php | 1 + src/di/tests/Stub/FooEnum.php | 1 + src/di/tests/Stub/FooEnumStruct.php | 1 + src/di/tests/Stub/FooFactory.php | 1 + src/di/tests/Stub/FooInterface.php | 1 + .../tests/Stub/FooWithNotExistAnnotation.php | 1 + src/di/tests/Stub/Ignore.php | 1 + src/di/tests/Stub/IgnoreDemoAnnotation.php | 1 + src/di/tests/Stub/Inject/Bar.php | 1 + src/di/tests/Stub/Inject/Foo.php | 1 + src/di/tests/Stub/Inject/Foo2Trait.php | 1 + src/di/tests/Stub/Inject/Foo3Trait.php | 1 + src/di/tests/Stub/Inject/FooTrait.php | 1 + src/di/tests/Stub/Inject/Origin2Class.php | 1 + src/di/tests/Stub/Inject/Origin3Class.php | 1 + src/di/tests/Stub/Inject/Origin4Class.php | 1 + src/di/tests/Stub/Inject/Origin5Class.php | 1 + src/di/tests/Stub/Inject/Origin6Class.php | 1 + src/di/tests/Stub/Inject/Origin7Class.php | 1 + src/di/tests/Stub/Inject/OriginClass.php | 1 + src/di/tests/Stub/Inject/Parent2Class.php | 1 + src/di/tests/Stub/Inject/Parent3Class.php | 1 + src/di/tests/Stub/Inject/Parent4Class.php | 1 + src/di/tests/Stub/Inject/ParentClass.php | 1 + src/di/tests/Stub/Inject/Tar.php | 1 + src/di/tests/Stub/LazyLoad/BarLazyLoad.php | 1 + src/di/tests/Stub/LazyLoad/FooLazyLoad.php | 1 + src/di/tests/Stub/LazyProxy.php | 1 + src/di/tests/Stub/NotFoundAttributeTarget.php | 1 + src/di/tests/Stub/Par.php | 1 + src/di/tests/Stub/Par2.php | 1 + src/di/tests/Stub/PathStub.php | 1 + src/di/tests/Stub/Proxied.php | 1 + src/di/tests/Stub/ProxyTraitObject.php | 1 + src/di/tests/Stub/ProxyTraitOnTrait.php | 1 + src/dispatcher/src/AbstractDispatcher.php | 1 + src/dispatcher/src/AbstractRequestHandler.php | 1 + src/dispatcher/src/ConfigProvider.php | 1 + .../Exceptions/InvalidArgumentException.php | 1 + src/dispatcher/src/HttpDispatcher.php | 1 + src/dispatcher/src/HttpRequestHandler.php | 1 + src/dispatcher/tests/HttpDispatcherTest.php | 1 + .../tests/Middlewares/CoreMiddleware.php | 1 + .../tests/Middlewares/Test2Middleware.php | 1 + .../tests/Middlewares/TestMiddleware.php | 1 + .../src/ClientBuilderFactory.php | 1 + src/elasticsearch/tests/ClientFactoryTest.php | 1 + src/etcd/composer.json | 3 +- src/etcd/src/Client.php | 1 + src/etcd/src/ConfigProvider.php | 1 + .../src/Exception/ClientNotFindException.php | 1 + src/etcd/src/KVFactory.php | 1 + src/etcd/src/KVInterface.php | 1 + src/etcd/src/V3/EtcdClient.php | 71 ++++---- src/etcd/src/V3/KV.php | 1 + src/etcd/tests/KVTest.php | 1 + src/etcd/tests/Stub/GuzzleClientStub.php | 1 + src/event/src/Annotation/Listener.php | 1 + src/event/src/ConfigProvider.php | 1 + src/event/src/Contract/ListenerInterface.php | 1 + src/event/src/EventDispatcher.php | 1 + src/event/src/EventDispatcherFactory.php | 1 + src/event/src/ListenerData.php | 1 + src/event/src/ListenerProvider.php | 1 + src/event/src/ListenerProviderFactory.php | 1 + src/event/src/Stoppable.php | 1 + src/event/tests/ConfigProviderTest.php | 4 +- src/event/tests/Event/Alpha.php | 1 + src/event/tests/Event/Beta.php | 1 + src/event/tests/Event/PriorityEvent.php | 1 + src/event/tests/EventDispatcherTest.php | 8 +- src/event/tests/Listener/AlphaListener.php | 1 + src/event/tests/Listener/BetaListener.php | 1 + src/event/tests/Listener/PriorityListener.php | 1 + src/event/tests/ListenerProviderTest.php | 1 + src/event/tests/ListenerTest.php | 1 + .../src/Annotation/ExceptionHandler.php | 1 + src/exception-handler/src/ConfigProvider.php | 1 + .../src/ExceptionHandler.php | 1 + .../src/ExceptionHandlerDispatcher.php | 1 + .../src/Formatter/DefaultFormatter.php | 1 + .../src/Formatter/FormatterInterface.php | 1 + .../src/Handler/WhoopsExceptionHandler.php | 1 + .../src/Listener/ErrorExceptionHandler.php | 1 + .../src/Listener/ExceptionHandlerListener.php | 1 + src/exception-handler/src/Propagation.php | 1 + .../tests/ErrorExceptionHandlerTest.php | 1 + .../tests/ExceptionHandlerListenerTest.php | 1 + .../tests/ExceptionHandlerTest.php | 1 + src/exception-handler/tests/FormatterTest.php | 1 + .../tests/Stub/BarExceptionHandler.php | 1 + .../tests/Stub/FooExceptionHandler.php | 1 + .../tests/WhoopsExceptionHandlerTest.php | 1 + src/filesystem/publish/file.php | 24 ++- .../src/Adapter/AliyunOssAdapterFactory.php | 1 + .../src/Adapter/CosAdapterFactory.php | 1 + .../src/Adapter/FtpAdapterFactory.php | 1 + .../src/Adapter/LocalAdapterFactory.php | 1 + .../src/Adapter/MemoryAdapterFactory.php | 1 + .../src/Adapter/NullAdapterFactory.php | 1 + .../src/Adapter/QiniuAdapterFactory.php | 1 + .../src/Adapter/S3AdapterFactory.php | 1 + src/filesystem/src/ConfigProvider.php | 1 + .../src/Contract/AdapterFactoryInterface.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/filesystem/src/FilesystemFactory.php | 1 + src/filesystem/src/FilesystemInvoker.php | 1 + src/filesystem/src/Version.php | 1 + .../tests/Cases/AbstractTestCase.php | 1 + .../tests/Cases/FilesystemFactoryTest.php | 29 +-- src/framework/src/ApplicationFactory.php | 1 + src/framework/src/Bootstrap/CloseCallback.php | 1 + .../src/Bootstrap/ConnectCallback.php | 1 + .../src/Bootstrap/FinishCallback.php | 1 + .../src/Bootstrap/ManagerStartCallback.php | 1 + .../src/Bootstrap/ManagerStopCallback.php | 1 + .../src/Bootstrap/PacketCallback.php | 1 + .../src/Bootstrap/PipeMessageCallback.php | 1 + .../src/Bootstrap/ReceiveCallback.php | 1 + .../src/Bootstrap/ServerStartCallback.php | 1 + .../src/Bootstrap/ShutdownCallback.php | 1 + src/framework/src/Bootstrap/StartCallback.php | 1 + src/framework/src/Bootstrap/TaskCallback.php | 1 + .../src/Bootstrap/WorkerErrorCallback.php | 1 + .../src/Bootstrap/WorkerExitCallback.php | 1 + .../src/Bootstrap/WorkerStartCallback.php | 1 + .../src/Bootstrap/WorkerStopCallback.php | 1 + src/framework/src/ConfigProvider.php | 1 + src/framework/src/Event/AfterWorkerStart.php | 1 + .../src/Event/BeforeMainServerStart.php | 1 + src/framework/src/Event/BeforeServerStart.php | 1 + src/framework/src/Event/BeforeWorkerStart.php | 1 + src/framework/src/Event/BootApplication.php | 1 + src/framework/src/Event/MainWorkerStart.php | 1 + src/framework/src/Event/OnClose.php | 1 + src/framework/src/Event/OnConnect.php | 1 + src/framework/src/Event/OnFinish.php | 1 + src/framework/src/Event/OnManagerStart.php | 1 + src/framework/src/Event/OnManagerStop.php | 1 + src/framework/src/Event/OnPacket.php | 1 + src/framework/src/Event/OnPipeMessage.php | 1 + src/framework/src/Event/OnReceive.php | 1 + src/framework/src/Event/OnShutdown.php | 1 + src/framework/src/Event/OnStart.php | 1 + src/framework/src/Event/OnTask.php | 1 + src/framework/src/Event/OnWorkerError.php | 1 + src/framework/src/Event/OnWorkerExit.php | 1 + src/framework/src/Event/OnWorkerStop.php | 1 + src/framework/src/Event/OtherWorkerStart.php | 1 + .../src/Exception/NotImplementedException.php | 1 + src/framework/src/Logger/StdoutLogger.php | 1 + src/framework/src/SymfonyEventDispatcher.php | 1 + .../tests/ApplicationFactoryTest.php | 1 + src/framework/tests/StdoutLoggerTest.php | 1 + src/framework/tests/Stub/TestObject.php | 1 + .../src/Annotation/AnnotationTrait.php | 1 + src/graphql/src/Annotation/ExtendType.php | 1 + src/graphql/src/Annotation/Factory.php | 1 + src/graphql/src/Annotation/FailWith.php | 1 + src/graphql/src/Annotation/Field.php | 1 + src/graphql/src/Annotation/Logged.php | 1 + src/graphql/src/Annotation/Mutation.php | 1 + src/graphql/src/Annotation/Query.php | 1 + src/graphql/src/Annotation/Right.php | 1 + src/graphql/src/Annotation/SourceField.php | 1 + src/graphql/src/Annotation/Type.php | 1 + src/graphql/src/AnnotationReader.php | 1 + src/graphql/src/ClassCollector.php | 1 + src/graphql/src/ConfigProvider.php | 4 +- src/graphql/src/FieldsBuilder.php | 9 +- src/graphql/src/FieldsBuilderFactory.php | 1 + src/graphql/src/GraphQLMiddleware.php | 1 + src/graphql/src/InputTypeGenerator.php | 1 + src/graphql/src/InputTypeUtils.php | 4 +- src/graphql/src/QueryProvider.php | 1 + src/graphql/src/ReaderFactory.php | 1 + .../src/RecursiveTypeMapperFactory.php | 1 + src/graphql/src/ResolvableInputObjectType.php | 1 + src/graphql/src/TypeAnnotatedObjectType.php | 1 + src/graphql/src/TypeGenerator.php | 1 + src/graphql/src/TypeMapper.php | 1 + src/grpc-client/src/BaseClient.php | 1 + src/grpc-client/src/BidiStreamingCall.php | 1 + src/grpc-client/src/ClientStreamingCall.php | 1 + src/grpc-client/src/ConfigProvider.php | 1 + src/grpc-client/src/DataFormatter.php | 1 + .../src/Exception/GrpcClientException.php | 1 + src/grpc-client/src/GrpcClient.php | 1 + src/grpc-client/src/GrpcNormalizer.php | 1 + src/grpc-client/src/GrpcPacker.php | 1 + src/grpc-client/src/GrpcTransporter.php | 1 + .../src/Listener/RegisterProtocolListener.php | 1 + src/grpc-client/src/Request.php | 1 + src/grpc-client/src/ServerStreamingCall.php | 1 + src/grpc-client/src/Status.php | 1 + src/grpc-client/src/StreamingCall.php | 1 + src/grpc-client/tests/BaseClientTest.php | 1 + src/grpc-client/tests/GPBMetadata/Grpc.php | 4 +- .../tests/GPBMetadata/RouteGuide.php | 4 +- src/grpc-client/tests/GPBMetadata/User.php | Bin 867 -> 887 bytes src/grpc-client/tests/GoUserServiceTest.php | 1 + src/grpc-client/tests/Grpc/Info.php | 12 +- src/grpc-client/tests/Grpc/UserReply.php | 18 +- src/grpc-client/tests/RequestTest.php | 1 + .../tests/RouteGuideClientTest.php | 1 + src/grpc-client/tests/Routeguide/Feature.php | 22 +-- src/grpc-client/tests/Routeguide/Point.php | 12 +- .../tests/Routeguide/Rectangle.php | 28 +-- .../tests/Routeguide/RouteNote.php | 22 +-- .../tests/Routeguide/RouteSummary.php | 24 +-- src/grpc-client/tests/Stub/HiClient.php | 1 + .../tests/Stub/RouteGuideClient.php | 1 + .../tests/Stub/UserServiceClient.php | 1 + src/grpc-client/tests/UserService/UserId.php | 10 +- .../tests/UserService/UserInfo.php | 14 +- src/grpc-server/src/ConfigProvider.php | 1 + src/grpc-server/src/CoreMiddleware.php | 1 + .../src/Exception/GrpcException.php | 1 + .../src/Exception/GrpcStatusException.php | 1 + .../Handler/GrpcExceptionHandler.php | 1 + .../src/Listener/RegisterProtocolListener.php | 1 + .../src/Listener/RegisterServiceListener.php | 1 + src/grpc-server/src/ResponseEmitter.php | 1 + src/grpc-server/src/Server.php | 1 + src/grpc-server/tests/CoreMiddlewareTest.php | 1 + .../tests/GrpcExceptionHandlerTest.php | 1 + .../tests/Stub/GrpcExceptionHandlerStub.php | 1 + .../Stub/GrpcStatusExceptionHandlerStub.php | 1 + src/grpc/src/Parser.php | 3 +- src/grpc/src/PathGenerator.php | 1 + src/grpc/src/StatusCode.php | 1 + src/guzzle/src/ClientFactory.php | 7 +- src/guzzle/src/ConfigProvider.php | 1 + src/guzzle/src/CoroutineHandler.php | 4 +- src/guzzle/src/HandlerStackFactory.php | 1 + src/guzzle/src/MiddlewareInterface.php | 1 + src/guzzle/src/PoolHandler.php | 1 + src/guzzle/src/RetryMiddleware.php | 1 + src/guzzle/src/RingPHP/CoroutineHandler.php | 1 + src/guzzle/src/RingPHP/PoolHandler.php | 1 + src/guzzle/src/RingPHP/ResourceGenerator.php | 1 + .../tests/Cases/CoroutineHandlerTest.php | 1 + .../tests/Cases/HandlerStackFactoryTest.php | 1 + src/guzzle/tests/Cases/PoolHandlerTest.php | 1 + .../Cases/RingPHPCoroutineHandlerTest.php | 1 + .../tests/Stub/CoroutineHandlerStub.php | 1 + .../tests/Stub/HandlerStackFactoryStub.php | 1 + src/guzzle/tests/Stub/PoolHandlerStub.php | 1 + .../tests/Stub/RingPHPCoroutineHanderStub.php | 1 + src/helper/src/Functions.php | 2 +- src/http-message/src/Base/MessageTrait.php | 1 + src/http-message/src/Base/Request.php | 3 +- src/http-message/src/Base/Response.php | 1 + src/http-message/src/ConfigProvider.php | 1 + src/http-message/src/Cookie/Cookie.php | 1 + src/http-message/src/Cookie/CookieJar.php | 1 + .../src/Cookie/CookieJarInterface.php | 1 + src/http-message/src/Cookie/FileCookieJar.php | 1 + .../src/Cookie/SessionCookieJar.php | 1 + src/http-message/src/Cookie/SetCookie.php | 3 +- .../src/Exception/BadRequestHttpException.php | 1 + .../src/Exception/ForbiddenHttpException.php | 1 + .../src/Exception/HttpException.php | 1 + .../MethodNotAllowedHttpException.php | 1 + .../Exception/NotAcceptableHttpException.php | 1 + .../src/Exception/NotFoundHttpException.php | 1 + .../RangeNotSatisfiableHttpException.php | 1 + .../Exception/ServerErrorHttpException.php | 1 + .../Exception/UnauthorizedHttpException.php | 1 + .../UnprocessableEntityHttpException.php | 1 + .../UnsupportedMediaTypeHttpException.php | 1 + .../src/Server/Chunk/Chunkable.php | 1 + .../src/Server/Chunk/HasChunk.php | 1 + src/http-message/src/Server/Request.php | 7 +- .../src/Server/Request/JsonParser.php | 1 + .../src/Server/Request/Parser.php | 1 + .../src/Server/Request/XmlParser.php | 1 + .../src/Server/RequestParserInterface.php | 1 + src/http-message/src/Server/Response.php | 1 + .../src/Server/ResponsePlusProxy.php | 1 + .../src/Server/ResponseProxyTrait.php | 1 + src/http-message/src/Stream/FileInterface.php | 1 + .../src/Stream/StandardStream.php | 1 + .../src/Stream/SwooleFileStream.php | 4 +- src/http-message/src/Stream/SwooleStream.php | 4 +- src/http-message/src/Upload/UploadedFile.php | 1 + src/http-message/src/Uri/Uri.php | 1 + src/http-message/tests/MessageTraitTest.php | 1 + src/http-message/tests/RequestParserTest.php | 1 + src/http-message/tests/ResponseProxyTest.php | 1 + src/http-message/tests/ResponseTest.php | 1 + src/http-message/tests/ServerRequestTest.php | 12 +- src/http-message/tests/Stub/ParserStub.php | 1 + .../tests/Stub/Server/RequestStub.php | 1 + .../tests/Stub/Server/ResponseStub.php | 1 + src/http-message/tests/SwooleStreamTest.php | 1 + .../tests/Upload/UploadedFileTest.php | 1 + .../src/Annotation/AutoController.php | 1 + src/http-server/src/Annotation/Controller.php | 1 + .../src/Annotation/DeleteMapping.php | 1 + src/http-server/src/Annotation/GetMapping.php | 1 + src/http-server/src/Annotation/Mapping.php | 1 + src/http-server/src/Annotation/Middleware.php | 1 + .../src/Annotation/Middlewares.php | 1 + .../src/Annotation/PatchMapping.php | 1 + .../src/Annotation/PostMapping.php | 1 + src/http-server/src/Annotation/PutMapping.php | 1 + .../src/Annotation/RequestMapping.php | 1 + src/http-server/src/ConfigProvider.php | 1 + .../src/Contract/CoreMiddlewareInterface.php | 1 + .../src/Contract/RequestInterface.php | 1 + .../src/Contract/ResponseInterface.php | 1 + src/http-server/src/CoreMiddleware.php | 3 +- src/http-server/src/Event/Event.php | 1 + src/http-server/src/Event/RequestHandled.php | 1 + src/http-server/src/Event/RequestReceived.php | 1 + .../src/Event/RequestTerminated.php | 1 + .../Handler/HttpExceptionHandler.php | 1 + .../src/Exception/Http/EncodingException.php | 1 + .../src/Exception/Http/FileException.php | 1 + .../Http/InvalidResponseException.php | 1 + src/http-server/src/MiddlewareManager.php | 1 + src/http-server/src/PriorityMiddleware.php | 1 + src/http-server/src/Request.php | 1 + src/http-server/src/Response.php | 1 + src/http-server/src/ResponseEmitter.php | 1 + src/http-server/src/Router/Dispatched.php | 1 + .../src/Router/DispatcherFactory.php | 1 + src/http-server/src/Router/Handler.php | 1 + src/http-server/src/Router/RouteCollector.php | 1 + src/http-server/src/Router/Router.php | 1 + src/http-server/src/Server.php | 1 + src/http-server/tests/CoreMiddlewareTest.php | 1 + .../tests/MappingAnnotationTest.php | 1 + src/http-server/tests/RequestTest.php | 1 + src/http-server/tests/ResponseTest.php | 1 + .../tests/Router/DispatcherFactoryTest.php | 1 + .../tests/Router/MiddlewareTest.php | 1 + .../tests/Router/RouteCollectorTest.php | 1 + src/http-server/tests/ServerTest.php | 1 + src/http-server/tests/Stub/BarMiddleware.php | 1 + .../tests/Stub/CoreMiddlewareStub.php | 1 + src/http-server/tests/Stub/DemoController.php | 1 + .../tests/Stub/DispatcherFactory.php | 1 + src/http-server/tests/Stub/FooController.php | 1 + src/http-server/tests/Stub/FooMiddleware.php | 1 + .../tests/Stub/RouteCollectorStub.php | 1 + src/http-server/tests/Stub/ServerStub.php | 1 + .../tests/Stub/SetHeaderMiddleware.php | 1 + src/http2-client/src/Client.php | 1 + src/http2-client/src/ConfigProvider.php | 1 + .../src/Exception/ClientClosedException.php | 1 + .../src/Exception/LoopBrokenException.php | 1 + .../src/Exception/StreamLostException.php | 1 + .../src/Exception/TimeoutException.php | 1 + src/http2-client/tests/ClientTest.php | 1 + .../Hyperf/Amqp/Annotation/Consumer.php | 1 + .../Hyperf/Amqp/Annotation/Producer.php | 1 + .../Annotation/AsyncQueueMessage.php | 1 + .../Hyperf/Cache/Annotation/CacheEvict.php | 1 + .../Hyperf/Cache/Annotation/CachePut.php | 1 + .../Hyperf/Cache/Annotation/Cacheable.php | 1 + .../Hyperf/Cache/Annotation/FailCache.php | 1 + .../Annotation/CircuitBreaker.php | 1 + .../Hyperf/Command/Annotation/Command.php | 1 + .../output/Hyperf/Config/Annotation/Value.php | 1 + .../Hyperf/Constants/Annotation/Constants.php | 1 + .../Hyperf/Crontab/Annotation/Crontab.php | 3 +- .../DbConnection/Annotation/Transactional.php | 1 + .../output/Hyperf/Di/Annotation/Aspect.php | 1 + .../output/Hyperf/Di/Annotation/Debug.php | 1 + .../output/Hyperf/Di/Annotation/Inject.php | 1 + .../Hyperf/Event/Annotation/Listener.php | 1 + .../Annotation/ExceptionHandler.php | 1 + .../HttpServer/Annotation/AutoController.php | 1 + .../HttpServer/Annotation/Controller.php | 1 + .../HttpServer/Annotation/DeleteMapping.php | 1 + .../HttpServer/Annotation/GetMapping.php | 1 + .../HttpServer/Annotation/Middleware.php | 1 + .../HttpServer/Annotation/Middlewares.php | 1 + .../HttpServer/Annotation/PatchMapping.php | 1 + .../HttpServer/Annotation/PostMapping.php | 1 + .../HttpServer/Annotation/PutMapping.php | 1 + .../HttpServer/Annotation/RequestMapping.php | 1 + .../Hyperf/Kafka/Annotation/Consumer.php | 1 + .../Hyperf/Metric/Annotation/Counter.php | 1 + .../Hyperf/Metric/Annotation/Histogram.php | 1 + .../Annotation/ModelListener.php | 1 + .../Hyperf/Nats/Annotation/Consumer.php | 1 + .../output/Hyperf/Nsq/Annotation/Consumer.php | 1 + .../Hyperf/Process/Annotation/Process.php | 1 + .../Hyperf/RateLimit/Annotation/RateLimit.php | 1 + .../Retry/Annotation/BackoffRetryFalsy.php | 1 + .../Annotation/BackoffRetryThrowable.php | 1 + .../Retry/Annotation/CircuitBreaker.php | 3 +- .../output/Hyperf/Retry/Annotation/Retry.php | 3 +- .../Hyperf/Retry/Annotation/RetryFalsy.php | 1 + .../Retry/Annotation/RetryThrowable.php | 1 + .../RpcServer/Annotation/RpcService.php | 1 + .../Hyperf/Signal/Annotation/Signal.php | 1 + .../SocketIOServer/Annotation/Event.php | 1 + .../Annotation/SocketIONamespace.php | 1 + .../output/Hyperf/Task/Annotation/Task.php | 1 + .../output/Hyperf/Tracer/Annotation/Trace.php | 1 + src/ide-helper/src/AnnotationGenerator.php | 4 +- src/ide-helper/src/Ast.php | 1 + src/ide-helper/src/Metadata.php | 1 + .../src/Visitor/AnnotationIDEVisitor.php | 1 + src/json-rpc/src/ConfigProvider.php | 1 + src/json-rpc/src/CoreMiddleware.php | 4 +- src/json-rpc/src/DataFormatter.php | 1 + src/json-rpc/src/DataFormatterFactory.php | 1 + .../src/Exception/BadRequestException.php | 1 + .../src/Exception/ClientException.php | 1 + .../Handler/HttpExceptionHandler.php | 1 + .../Exception/Handler/TcpExceptionHandler.php | 1 + src/json-rpc/src/HttpCoreMiddleware.php | 1 + src/json-rpc/src/HttpServer.php | 1 + src/json-rpc/src/JsonRpcHttpTransporter.php | 1 + src/json-rpc/src/JsonRpcNormalizer.php | 1 + src/json-rpc/src/JsonRpcPoolTransporter.php | 1 + src/json-rpc/src/JsonRpcTransporter.php | 1 + .../src/Listener/RegisterProtocolListener.php | 1 + .../src/Listener/RegisterServiceListener.php | 1 + src/json-rpc/src/NormalizeDataFormatter.php | 1 + src/json-rpc/src/Packer/JsonEofPacker.php | 1 + src/json-rpc/src/Packer/JsonLengthPacker.php | 1 + src/json-rpc/src/PathGenerator.php | 1 + src/json-rpc/src/Pool/Frequency.php | 1 + src/json-rpc/src/Pool/PoolFactory.php | 1 + src/json-rpc/src/Pool/RpcConnection.php | 7 +- src/json-rpc/src/Pool/RpcPool.php | 1 + src/json-rpc/src/RecvTrait.php | 1 + src/json-rpc/src/ResponseBuilder.php | 1 + src/json-rpc/src/TcpServer.php | 4 +- .../tests/AnyParamCoreMiddlewareTest.php | 1 + src/json-rpc/tests/CoreMiddlewareTest.php | 1 + src/json-rpc/tests/DataFormatterTest.php | 1 + src/json-rpc/tests/JsonPackerTest.php | 1 + .../tests/JsonRpcHttpTransporterTest.php | 1 + .../tests/JsonRpcPoolTransporterTest.php | 1 + src/json-rpc/tests/RpcServiceClientTest.php | 1 + .../Stub/CalculatorProxyServiceClient.php | 1 + src/json-rpc/tests/Stub/CalculatorService.php | 1 + .../tests/Stub/CalculatorServiceInterface.php | 1 + src/json-rpc/tests/Stub/IntegerValue.php | 1 + src/json-rpc/tests/Stub/RpcConnectionStub.php | 5 +- src/json-rpc/tests/Stub/RpcPoolStub.php | 1 + src/json-rpc/tests/TcpServerTest.php | 3 +- src/kafka/publish/kafka.php | 9 +- src/kafka/src/AbstractConsumer.php | 3 +- src/kafka/src/Annotation/Consumer.php | 1 + src/kafka/src/ConfigProvider.php | 1 + src/kafka/src/Constants/KafkaStrategy.php | 1 + src/kafka/src/ConsumerManager.php | 1 + src/kafka/src/Context.php | 1 + src/kafka/src/Event/AfterConsume.php | 1 + src/kafka/src/Event/BeforeConsume.php | 1 + src/kafka/src/Event/Consume.php | 1 + src/kafka/src/Event/Event.php | 1 + src/kafka/src/Event/FailToConsume.php | 1 + .../Exception/ConnectionClosedException.php | 1 + .../InvalidConsumeResultException.php | 1 + src/kafka/src/Exception/KafkaException.php | 1 + src/kafka/src/Exception/TimeoutException.php | 1 + .../src/Listener/AfterWorkerExitListener.php | 1 + .../BeforeMainServerStartListener.php | 1 + src/kafka/src/Producer.php | 1 + src/kafka/src/ProducerManager.php | 1 + src/kafka/src/Promise.php | 1 + src/kafka/src/Result.php | 1 + src/kafka/tests/ConsumerManagerTest.php | 1 + src/kafka/tests/Stub/ContainerStub.php | 1 + src/kafka/tests/Stub/DemoConsumer.php | 1 + src/kafka/tests/TestCase.php | 1 + .../src/AbstractLoadBalancer.php | 1 + src/load-balancer/src/ConfigProvider.php | 1 + .../Exception/NoNodesAvailableException.php | 1 + .../src/Exception/RuntimeException.php | 1 + .../src/LoadBalancerInterface.php | 1 + src/load-balancer/src/LoadBalancerManager.php | 1 + src/load-balancer/src/Node.php | 1 + src/load-balancer/src/Random.php | 1 + src/load-balancer/src/RoundRobin.php | 1 + src/load-balancer/src/WeightedRandom.php | 1 + src/load-balancer/src/WeightedRoundRobin.php | 1 + src/load-balancer/tests/RandomTest.php | 1 + src/load-balancer/tests/RoundRobinTest.php | 1 + .../tests/WeightedRandomTest.php | 1 + .../tests/WeightedRoundRobinTest.php | 1 + src/logger/publish/logger.php | 10 +- src/logger/src/Aspect/UdpSocketAspect.php | 1 + src/logger/src/ConfigProvider.php | 1 + .../src/Exception/InvalidConfigException.php | 1 + src/logger/src/Logger.php | 1 + src/logger/src/LoggerFactory.php | 1 + src/logger/tests/LoggerFactoryTest.php | 34 ++-- src/logger/tests/LoggerTest.php | 4 +- src/logger/tests/Stub/BarProcessor.php | 1 + src/logger/tests/Stub/FooHandler.php | 1 + src/logger/tests/Stub/FooProcessor.php | 1 + src/macroable/src/Macroable.php | 1 + src/macroable/tests/MacroableTest.php | 1 + src/memory/src/AtomicManager.php | 1 + src/memory/src/ConfigProvider.php | 1 + src/memory/src/LockManager.php | 1 + src/memory/src/TableManager.php | 1 + src/metric/publish/metric.php | 3 +- .../src/Adapter/InfluxDB/MetricFactory.php | 1 + src/metric/src/Adapter/NoOp/Counter.php | 1 + src/metric/src/Adapter/NoOp/Gauge.php | 1 + src/metric/src/Adapter/NoOp/Histogram.php | 1 + src/metric/src/Adapter/NoOp/MetricFactory.php | 1 + .../src/Adapter/Prometheus/Constants.php | 1 + src/metric/src/Adapter/Prometheus/Counter.php | 1 + src/metric/src/Adapter/Prometheus/Gauge.php | 1 + .../src/Adapter/Prometheus/Histogram.php | 1 + .../src/Adapter/Prometheus/MetricFactory.php | 1 + src/metric/src/Adapter/Prometheus/Redis.php | 1 + .../Prometheus/RedisStorageFactory.php | 1 + .../src/Adapter/RemoteProxy/Counter.php | 1 + src/metric/src/Adapter/RemoteProxy/Gauge.php | 1 + .../src/Adapter/RemoteProxy/Histogram.php | 1 + .../Adapter/RemoteProxy/MetricCollector.php | 1 + .../RemoteProxy/MetricCollectorFactory.php | 1 + .../src/Adapter/RemoteProxy/MetricFactory.php | 1 + src/metric/src/Adapter/StatsD/Counter.php | 1 + src/metric/src/Adapter/StatsD/Gauge.php | 1 + src/metric/src/Adapter/StatsD/Histogram.php | 1 + .../src/Adapter/StatsD/MetricFactory.php | 1 + src/metric/src/Annotation/Counter.php | 1 + src/metric/src/Annotation/Histogram.php | 1 + .../src/Aspect/CounterAnnotationAspect.php | 1 + .../src/Aspect/HistogramAnnotationAspect.php | 1 + src/metric/src/ConfigProvider.php | 1 + src/metric/src/Contract/CounterInterface.php | 1 + src/metric/src/Contract/GaugeInterface.php | 1 + .../src/Contract/HistogramInterface.php | 1 + .../src/Contract/MetricCollectorInterface.php | 1 + .../src/Contract/MetricFactoryInterface.php | 1 + src/metric/src/CoroutineServerStats.php | 1 + src/metric/src/Event/MetricFactoryReady.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/metric/src/Exception/RuntimeException.php | 1 + src/metric/src/Listener/DBPoolWatcher.php | 4 +- .../src/Listener/MetricBufferWatcher.php | 1 + src/metric/src/Listener/OnBeforeHandle.php | 1 + .../src/Listener/OnCoroutineServerStart.php | 1 + .../src/Listener/OnMetricFactoryReady.php | 1 + src/metric/src/Listener/OnPipeMessage.php | 1 + src/metric/src/Listener/OnWorkerStart.php | 4 +- src/metric/src/Listener/PoolWatcher.php | 1 + src/metric/src/Listener/QueueWatcher.php | 1 + src/metric/src/Listener/RedisPoolWatcher.php | 4 +- src/metric/src/Metric.php | 1 + src/metric/src/MetricFactoryPicker.php | 1 + src/metric/src/MetricSetter.php | 1 + .../src/Middleware/MetricMiddleware.php | 1 + src/metric/src/Process/MetricProcess.php | 1 + src/metric/src/Timer.php | 1 + .../Prometheus/RedisStorageFactoryTest.php | 1 + .../tests/Adapter/Prometheus/RedisTest.php | 1 + .../RemoteProxy/MetricCollectorTest.php | 1 + .../tests/Cases/MetricFactoryPickerTest.php | 6 +- src/metric/tests/Cases/MetricFactoryTest.php | 1 + src/metric/tests/Cases/OnWorkerStartTest.php | 1 + src/metric/tests/Cases/TimerTest.php | 1 + .../src/Command/GenerateMigrationCommand.php | 1 + .../src/ConfigProvider.php | 1 + .../src/CreateMigrationVisitor.php | 1 + .../src/MigrationGenerator.php | 1 + src/migration-generator/src/TableData.php | 1 + .../tests/Cases/MigrationGeneratorTest.php | 1 + .../tests/ContainerStub.php | 1 + src/model-cache/publish/databases.php | 4 +- src/model-cache/src/Builder.php | 1 + src/model-cache/src/Cacheable.php | 1 + src/model-cache/src/CacheableInterface.php | 1 + src/model-cache/src/Config.php | 1 + src/model-cache/src/ConfigProvider.php | 1 + src/model-cache/src/EagerLoad/EagerLoader.php | 1 + .../src/EagerLoad/EagerLoaderBuilder.php | 1 + .../src/Exception/CacheException.php | 1 + .../Exception/OperatorNotFoundException.php | 1 + .../src/Handler/DefaultValueInterface.php | 1 + .../src/Handler/HandlerInterface.php | 1 + src/model-cache/src/Handler/RedisHandler.php | 1 + .../src/Handler/RedisStringHandler.php | 1 + src/model-cache/src/InvalidCacheManager.php | 1 + .../DeleteCacheInTransactionListener.php | 1 + .../src/Listener/DeleteCacheListener.php | 1 + .../src/Listener/EagerLoadListener.php | 1 + src/model-cache/src/Manager.php | 1 + src/model-cache/src/Redis/HashGetMultiple.php | 1 + src/model-cache/src/Redis/HashIncr.php | 1 + src/model-cache/src/Redis/LuaManager.php | 1 + .../src/Redis/OperatorInterface.php | 1 + .../tests/Handler/RedisHandlerTest.php | 1 + .../tests/Handler/RedisStringHandlerTest.php | 1 + src/model-cache/tests/ManagerTest.php | 1 + src/model-cache/tests/ModelCacheTest.php | 1 + src/model-cache/tests/Stub/BookModel.php | 8 +- src/model-cache/tests/Stub/ContainerStub.php | 1 + src/model-cache/tests/Stub/ImageModel.php | 6 +- src/model-cache/tests/Stub/ManagerStub.php | 4 +- src/model-cache/tests/Stub/ModelStub.php | 1 + src/model-cache/tests/Stub/NonHandler.php | 1 + src/model-cache/tests/Stub/StdoutLogger.php | 1 + src/model-cache/tests/Stub/UserExtModel.php | 6 +- .../tests/Stub/UserHiddenModel.php | 1 + src/model-cache/tests/Stub/UserModel.php | 6 +- src/model-listener/src/AbstractListener.php | 1 + .../src/Annotation/ModelListener.php | 1 + .../src/Collector/ListenerCollector.php | 1 + src/model-listener/src/ConfigProvider.php | 1 + .../src/Listener/ModelEventListener.php | 1 + .../src/Listener/ModelHookEventListener.php | 1 + src/model-listener/tests/AnnotationTest.php | 1 + .../tests/ListenerCollectorTest.php | 1 + .../tests/ModelListenerTest.php | 1 + .../tests/Stub/ModelListenerStub.php | 1 + src/model-listener/tests/Stub/ModelStub.php | 1 + src/nacos/composer.json | 3 +- src/nacos/src/AbstractProvider.php | 1 + src/nacos/src/Application.php | 1 + src/nacos/src/ApplicationFactory.php | 1 + src/nacos/src/Config.php | 30 ++-- src/nacos/src/ConfigProvider.php | 1 + .../ConnectToServerFailedException.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/nacos/src/Exception/NacosThrowable.php | 1 + src/nacos/src/Exception/RequestException.php | 1 + src/nacos/src/Exception/RuntimeException.php | 1 + src/nacos/src/GrpcClient.php | 1 + src/nacos/src/GrpcFactory.php | 5 +- src/nacos/src/Module.php | 1 + src/nacos/src/Protobuf/Any.php | 47 ++--- src/nacos/src/Protobuf/GPBMetadata/Any.php | 4 +- src/nacos/src/Protobuf/GPBMetadata/Nacos.php | Bin 1263 -> 1248 bytes src/nacos/src/Protobuf/ListenContext.php | 1 + .../ConfigChangeNotifyRequestHandler.php | 1 + .../NamingPushRequestHandler.php | 1 + .../src/Protobuf/ListenHandlerInterface.php | 1 + src/nacos/src/Protobuf/Message/Instance.php | 1 + src/nacos/src/Protobuf/Message/Service.php | 1 + src/nacos/src/Protobuf/Metadata.php | 19 +- src/nacos/src/Protobuf/Payload.php | 21 +-- .../Request/ConfigBatchListenRequest.php | 1 + .../Protobuf/Request/ConfigQueryRequest.php | 1 + .../Request/ConnectionSetupRequest.php | 1 + .../Protobuf/Request/HealthCheckRequest.php | 1 + .../src/Protobuf/Request/InstanceRequest.php | 1 + .../src/Protobuf/Request/NamingRequest.php | 1 + .../Request/NotifySubscriberResponse.php | 1 + src/nacos/src/Protobuf/Request/Request.php | 1 + .../src/Protobuf/Request/RequestInterface.php | 1 + .../Protobuf/Request/ServerCheckRequest.php | 1 + .../Protobuf/Request/ServiceQueryRequest.php | 1 + .../Request/SubscribeServiceRequest.php | 1 + .../ConfigChangeBatchListenResponse.php | 1 + .../Response/ConfigChangeNotifyRequest.php | 1 + .../Protobuf/Response/ConfigQueryResponse.php | 1 + .../Protobuf/Response/HealthCheckResponse.php | 1 + src/nacos/src/Protobuf/Response/Mapping.php | 1 + .../Response/NotifySubscriberRequest.php | 1 + src/nacos/src/Protobuf/Response/Response.php | 1 + .../Protobuf/Response/ServerCheckResponse.php | 1 + .../Response/SubscribeServiceResponse.php | 1 + src/nacos/src/Protobuf/ServiceHost.php | 1 + src/nacos/src/Protobuf/ServiceInfo.php | 1 + src/nacos/src/Provider/AccessToken.php | 1 + src/nacos/src/Provider/AuthProvider.php | 1 + src/nacos/src/Provider/ConfigProvider.php | 21 +-- src/nacos/src/Provider/InstanceProvider.php | 170 ++++++++++-------- src/nacos/src/Provider/OperatorProvider.php | 1 + src/nacos/src/Provider/ServiceProvider.php | 46 ++--- src/nacos/tests/AbstractTestCase.php | 1 + src/nacos/tests/Cases/ApplicationTest.php | 1 + .../tests/Cases/Provider/NacosAuthTest.php | 1 + .../tests/Cases/Provider/NacosConfigTest.php | 1 + .../Cases/Provider/NacosInstanceTest.php | 1 + .../Cases/Provider/NacosOperatorTest.php | 1 + .../tests/Cases/Provider/NacosServiceTest.php | 1 + .../tests/Cases/Sign/NacosNamingSignTest.php | 1 + src/nacos/tests/HandlerMockery.php | 1 + src/nats/publish/nats.php | 7 +- src/nats/src/AbstractConsumer.php | 1 + src/nats/src/Annotation/Consumer.php | 1 + src/nats/src/ConfigProvider.php | 1 + src/nats/src/Connection.php | 1 + src/nats/src/ConnectionOptions.php | 3 +- src/nats/src/ConsumerManager.php | 1 + src/nats/src/Contract/PublishInterface.php | 1 + src/nats/src/Contract/RequestInterface.php | 1 + src/nats/src/Contract/SubscribeInterface.php | 1 + src/nats/src/Driver/AbstractDriver.php | 1 + src/nats/src/Driver/DriverFactory.php | 1 + src/nats/src/Driver/DriverInterface.php | 1 + src/nats/src/Driver/NatsDriver.php | 1 + src/nats/src/EncodedConnection.php | 1 + src/nats/src/Encoders/Encoder.php | 1 + src/nats/src/Encoders/JSONEncoder.php | 1 + src/nats/src/Encoders/PHPEncoder.php | 1 + src/nats/src/Encoders/YAMLEncoder.php | 1 + src/nats/src/Event/AfterConsume.php | 1 + src/nats/src/Event/AfterSubscribe.php | 1 + src/nats/src/Event/BeforeConsume.php | 1 + src/nats/src/Event/BeforeSubscribe.php | 1 + src/nats/src/Event/Consume.php | 1 + src/nats/src/Event/Event.php | 1 + src/nats/src/Event/FailToConsume.php | 1 + src/nats/src/Exception.php | 1 + .../src/Exception/ConfigNotFoundException.php | 1 + src/nats/src/Exception/DriverException.php | 1 + src/nats/src/Exception/TimeoutException.php | 1 + src/nats/src/Functions.php | 1 + .../src/Listener/AfterSubscribeListener.php | 1 + .../BeforeMainServerStartListener.php | 1 + src/nats/src/Message.php | 1 + src/nats/src/RandomGenerator.php | 1 + src/nats/src/ServerInfo.php | 1 + src/nats/tests/NatsDriverTest.php | 6 +- src/nsq/src/AbstractConsumer.php | 1 + src/nsq/src/Annotation/Consumer.php | 1 + src/nsq/src/ClientInterface.php | 1 + src/nsq/src/ConfigProvider.php | 1 + src/nsq/src/ConsumerManager.php | 1 + src/nsq/src/Event/AfterConsume.php | 1 + src/nsq/src/Event/AfterSubscribe.php | 1 + src/nsq/src/Event/BeforeConsume.php | 1 + src/nsq/src/Event/BeforeSubscribe.php | 1 + src/nsq/src/Event/Consume.php | 1 + src/nsq/src/Event/Event.php | 1 + src/nsq/src/Event/FailToConsume.php | 1 + src/nsq/src/Exception/SocketSendException.php | 1 + .../BeforeMainServerStartListener.php | 1 + src/nsq/src/Message.php | 1 + src/nsq/src/MessageBuilder.php | 1 + src/nsq/src/Nsq.php | 3 +- src/nsq/src/Nsqd/AbstractEndpoint.php | 1 + src/nsq/src/Nsqd/Api.php | 1 + src/nsq/src/Nsqd/Channel.php | 1 + src/nsq/src/Nsqd/Client.php | 1 + src/nsq/src/Nsqd/ClientInterface.php | 1 + src/nsq/src/Nsqd/Topic.php | 1 + src/nsq/src/Packer.php | 1 + src/nsq/src/Pool/NsqConnection.php | 1 + src/nsq/src/Pool/NsqPool.php | 1 + src/nsq/src/Pool/NsqPoolFactory.php | 1 + src/nsq/src/Result.php | 1 + src/nsq/src/Subscriber.php | 1 + src/nsq/tests/ConsumerManagerTest.php | 1 + src/nsq/tests/HttpClientTest.php | 1 + src/nsq/tests/NsqTest.php | 1 + src/nsq/tests/NsqdApiTest.php | 1 + src/nsq/tests/Stub/ContainerStub.php | 1 + src/nsq/tests/Stub/CoroutineHandlerStub.php | 1 + src/nsq/tests/Stub/DemoConsumer.php | 1 + src/nsq/tests/Stub/DisabledDemoConsumer.php | 1 + src/nsq/tests/SubscriberTest.php | 1 + src/paginator/src/AbstractPaginator.php | 1 + src/paginator/src/ConfigProvider.php | 1 + src/paginator/src/LengthAwarePaginator.php | 1 + .../src/Listener/PageResolverListener.php | 1 + src/paginator/src/Paginator.php | 1 + src/paginator/src/UrlWindow.php | 1 + .../tests/LengthAwarePaginatorTest.php | 1 + .../tests/PageResolverListenerTest.php | 1 + src/phar/src/Ast/Ast.php | 1 + .../Visitor/RewriteConfigFactoryVisitor.php | 1 + .../src/Ast/Visitor/RewriteConfigVisitor.php | 1 + src/phar/src/BuildCommand.php | 1 + src/phar/src/Bundle.php | 1 + src/phar/src/ConfigProvider.php | 1 + src/phar/src/LoggerInterface.php | 1 + src/phar/src/Package.php | 1 + src/phar/src/PharBuilder.php | 1 + src/phar/src/TargetPhar.php | 1 + src/phar/tests/ConfigFactoryVisitorTest.php | 1 + src/phar/tests/PackageTest.php | 1 + src/phar/tests/VisitorTest.php | 1 + src/pipeline/src/Pipeline.php | 1 + src/pipeline/tests/PipelineTest.php | 1 + src/pipeline/tests/Stub/FooPipeline.php | 1 + src/pool/src/Channel.php | 1 + src/pool/src/ConfigProvider.php | 1 + src/pool/src/Connection.php | 1 + src/pool/src/ConstantFrequency.php | 1 + src/pool/src/Context.php | 1 + src/pool/src/Event/ReleaseConnection.php | 1 + .../src/Exception/ConnectionException.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/pool/src/Exception/SocketPopException.php | 1 + src/pool/src/Frequency.php | 1 + src/pool/src/KeepaliveConnection.php | 1 + src/pool/src/LowFrequencyInterface.php | 1 + src/pool/src/Pool.php | 3 +- src/pool/src/PoolOption.php | 1 + src/pool/src/SimplePool/Config.php | 1 + src/pool/src/SimplePool/Connection.php | 1 + src/pool/src/SimplePool/Pool.php | 1 + src/pool/src/SimplePool/PoolFactory.php | 1 + src/pool/tests/ConnectionTest.php | 1 + src/pool/tests/FrequencyTest.php | 1 + src/pool/tests/HeartbeatConnectionTest.php | 1 + src/pool/tests/PoolTest.php | 1 + src/pool/tests/Stub/ActiveConnectionStub.php | 1 + src/pool/tests/Stub/ConstantFrequencyStub.php | 1 + src/pool/tests/Stub/FooPool.php | 1 + src/pool/tests/Stub/FrequencyStub.php | 1 + src/pool/tests/Stub/HeartbeatPoolStub.php | 1 + .../tests/Stub/KeepaliveConnectionStub.php | 1 + src/process/src/AbstractProcess.php | 4 +- src/process/src/Annotation/Process.php | 1 + src/process/src/ConfigProvider.php | 1 + .../src/Event/AfterCoroutineHandle.php | 1 + src/process/src/Event/AfterProcessHandle.php | 1 + .../src/Event/BeforeCoroutineHandle.php | 1 + src/process/src/Event/BeforeProcessHandle.php | 1 + src/process/src/Event/PipeMessage.php | 1 + .../src/Exception/ServerInvalidException.php | 1 + .../src/Exception/SocketAcceptException.php | 1 + .../src/Handler/ProcessStopHandler.php | 1 + .../src/Listener/BootProcessListener.php | 1 + .../LogAfterProcessStoppedListener.php | 1 + .../LogBeforeProcessStartListener.php | 1 + src/process/src/ProcessCollector.php | 1 + src/process/src/ProcessManager.php | 1 + src/process/tests/BootProcessListenerTest.php | 1 + src/process/tests/ProcessTest.php | 7 +- src/process/tests/Stub/FooProcess.php | 1 + src/protocol/src/ConfigProvider.php | 1 + src/protocol/src/Packer/SerializePacker.php | 1 + src/protocol/src/ProtocolPackerInterface.php | 1 + src/protocol/tests/SerializePackerTest.php | 1 + src/protocol/tests/Stub/DemoStub.php | 1 + src/rate-limit/src/Annotation/RateLimit.php | 1 + .../src/Aspect/RateLimitAnnotationAspect.php | 1 + src/rate-limit/src/ConfigProvider.php | 1 + .../src/Exception/RateLimitException.php | 1 + .../src/Handler/RateLimitHandler.php | 4 +- src/rate-limit/src/Storage/RedisStorage.php | 1 + .../src/Storage/StorageInterface.php | 1 + src/rate-limit/tests/RateLimitTest.php | 1 + .../tests/Stub/Storage/EmptyStorage.php | 1 + .../tests/Stub/Storage/InvalidStorage.php | 1 + .../src/AllProcessesBroadcaster.php | 1 + src/reactive-x/src/ConfigProvider.php | 1 + .../src/Contract/BroadcasterInterface.php | 1 + .../src/Contract/MessageBusInterface.php | 1 + src/reactive-x/src/Example/BatchSaveRoute.php | 1 + src/reactive-x/src/Example/SqlListener.php | 1 + .../src/Example/WebSocketsController.php | 1 + src/reactive-x/src/IpcMessageWrapper.php | 1 + src/reactive-x/src/IpcSubject.php | 1 + .../src/Listener/BootApplicationListener.php | 1 + src/reactive-x/src/MessageBusFactory.php | 1 + src/reactive-x/src/Observable.php | 1 + .../src/Observable/ChannelObservable.php | 1 + .../src/Observable/CoroutineObservable.php | 1 + .../src/Observable/EventObservable.php | 1 + .../src/Observable/HttpRouteObservable.php | 3 +- src/reactive-x/src/RxSwoole.php | 1 + .../ConcurrentEventLoopScheduler.php | 4 +- src/reactive-x/src/ServerBroadcaster.php | 1 + .../src/UserProcessesBroadcaster.php | 1 + .../ConcurrentEventLoopSchedulerTest.php | 1 + src/reactive-x/tests/Cases/IpcSubjectTest.php | 1 + src/reactive-x/tests/Cases/ObservableTest.php | 1 + src/reactive-x/tests/Stub/TestEvent.php | 1 + src/redis/src/ConfigProvider.php | 1 + .../InvalidRedisConnectionException.php | 1 + .../Exception/InvalidRedisOptionException.php | 1 + .../Exception/InvalidRedisProxyException.php | 1 + .../src/Exception/RedisNotFoundException.php | 1 + src/redis/src/Frequency.php | 1 + src/redis/src/Lua/Hash/HGetAllMultiple.php | 1 + .../src/Lua/Hash/HIncrByFloatIfExists.php | 1 + src/redis/src/Lua/Script.php | 1 + src/redis/src/Lua/ScriptInterface.php | 1 + src/redis/src/Pool/PoolFactory.php | 1 + src/redis/src/Pool/RedisPool.php | 1 + src/redis/src/Redis.php | 1 + src/redis/src/RedisConnection.php | 3 +- src/redis/src/RedisFactory.php | 1 + src/redis/src/RedisProxy.php | 1 + src/redis/src/RedisSentinelFactory.php | 1 + src/redis/src/Traits/MultiExec.php | 1 + src/redis/src/Traits/ScanCaller.php | 1 + src/redis/tests/Lua/EvalTest.php | 1 + src/redis/tests/Lua/HashTest.php | 1 + src/redis/tests/RedisConnectionTest.php | 1 + src/redis/tests/RedisProxyTest.php | 1 + src/redis/tests/RedisTest.php | 1 + src/redis/tests/Stub/ContainerStub.php | 1 + src/redis/tests/Stub/HGetAllMultipleStub.php | 1 + .../tests/Stub/HIncrByFloatIfExistsStub.php | 1 + .../tests/Stub/RedisConnectionFailedStub.php | 1 + src/redis/tests/Stub/RedisConnectionStub.php | 1 + src/redis/tests/Stub/RedisPoolFailedStub.php | 1 + src/redis/tests/Stub/RedisPoolStub.php | 1 + .../src/AnonymousGrpcResourceCollection.php | 1 + src/resource-grpc/src/ConfigProvider.php | 1 + src/resource-grpc/src/GrpcResource.php | 1 + .../src/GrpcResourceCollection.php | 1 + src/resource-grpc/src/GrpcResponse.php | 1 + .../UndefinedGrpcResourceExpectMessage.php | 1 + src/resource-grpc/tests/GrpcResourceTest.php | 4 +- .../tests/Stubs/Grpc/AllReply.php | 20 ++- .../Stubs/Grpc/GPBMetadata/Grpc/Grpc.php | 4 +- .../tests/Stubs/Grpc/HiReply.php | 18 +- src/resource-grpc/tests/Stubs/Grpc/HiUser.php | 12 +- .../tests/Stubs/Models/Reply.php | 1 + src/resource-grpc/tests/Stubs/Models/User.php | 1 + .../Stubs/Resources/AllReplyResource.php | 1 + .../tests/Stubs/Resources/HiReplyResource.php | 1 + .../tests/Stubs/Resources/HiUserResource.php | 1 + .../src/Concerns/CollectsResources.php | 1 + .../Concerns/ConditionallyLoadsAttributes.php | 1 + .../src/Concerns/DelegatesToResource.php | 1 + src/resource/src/ConfigProvider.php | 1 + .../src/Exception/ResourceException.php | 1 + .../src/Json/AnonymousResourceCollection.php | 1 + src/resource/src/Json/JsonResource.php | 1 + src/resource/src/Json/ResourceCollection.php | 1 + src/resource/src/JsonEncodingException.php | 1 + .../src/Response/PaginatedResponse.php | 1 + src/resource/src/Response/Response.php | 1 + src/resource/src/Value/MergeValue.php | 1 + src/resource/src/Value/MissingValue.php | 1 + src/resource/src/Value/PotentiallyMissing.php | 1 + src/resource/tests/HttpResponse.php | 1 + src/resource/tests/ResourceTest.php | 1 + src/resource/tests/Stubs/Models/Author.php | 1 + src/resource/tests/Stubs/Models/Post.php | 1 + .../tests/Stubs/Models/Subscription.php | 1 + .../tests/Stubs/Resources/AuthorResource.php | 1 + ...AuthorResourceWithOptionalRelationship.php | 1 + .../Stubs/Resources/CommentCollection.php | 1 + .../Resources/EmptyPostCollectionResource.php | 1 + .../Stubs/Resources/EmptyPostResource.php | 1 + .../Resources/JsonSerializableResource.php | 1 + .../tests/Stubs/Resources/ObjectResource.php | 1 + .../Resources/PostCollectionResource.php | 1 + .../tests/Stubs/Resources/PostResource.php | 1 + .../Resources/PostResourceWithExtraData.php | 1 + .../PostResourceWithOptionalData.php | 1 + .../PostResourceWithOptionalMerging.php | 1 + ...tResourceWithOptionalPivotRelationship.php | 1 + .../PostResourceWithOptionalRelationship.php | 1 + .../Resources/PostResourceWithoutWrap.php | 1 + .../Resources/ReallyEmptyPostResource.php | 1 + .../Resources/ResourceWithPreservedKeys.php | 1 + src/resource/tests/TestCase.php | 1 + src/retry/src/Annotation/AbstractRetry.php | 1 + .../src/Annotation/BackoffRetryFalsy.php | 1 + .../src/Annotation/BackoffRetryThrowable.php | 1 + src/retry/src/Annotation/CircuitBreaker.php | 1 + src/retry/src/Annotation/Retry.php | 1 + src/retry/src/Annotation/RetryFalsy.php | 1 + src/retry/src/Annotation/RetryThrowable.php | 1 + .../src/Aspect/RetryAnnotationAspect.php | 1 + src/retry/src/BackoffStrategy.php | 1 + src/retry/src/CircuitBreakerState.php | 1 + src/retry/src/ConfigProvider.php | 1 + src/retry/src/FlatStrategy.php | 1 + src/retry/src/FluentRetry.php | 1 + src/retry/src/NoOpRetryBudget.php | 1 + src/retry/src/Policy/BaseRetryPolicy.php | 1 + src/retry/src/Policy/BudgetRetryPolicy.php | 1 + .../src/Policy/CircuitBreakerRetryPolicy.php | 1 + .../src/Policy/ClassifierRetryPolicy.php | 1 + .../src/Policy/ExpressionRetryPolicy.php | 1 + src/retry/src/Policy/FallbackRetryPolicy.php | 1 + src/retry/src/Policy/HybridRetryPolicy.php | 1 + .../src/Policy/MaxAttemptsRetryPolicy.php | 1 + src/retry/src/Policy/RetryPolicyInterface.php | 1 + src/retry/src/Policy/SleepRetryPolicy.php | 1 + src/retry/src/Policy/TimeoutRetryPolicy.php | 1 + src/retry/src/Retry.php | 1 + src/retry/src/RetryBudget.php | 1 + src/retry/src/RetryBudgetInterface.php | 1 + src/retry/src/RetryContext.php | 1 + src/retry/src/SleepStrategyInterface.php | 1 + .../CircuitBreakerAnotationAspectTest.php | 1 + src/retry/tests/CircuitBreakerStateTest.php | 1 + src/retry/tests/RetryAnnotationAspectTest.php | 8 +- src/retry/tests/RetryBudgetTest.php | 1 + src/retry/tests/RetryFalsyTest.php | 1 + src/retry/tests/RetryTest.php | 1 + src/retry/tests/Stub/Foo.php | 1 + src/rpc-client/composer.json | 5 +- src/rpc-client/src/AbstractServiceClient.php | 1 + src/rpc-client/src/Client.php | 1 + src/rpc-client/src/ConfigProvider.php | 1 + .../src/Exception/RequestException.php | 36 ++-- .../AddConsumerDefinitionListener.php | 1 + .../src/Proxy/AbstractProxyService.php | 1 + src/rpc-client/src/Proxy/Ast.php | 1 + src/rpc-client/src/Proxy/CodeLoader.php | 1 + src/rpc-client/src/Proxy/ProxyCallVisitor.php | 1 + src/rpc-client/src/ProxyFactory.php | 1 + src/rpc-client/src/ServiceClient.php | 1 + .../tests/AbstractServiceClientTest.php | 1 + src/rpc-client/tests/AstTest.php | 1 + src/rpc-client/tests/ClientTest.php | 1 + src/rpc-client/tests/Stub/FooInterface.php | 1 + .../tests/Stub/FooServiceClient.php | 1 + src/rpc-client/tests/Stub/ParInterface.php | 1 + src/rpc-multiplex/composer.json | 1 + src/rpc-multiplex/src/Client.php | 20 ++- src/rpc-multiplex/src/ConfigProvider.php | 1 + src/rpc-multiplex/src/Constant.php | 1 + .../src/Contract/DataFetcherInterface.php | 1 + .../src/Contract/DnsResolverInterface.php | 1 + .../src/Contract/HostReaderInterface.php | 1 + .../Contract/HttpMessageBuilderInterface.php | 1 + src/rpc-multiplex/src/CoreMiddleware.php | 1 + src/rpc-multiplex/src/DataFormatter.php | 1 + .../Handler/DefaultExceptionHandler.php | 1 + .../Exception/InvalidArgumentException.php | 1 + .../Exception/NoAvailableNodesException.php | 1 + .../src/Exception/NotSupportException.php | 1 + .../HttpMessage/HostReader/NullHostReader.php | 1 + src/rpc-multiplex/src/HttpMessageBuilder.php | 1 + .../src/Listener/RegisterProtocolListener.php | 1 + .../src/Listener/RegisterServiceListener.php | 1 + src/rpc-multiplex/src/Packer/JsonPacker.php | 1 + src/rpc-multiplex/src/PathGenerator.php | 1 + src/rpc-multiplex/src/Socket.php | 4 +- src/rpc-multiplex/src/SocketFactory.php | 1 + src/rpc-multiplex/src/TcpServer.php | 1 + src/rpc-multiplex/src/Transporter.php | 1 + .../tests/Cases/AbstractTestCase.php | 1 + .../tests/Cases/ChannelManagerTest.php | 1 + .../tests/Cases/HttpMessageBuilderTest.php | 1 + .../tests/Cases/SocketFactoryTest.php | 1 + .../tests/Cases/TcpServerTest.php | 1 + .../tests/Cases/TransporterTest.php | 1 + .../tests/Stub/ContainerStub.php | 1 + src/rpc-server/src/Annotation/RpcService.php | 1 + src/rpc-server/src/ConfigProvider.php | 1 + src/rpc-server/src/CoreMiddleware.php | 1 + .../src/Event/AfterPathRegister.php | 1 + src/rpc-server/src/Event/RequestEvent.php | 1 + src/rpc-server/src/Event/RequestHandled.php | 1 + src/rpc-server/src/Event/RequestReceived.php | 1 + .../src/Event/RequestTerminated.php | 1 + src/rpc-server/src/RequestDispatcher.php | 1 + .../src/Router/DispatcherFactory.php | 1 + src/rpc-server/src/Router/RouteCollector.php | 1 + src/rpc-server/src/Router/Router.php | 1 + src/rpc-server/src/Server.php | 3 +- .../tests/RouterDispatcherFactoryTest.php | 1 + src/rpc-server/tests/Stub/ContainerStub.php | 1 + src/rpc-server/tests/Stub/IdGeneratorStub.php | 1 + src/rpc-server/tests/Stub/MiddlewareStub.php | 1 + src/rpc/composer.json | 3 +- src/rpc/src/Context.php | 1 + .../src/Contract/DataFormatterInterface.php | 1 + src/rpc/src/Contract/EofInterface.php | 1 + src/rpc/src/Contract/PackerInterface.php | 1 + .../src/Contract/PathGeneratorInterface.php | 1 + src/rpc/src/Contract/RequestInterface.php | 1 + src/rpc/src/Contract/ResponseInterface.php | 1 + src/rpc/src/Contract/TransporterInterface.php | 1 + src/rpc/src/ErrorResponse.php | 1 + src/rpc/src/Exception/RecvException.php | 1 + .../src/IdGenerator/IdGeneratorInterface.php | 1 + .../IdGenerator/NodeRequestIdGenerator.php | 1 + .../src/IdGenerator/RequestIdGenerator.php | 1 + src/rpc/src/IdGenerator/UniqidIdGenerator.php | 1 + .../src/PathGenerator/DotPathGenerator.php | 1 + .../src/PathGenerator/FullPathGenerator.php | 1 + src/rpc/src/PathGenerator/PathGenerator.php | 1 + src/rpc/src/Protocol.php | 1 + src/rpc/src/ProtocolManager.php | 28 ++- src/rpc/src/Request.php | 1 + src/rpc/src/Response.php | 1 + src/rpc/tests/ContextTest.php | 1 + .../NodeRequestIdGeneratorTest.php | 1 + .../IdGenerator/RequestIdGeneratorTest.php | 1 + .../PathGenerator/FullPathGeneratorTest.php | 1 + .../tests/PathGenerator/PathGeneratorTest.php | 1 + src/rpc/tests/ProtocolTest.php | 1 + src/rpn/src/Calculator.php | 1 + src/rpn/src/ConfigProvider.php | 1 + .../Exception/InvalidExpressionException.php | 1 + .../Exception/InvalidOperatorException.php | 1 + .../src/Exception/InvalidValueException.php | 1 + src/rpn/src/Exception/NotFoundException.php | 1 + src/rpn/src/Operator/AddOperator.php | 1 + src/rpn/src/Operator/DivideOperator.php | 1 + src/rpn/src/Operator/HasBindings.php | 1 + src/rpn/src/Operator/MultiplyOperator.php | 1 + src/rpn/src/Operator/Operator.php | 1 + src/rpn/src/Operator/OperatorInterface.php | 1 + src/rpn/src/Operator/SubtractOperator.php | 1 + src/rpn/tests/AbstractTestCase.php | 1 + src/rpn/tests/CalculatorTest.php | 1 + src/rpn/tests/ExampleTest.php | 1 + src/rpn/tests/HasBindingsTest.php | 1 + src/rpn/tests/Stub/HasBindingsStub.php | 1 + src/scout/publish/scout.php | 4 +- src/scout/src/Builder.php | 1 + src/scout/src/ConfigProvider.php | 1 + src/scout/src/Console/FlushCommand.php | 1 + src/scout/src/Console/ImportCommand.php | 1 + src/scout/src/Engine/ElasticsearchEngine.php | 1 + src/scout/src/Engine/Engine.php | 1 + src/scout/src/Engine/NullEngine.php | 1 + src/scout/src/EngineFactory.php | 1 + src/scout/src/Event/ModelsFlushed.php | 1 + src/scout/src/Event/ModelsImported.php | 1 + src/scout/src/Exception/RuntimeException.php | 1 + src/scout/src/ModelObserver.php | 1 + .../src/Provider/ElasticsearchProvider.php | 1 + src/scout/src/Provider/ProviderInterface.php | 1 + src/scout/src/Searchable.php | 1 + src/scout/src/SearchableInterface.php | 1 + src/scout/src/SearchableScope.php | 1 + src/scout/tests/Cases/BuilderTest.php | 1 + .../tests/Cases/ElasticsearchEngineTest.php | 9 +- src/scout/tests/Cases/ModelObserverTest.php | 1 + src/scout/tests/Cases/SearchableTest.php | 10 +- src/scout/tests/Stub/ContainerStub.php | 1 + .../Stub/ElasticsearchEngineTestModel.php | 1 + .../Stub/ModelStubForMakeAllSearchable.php | 1 + src/scout/tests/Stub/SearchableModel.php | 1 + src/serializer/src/ConfigProvider.php | 1 + src/serializer/src/ExceptionNormalizer.php | 7 +- src/serializer/src/JsonDeNormalizer.php | 1 + src/serializer/src/ScalarNormalizer.php | 1 + src/serializer/src/Serializer.php | 10 +- src/serializer/src/SerializerFactory.php | 1 + src/serializer/src/SimpleNormalizer.php | 1 + src/serializer/src/SymfonyNormalizer.php | 1 + .../tests/ExceptionNormalizerTest.php | 1 + src/serializer/tests/Foo.php | 1 + .../tests/JsonDeSerializableTest.php | 1 + src/serializer/tests/Stub/Foo.php | 1 + src/serializer/tests/Stub/FooException.php | 1 + .../tests/Stub/SerializableException.php | 1 + .../tests/SymfonySerializerTest.php | 1 + src/server/publish/server.php | 12 +- src/server/src/Command/StartServer.php | 1 + src/server/src/ConfigProvider.php | 1 + src/server/src/Connection.php | 1 + src/server/src/CoroutineServer.php | 3 +- src/server/src/Entry/EventDispatcher.php | 1 + src/server/src/Entry/Logger.php | 1 + src/server/src/Event.php | 1 + .../src/Event/AllCoroutineServersClosed.php | 1 + src/server/src/Event/CoroutineServerStart.php | 1 + src/server/src/Event/CoroutineServerStop.php | 1 + .../src/Event/MainCoroutineServerStart.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/server/src/Exception/RuntimeException.php | 1 + src/server/src/Exception/ServerException.php | 1 + .../src/Listener/AfterWorkerStartListener.php | 6 +- .../src/Listener/InitProcessTitleListener.php | 1 + .../src/Listener/StoreServerNameListener.php | 1 + src/server/src/Option.php | 1 + src/server/src/Port.php | 1 + src/server/src/Server.php | 3 +- src/server/src/ServerConfig.php | 1 + src/server/src/ServerFactory.php | 1 + src/server/src/ServerInterface.php | 1 + src/server/src/ServerManager.php | 1 + src/server/src/SwooleServerFactory.php | 1 + src/server/src/SwowServer.php | 1 + .../Listener/InitProcessTitleListenerTest.php | 1 + src/server/tests/PortTest.php | 1 + src/server/tests/Stub/DemoProcess.php | 1 + .../Stub/InitProcessTitleListenerStub.php | 1 + .../Stub/InitProcessTitleListenerStub2.php | 1 + .../src/ConfigProvider.php | 1 + .../src/ConsulAgent.php | 1 + .../src/ConsulAgentFactory.php | 1 + .../src/ConsulDriver.php | 1 + .../src/Listener/RegisterDriverListener.php | 1 + .../tests/ConsulDriverTest.php | 1 + src/service-governance-nacos/src/Client.php | 1 + .../src/ClientFactory.php | 1 + .../src/ConfigProvider.php | 1 + .../src/Listener/MainWorkerStartListener.php | 1 + .../src/Listener/OnShutdownListener.php | 1 + .../src/Listener/RegisterDriverListener.php | 1 + .../src/NacosDriver.php | 1 + .../src/NacosGrpcDriver.php | 1 + .../src/Process/InstanceBeatProcess.php | 1 + src/service-governance/composer.json | 3 +- src/service-governance/src/ConfigProvider.php | 1 + .../src/DriverInterface.php | 53 ++++-- src/service-governance/src/DriverManager.php | 1 + .../Exception/ComponentRequiredException.php | 1 + .../Exception/RegisterInstanceException.php | 1 + .../src/Listener/RegisterServiceListener.php | 1 + src/service-governance/src/ServiceManager.php | 1 + .../Listener/RegisterServiceListenerTest.php | 1 + .../tests/ServiceManagerTest.php | 1 + src/session/src/ConfigProvider.php | 1 + src/session/src/FlashTrait.php | 1 + src/session/src/Handler/DatabaseHandler.php | 5 +- .../src/Handler/DatabaseHandlerFactory.php | 1 + src/session/src/Handler/FileHandler.php | 5 +- .../src/Handler/FileHandlerFactory.php | 1 + src/session/src/Handler/NullHandler.php | 5 +- src/session/src/Handler/RedisHandler.php | 10 +- .../src/Handler/RedisHandlerFactory.php | 1 + .../src/Middleware/SessionMiddleware.php | 1 + src/session/src/Session.php | 1 + src/session/src/SessionManager.php | 1 + src/session/src/SessionProxy.php | 1 + src/session/tests/ConfigProviderTest.php | 4 +- src/session/tests/FileHandlerTest.php | 1 + src/session/tests/SessionManagerTest.php | 4 +- src/session/tests/SessionMiddlewareTest.php | 6 +- src/session/tests/SessionTest.php | 4 +- src/session/tests/Stub/FooHandler.php | 20 +-- src/session/tests/Stub/MockStub.php | 1 + src/session/tests/Stub/NonSessionHandler.php | 1 + src/signal/src/Annotation/Signal.php | 1 + src/signal/src/ConfigProvider.php | 1 + .../Handler/CoroutineServerStopHandler.php | 1 + src/signal/src/Handler/WorkerStopHandler.php | 1 + .../src/Listener/SignalDeregisterListener.php | 1 + .../src/Listener/SignalRegisterListener.php | 1 + src/signal/src/SignalHandlerInterface.php | 1 + src/signal/src/SignalManager.php | 3 +- src/signal/tests/SignalManagerTest.php | 1 + src/signal/tests/Stub/SignalHandler2Stub.php | 1 + src/signal/tests/Stub/SignalHandlerStub.php | 1 + src/snowflake/src/Concern/Snowflake.php | 1 + src/snowflake/src/ConfigProvider.php | 1 + src/snowflake/src/Configuration.php | 1 + src/snowflake/src/ConfigurationInterface.php | 1 + .../src/Exception/SnowflakeException.php | 1 + src/snowflake/src/IdGenerator.php | 1 + .../src/IdGenerator/SnowflakeIdGenerator.php | 1 + src/snowflake/src/IdGeneratorInterface.php | 1 + src/snowflake/src/Meta.php | 1 + src/snowflake/src/MetaGenerator.php | 1 + .../RandomMilliSecondMetaGenerator.php | 1 + .../src/MetaGenerator/RedisMetaGenerator.php | 1 + .../RedisMilliSecondMetaGenerator.php | 1 + .../RedisSecondMetaGenerator.php | 1 + src/snowflake/src/MetaGeneratorFactory.php | 1 + src/snowflake/src/MetaGeneratorInterface.php | 1 + src/snowflake/tests/MetaGeneratorTest.php | 1 + .../tests/RedisMetaGeneratorTest.php | 1 + .../tests/SnowflakeGeneratorTest.php | 1 + .../tests/Stub/UserDefinedIdGenerator.php | 1 + src/socket/src/ConfigProvider.php | 1 + src/socket/src/Exception/SocketException.php | 1 + src/socket/src/Socket.php | 1 + src/socket/src/SocketInterface.php | 1 + src/socket/tests/SocketTest.php | 6 +- src/socket/tests/Stub/BigDemoStub.php | 1 + src/socket/tests/Stub/DemoStub.php | 1 + src/socketio-server/src/Annotation/Event.php | 1 + .../src/Annotation/SocketIONamespace.php | 1 + .../src/Aspect/SessionAspect.php | 1 + src/socketio-server/src/Atomic.php | 1 + src/socketio-server/src/BaseNamespace.php | 1 + .../Collector/EventAnnotationCollector.php | 1 + .../src/Collector/SocketIORouter.php | 1 + .../src/Command/RemoveRedisGarbage.php | 1 + src/socketio-server/src/ConfigProvider.php | 1 + src/socketio-server/src/Emitter/Emitter.php | 1 + src/socketio-server/src/Emitter/Future.php | 1 + .../Exception/ConnectionClosedException.php | 1 + .../src/Exception/RouteNotFoundException.php | 1 + .../src/Listener/AddRouteListener.php | 1 + .../src/Listener/ServerIdListener.php | 1 + .../src/Listener/StartSubscriberListener.php | 1 + .../src/NamespaceInterface.php | 1 + src/socketio-server/src/Parser/Decoder.php | 1 + src/socketio-server/src/Parser/Encoder.php | 1 + src/socketio-server/src/Parser/Engine.php | 1 + src/socketio-server/src/Parser/Packet.php | 1 + .../src/Room/AdapterInterface.php | 1 + .../src/Room/EphemeralInterface.php | 1 + .../src/Room/MemoryAdapter.php | 1 + src/socketio-server/src/Room/MemoryRoom.php | 1 + src/socketio-server/src/Room/NullAdapter.php | 1 + src/socketio-server/src/Room/RedisAdapter.php | 1 + .../src/Room/RedisNsqAdapter.php | 1 + .../src/Room/RoomInterface.php | 1 + .../SidProvider/DistributedSidProvider.php | 1 + .../src/SidProvider/LocalSidProvider.php | 1 + .../src/SidProvider/SessionSidProvider.php | 1 + .../src/SidProvider/SidProviderInterface.php | 1 + src/socketio-server/src/Socket.php | 1 + src/socketio-server/src/SocketIO.php | 1 + src/socketio-server/src/SocketIOConfig.php | 1 + .../tests/Cases/AbstractTestCase.php | 1 + .../tests/Cases/DecoderTest.php | 1 + .../tests/Cases/EncoderTest.php | 1 + .../tests/Cases/FutureTest.php | 1 + .../tests/Cases/IONamespaceTest.php | 1 + .../tests/Cases/RoomAdapterTest.php | 1 + .../tests/Cases/SocketTest.php | 1 + .../tests/Stub/EphemeralAdapter.php | 1 + src/stdlib/src/SplPriorityQueue.php | 1 + src/stdlib/tests/SplPriorityQueueTest.php | 1 + src/stringable/src/Functions.php | 1 + src/stringable/src/Pluralizer.php | 1 + src/stringable/src/Str.php | 3 +- src/stringable/src/StrCache.php | 1 + src/stringable/src/Stringable.php | 1 + src/stringable/tests/FunctionsTest.php | 1 + src/stringable/tests/StrTest.php | 12 +- src/stringable/tests/StringableTest.php | 1 + src/super-globals/src/ConfigProvider.php | 1 + .../Exception/ContainerNotFoundException.php | 1 + .../Exception/InvalidOperationException.php | 1 + .../Exception/RequestNotFoundException.php | 1 + .../Exception/SessionNotFoundException.php | 1 + .../SuperGlobalsInitializeListener.php | 1 + src/super-globals/src/Proxy.php | 1 + src/super-globals/src/Proxy/Cookie.php | 1 + src/super-globals/src/Proxy/File.php | 1 + src/super-globals/src/Proxy/Get.php | 1 + src/super-globals/src/Proxy/Post.php | 1 + src/super-globals/src/Proxy/Request.php | 1 + src/super-globals/src/Proxy/Server.php | 1 + src/super-globals/src/Proxy/Session.php | 1 + src/super-globals/tests/ProxyTest.php | 1 + .../tests/Stub/ContainerStub.php | 1 + src/support/src/Backoff.php | 1 + src/support/src/Backoff/ArrayBackoff.php | 1 + src/support/src/ClearStatCache.php | 1 + src/support/src/Composer.php | 1 + .../src/Exception/ExceptionThrower.php | 1 + .../src/Exception/IPReadFailedException.php | 1 + .../Exception/InvalidArgumentException.php | 1 + .../src/Filesystem/FileNotFoundException.php | 1 + src/support/src/Filesystem/Filesystem.php | 1 + src/support/src/Fluent.php | 1 + src/support/src/Functions.php | 4 +- src/support/src/IPReader.php | 1 + src/support/src/MessageBag.php | 1 + src/support/src/MimeTypeExtensionGuesser.php | 1 + src/support/src/Network.php | 1 + src/support/src/Optional.php | 1 + src/support/src/Pluralizer.php | 1 + src/support/src/Reflection/ClassInvoker.php | 1 + src/support/src/ResourceGenerator.php | 1 + src/support/src/SafeCaller.php | 1 + src/support/src/System.php | 1 + src/support/src/Traits/Container.php | 1 + src/support/src/Traits/ForwardsCalls.php | 3 +- src/support/src/Traits/InteractsWithTime.php | 1 + src/support/src/Traits/StaticInstance.php | 1 + src/support/tests/BackoffTest.php | 4 +- src/support/tests/ComposerTest.php | 1 + .../tests/Exception/RetryException.php | 1 + .../tests/Filesystem/FilesystemTest.php | 6 +- src/support/tests/FunctionTest.php | 1 + src/support/tests/NetworkTest.php | 1 + src/support/tests/OptionalTest.php | 1 + .../tests/Reflection/ClassInvokerTest.php | 1 + src/support/tests/ResourceGeneratorTest.php | 1 + src/support/tests/Stub/Bar.php | 1 + src/support/tests/Stub/Foo.php | 1 + src/support/tests/Stub/FooClosure.php | 1 + src/support/tests/Stub/Traits/BarTrait.php | 1 + src/support/tests/Stub/Traits/FooTrait.php | 1 + .../src/Annotation/AdditionalProperties.php | 1 + .../src/Annotation/AnnotationTrait.php | 1 + src/swagger/src/Annotation/Attachable.php | 1 + src/swagger/src/Annotation/Components.php | 1 + src/swagger/src/Annotation/Contact.php | 1 + .../src/Annotation/CookieParameter.php | 1 + src/swagger/src/Annotation/Delete.php | 1 + src/swagger/src/Annotation/Discriminator.php | 1 + src/swagger/src/Annotation/Examples.php | 1 + .../src/Annotation/ExternalDocumentation.php | 1 + src/swagger/src/Annotation/Flow.php | 1 + src/swagger/src/Annotation/Get.php | 1 + src/swagger/src/Annotation/Head.php | 1 + src/swagger/src/Annotation/Header.php | 1 + .../src/Annotation/HeaderParameter.php | 1 + src/swagger/src/Annotation/HyperfServer.php | 1 + src/swagger/src/Annotation/Info.php | 1 + src/swagger/src/Annotation/Items.php | 1 + src/swagger/src/Annotation/JsonContent.php | 1 + src/swagger/src/Annotation/License.php | 1 + src/swagger/src/Annotation/Link.php | 1 + src/swagger/src/Annotation/MediaType.php | 1 + .../Annotation/MultipleAnnotationTrait.php | 1 + src/swagger/src/Annotation/OpenApi.php | 1 + src/swagger/src/Annotation/Options.php | 1 + src/swagger/src/Annotation/Parameter.php | 1 + src/swagger/src/Annotation/Patch.php | 1 + src/swagger/src/Annotation/PathItem.php | 1 + src/swagger/src/Annotation/PathParameter.php | 1 + src/swagger/src/Annotation/Post.php | 1 + src/swagger/src/Annotation/Property.php | 7 +- src/swagger/src/Annotation/Put.php | 1 + src/swagger/src/Annotation/QueryParameter.php | 5 +- src/swagger/src/Annotation/RequestBody.php | 5 +- src/swagger/src/Annotation/Response.php | 1 + src/swagger/src/Annotation/Schema.php | 1 + src/swagger/src/Annotation/SecurityScheme.php | 1 + src/swagger/src/Annotation/Server.php | 1 + src/swagger/src/Annotation/ServerVariable.php | 1 + src/swagger/src/Annotation/Tag.php | 1 + src/swagger/src/Annotation/Trace.php | 1 + src/swagger/src/Annotation/Xml.php | 1 + src/swagger/src/Annotation/XmlContent.php | 1 + .../src/Command/Ast/ModelSchemaVisitor.php | 8 +- src/swagger/src/Command/GenCommand.php | 1 + src/swagger/src/Command/GenSchemaCommand.php | 1 + src/swagger/src/ConfigProvider.php | 1 + .../src/Exception/RuntimeException.php | 1 + src/swagger/src/Generator.php | 1 + src/swagger/src/HttpServer.php | 1 + .../src/Listener/BootSwaggerListener.php | 1 + .../src/Processor/BuildPathsProcessor.php | 27 ++- src/swagger/src/Request/RuleCollector.php | 1 + src/swagger/src/Request/SwaggerRequest.php | 3 +- .../src/Request/ValidationCollector.php | 7 +- src/swagger/src/Util.php | 1 + src/swagger/tests/Stub/ExampleController.php | 1 + src/swagger/tests/SwaggerRequestTest.php | 1 + src/tappable/src/Functions.php | 1 + src/tappable/src/HigherOrderTapProxy.php | 1 + src/tappable/src/Tappable.php | 1 + src/tappable/tests/TappableTest.php | 1 + src/task/src/Annotation/Task.php | 1 + src/task/src/Aspect/TaskAspect.php | 1 + src/task/src/ChannelFactory.php | 1 + src/task/src/ConfigProvider.php | 1 + src/task/src/Exception.php | 1 + src/task/src/Exception/TaskException.php | 1 + .../src/Exception/TaskExecuteException.php | 1 + .../Exception/TaskExecuteTimeoutException.php | 1 + src/task/src/Finish.php | 1 + .../src/Listener/AfterWorkerStartListener.php | 1 + src/task/src/Listener/InitServerListener.php | 1 + src/task/src/Listener/OnFinishListener.php | 1 + src/task/src/Listener/OnTaskListener.php | 1 + src/task/src/Task.php | 1 + src/task/src/TaskData.php | 1 + src/task/src/TaskExecutor.php | 1 + src/task/tests/ChannelFactoryTest.php | 1 + src/task/tests/OnTaskListenerTest.php | 1 + src/task/tests/Stub/Foo.php | 1 + src/task/tests/Stub/SwooleServer.php | 1 + src/task/tests/TaskAspectTest.php | 1 + src/testing/src/Assert.php | 1 + src/testing/src/AssertableJsonString.php | 1 + src/testing/src/Client.php | 1 + .../src/Concerns/InteractsWithContainer.php | 13 +- .../src/Concerns/InteractsWithDatabase.php | 1 + .../Concerns/InteractsWithModelFactory.php | 1 + .../src/Concerns/MakesHttpRequests.php | 1 + .../src/Concerns/RunTestsInCoroutine.php | 11 +- src/testing/src/Constraint/ArraySubset.php | 1 + src/testing/src/Constraint/HasInDatabase.php | 1 + src/testing/src/Constraint/SeeInOrder.php | 1 + src/testing/src/Debug.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/testing/src/Fluent/AssertableJson.php | 1 + src/testing/src/Fluent/Concerns/Debugging.php | 1 + src/testing/src/Fluent/Concerns/Has.php | 1 + .../src/Fluent/Concerns/Interaction.php | 1 + src/testing/src/Fluent/Concerns/Matching.php | 1 + src/testing/src/Http/Client.php | 1 + .../src/Http/Concerns/AssertsStatusCodes.php | 1 + src/testing/src/Http/TestResponse.php | 1 + src/testing/src/HttpClient.php | 1 + .../src/HttpMessage/Upload/UploadedFile.php | 1 + src/testing/src/ModelFactory.php | 1 + src/testing/src/TestCase.php | 1 + src/testing/tests/ClientTest.php | 1 + src/testing/tests/DebugTest.php | 1 + src/testing/tests/HttpClientTest.php | 4 +- .../Exception/Handler/FooExceptionHandler.php | 1 + src/testing/tests/Stub/FooController.php | 1 + src/tracer/class_map/GlobalTracer.php | 1 + src/tracer/class_map/Map.php | 2 +- src/tracer/class_map/ThriftUdpTransport.php | 1 + src/tracer/publish/opentracing.php | 18 +- src/tracer/src/Adapter/HttpClientFactory.php | 1 + .../src/Adapter/JaegerTracerFactory.php | 1 + src/tracer/src/Adapter/NoOpTracerFactory.php | 1 + .../Adapter/Reporter/HttpClientFactory.php | 1 + src/tracer/src/Adapter/Reporter/Kafka.php | 1 + .../Adapter/Reporter/KafkaClientFactory.php | 1 + .../src/Adapter/Reporter/ReporterFactory.php | 4 +- .../src/Adapter/ZipkinTracerFactory.php | 4 +- src/tracer/src/Annotation/Trace.php | 1 + src/tracer/src/Aspect/CoroutineAspect.php | 1 + .../src/Aspect/CreateTraceContextAspect.php | 1 + src/tracer/src/Aspect/DbAspect.php | 1 + src/tracer/src/Aspect/ElasticserachAspect.php | 1 + src/tracer/src/Aspect/GrpcAspect.php | 1 + src/tracer/src/Aspect/HttpClientAspect.php | 1 + src/tracer/src/Aspect/JsonRpcAspect.php | 1 + src/tracer/src/Aspect/MethodAspect.php | 1 + src/tracer/src/Aspect/RedisAspect.php | 1 + src/tracer/src/Aspect/RpcAspect.php | 1 + .../src/Aspect/TraceAnnotationAspect.php | 1 + src/tracer/src/ConfigProvider.php | 1 + .../src/Contract/NamedFactoryInterface.php | 5 +- .../Exception/ConnectionClosedException.php | 1 + .../Exception/InvalidArgumentException.php | 1 + src/tracer/src/Exception/TimeoutException.php | 1 + .../src/Listener/DbQueryExecutedListener.php | 1 + .../src/Listener/RequestTraceListener.php | 1 + src/tracer/src/Middleware/TraceMiddleware.php | 3 +- src/tracer/src/SpanStarter.php | 1 + src/tracer/src/SpanTagManager.php | 1 + src/tracer/src/SpanTagManagerFactory.php | 1 + src/tracer/src/SwitchManager.php | 3 +- src/tracer/src/SwitchManagerFactory.php | 1 + src/tracer/src/TracerContext.php | 1 + src/tracer/src/TracerFactory.php | 1 + src/tracer/tests/TracerFactoryTest.php | 54 +++--- src/translation/src/ArrayLoader.php | 1 + src/translation/src/ConfigProvider.php | 1 + src/translation/src/FileLoader.php | 1 + src/translation/src/FileLoaderFactory.php | 1 + src/translation/src/Functions.php | 1 + src/translation/src/MessageSelector.php | 1 + src/translation/src/Translator.php | 1 + src/translation/src/TranslatorFactory.php | 1 + src/translation/tests/FileLoaderTest.php | 1 + src/translation/tests/MessageSelectorTest.php | 4 +- src/translation/tests/TranslatorTest.php | 1 + src/validation/src/Annotation/Scene.php | 1 + src/validation/src/ClosureValidationRule.php | 1 + .../src/Concerns/FormatsMessages.php | 3 +- .../src/Concerns/ReplacesAttributes.php | 1 + .../src/Concerns/ValidatesAttributes.php | 1 + src/validation/src/ConfigProvider.php | 1 + src/validation/src/Contract/DataAwareRule.php | 1 + src/validation/src/Contract/ImplicitRule.php | 1 + .../Contract/PresenceVerifierInterface.php | 1 + src/validation/src/Contract/Rule.php | 1 + .../src/Contract/ValidatesWhenResolved.php | 1 + .../src/Contract/ValidatorAwareRule.php | 1 + .../Contract/ValidatorFactoryInterface.php | 1 + .../src/DatabasePresenceVerifier.php | 10 +- .../src/DatabasePresenceVerifierFactory.php | 1 + .../src/Event/ValidatorFactoryResolved.php | 1 + .../src/Middleware/ValidationMiddleware.php | 1 + src/validation/src/Request/FormRequest.php | 1 + src/validation/src/Rule.php | 1 + src/validation/src/Rules/DatabaseRule.php | 1 + src/validation/src/Rules/Dimensions.php | 1 + src/validation/src/Rules/ExcludeIf.php | 3 +- src/validation/src/Rules/Exists.php | 1 + src/validation/src/Rules/File.php | 3 +- src/validation/src/Rules/ImageFile.php | 1 + src/validation/src/Rules/In.php | 1 + src/validation/src/Rules/NotIn.php | 1 + src/validation/src/Rules/ProhibitedIf.php | 3 +- src/validation/src/Rules/RequiredIf.php | 1 + src/validation/src/Rules/Unique.php | 3 +- src/validation/src/UnauthorizedException.php | 1 + .../src/ValidatesWhenResolvedTrait.php | 5 +- src/validation/src/ValidationData.php | 1 + src/validation/src/ValidationException.php | 1 + .../src/ValidationExceptionHandler.php | 3 +- src/validation/src/ValidationRuleParser.php | 1 + src/validation/src/Validator.php | 7 +- src/validation/src/ValidatorFactory.php | 5 +- .../src/ValidatorFactoryFactory.php | 3 +- .../tests/Cases/AbstractTestCase.php | 1 + .../tests/Cases/FormRequestTest.php | 1 + .../tests/Cases/Stub/BarSceneRequest.php | 1 + .../tests/Cases/Stub/DemoController.php | 1 + .../tests/Cases/Stub/DemoRequest.php | 1 + .../tests/Cases/Stub/FooMiddleware.php | 1 + .../tests/Cases/Stub/FooSceneRequest.php | 1 + .../Cases/Stub/ValidatesAttributesStub.php | 1 + .../tests/Cases/ValidateAttributesTest.php | 1 + .../tests/Cases/ValidationAddFailureTest.php | 1 + ...ValidationDatabasePresenceVerifierTest.php | 1 + .../Cases/ValidationDimensionsRuleTest.php | 1 + .../tests/Cases/ValidationExceptionTest.php | 1 + .../tests/Cases/ValidationExcludeIfTest.php | 1 + .../tests/Cases/ValidationExistsRuleTest.php | 1 + .../tests/Cases/ValidationFactoryTest.php | 1 + .../tests/Cases/ValidationFileRuleTest.php | 1 + .../Cases/ValidationImageFileRuleTest.php | 5 +- .../tests/Cases/ValidationInRuleTest.php | 1 + .../tests/Cases/ValidationMiddlewareTest.php | 3 +- .../tests/Cases/ValidationNotInRuleTest.php | 1 + .../Cases/ValidationProhibitedIfTest.php | 1 + .../tests/Cases/ValidationRequiredIfTest.php | 1 + .../tests/Cases/ValidationRuleTest.php | 1 + .../tests/Cases/ValidationUniqueRuleTest.php | 1 + .../tests/Cases/ValidationValidatorTest.php | 10 +- .../tests/Cases/fixtures/Values.php | 1 + src/validation/tests/File/File.php | 1 + src/validation/tests/File/FileFactory.php | 1 + src/validation/tests/File/MimeType.php | 1 + src/validation/tests/FileTest.php | 12 +- src/view-engine/src/Blade.php | 1 + .../src/Command/GenerateViewCacheCommand.php | 1 + .../src/Command/ViewPublishCommand.php | 1 + .../src/Compiler/BladeCompiler.php | 1 + src/view-engine/src/Compiler/Compiler.php | 1 + .../src/Compiler/CompilerInterface.php | 1 + .../src/Compiler/ComponentTagCompiler.php | 3 +- .../src/Compiler/Concern/CompilesComments.php | 1 + .../Compiler/Concern/CompilesComponents.php | 1 + .../Compiler/Concern/CompilesConditionals.php | 1 + .../src/Compiler/Concern/CompilesEchos.php | 1 + .../src/Compiler/Concern/CompilesErrors.php | 1 + .../src/Compiler/Concern/CompilesIncludes.php | 1 + .../Compiler/Concern/CompilesInjections.php | 1 + .../src/Compiler/Concern/CompilesJson.php | 1 + .../src/Compiler/Concern/CompilesLayouts.php | 1 + .../src/Compiler/Concern/CompilesLoops.php | 1 + .../src/Compiler/Concern/CompilesRawPhp.php | 1 + .../src/Compiler/Concern/CompilesStacks.php | 1 + .../Compiler/Concern/CompilesTranslations.php | 1 + .../src/Component/AnonymousComponent.php | 1 + src/view-engine/src/Component/Component.php | 1 + .../src/Component/ComponentAttributeBag.php | 4 +- .../src/Component/DynamicComponent.php | 1 + .../Component/InvokableComponentVariable.php | 1 + .../src/Concern/ManagesComponents.php | 1 + src/view-engine/src/Concern/ManagesEvents.php | 1 + .../src/Concern/ManagesLayouts.php | 1 + src/view-engine/src/Concern/ManagesLoops.php | 1 + src/view-engine/src/Concern/ManagesStacks.php | 1 + .../src/Concern/ManagesTranslations.php | 1 + src/view-engine/src/ConfigProvider.php | 1 + .../Contract/DeferringDisplayableValue.php | 1 + .../src/Contract/EngineInterface.php | 1 + .../src/Contract/EngineResolverInterface.php | 1 + src/view-engine/src/Contract/Enumerable.php | 1 + .../src/Contract/FactoryInterface.php | 1 + .../src/Contract/FinderInterface.php | 1 + src/view-engine/src/Contract/Htmlable.php | 1 + src/view-engine/src/Contract/Renderable.php | 1 + .../src/Contract/ViewInterface.php | 1 + src/view-engine/src/Engine/CompilerEngine.php | 1 + src/view-engine/src/Engine/Engine.php | 1 + src/view-engine/src/Engine/EngineResolver.php | 1 + src/view-engine/src/Engine/FileEngine.php | 1 + src/view-engine/src/Engine/PhpEngine.php | 1 + .../Exception/ViewCompilationException.php | 1 + src/view-engine/src/Factory.php | 1 + .../src/Factory/CompilerFactory.php | 1 + .../src/Factory/EngineResolverFactory.php | 1 + src/view-engine/src/Factory/FinderFactory.php | 1 + src/view-engine/src/Finder.php | 1 + src/view-engine/src/Functions.php | 1 + src/view-engine/src/HtmlString.php | 1 + .../Middleware/ShareErrorsFromSession.php | 1 + .../Middleware/ValidationExceptionHandle.php | 1 + src/view-engine/src/HyperfViewEngine.php | 1 + src/view-engine/src/T.php | 1 + src/view-engine/src/View.php | 1 + src/view-engine/src/ViewErrorBag.php | 1 + .../tests/Blade/AbstractBladeTestCase.php | 1 + .../tests/Blade/BladeCommentsTest.php | 1 + .../Blade/BladeComponentTagCompilerTest.php | 1 + .../tests/Blade/BladeComponentsTest.php | 1 + .../tests/Blade/BladeConditionalsTest.php | 1 + .../tests/Blade/BladeCustomTest.php | 1 + .../tests/Blade/BladeEchosTest.php | 1 + .../tests/Blade/BladeErrorsTest.php | 1 + .../tests/Blade/BladeIncludesTest.php | 1 + .../tests/Blade/BladeInjectTest.php | 1 + src/view-engine/tests/Blade/BladeJsonTest.php | 1 + .../tests/Blade/BladeLayoutsTest.php | 1 + .../tests/Blade/BladeLoopsTest.php | 6 +- .../tests/Blade/BladeRawPhpTest.php | 1 + .../tests/Blade/BladeStacksTest.php | 1 + .../tests/Blade/BladeTranslationsTest.php | 1 + .../tests/Blade/BladeVerbatimTest.php | 1 + src/view-engine/tests/BladeTest.php | 1 + src/view-engine/tests/Stub/Alert.php | 1 + .../tests/Stub/AlertAttributeMerge.php | 1 + .../tests/Stub/AlertAttributeMergeForce.php | 1 + src/view-engine/tests/Stub/AlertSlot.php | 1 + src/view-engine/tests/Stub/ContainerStub.php | 1 + src/view/src/ConfigProvider.php | 1 + src/view/src/Engine/BladeEngine.php | 1 + src/view/src/Engine/EngineInterface.php | 1 + src/view/src/Engine/NoneEngine.php | 1 + src/view/src/Engine/PlatesEngine.php | 1 + src/view/src/Engine/SmartyEngine.php | 1 + src/view/src/Engine/ThinkEngine.php | 1 + src/view/src/Engine/TwigEngine.php | 1 + .../src/Exception/EngineNotFindException.php | 1 + src/view/src/Exception/RenderException.php | 1 + src/view/src/Mode.php | 1 + src/view/src/Render.php | 1 + src/view/src/RenderInterface.php | 1 + src/view/tests/NoneTest.php | 1 + src/view/tests/PlatesTest.php | 1 + src/view/tests/RenderTest.php | 1 + src/view/tests/SmartyTest.php | 1 + src/view/tests/ThinkTest.php | 1 + src/view/tests/TwigTest.php | 1 + src/watcher/src/Ast/Metadata.php | 1 + .../src/Ast/RewriteClassNameVisitor.php | 1 + src/watcher/src/Command/WatchCommand.php | 1 + src/watcher/src/ConfigProvider.php | 1 + src/watcher/src/Driver/AbstractDriver.php | 1 + src/watcher/src/Driver/DriverInterface.php | 1 + src/watcher/src/Driver/FindDriver.php | 1 + src/watcher/src/Driver/FindNewerDriver.php | 1 + src/watcher/src/Driver/FswatchDriver.php | 1 + src/watcher/src/Driver/ScanFileDriver.php | 1 + src/watcher/src/Functions.php | 6 +- src/watcher/src/Option.php | 1 + src/watcher/src/Process.php | 1 + src/watcher/src/Watcher.php | 4 +- src/watcher/tests/Driver/FindDriverTest.php | 1 + .../tests/Driver/FindNewerDriverTest.php | 1 + .../tests/Driver/FswatchDriverTest.php | 1 + .../tests/Driver/ScanFileDriverTest.php | 1 + src/watcher/tests/Stub/ContainerStub.php | 3 +- src/watcher/tests/Stub/FindDriverStub.php | 1 + .../tests/Stub/FindNewerDriverStub.php | 1 + src/watcher/tests/Stub/ScanFileDriverStub.php | 1 + src/watcher/tests/WatcherTest.php | 1 + src/websocket-client/src/Client.php | 1 + src/websocket-client/src/ClientFactory.php | 1 + src/websocket-client/src/ConfigProvider.php | 1 + .../src/Exception/ConnectException.php | 1 + src/websocket-client/src/Frame.php | 1 + src/websocket-client/tests/ClientTest.php | 4 +- src/websocket-client/tests/FrameTest.php | 1 + src/websocket-server/src/Collector/Fd.php | 1 + .../src/Collector/FdCollector.php | 1 + src/websocket-server/src/ConfigProvider.php | 1 + src/websocket-server/src/Constant/Opcode.php | 1 + src/websocket-server/src/Context.php | 1 + src/websocket-server/src/CoreMiddleware.php | 1 + .../src/Event/OnOpenEvent.php | 1 + .../Handler/WebSocketExceptionHandler.php | 1 + .../src/Exception/InvalidMethodException.php | 1 + .../WebSocketHandeShakeException.php | 1 + .../Exception/WebSocketMessageException.php | 1 + .../src/Listener/InitSenderListener.php | 1 + .../src/Listener/OnPipeMessageListener.php | 1 + src/websocket-server/src/Security.php | 1 + src/websocket-server/src/Sender.php | 1 + .../src/SenderPipeMessage.php | 1 + src/websocket-server/src/Server.php | 6 +- src/websocket-server/tests/ContextTest.php | 1 + src/websocket-server/tests/SenderTest.php | 6 +- src/websocket-server/tests/ServerTest.php | 1 + src/websocket-server/tests/Stub/FooServer.php | 3 +- .../tests/Stub/WebSocketStub.php | 1 + 2752 files changed, 4274 insertions(+), 1357 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 93b384f08..41321b3ca 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -94,7 +94,9 @@ return (new PhpCsFixer\Config()) 'single_quote' => true, 'standardize_not_equals' => true, 'multiline_comment_opening_closing' => true, - 'nullable_type_declaration_for_default_null_value' => true, // Since PHP 8.3, default null values can be declared as nullable. + // Since PHP 8.3, default null values can be declared as nullable. + 'nullable_type_declaration_for_default_null_value' => true, + 'single_line_empty_body' => false, ]) ->setFinder( PhpCsFixer\Finder::create() diff --git a/CHANGELOG-3.1.md b/CHANGELOG-3.1.md index 810c04799..b6746d00c 100644 --- a/CHANGELOG-3.1.md +++ b/CHANGELOG-3.1.md @@ -4,6 +4,10 @@ - [#6613](https://github.com/hyperf/hyperf/pull/6613) Added event of release connection for `hyperf/pool`. +## Optimized + +- [#6616](https://github.com/hyperf/hyperf/pull/6616) [#6617](https://github.com/hyperf/hyperf/pull/6617) Format code by the latest `cs-fixer`. + # v3.1.14 - 2024-03-21 ## Fixed diff --git a/bootstrap.php b/bootstrap.php index 5126505a1..97152e3d1 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -32,4 +32,4 @@ AstVisitorRegistry::insert(ProxyCallVisitor::class); // Register Property Handler. RegisterInjectPropertyHandler::register(); -(new RegisterPropertyHandlerListener())->process(new \stdClass()); +(new RegisterPropertyHandlerListener())->process(new stdClass()); diff --git a/composer.json b/composer.json index 0fe1c611a..3c0cdb92f 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "fakerphp/faker": "^1.23", "fig/http-message-util": "^1.1.2", "filp/whoops": "^2.7", - "friendsofphp/php-cs-fixer": "~3.16.0", + "friendsofphp/php-cs-fixer": "^3.52", "google/common-protos": "^3.2|^4.4", "google/protobuf": "^3.6.1", "grpc/grpc": "^1.15", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1fbd51ec4..808c7d6c1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -16,7 +16,6 @@ parameters: - %currentWorkingDirectory%/src/*/class_map/* - %currentWorkingDirectory%/src/di/src/Resolver/FactoryResolver.php - %currentWorkingDirectory%/src/config-zookeeper/src/Client.php - - %currentWorkingDirectory%/src/contract/* - %currentWorkingDirectory%/src/database/* - %currentWorkingDirectory%/src/database-pgsql/* - %currentWorkingDirectory%/src/db/src/PgSQL/* @@ -25,7 +24,6 @@ parameters: - %currentWorkingDirectory%/src/grpc/* - %currentWorkingDirectory%/src/grpc-server/* - %currentWorkingDirectory%/src/ide-helper/* - - %currentWorkingDirectory%/src/swagger/* - %currentWorkingDirectory%/src/validation/* - %currentWorkingDirectory%/src/view/src/Engine/* - %currentWorkingDirectory%/src/server/src/SwowServer.php diff --git a/src/amqp/src/AMQPConnection.php b/src/amqp/src/AMQPConnection.php index 61dd844f1..49e8bd3a0 100644 --- a/src/amqp/src/AMQPConnection.php +++ b/src/amqp/src/AMQPConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Exception\LoopBrokenException; diff --git a/src/amqp/src/Annotation/Consumer.php b/src/amqp/src/Annotation/Consumer.php index f121f9ebc..d3f0926c2 100644 --- a/src/amqp/src/Annotation/Consumer.php +++ b/src/amqp/src/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Annotation; use Attribute; diff --git a/src/amqp/src/Annotation/Producer.php b/src/amqp/src/Annotation/Producer.php index 3b7243377..637c1a9be 100644 --- a/src/amqp/src/Annotation/Producer.php +++ b/src/amqp/src/Annotation/Producer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Annotation; use Attribute; diff --git a/src/amqp/src/Builder.php b/src/amqp/src/Builder.php index 3a3a8fd71..1d8c660dd 100644 --- a/src/amqp/src/Builder.php +++ b/src/amqp/src/Builder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Message\MessageInterface; diff --git a/src/amqp/src/Builder/Builder.php b/src/amqp/src/Builder/Builder.php index f9036c26e..96cc2b1d0 100644 --- a/src/amqp/src/Builder/Builder.php +++ b/src/amqp/src/Builder/Builder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Builder; use PhpAmqpLib\Wire\AMQPTable; diff --git a/src/amqp/src/Builder/ExchangeBuilder.php b/src/amqp/src/Builder/ExchangeBuilder.php index 8f4f89b99..a85284c36 100644 --- a/src/amqp/src/Builder/ExchangeBuilder.php +++ b/src/amqp/src/Builder/ExchangeBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Builder; use Hyperf\Amqp\Message\Type; @@ -32,7 +33,7 @@ class ExchangeBuilder extends Builder return $this; } - public function getType(): Type|string + public function getType(): string|Type { return $this->type; } @@ -42,7 +43,7 @@ class ExchangeBuilder extends Builder return $this->type instanceof Type ? $this->type->value : $this->type; } - public function setType(Type|string $type): static + public function setType(string|Type $type): static { $this->type = $type; return $this; diff --git a/src/amqp/src/Builder/QueueBuilder.php b/src/amqp/src/Builder/QueueBuilder.php index e941b39c7..362f81e33 100644 --- a/src/amqp/src/Builder/QueueBuilder.php +++ b/src/amqp/src/Builder/QueueBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Builder; use PhpAmqpLib\Wire\AMQPTable; diff --git a/src/amqp/src/ConfigProvider.php b/src/amqp/src/ConfigProvider.php index 9aed31c78..de400aa07 100644 --- a/src/amqp/src/ConfigProvider.php +++ b/src/amqp/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Listener\BeforeMainServerStartListener; diff --git a/src/amqp/src/ConnectionFactory.php b/src/amqp/src/ConnectionFactory.php index 58473afd4..60ea4d373 100644 --- a/src/amqp/src/ConnectionFactory.php +++ b/src/amqp/src/ConnectionFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Exception\NotSupportedException; diff --git a/src/amqp/src/Constants.php b/src/amqp/src/Constants.php index 5fbdb344a..4177df83e 100644 --- a/src/amqp/src/Constants.php +++ b/src/amqp/src/Constants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; class Constants diff --git a/src/amqp/src/Consumer.php b/src/amqp/src/Consumer.php index cf4248b5a..7a6d79bd8 100644 --- a/src/amqp/src/Consumer.php +++ b/src/amqp/src/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Event\AfterConsume; diff --git a/src/amqp/src/ConsumerFactory.php b/src/amqp/src/ConsumerFactory.php index 427f5dc5b..ba3429998 100644 --- a/src/amqp/src/ConsumerFactory.php +++ b/src/amqp/src/ConsumerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/amqp/src/ConsumerManager.php b/src/amqp/src/ConsumerManager.php index de3ec46e9..23c9dcc66 100644 --- a/src/amqp/src/ConsumerManager.php +++ b/src/amqp/src/ConsumerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Annotation\Consumer as ConsumerAnnotation; diff --git a/src/amqp/src/Event/AfterConsume.php b/src/amqp/src/Event/AfterConsume.php index d5bbeca35..f0db81952 100644 --- a/src/amqp/src/Event/AfterConsume.php +++ b/src/amqp/src/Event/AfterConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Event; use Hyperf\Amqp\Message\ConsumerMessageInterface; diff --git a/src/amqp/src/Event/BeforeConsume.php b/src/amqp/src/Event/BeforeConsume.php index 4f5d874cb..9bf38fbab 100644 --- a/src/amqp/src/Event/BeforeConsume.php +++ b/src/amqp/src/Event/BeforeConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Event; use Hyperf\Amqp\Message\ConsumerMessageInterface; diff --git a/src/amqp/src/Event/ConsumeEvent.php b/src/amqp/src/Event/ConsumeEvent.php index 1b9aa6fd7..d1dbb56f6 100644 --- a/src/amqp/src/Event/ConsumeEvent.php +++ b/src/amqp/src/Event/ConsumeEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Event; use Hyperf\Amqp\Message\ConsumerMessageInterface; diff --git a/src/amqp/src/Event/FailToConsume.php b/src/amqp/src/Event/FailToConsume.php index 6e8b40787..2cf65961c 100644 --- a/src/amqp/src/Event/FailToConsume.php +++ b/src/amqp/src/Event/FailToConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Event; use Hyperf\Amqp\Message\ConsumerMessageInterface; diff --git a/src/amqp/src/Event/WaitTimeout.php b/src/amqp/src/Event/WaitTimeout.php index c352b9865..ec4041598 100644 --- a/src/amqp/src/Event/WaitTimeout.php +++ b/src/amqp/src/Event/WaitTimeout.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Event; class WaitTimeout extends ConsumeEvent diff --git a/src/amqp/src/Exception/LoopBrokenException.php b/src/amqp/src/Exception/LoopBrokenException.php index ec08d97c9..cbeba483b 100644 --- a/src/amqp/src/Exception/LoopBrokenException.php +++ b/src/amqp/src/Exception/LoopBrokenException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use RuntimeException; diff --git a/src/amqp/src/Exception/MaxConsumptionException.php b/src/amqp/src/Exception/MaxConsumptionException.php index d6fc9a501..5b1cafa39 100644 --- a/src/amqp/src/Exception/MaxConsumptionException.php +++ b/src/amqp/src/Exception/MaxConsumptionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use Exception; diff --git a/src/amqp/src/Exception/MessageException.php b/src/amqp/src/Exception/MessageException.php index 36106e10c..5d336ac29 100644 --- a/src/amqp/src/Exception/MessageException.php +++ b/src/amqp/src/Exception/MessageException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use Exception; diff --git a/src/amqp/src/Exception/NotSupportedException.php b/src/amqp/src/Exception/NotSupportedException.php index cbb7f5dc7..c31f888da 100644 --- a/src/amqp/src/Exception/NotSupportedException.php +++ b/src/amqp/src/Exception/NotSupportedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use RuntimeException; diff --git a/src/amqp/src/Exception/SendChannelClosedException.php b/src/amqp/src/Exception/SendChannelClosedException.php index 5bf89890a..758ddf07b 100644 --- a/src/amqp/src/Exception/SendChannelClosedException.php +++ b/src/amqp/src/Exception/SendChannelClosedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use RuntimeException; diff --git a/src/amqp/src/Exception/SendChannelTimeoutException.php b/src/amqp/src/Exception/SendChannelTimeoutException.php index 7af0cae5b..f6eaecba2 100644 --- a/src/amqp/src/Exception/SendChannelTimeoutException.php +++ b/src/amqp/src/Exception/SendChannelTimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use RuntimeException; diff --git a/src/amqp/src/Exception/TimeoutException.php b/src/amqp/src/Exception/TimeoutException.php index ac8a933e0..d8162b504 100644 --- a/src/amqp/src/Exception/TimeoutException.php +++ b/src/amqp/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Exception; use RuntimeException; diff --git a/src/amqp/src/IO/IOFactory.php b/src/amqp/src/IO/IOFactory.php index ac5d69d2c..9e34a674e 100644 --- a/src/amqp/src/IO/IOFactory.php +++ b/src/amqp/src/IO/IOFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\IO; use Hyperf\Amqp\Exception\NotSupportedException; diff --git a/src/amqp/src/IO/IOFactoryInterface.php b/src/amqp/src/IO/IOFactoryInterface.php index 65436d51f..a8f936910 100644 --- a/src/amqp/src/IO/IOFactoryInterface.php +++ b/src/amqp/src/IO/IOFactoryInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\IO; use Hyperf\Amqp\Params; diff --git a/src/amqp/src/IO/SwooleIO.php b/src/amqp/src/IO/SwooleIO.php index 385d69273..65a19f511 100644 --- a/src/amqp/src/IO/SwooleIO.php +++ b/src/amqp/src/IO/SwooleIO.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\IO; use InvalidArgumentException; diff --git a/src/amqp/src/IO/SwowIO.php b/src/amqp/src/IO/SwowIO.php index a18dfa436..81f1a2fdd 100644 --- a/src/amqp/src/IO/SwowIO.php +++ b/src/amqp/src/IO/SwowIO.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\IO; use Hyperf\Engine\Socket; diff --git a/src/amqp/src/Listener/BeforeMainServerStartListener.php b/src/amqp/src/Listener/BeforeMainServerStartListener.php index a090819b0..156adee0d 100644 --- a/src/amqp/src/Listener/BeforeMainServerStartListener.php +++ b/src/amqp/src/Listener/BeforeMainServerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Listener; use Hyperf\Amqp\ConsumerManager; diff --git a/src/amqp/src/Listener/MainWorkerStartListener.php b/src/amqp/src/Listener/MainWorkerStartListener.php index dc9d9bfd2..1f99c72d7 100644 --- a/src/amqp/src/Listener/MainWorkerStartListener.php +++ b/src/amqp/src/Listener/MainWorkerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Listener; use Doctrine\Instantiator\Instantiator; diff --git a/src/amqp/src/Message/ConsumerDelayedMessageTrait.php b/src/amqp/src/Message/ConsumerDelayedMessageTrait.php index 0467d5097..5ceec6206 100644 --- a/src/amqp/src/Message/ConsumerDelayedMessageTrait.php +++ b/src/amqp/src/Message/ConsumerDelayedMessageTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\QueueBuilder; diff --git a/src/amqp/src/Message/ConsumerMessage.php b/src/amqp/src/Message/ConsumerMessage.php index 5d6e64ba3..283bea56c 100644 --- a/src/amqp/src/Message/ConsumerMessage.php +++ b/src/amqp/src/Message/ConsumerMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\QueueBuilder; @@ -38,7 +39,7 @@ abstract class ConsumerMessage extends Message implements ConsumerMessageInterfa protected int $maxConsumption = 0; - protected int|float $waitTimeout = 0; + protected float|int $waitTimeout = 0; protected int $nums = 1; @@ -113,12 +114,12 @@ abstract class ConsumerMessage extends Message implements ConsumerMessageInterfa return $this; } - public function getWaitTimeout(): int|float + public function getWaitTimeout(): float|int { return $this->waitTimeout; } - public function setWaitTimeout(int|float $timeout): static + public function setWaitTimeout(float|int $timeout): static { $this->waitTimeout = $timeout; return $this; diff --git a/src/amqp/src/Message/ConsumerMessageInterface.php b/src/amqp/src/Message/ConsumerMessageInterface.php index 3fa017f6b..2ca861659 100644 --- a/src/amqp/src/Message/ConsumerMessageInterface.php +++ b/src/amqp/src/Message/ConsumerMessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\QueueBuilder; @@ -40,9 +41,9 @@ interface ConsumerMessageInterface extends MessageInterface public function setMaxConsumption(int $maxConsumption): static; - public function getWaitTimeout(): int|float; + public function getWaitTimeout(): float|int; - public function setWaitTimeout(int|float $timeout): static; + public function setWaitTimeout(float|int $timeout): static; public function setNums(int $nums): static; diff --git a/src/amqp/src/Message/DynamicRpcMessage.php b/src/amqp/src/Message/DynamicRpcMessage.php index dea61e053..cd3da8717 100644 --- a/src/amqp/src/Message/DynamicRpcMessage.php +++ b/src/amqp/src/Message/DynamicRpcMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; class DynamicRpcMessage extends RpcMessage diff --git a/src/amqp/src/Message/Message.php b/src/amqp/src/Message/Message.php index 7448c3dae..6ecf6fbea 100644 --- a/src/amqp/src/Message/Message.php +++ b/src/amqp/src/Message/Message.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\ExchangeBuilder; @@ -20,17 +21,17 @@ abstract class Message implements MessageInterface protected string $exchange = ''; - protected Type|string $type = Type::TOPIC; + protected string|Type $type = Type::TOPIC; protected array|string $routingKey = ''; - public function setType(Type|string $type): static + public function setType(string|Type $type): static { $this->type = $type; return $this; } - public function getType(): Type|string + public function getType(): string|Type { return $this->type; } diff --git a/src/amqp/src/Message/MessageInterface.php b/src/amqp/src/Message/MessageInterface.php index 6cbd782ae..59962622a 100644 --- a/src/amqp/src/Message/MessageInterface.php +++ b/src/amqp/src/Message/MessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\ExchangeBuilder; @@ -22,9 +23,9 @@ interface MessageInterface */ public function getPoolName(): string; - public function setType(Type|string $type); + public function setType(string|Type $type); - public function getType(): Type|string; + public function getType(): string|Type; public function setExchange(string $exchange); diff --git a/src/amqp/src/Message/ProducerDelayedMessageTrait.php b/src/amqp/src/Message/ProducerDelayedMessageTrait.php index 075243187..5b726a355 100644 --- a/src/amqp/src/Message/ProducerDelayedMessageTrait.php +++ b/src/amqp/src/Message/ProducerDelayedMessageTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\ExchangeBuilder; diff --git a/src/amqp/src/Message/ProducerMessage.php b/src/amqp/src/Message/ProducerMessage.php index 6ac998c8f..835660a23 100644 --- a/src/amqp/src/Message/ProducerMessage.php +++ b/src/amqp/src/Message/ProducerMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Constants; diff --git a/src/amqp/src/Message/ProducerMessageInterface.php b/src/amqp/src/Message/ProducerMessageInterface.php index 3ff0a93f2..4b0152642 100644 --- a/src/amqp/src/Message/ProducerMessageInterface.php +++ b/src/amqp/src/Message/ProducerMessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; interface ProducerMessageInterface extends MessageInterface diff --git a/src/amqp/src/Message/RpcMessage.php b/src/amqp/src/Message/RpcMessage.php index a233ae266..bed559d6b 100644 --- a/src/amqp/src/Message/RpcMessage.php +++ b/src/amqp/src/Message/RpcMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\QueueBuilder; diff --git a/src/amqp/src/Message/RpcMessageInterface.php b/src/amqp/src/Message/RpcMessageInterface.php index bc2267226..d5ce5d055 100644 --- a/src/amqp/src/Message/RpcMessageInterface.php +++ b/src/amqp/src/Message/RpcMessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; use Hyperf\Amqp\Builder\QueueBuilder; diff --git a/src/amqp/src/Message/Type.php b/src/amqp/src/Message/Type.php index d2e7de13b..7841b8fa6 100644 --- a/src/amqp/src/Message/Type.php +++ b/src/amqp/src/Message/Type.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Message; enum Type: string diff --git a/src/amqp/src/Packer/Packer.php b/src/amqp/src/Packer/Packer.php index 6c2abf353..92a793b2e 100644 --- a/src/amqp/src/Packer/Packer.php +++ b/src/amqp/src/Packer/Packer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Packer; use Hyperf\Contract\PackerInterface; diff --git a/src/amqp/src/Params.php b/src/amqp/src/Params.php index cf1afb7e3..ef0478cf0 100644 --- a/src/amqp/src/Params.php +++ b/src/amqp/src/Params.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; class Params diff --git a/src/amqp/src/Producer.php b/src/amqp/src/Producer.php index 0a3f57713..a71ba0fd0 100644 --- a/src/amqp/src/Producer.php +++ b/src/amqp/src/Producer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Message\ProducerMessageInterface; @@ -64,7 +65,7 @@ class Producer extends Builder private function injectMessageProperty(ProducerMessageInterface $producerMessage): void { if (class_exists(AnnotationCollector::class)) { - /** @var null|\Hyperf\Amqp\Annotation\Producer $annotation */ + /** @var null|Annotation\Producer $annotation */ $annotation = AnnotationCollector::getClassAnnotation(get_class($producerMessage), Annotation\Producer::class); if ($annotation) { $annotation->routingKey && $producerMessage->setRoutingKey($annotation->routingKey); diff --git a/src/amqp/src/Result.php b/src/amqp/src/Result.php index 0fa731b58..f883410f2 100644 --- a/src/amqp/src/Result.php +++ b/src/amqp/src/Result.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; enum Result: string diff --git a/src/amqp/src/RpcChannel.php b/src/amqp/src/RpcChannel.php index 9ce92466f..623b91443 100644 --- a/src/amqp/src/RpcChannel.php +++ b/src/amqp/src/RpcChannel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Engine\Channel; @@ -61,7 +62,7 @@ class RpcChannel return $this; } - public function wait(int $timeout): bool|AMQPMessage + public function wait(int $timeout): AMQPMessage|bool { $this->channel->wait(null, false, $timeout); diff --git a/src/amqp/src/RpcClient.php b/src/amqp/src/RpcClient.php index 64314ebe9..411a4e1cc 100644 --- a/src/amqp/src/RpcClient.php +++ b/src/amqp/src/RpcClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp; use Hyperf\Amqp\Builder\QueueBuilder; diff --git a/src/amqp/tests/AMQPConnectionTest.php b/src/amqp/tests/AMQPConnectionTest.php index 40574c73a..eae396f3a 100644 --- a/src/amqp/tests/AMQPConnectionTest.php +++ b/src/amqp/tests/AMQPConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp; use Hyperf\Amqp\ConnectionFactory; diff --git a/src/amqp/tests/ConsumerManagerTest.php b/src/amqp/tests/ConsumerManagerTest.php index 7871bde32..a7b756b5a 100644 --- a/src/amqp/tests/ConsumerManagerTest.php +++ b/src/amqp/tests/ConsumerManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp; use Hyperf\Amqp\Annotation\Consumer; diff --git a/src/amqp/tests/ConsumerTest.php b/src/amqp/tests/ConsumerTest.php index fe44dd019..c00933ef4 100644 --- a/src/amqp/tests/ConsumerTest.php +++ b/src/amqp/tests/ConsumerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp; use Hyperf\Amqp\ConnectionFactory; diff --git a/src/amqp/tests/ExchangeBuilderTest.php b/src/amqp/tests/ExchangeBuilderTest.php index 49d4064c1..b3adc662a 100644 --- a/src/amqp/tests/ExchangeBuilderTest.php +++ b/src/amqp/tests/ExchangeBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp; use HyperfTest\Amqp\Stub\DelayProducerStub; diff --git a/src/amqp/tests/Listener/BeforeMainServerStartListenerTest.php b/src/amqp/tests/Listener/BeforeMainServerStartListenerTest.php index a4520c45c..c6533123a 100644 --- a/src/amqp/tests/Listener/BeforeMainServerStartListenerTest.php +++ b/src/amqp/tests/Listener/BeforeMainServerStartListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Listener; use Hyperf\Amqp\ConsumerManager; diff --git a/src/amqp/tests/Listener/MainWorkerStartListenerTest.php b/src/amqp/tests/Listener/MainWorkerStartListenerTest.php index dde7e5931..5d0ae6f8e 100644 --- a/src/amqp/tests/Listener/MainWorkerStartListenerTest.php +++ b/src/amqp/tests/Listener/MainWorkerStartListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Listener; use Doctrine\Instantiator\Instantiator; diff --git a/src/amqp/tests/Message/ConsumerMessageTest.php b/src/amqp/tests/Message/ConsumerMessageTest.php index 37fd93738..97c408ad8 100644 --- a/src/amqp/tests/Message/ConsumerMessageTest.php +++ b/src/amqp/tests/Message/ConsumerMessageTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Message; use Hyperf\Amqp\ConnectionFactory; diff --git a/src/amqp/tests/Message/MessageTest.php b/src/amqp/tests/Message/MessageTest.php index c4e4b13b9..5e03483ad 100644 --- a/src/amqp/tests/Message/MessageTest.php +++ b/src/amqp/tests/Message/MessageTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Message; use HyperfTest\Amqp\Stub\DemoConsumer; diff --git a/src/amqp/tests/ParamsTest.php b/src/amqp/tests/ParamsTest.php index afd4a8fc3..6b3f8757d 100644 --- a/src/amqp/tests/ParamsTest.php +++ b/src/amqp/tests/ParamsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp; use Hyperf\Amqp\Params; diff --git a/src/amqp/tests/Stub/AMQPConnectionStub.php b/src/amqp/tests/Stub/AMQPConnectionStub.php index e3cee53b8..0d489670e 100644 --- a/src/amqp/tests/Stub/AMQPConnectionStub.php +++ b/src/amqp/tests/Stub/AMQPConnectionStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\AMQPConnection; diff --git a/src/amqp/tests/Stub/ContainerStub.php b/src/amqp/tests/Stub/ContainerStub.php index 5de0b057d..0bb557668 100644 --- a/src/amqp/tests/Stub/ContainerStub.php +++ b/src/amqp/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\ConnectionFactory; diff --git a/src/amqp/tests/Stub/Delay2Consumer.php b/src/amqp/tests/Stub/Delay2Consumer.php index 186ea2129..d4b7e2967 100644 --- a/src/amqp/tests/Stub/Delay2Consumer.php +++ b/src/amqp/tests/Stub/Delay2Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Message\ConsumerDelayedMessageTrait; diff --git a/src/amqp/tests/Stub/DelayConsumer.php b/src/amqp/tests/Stub/DelayConsumer.php index 8a8b70484..0a7208175 100644 --- a/src/amqp/tests/Stub/DelayConsumer.php +++ b/src/amqp/tests/Stub/DelayConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Message\ConsumerDelayedMessageTrait; diff --git a/src/amqp/tests/Stub/DelayProducerStub.php b/src/amqp/tests/Stub/DelayProducerStub.php index d3b47d58a..8988d3676 100644 --- a/src/amqp/tests/Stub/DelayProducerStub.php +++ b/src/amqp/tests/Stub/DelayProducerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Annotation\Producer; @@ -23,7 +24,7 @@ class DelayProducerStub extends ProducerMessage protected string $exchange = 'ext.hyperf.delay'; - protected Type|string $type = Type::DIRECT; + protected string|Type $type = Type::DIRECT; protected array|string $routingKey = ''; diff --git a/src/amqp/tests/Stub/DemoConsumer.php b/src/amqp/tests/Stub/DemoConsumer.php index a155ce4ae..bfba6943e 100644 --- a/src/amqp/tests/Stub/DemoConsumer.php +++ b/src/amqp/tests/Stub/DemoConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Message\ConsumerMessage; diff --git a/src/amqp/tests/Stub/DemoProducer.php b/src/amqp/tests/Stub/DemoProducer.php index 79306ae51..2293f13aa 100644 --- a/src/amqp/tests/Stub/DemoProducer.php +++ b/src/amqp/tests/Stub/DemoProducer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Message\ProducerMessage; diff --git a/src/amqp/tests/Stub/NumsConsumer.php b/src/amqp/tests/Stub/NumsConsumer.php index 18dd3327a..d2de7da2d 100644 --- a/src/amqp/tests/Stub/NumsConsumer.php +++ b/src/amqp/tests/Stub/NumsConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Message\ConsumerMessage; diff --git a/src/amqp/tests/Stub/QosConsumer.php b/src/amqp/tests/Stub/QosConsumer.php index af40fffd8..3cd1fafe2 100644 --- a/src/amqp/tests/Stub/QosConsumer.php +++ b/src/amqp/tests/Stub/QosConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Amqp\Stub; use Hyperf\Amqp\Message\ConsumerMessage; diff --git a/src/async-queue/src/Annotation/AsyncQueueMessage.php b/src/async-queue/src/Annotation/AsyncQueueMessage.php index 8e43fc223..0ea97640e 100644 --- a/src/async-queue/src/Annotation/AsyncQueueMessage.php +++ b/src/async-queue/src/Annotation/AsyncQueueMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Annotation; use Attribute; diff --git a/src/async-queue/src/AnnotationJob.php b/src/async-queue/src/AnnotationJob.php index 6fa90cfb3..030493ae0 100644 --- a/src/async-queue/src/AnnotationJob.php +++ b/src/async-queue/src/AnnotationJob.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Hyperf\Context\ApplicationContext; diff --git a/src/async-queue/src/Aspect/AsyncQueueAspect.php b/src/async-queue/src/Aspect/AsyncQueueAspect.php index 1d55a8116..00a371e98 100644 --- a/src/async-queue/src/Aspect/AsyncQueueAspect.php +++ b/src/async-queue/src/Aspect/AsyncQueueAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Aspect; use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage; diff --git a/src/async-queue/src/Command/FlushFailedMessageCommand.php b/src/async-queue/src/Command/FlushFailedMessageCommand.php index 7c63695f3..0e9e67fd3 100644 --- a/src/async-queue/src/Command/FlushFailedMessageCommand.php +++ b/src/async-queue/src/Command/FlushFailedMessageCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Command; use Hyperf\AsyncQueue\Driver\DriverFactory; diff --git a/src/async-queue/src/Command/InfoCommand.php b/src/async-queue/src/Command/InfoCommand.php index e78bf41f6..acbfbb2f4 100644 --- a/src/async-queue/src/Command/InfoCommand.php +++ b/src/async-queue/src/Command/InfoCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Command; use Hyperf\AsyncQueue\Driver\DriverFactory; diff --git a/src/async-queue/src/Command/ReloadFailedMessageCommand.php b/src/async-queue/src/Command/ReloadFailedMessageCommand.php index b60b05565..90a587575 100644 --- a/src/async-queue/src/Command/ReloadFailedMessageCommand.php +++ b/src/async-queue/src/Command/ReloadFailedMessageCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Command; use Hyperf\AsyncQueue\Driver\DriverFactory; diff --git a/src/async-queue/src/ConfigProvider.php b/src/async-queue/src/ConfigProvider.php index d56cadc07..160dd0777 100644 --- a/src/async-queue/src/ConfigProvider.php +++ b/src/async-queue/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Hyperf\AsyncQueue\Aspect\AsyncQueueAspect; diff --git a/src/async-queue/src/Driver/ChannelConfig.php b/src/async-queue/src/Driver/ChannelConfig.php index a83b70cf7..3a9ec90e2 100644 --- a/src/async-queue/src/Driver/ChannelConfig.php +++ b/src/async-queue/src/Driver/ChannelConfig.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Driver; use Hyperf\AsyncQueue\Exception\InvalidQueueException; diff --git a/src/async-queue/src/Driver/Driver.php b/src/async-queue/src/Driver/Driver.php index 060a963d4..c0fd44b82 100644 --- a/src/async-queue/src/Driver/Driver.php +++ b/src/async-queue/src/Driver/Driver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Driver; use Hyperf\AsyncQueue\Event\AfterHandle; diff --git a/src/async-queue/src/Driver/DriverFactory.php b/src/async-queue/src/Driver/DriverFactory.php index a5ff4e731..9e1aa9eb5 100644 --- a/src/async-queue/src/Driver/DriverFactory.php +++ b/src/async-queue/src/Driver/DriverFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Driver; use Hyperf\AsyncQueue\Exception\InvalidDriverException; diff --git a/src/async-queue/src/Driver/DriverInterface.php b/src/async-queue/src/Driver/DriverInterface.php index c8138d135..a279f9f61 100644 --- a/src/async-queue/src/Driver/DriverInterface.php +++ b/src/async-queue/src/Driver/DriverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Driver; use Hyperf\AsyncQueue\JobInterface; diff --git a/src/async-queue/src/Driver/RedisDriver.php b/src/async-queue/src/Driver/RedisDriver.php index 02b43ff1a..2d603ce6b 100644 --- a/src/async-queue/src/Driver/RedisDriver.php +++ b/src/async-queue/src/Driver/RedisDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Driver; use Hyperf\AsyncQueue\Exception\InvalidQueueException; diff --git a/src/async-queue/src/Environment.php b/src/async-queue/src/Environment.php index a6b7c180f..344fb0169 100644 --- a/src/async-queue/src/Environment.php +++ b/src/async-queue/src/Environment.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Hyperf\Context\Context; diff --git a/src/async-queue/src/Event/AfterHandle.php b/src/async-queue/src/Event/AfterHandle.php index ee0fc025f..d4c24e1d1 100644 --- a/src/async-queue/src/Event/AfterHandle.php +++ b/src/async-queue/src/Event/AfterHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Event; class AfterHandle extends Event diff --git a/src/async-queue/src/Event/BeforeHandle.php b/src/async-queue/src/Event/BeforeHandle.php index c6a89df93..c0966109e 100644 --- a/src/async-queue/src/Event/BeforeHandle.php +++ b/src/async-queue/src/Event/BeforeHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Event; class BeforeHandle extends Event diff --git a/src/async-queue/src/Event/Event.php b/src/async-queue/src/Event/Event.php index d759a25f2..ad966d071 100644 --- a/src/async-queue/src/Event/Event.php +++ b/src/async-queue/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Event; use Hyperf\AsyncQueue\MessageInterface; diff --git a/src/async-queue/src/Event/FailedHandle.php b/src/async-queue/src/Event/FailedHandle.php index c4aca0a6b..b106638dc 100644 --- a/src/async-queue/src/Event/FailedHandle.php +++ b/src/async-queue/src/Event/FailedHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Event; use Hyperf\AsyncQueue\MessageInterface; diff --git a/src/async-queue/src/Event/QueueLength.php b/src/async-queue/src/Event/QueueLength.php index e842368d9..a5a1e5480 100644 --- a/src/async-queue/src/Event/QueueLength.php +++ b/src/async-queue/src/Event/QueueLength.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Event; use Hyperf\AsyncQueue\Driver\DriverInterface; diff --git a/src/async-queue/src/Event/RetryHandle.php b/src/async-queue/src/Event/RetryHandle.php index 02899bb5c..bf38efd1b 100644 --- a/src/async-queue/src/Event/RetryHandle.php +++ b/src/async-queue/src/Event/RetryHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Event; use Hyperf\AsyncQueue\MessageInterface; diff --git a/src/async-queue/src/Exception/InvalidDriverException.php b/src/async-queue/src/Exception/InvalidDriverException.php index f7a085d98..a610690b4 100644 --- a/src/async-queue/src/Exception/InvalidDriverException.php +++ b/src/async-queue/src/Exception/InvalidDriverException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Exception; use RuntimeException; diff --git a/src/async-queue/src/Exception/InvalidPackerException.php b/src/async-queue/src/Exception/InvalidPackerException.php index 5a4a2afe8..31765ffc0 100644 --- a/src/async-queue/src/Exception/InvalidPackerException.php +++ b/src/async-queue/src/Exception/InvalidPackerException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Exception; use RuntimeException; diff --git a/src/async-queue/src/Exception/InvalidQueueException.php b/src/async-queue/src/Exception/InvalidQueueException.php index 833109215..28ac1f724 100644 --- a/src/async-queue/src/Exception/InvalidQueueException.php +++ b/src/async-queue/src/Exception/InvalidQueueException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Exception; use RuntimeException; diff --git a/src/async-queue/src/Functions.php b/src/async-queue/src/Functions.php index 5f61c1cad..5a3357832 100644 --- a/src/async-queue/src/Functions.php +++ b/src/async-queue/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Hyperf\AsyncQueue\Driver\DriverFactory; diff --git a/src/async-queue/src/Job.php b/src/async-queue/src/Job.php index d756cf239..313695a5f 100644 --- a/src/async-queue/src/Job.php +++ b/src/async-queue/src/Job.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Hyperf\Contract\CompressInterface; diff --git a/src/async-queue/src/JobInterface.php b/src/async-queue/src/JobInterface.php index 1b4f0c865..4e83572a8 100644 --- a/src/async-queue/src/JobInterface.php +++ b/src/async-queue/src/JobInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Throwable; diff --git a/src/async-queue/src/JobMessage.php b/src/async-queue/src/JobMessage.php index bdd0384fc..07b26d842 100644 --- a/src/async-queue/src/JobMessage.php +++ b/src/async-queue/src/JobMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; use Hyperf\Contract\CompressInterface; diff --git a/src/async-queue/src/Listener/QueueHandleListener.php b/src/async-queue/src/Listener/QueueHandleListener.php index ef032ad70..cb9b6800f 100644 --- a/src/async-queue/src/Listener/QueueHandleListener.php +++ b/src/async-queue/src/Listener/QueueHandleListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Listener; use Hyperf\AsyncQueue\AnnotationJob; diff --git a/src/async-queue/src/Listener/QueueLengthListener.php b/src/async-queue/src/Listener/QueueLengthListener.php index b828e0894..48237493f 100644 --- a/src/async-queue/src/Listener/QueueLengthListener.php +++ b/src/async-queue/src/Listener/QueueLengthListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Listener; use Hyperf\AsyncQueue\Event\QueueLength; diff --git a/src/async-queue/src/Listener/ReloadChannelListener.php b/src/async-queue/src/Listener/ReloadChannelListener.php index 66bcc4ae3..c2f7552de 100644 --- a/src/async-queue/src/Listener/ReloadChannelListener.php +++ b/src/async-queue/src/Listener/ReloadChannelListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Listener; use Hyperf\AsyncQueue\Event\QueueLength; diff --git a/src/async-queue/src/MessageInterface.php b/src/async-queue/src/MessageInterface.php index 4bc329902..6a857637e 100644 --- a/src/async-queue/src/MessageInterface.php +++ b/src/async-queue/src/MessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue; interface MessageInterface diff --git a/src/async-queue/src/Process/ConsumerProcess.php b/src/async-queue/src/Process/ConsumerProcess.php index 7980bef79..12bb1dfe8 100644 --- a/src/async-queue/src/Process/ConsumerProcess.php +++ b/src/async-queue/src/Process/ConsumerProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Process; use Hyperf\AsyncQueue\Driver\DriverFactory; diff --git a/src/async-queue/tests/AsyncQueueAspectTest.php b/src/async-queue/tests/AsyncQueueAspectTest.php index 8060bd37c..c64e94f5e 100644 --- a/src/async-queue/tests/AsyncQueueAspectTest.php +++ b/src/async-queue/tests/AsyncQueueAspectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue; use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage; diff --git a/src/async-queue/tests/DriverTest.php b/src/async-queue/tests/DriverTest.php index 9a2741918..5d74dfc0f 100644 --- a/src/async-queue/tests/DriverTest.php +++ b/src/async-queue/tests/DriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue; use Hyperf\AsyncQueue\Driver\ChannelConfig; diff --git a/src/async-queue/tests/JobMessageTest.php b/src/async-queue/tests/JobMessageTest.php index 6775c0aec..4816e4691 100644 --- a/src/async-queue/tests/JobMessageTest.php +++ b/src/async-queue/tests/JobMessageTest.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue; use Hyperf\AsyncQueue\JobInterface; use Hyperf\AsyncQueue\JobMessage; use Hyperf\AsyncQueue\MessageInterface; use HyperfTest\AsyncQueue\Stub\DemoJob; +use HyperfTest\AsyncQueue\Stub\OldJobMessage; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; @@ -99,8 +101,8 @@ class JobMessageTest extends TestCase $serialized = serialize($message); $serialized = str_replace( - sprintf('O:%d:"%s', strlen(\Hyperf\AsyncQueue\JobMessage::class), \Hyperf\AsyncQueue\JobMessage::class), - sprintf('O:%d:"%s', strlen(\HyperfTest\AsyncQueue\Stub\OldJobMessage::class), \HyperfTest\AsyncQueue\Stub\OldJobMessage::class), + sprintf('O:%d:"%s', strlen(JobMessage::class), JobMessage::class), + sprintf('O:%d:"%s', strlen(OldJobMessage::class), OldJobMessage::class), $serialized ); $message = unserialize($serialized); diff --git a/src/async-queue/tests/ListenerTest.php b/src/async-queue/tests/ListenerTest.php index bad89fef2..da1df3ae1 100644 --- a/src/async-queue/tests/ListenerTest.php +++ b/src/async-queue/tests/ListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue; use Hyperf\AsyncQueue\Driver\DriverInterface; diff --git a/src/async-queue/tests/RedisDriverTest.php b/src/async-queue/tests/RedisDriverTest.php index c8cf90595..cccd3cc70 100644 --- a/src/async-queue/tests/RedisDriverTest.php +++ b/src/async-queue/tests/RedisDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue; use Hyperf\AsyncQueue\Driver\ChannelConfig; diff --git a/src/async-queue/tests/Stub/DemoJob.php b/src/async-queue/tests/Stub/DemoJob.php index 449ec9c1d..97fd6b696 100644 --- a/src/async-queue/tests/Stub/DemoJob.php +++ b/src/async-queue/tests/Stub/DemoJob.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; use Hyperf\AsyncQueue\Job; diff --git a/src/async-queue/tests/Stub/DemoModel.php b/src/async-queue/tests/Stub/DemoModel.php index dc4a0590d..22e848270 100644 --- a/src/async-queue/tests/Stub/DemoModel.php +++ b/src/async-queue/tests/Stub/DemoModel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; use Hyperf\Context\Context; diff --git a/src/async-queue/tests/Stub/DemoModelMeta.php b/src/async-queue/tests/Stub/DemoModelMeta.php index 63be13865..51c0d388a 100644 --- a/src/async-queue/tests/Stub/DemoModelMeta.php +++ b/src/async-queue/tests/Stub/DemoModelMeta.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; use Hyperf\Context\Context; diff --git a/src/async-queue/tests/Stub/FooProxy.php b/src/async-queue/tests/Stub/FooProxy.php index ecb7a33e9..27fc902b5 100644 --- a/src/async-queue/tests/Stub/FooProxy.php +++ b/src/async-queue/tests/Stub/FooProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage; diff --git a/src/async-queue/tests/Stub/OldJobMessage.php b/src/async-queue/tests/Stub/OldJobMessage.php index a364c3af9..53cdd763a 100644 --- a/src/async-queue/tests/Stub/OldJobMessage.php +++ b/src/async-queue/tests/Stub/OldJobMessage.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; +use Hyperf\AsyncQueue\JobMessage; use Hyperf\Contract\UnCompressInterface; -class OldJobMessage extends \Hyperf\AsyncQueue\JobMessage +class OldJobMessage extends JobMessage { public function __unserialize(array $data): void { diff --git a/src/async-queue/tests/Stub/Redis.php b/src/async-queue/tests/Stub/Redis.php index 6d0663142..57a4e5b9e 100644 --- a/src/async-queue/tests/Stub/Redis.php +++ b/src/async-queue/tests/Stub/Redis.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; use Hyperf\Context\Context; diff --git a/src/async-queue/tests/Stub/RedisDriverStub.php b/src/async-queue/tests/Stub/RedisDriverStub.php index 359110a57..5264592a9 100644 --- a/src/async-queue/tests/Stub/RedisDriverStub.php +++ b/src/async-queue/tests/Stub/RedisDriverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\AsyncQueue\Stub; use Hyperf\AsyncQueue\Driver\RedisDriver; diff --git a/src/cache/publish/cache.php b/src/cache/publish/cache.php index 6875207fc..bddb227b7 100644 --- a/src/cache/publish/cache.php +++ b/src/cache/publish/cache.php @@ -9,10 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Cache\Driver\RedisDriver; +use Hyperf\Codec\Packer\PhpSerializerPacker; + return [ 'default' => [ - 'driver' => Hyperf\Cache\Driver\RedisDriver::class, - 'packer' => Hyperf\Codec\Packer\PhpSerializerPacker::class, + 'driver' => RedisDriver::class, + 'packer' => PhpSerializerPacker::class, 'prefix' => 'c:', 'skip_cache_results' => [], ], diff --git a/src/cache/src/Annotation/CacheAhead.php b/src/cache/src/Annotation/CacheAhead.php index d5110ae73..5b96fd4ac 100644 --- a/src/cache/src/Annotation/CacheAhead.php +++ b/src/cache/src/Annotation/CacheAhead.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/cache/src/Annotation/CacheEvict.php b/src/cache/src/Annotation/CacheEvict.php index e7ee8f304..c0bc1c685 100644 --- a/src/cache/src/Annotation/CacheEvict.php +++ b/src/cache/src/Annotation/CacheEvict.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/cache/src/Annotation/CachePut.php b/src/cache/src/Annotation/CachePut.php index 4ec0d1309..5c9bb25db 100644 --- a/src/cache/src/Annotation/CachePut.php +++ b/src/cache/src/Annotation/CachePut.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/cache/src/Annotation/Cacheable.php b/src/cache/src/Annotation/Cacheable.php index d89e610ae..8afc259a3 100644 --- a/src/cache/src/Annotation/Cacheable.php +++ b/src/cache/src/Annotation/Cacheable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/cache/src/Annotation/FailCache.php b/src/cache/src/Annotation/FailCache.php index 6300bea23..655392cbe 100644 --- a/src/cache/src/Annotation/FailCache.php +++ b/src/cache/src/Annotation/FailCache.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/cache/src/AnnotationManager.php b/src/cache/src/AnnotationManager.php index f75c7439f..df6b86e97 100644 --- a/src/cache/src/AnnotationManager.php +++ b/src/cache/src/AnnotationManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache; use Hyperf\Cache\Annotation\Cacheable; diff --git a/src/cache/src/Aspect/CacheAheadAspect.php b/src/cache/src/Aspect/CacheAheadAspect.php index cffa99f4c..bae2f14cd 100644 --- a/src/cache/src/Aspect/CacheAheadAspect.php +++ b/src/cache/src/Aspect/CacheAheadAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Aspect; use Hyperf\Cache\Annotation\CacheAhead; diff --git a/src/cache/src/Aspect/CacheEvictAspect.php b/src/cache/src/Aspect/CacheEvictAspect.php index 9459fcb0c..56365ea3a 100644 --- a/src/cache/src/Aspect/CacheEvictAspect.php +++ b/src/cache/src/Aspect/CacheEvictAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Aspect; use Hyperf\Cache\Annotation\CacheEvict; diff --git a/src/cache/src/Aspect/CachePutAspect.php b/src/cache/src/Aspect/CachePutAspect.php index 87985bcb6..0fb56b59d 100644 --- a/src/cache/src/Aspect/CachePutAspect.php +++ b/src/cache/src/Aspect/CachePutAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Aspect; use Hyperf\Cache\Annotation\CachePut; diff --git a/src/cache/src/Aspect/CacheableAspect.php b/src/cache/src/Aspect/CacheableAspect.php index c17810703..8e142b20b 100644 --- a/src/cache/src/Aspect/CacheableAspect.php +++ b/src/cache/src/Aspect/CacheableAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Aspect; use Hyperf\Cache\Annotation\Cacheable; diff --git a/src/cache/src/Aspect/FailCacheAspect.php b/src/cache/src/Aspect/FailCacheAspect.php index a9bd015e7..4f63f0b80 100644 --- a/src/cache/src/Aspect/FailCacheAspect.php +++ b/src/cache/src/Aspect/FailCacheAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Aspect; use Hyperf\Cache\Annotation\FailCache; diff --git a/src/cache/src/Cache.php b/src/cache/src/Cache.php index 5a4902ea2..15d38c90c 100644 --- a/src/cache/src/Cache.php +++ b/src/cache/src/Cache.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache; use Psr\SimpleCache\CacheInterface; diff --git a/src/cache/src/CacheListenerCollector.php b/src/cache/src/CacheListenerCollector.php index 14bf4a80c..ba0bc5f51 100644 --- a/src/cache/src/CacheListenerCollector.php +++ b/src/cache/src/CacheListenerCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache; use Hyperf\Di\MetadataCollector; diff --git a/src/cache/src/CacheManager.php b/src/cache/src/CacheManager.php index a64c5bf16..a0411d0e6 100644 --- a/src/cache/src/CacheManager.php +++ b/src/cache/src/CacheManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache; use Hyperf\Cache\Driver\DriverInterface; diff --git a/src/cache/src/Collector/CoroutineMemory.php b/src/cache/src/Collector/CoroutineMemory.php index c93e33ca6..44d807389 100644 --- a/src/cache/src/Collector/CoroutineMemory.php +++ b/src/cache/src/Collector/CoroutineMemory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Collector; use Hyperf\Collection\Collection; diff --git a/src/cache/src/Collector/CoroutineMemoryKey.php b/src/cache/src/Collector/CoroutineMemoryKey.php index 500ef8c27..6c265031e 100644 --- a/src/cache/src/Collector/CoroutineMemoryKey.php +++ b/src/cache/src/Collector/CoroutineMemoryKey.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Collector; use Hyperf\Collection\Collection; diff --git a/src/cache/src/Collector/FileStorage.php b/src/cache/src/Collector/FileStorage.php index 78d184b7d..357f5cac1 100644 --- a/src/cache/src/Collector/FileStorage.php +++ b/src/cache/src/Collector/FileStorage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Collector; class FileStorage diff --git a/src/cache/src/Collector/Memory.php b/src/cache/src/Collector/Memory.php index 7f3752c6b..854db1613 100644 --- a/src/cache/src/Collector/Memory.php +++ b/src/cache/src/Collector/Memory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Collector; use Carbon\Carbon; diff --git a/src/cache/src/ConfigProvider.php b/src/cache/src/ConfigProvider.php index a9a56868d..f2c6362cc 100644 --- a/src/cache/src/ConfigProvider.php +++ b/src/cache/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache; use Hyperf\Cache\Aspect\CacheableAspect; diff --git a/src/cache/src/Driver/CoroutineMemoryDriver.php b/src/cache/src/Driver/CoroutineMemoryDriver.php index 91b47b116..454ea8dd8 100644 --- a/src/cache/src/Driver/CoroutineMemoryDriver.php +++ b/src/cache/src/Driver/CoroutineMemoryDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Hyperf\Cache\Collector\CoroutineMemory; diff --git a/src/cache/src/Driver/Driver.php b/src/cache/src/Driver/Driver.php index 81f748a22..3b928fc15 100644 --- a/src/cache/src/Driver/Driver.php +++ b/src/cache/src/Driver/Driver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Hyperf\Cache\Exception\InvalidArgumentException; diff --git a/src/cache/src/Driver/DriverInterface.php b/src/cache/src/Driver/DriverInterface.php index 89178bf3f..8ccdfe802 100644 --- a/src/cache/src/Driver/DriverInterface.php +++ b/src/cache/src/Driver/DriverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Psr\Container\ContainerInterface; diff --git a/src/cache/src/Driver/FileSystemDriver.php b/src/cache/src/Driver/FileSystemDriver.php index d8aa6f174..2a443f5fd 100644 --- a/src/cache/src/Driver/FileSystemDriver.php +++ b/src/cache/src/Driver/FileSystemDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Hyperf\Cache\Collector\FileStorage; diff --git a/src/cache/src/Driver/KeyCollectorInterface.php b/src/cache/src/Driver/KeyCollectorInterface.php index ecc821b38..2b7b8091a 100644 --- a/src/cache/src/Driver/KeyCollectorInterface.php +++ b/src/cache/src/Driver/KeyCollectorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; interface KeyCollectorInterface diff --git a/src/cache/src/Driver/MemoryDriver.php b/src/cache/src/Driver/MemoryDriver.php index 32786e002..8ff7d4663 100644 --- a/src/cache/src/Driver/MemoryDriver.php +++ b/src/cache/src/Driver/MemoryDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Carbon\Carbon; diff --git a/src/cache/src/Driver/RedisDriver.php b/src/cache/src/Driver/RedisDriver.php index 265e24491..75013b55c 100644 --- a/src/cache/src/Driver/RedisDriver.php +++ b/src/cache/src/Driver/RedisDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Hyperf\Cache\Exception\InvalidArgumentException; diff --git a/src/cache/src/Driver/SqliteDriver.php b/src/cache/src/Driver/SqliteDriver.php index 7a08134ed..0d40b56a1 100644 --- a/src/cache/src/Driver/SqliteDriver.php +++ b/src/cache/src/Driver/SqliteDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Driver; use Carbon\Carbon; diff --git a/src/cache/src/Exception/CacheException.php b/src/cache/src/Exception/CacheException.php index 6cc6faa12..7e3aafbee 100644 --- a/src/cache/src/Exception/CacheException.php +++ b/src/cache/src/Exception/CacheException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Exception; use RuntimeException; diff --git a/src/cache/src/Exception/InvalidArgumentException.php b/src/cache/src/Exception/InvalidArgumentException.php index bb44ca3df..6febb9cb7 100644 --- a/src/cache/src/Exception/InvalidArgumentException.php +++ b/src/cache/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Exception; class InvalidArgumentException extends CacheException implements \Psr\SimpleCache\InvalidArgumentException diff --git a/src/cache/src/Exception/OverflowException.php b/src/cache/src/Exception/OverflowException.php index e1a045fbc..cafffc9a5 100644 --- a/src/cache/src/Exception/OverflowException.php +++ b/src/cache/src/Exception/OverflowException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Exception; class OverflowException extends CacheException diff --git a/src/cache/src/Helper/StringHelper.php b/src/cache/src/Helper/StringHelper.php index 7026d2576..b2b476c50 100644 --- a/src/cache/src/Helper/StringHelper.php +++ b/src/cache/src/Helper/StringHelper.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Helper; use Hyperf\Stringable\Str; diff --git a/src/cache/src/Listener/DeleteEvent.php b/src/cache/src/Listener/DeleteEvent.php index 70d646e10..8c314e999 100644 --- a/src/cache/src/Listener/DeleteEvent.php +++ b/src/cache/src/Listener/DeleteEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Listener; class DeleteEvent diff --git a/src/cache/src/Listener/DeleteListener.php b/src/cache/src/Listener/DeleteListener.php index a72eeb52a..c718d9c9a 100644 --- a/src/cache/src/Listener/DeleteListener.php +++ b/src/cache/src/Listener/DeleteListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Listener; use Hyperf\Cache\Annotation\Cacheable; diff --git a/src/cache/src/Listener/DeleteListenerEvent.php b/src/cache/src/Listener/DeleteListenerEvent.php index e840faeac..27bc39418 100644 --- a/src/cache/src/Listener/DeleteListenerEvent.php +++ b/src/cache/src/Listener/DeleteListenerEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Listener; use Hyperf\Cache\CacheListenerCollector; diff --git a/src/cache/tests/Cases/AnnotationTest.php b/src/cache/tests/Cases/AnnotationTest.php index 1170d6fc5..01cf68c4d 100644 --- a/src/cache/tests/Cases/AnnotationTest.php +++ b/src/cache/tests/Cases/AnnotationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use Hyperf\Cache\Annotation\Cacheable; diff --git a/src/cache/tests/Cases/AspectTest.php b/src/cache/tests/Cases/AspectTest.php index 4f8960bae..aee21bfab 100644 --- a/src/cache/tests/Cases/AspectTest.php +++ b/src/cache/tests/Cases/AspectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use Hyperf\Cache\Annotation\Cacheable; diff --git a/src/cache/tests/Cases/CoroutineMemoryDriverTest.php b/src/cache/tests/Cases/CoroutineMemoryDriverTest.php index aec624743..f140011c1 100644 --- a/src/cache/tests/Cases/CoroutineMemoryDriverTest.php +++ b/src/cache/tests/Cases/CoroutineMemoryDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use Hyperf\Cache\Collector\CoroutineMemory; diff --git a/src/cache/tests/Cases/FileSystemDriverTest.php b/src/cache/tests/Cases/FileSystemDriverTest.php index a698ba4ad..6f4ef66a6 100644 --- a/src/cache/tests/Cases/FileSystemDriverTest.php +++ b/src/cache/tests/Cases/FileSystemDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use Hyperf\Cache\CacheManager; diff --git a/src/cache/tests/Cases/MemoryDriverTest.php b/src/cache/tests/Cases/MemoryDriverTest.php index b1b769d42..883abdf42 100644 --- a/src/cache/tests/Cases/MemoryDriverTest.php +++ b/src/cache/tests/Cases/MemoryDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use Hyperf\Cache\Collector\Memory; @@ -16,13 +17,14 @@ use Hyperf\Cache\Driver\MemoryDriver; use Hyperf\Cache\Exception\OverflowException; use Hyperf\Codec\Packer\PhpSerializerPacker; use Mockery; +use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; /** * @internal * @coversNothing */ -class MemoryDriverTest extends \PHPUnit\Framework\TestCase +class MemoryDriverTest extends TestCase { protected function tearDown(): void { diff --git a/src/cache/tests/Cases/RedisDriverTest.php b/src/cache/tests/Cases/RedisDriverTest.php index d71648592..6d62b5577 100644 --- a/src/cache/tests/Cases/RedisDriverTest.php +++ b/src/cache/tests/Cases/RedisDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use DateInterval; diff --git a/src/cache/tests/Cases/StringHelperTest.php b/src/cache/tests/Cases/StringHelperTest.php index 5d6da6fb6..e5ae9219c 100644 --- a/src/cache/tests/Cases/StringHelperTest.php +++ b/src/cache/tests/Cases/StringHelperTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Cases; use Hyperf\Cache\Helper\StringHelper; diff --git a/src/cache/tests/Stub/ContainerStub.php b/src/cache/tests/Stub/ContainerStub.php index 8f02b3f04..b1da0f8dd 100644 --- a/src/cache/tests/Stub/ContainerStub.php +++ b/src/cache/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Stub; use Hyperf\Cache\CacheManager; diff --git a/src/cache/tests/Stub/Foo.php b/src/cache/tests/Stub/Foo.php index 3e069da12..fa6728627 100644 --- a/src/cache/tests/Stub/Foo.php +++ b/src/cache/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Stub; class Foo diff --git a/src/cache/tests/Stub/SerializeRedisDriver.php b/src/cache/tests/Stub/SerializeRedisDriver.php index f148513aa..4969281e3 100644 --- a/src/cache/tests/Stub/SerializeRedisDriver.php +++ b/src/cache/tests/Stub/SerializeRedisDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cache\Stub; use Hyperf\Cache\Driver\RedisDriver; diff --git a/src/carbon/src/Carbon.php b/src/carbon/src/Carbon.php index cb9a19599..9a12b8087 100644 --- a/src/carbon/src/Carbon.php +++ b/src/carbon/src/Carbon.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Carbon; use DateTime; @@ -20,7 +21,7 @@ class Carbon extends \Carbon\Carbon /** * Create a Carbon instance from a given ordered UUID or ULID. */ - public static function createFromId(Uuid|Ulid|string $id): static + public static function createFromId(string|Ulid|Uuid $id): static { if (is_string($id)) { $id = Ulid::isValid($id) ? Ulid::fromString($id) : Uuid::fromString($id); diff --git a/src/carbon/src/ConfigProvider.php b/src/carbon/src/ConfigProvider.php index f743d44b7..3460ac491 100644 --- a/src/carbon/src/ConfigProvider.php +++ b/src/carbon/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Carbon; class ConfigProvider diff --git a/src/carbon/src/Listener/CarbonListener.php b/src/carbon/src/Listener/CarbonListener.php index fcc429cb9..ff1478a39 100644 --- a/src/carbon/src/Listener/CarbonListener.php +++ b/src/carbon/src/Listener/CarbonListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Carbon\Listener; use Carbon\Carbon as BaseCarbon; diff --git a/src/carbon/tests/CarbonTest.php b/src/carbon/tests/CarbonTest.php index fe275c26b..c3e393205 100644 --- a/src/carbon/tests/CarbonTest.php +++ b/src/carbon/tests/CarbonTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Carbon; use Carbon\Carbon as BaseCarbon; @@ -17,13 +18,14 @@ use Hyperf\Carbon\Listener\CarbonListener; use Hyperf\Contract\TranslatorInterface; use Hyperf\Framework\Event\BootApplication; use Mockery; +use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; /** * @internal * @coversNothing */ -class CarbonTest extends \PHPUnit\Framework\TestCase +class CarbonTest extends TestCase { protected ?string $defaultLocale = null; diff --git a/src/circuit-breaker/src/Annotation/CircuitBreaker.php b/src/circuit-breaker/src/Annotation/CircuitBreaker.php index 8f662a13b..daf753baf 100644 --- a/src/circuit-breaker/src/Annotation/CircuitBreaker.php +++ b/src/circuit-breaker/src/Annotation/CircuitBreaker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Annotation; use Attribute; @@ -27,7 +28,7 @@ class CircuitBreaker extends AbstractAnnotation */ public function __construct( public string $handler = TimeoutHandler::class, - public string|array|Closure $fallback = [], + public array|Closure|string $fallback = [], public float $duration = 10.0, public int $successCounter = 10, public int $failCounter = 10, diff --git a/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php b/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php index 03160e21f..ebbc88eff 100644 --- a/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php +++ b/src/circuit-breaker/src/Aspect/BreakerAnnotationAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Aspect; use Hyperf\CircuitBreaker\Annotation\CircuitBreaker; diff --git a/src/circuit-breaker/src/Attempt.php b/src/circuit-breaker/src/Attempt.php index cae9d7273..159249246 100644 --- a/src/circuit-breaker/src/Attempt.php +++ b/src/circuit-breaker/src/Attempt.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; class Attempt diff --git a/src/circuit-breaker/src/CircuitBreaker.php b/src/circuit-breaker/src/CircuitBreaker.php index f459ba681..2d248032e 100644 --- a/src/circuit-breaker/src/CircuitBreaker.php +++ b/src/circuit-breaker/src/CircuitBreaker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; use Psr\Container\ContainerInterface; diff --git a/src/circuit-breaker/src/CircuitBreakerFactory.php b/src/circuit-breaker/src/CircuitBreakerFactory.php index 101570280..f86a20a69 100644 --- a/src/circuit-breaker/src/CircuitBreakerFactory.php +++ b/src/circuit-breaker/src/CircuitBreakerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; use Psr\Container\ContainerInterface; diff --git a/src/circuit-breaker/src/CircuitBreakerInterface.php b/src/circuit-breaker/src/CircuitBreakerInterface.php index 2c458f487..faabb8e9b 100644 --- a/src/circuit-breaker/src/CircuitBreakerInterface.php +++ b/src/circuit-breaker/src/CircuitBreakerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; interface CircuitBreakerInterface diff --git a/src/circuit-breaker/src/ConfigProvider.php b/src/circuit-breaker/src/ConfigProvider.php index ade61f2a4..561fa038e 100644 --- a/src/circuit-breaker/src/ConfigProvider.php +++ b/src/circuit-breaker/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; use Hyperf\CircuitBreaker\Aspect\BreakerAnnotationAspect; diff --git a/src/circuit-breaker/src/Exception/BadFallbackException.php b/src/circuit-breaker/src/Exception/BadFallbackException.php index a5baf94b6..dfc47b732 100644 --- a/src/circuit-breaker/src/Exception/BadFallbackException.php +++ b/src/circuit-breaker/src/Exception/BadFallbackException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Exception; use RuntimeException; diff --git a/src/circuit-breaker/src/Exception/CircuitBreakerException.php b/src/circuit-breaker/src/Exception/CircuitBreakerException.php index 188923858..c668ea403 100644 --- a/src/circuit-breaker/src/Exception/CircuitBreakerException.php +++ b/src/circuit-breaker/src/Exception/CircuitBreakerException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Exception; use RuntimeException; diff --git a/src/circuit-breaker/src/Exception/InvalidConfigException.php b/src/circuit-breaker/src/Exception/InvalidConfigException.php index 5e18e3714..90b993e71 100644 --- a/src/circuit-breaker/src/Exception/InvalidConfigException.php +++ b/src/circuit-breaker/src/Exception/InvalidConfigException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Exception; use RuntimeException; diff --git a/src/circuit-breaker/src/Exception/TimeoutException.php b/src/circuit-breaker/src/Exception/TimeoutException.php index 0aef4bf8a..ad5f5a786 100644 --- a/src/circuit-breaker/src/Exception/TimeoutException.php +++ b/src/circuit-breaker/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Exception; class TimeoutException extends CircuitBreakerException diff --git a/src/circuit-breaker/src/FallbackInterface.php b/src/circuit-breaker/src/FallbackInterface.php index 4752c3dcc..0c3543fff 100644 --- a/src/circuit-breaker/src/FallbackInterface.php +++ b/src/circuit-breaker/src/FallbackInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; use Hyperf\Di\Aop\ProceedingJoinPoint; diff --git a/src/circuit-breaker/src/Handler/AbstractHandler.php b/src/circuit-breaker/src/Handler/AbstractHandler.php index 29484a423..2b0ef6892 100644 --- a/src/circuit-breaker/src/Handler/AbstractHandler.php +++ b/src/circuit-breaker/src/Handler/AbstractHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Handler; use Closure; @@ -193,7 +194,7 @@ abstract class AbstractHandler implements HandlerInterface abstract protected function process(ProceedingJoinPoint $proceedingJoinPoint, CircuitBreakerInterface $breaker, Annotation $annotation); - protected function prepareHandler(string|array $fallback, ProceedingJoinPoint $proceedingJoinPoint): array + protected function prepareHandler(array|string $fallback, ProceedingJoinPoint $proceedingJoinPoint): array { if (is_string($fallback)) { $fallback = explode('::', $fallback); diff --git a/src/circuit-breaker/src/Handler/HandlerInterface.php b/src/circuit-breaker/src/Handler/HandlerInterface.php index aea308761..c0f8dff40 100644 --- a/src/circuit-breaker/src/Handler/HandlerInterface.php +++ b/src/circuit-breaker/src/Handler/HandlerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Handler; use Hyperf\CircuitBreaker\Annotation\CircuitBreaker; diff --git a/src/circuit-breaker/src/Handler/TimeoutHandler.php b/src/circuit-breaker/src/Handler/TimeoutHandler.php index 14e26b9c5..c82222f5d 100644 --- a/src/circuit-breaker/src/Handler/TimeoutHandler.php +++ b/src/circuit-breaker/src/Handler/TimeoutHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Handler; use Hyperf\CircuitBreaker\Annotation\CircuitBreaker as Annotation; diff --git a/src/circuit-breaker/src/LoggerInterface.php b/src/circuit-breaker/src/LoggerInterface.php index ec7d0fe6f..d87f565ab 100644 --- a/src/circuit-breaker/src/LoggerInterface.php +++ b/src/circuit-breaker/src/LoggerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; interface LoggerInterface extends \Psr\Log\LoggerInterface diff --git a/src/circuit-breaker/src/State.php b/src/circuit-breaker/src/State.php index ea5c8594c..b4a3d86a7 100644 --- a/src/circuit-breaker/src/State.php +++ b/src/circuit-breaker/src/State.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker; class State diff --git a/src/circuit-breaker/tests/Annotation/CircuitBreakerTest.php b/src/circuit-breaker/tests/Annotation/CircuitBreakerTest.php index 25440f34d..c66644189 100644 --- a/src/circuit-breaker/tests/Annotation/CircuitBreakerTest.php +++ b/src/circuit-breaker/tests/Annotation/CircuitBreakerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CircuitBreaker\Annotation; use Hyperf\CircuitBreaker\Annotation\CircuitBreaker; diff --git a/src/circuit-breaker/tests/Stub/CircuitBreakerStub.php b/src/circuit-breaker/tests/Stub/CircuitBreakerStub.php index c5a4fb674..6185de1cd 100644 --- a/src/circuit-breaker/tests/Stub/CircuitBreakerStub.php +++ b/src/circuit-breaker/tests/Stub/CircuitBreakerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CircuitBreaker\Stub; use Hyperf\CircuitBreaker\Annotation\CircuitBreaker; diff --git a/src/code-parser/src/Exception/InvalidArgumentException.php b/src/code-parser/src/Exception/InvalidArgumentException.php index 853a0130d..a0ce23707 100644 --- a/src/code-parser/src/Exception/InvalidArgumentException.php +++ b/src/code-parser/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CodeParser\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/code-parser/src/Package.php b/src/code-parser/src/Package.php index 4e8e9f48f..ae772c8e4 100644 --- a/src/code-parser/src/Package.php +++ b/src/code-parser/src/Package.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CodeParser; use Jean85\PrettyVersions; diff --git a/src/code-parser/src/PhpDocReader.php b/src/code-parser/src/PhpDocReader.php index 409deeee7..d18c3bff3 100644 --- a/src/code-parser/src/PhpDocReader.php +++ b/src/code-parser/src/PhpDocReader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CodeParser; use PhpDocReader\AnnotationException; diff --git a/src/code-parser/src/PhpDocReaderManager.php b/src/code-parser/src/PhpDocReaderManager.php index a67cbbf57..73d8b8c15 100644 --- a/src/code-parser/src/PhpDocReaderManager.php +++ b/src/code-parser/src/PhpDocReaderManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CodeParser; use PhpDocReader\PhpDocReader; diff --git a/src/code-parser/src/PhpParser.php b/src/code-parser/src/PhpParser.php index 38f8e6233..bcdbf9299 100644 --- a/src/code-parser/src/PhpParser.php +++ b/src/code-parser/src/PhpParser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CodeParser; use Hyperf\CodeParser\Exception\InvalidArgumentException; diff --git a/src/code-parser/src/Project.php b/src/code-parser/src/Project.php index 8a69cf183..0c20f65e7 100644 --- a/src/code-parser/src/Project.php +++ b/src/code-parser/src/Project.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CodeParser; use Hyperf\Stringable\Str; diff --git a/src/code-parser/tests/PhpDocReaderTest.php b/src/code-parser/tests/PhpDocReaderTest.php index d7634eb59..bed7bfb41 100644 --- a/src/code-parser/tests/PhpDocReaderTest.php +++ b/src/code-parser/tests/PhpDocReaderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser; use Hyperf\CodeParser\PhpDocReader; diff --git a/src/code-parser/tests/PhpParserTest.php b/src/code-parser/tests/PhpParserTest.php index b7ab625a2..e56c2ab40 100644 --- a/src/code-parser/tests/PhpParserTest.php +++ b/src/code-parser/tests/PhpParserTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser; use Hyperf\CodeParser\PhpParser; diff --git a/src/code-parser/tests/ProjectTest.php b/src/code-parser/tests/ProjectTest.php index f30abf9c4..739bf862e 100644 --- a/src/code-parser/tests/ProjectTest.php +++ b/src/code-parser/tests/ProjectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser; use Hyperf\CodeParser\Project; diff --git a/src/code-parser/tests/Stub/Bar.php b/src/code-parser/tests/Stub/Bar.php index c9fbfa55a..62a8550b0 100644 --- a/src/code-parser/tests/Stub/Bar.php +++ b/src/code-parser/tests/Stub/Bar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser\Stub; class Bar diff --git a/src/code-parser/tests/Stub/DocFoo.php b/src/code-parser/tests/Stub/DocFoo.php index 751ee8ad3..0581a2f21 100644 --- a/src/code-parser/tests/Stub/DocFoo.php +++ b/src/code-parser/tests/Stub/DocFoo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser\Stub; class DocFoo diff --git a/src/code-parser/tests/Stub/Foo.php b/src/code-parser/tests/Stub/Foo.php index a708990f9..3eaee2558 100644 --- a/src/code-parser/tests/Stub/Foo.php +++ b/src/code-parser/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser\Stub; class Foo diff --git a/src/code-parser/tests/Stub/FooEnum.php b/src/code-parser/tests/Stub/FooEnum.php index f35c8658e..068eaab12 100644 --- a/src/code-parser/tests/Stub/FooEnum.php +++ b/src/code-parser/tests/Stub/FooEnum.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser\Stub; enum FooEnum: int diff --git a/src/code-parser/tests/Stub/FooEnumStruct.php b/src/code-parser/tests/Stub/FooEnumStruct.php index 77e5c5ca1..270635473 100644 --- a/src/code-parser/tests/Stub/FooEnumStruct.php +++ b/src/code-parser/tests/Stub/FooEnumStruct.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser\Stub; use HyperfTest\Di\Stub\Ignore; diff --git a/src/code-parser/tests/Stub/UnionTypeFoo.php b/src/code-parser/tests/Stub/UnionTypeFoo.php index 606093e3d..5f7a88246 100644 --- a/src/code-parser/tests/Stub/UnionTypeFoo.php +++ b/src/code-parser/tests/Stub/UnionTypeFoo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\CodeParser\Stub; class UnionTypeFoo diff --git a/src/codec/src/Base62.php b/src/codec/src/Base62.php index 614865790..dd4a5f7e8 100644 --- a/src/codec/src/Base62.php +++ b/src/codec/src/Base62.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec; use Hyperf\Codec\Exception\InvalidArgumentException; diff --git a/src/codec/src/Exception/InvalidArgumentException.php b/src/codec/src/Exception/InvalidArgumentException.php index e825b76c7..01c945977 100644 --- a/src/codec/src/Exception/InvalidArgumentException.php +++ b/src/codec/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/codec/src/Json.php b/src/codec/src/Json.php index f7b4263da..456aea800 100644 --- a/src/codec/src/Json.php +++ b/src/codec/src/Json.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec; use Hyperf\Codec\Exception\InvalidArgumentException; diff --git a/src/codec/src/Packer/IgbinarySerializerPacker.php b/src/codec/src/Packer/IgbinarySerializerPacker.php index d38933dae..2251cf728 100644 --- a/src/codec/src/Packer/IgbinarySerializerPacker.php +++ b/src/codec/src/Packer/IgbinarySerializerPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec\Packer; use Hyperf\Contract\PackerInterface; diff --git a/src/codec/src/Packer/JsonPacker.php b/src/codec/src/Packer/JsonPacker.php index d2e0559a9..2468f91a8 100644 --- a/src/codec/src/Packer/JsonPacker.php +++ b/src/codec/src/Packer/JsonPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec\Packer; use Hyperf\Contract\PackerInterface; diff --git a/src/codec/src/Packer/PhpSerializerPacker.php b/src/codec/src/Packer/PhpSerializerPacker.php index 7524f83e7..b6805b563 100644 --- a/src/codec/src/Packer/PhpSerializerPacker.php +++ b/src/codec/src/Packer/PhpSerializerPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec\Packer; use Hyperf\Contract\PackerInterface; diff --git a/src/codec/src/Xml.php b/src/codec/src/Xml.php index a6a62a2bd..848c13128 100644 --- a/src/codec/src/Xml.php +++ b/src/codec/src/Xml.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Codec; use Hyperf\Codec\Exception\InvalidArgumentException; diff --git a/src/codec/tests/Base62Test.php b/src/codec/tests/Base62Test.php index d2d08045d..02a3d2300 100644 --- a/src/codec/tests/Base62Test.php +++ b/src/codec/tests/Base62Test.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec; use Hyperf\Codec\Base62; diff --git a/src/codec/tests/JsonTest.php b/src/codec/tests/JsonTest.php index d6638f954..7bcb68339 100644 --- a/src/codec/tests/JsonTest.php +++ b/src/codec/tests/JsonTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec; use Hyperf\Codec\Exception\InvalidArgumentException; diff --git a/src/codec/tests/Packer/IgbinarySerializerPackerTest.php b/src/codec/tests/Packer/IgbinarySerializerPackerTest.php index a2d393776..1dc75ef8e 100644 --- a/src/codec/tests/Packer/IgbinarySerializerPackerTest.php +++ b/src/codec/tests/Packer/IgbinarySerializerPackerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec\Packer; use Exception; diff --git a/src/codec/tests/Packer/JsonPackerTest.php b/src/codec/tests/Packer/JsonPackerTest.php index 2ae246a9a..a9272996a 100644 --- a/src/codec/tests/Packer/JsonPackerTest.php +++ b/src/codec/tests/Packer/JsonPackerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec\Packer; use Hyperf\Codec\Packer\JsonPacker; diff --git a/src/codec/tests/Stub/Car.php b/src/codec/tests/Stub/Car.php index 237c86984..dca79deb0 100644 --- a/src/codec/tests/Stub/Car.php +++ b/src/codec/tests/Stub/Car.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec\Stub; use JsonSerializable; diff --git a/src/codec/tests/Stub/StringCodeException.php b/src/codec/tests/Stub/StringCodeException.php index 1ae96a1c3..9743eabe6 100644 --- a/src/codec/tests/Stub/StringCodeException.php +++ b/src/codec/tests/Stub/StringCodeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec\Stub; use Exception; diff --git a/src/codec/tests/XmlTest.php b/src/codec/tests/XmlTest.php index 0cc8c0729..df51fb9bb 100644 --- a/src/codec/tests/XmlTest.php +++ b/src/codec/tests/XmlTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Codec; use Hyperf\Codec\Exception\InvalidArgumentException; diff --git a/src/collection/src/Arr.php b/src/collection/src/Arr.php index 2848884ca..1ce68e10b 100644 --- a/src/collection/src/Arr.php +++ b/src/collection/src/Arr.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Collection; use ArrayAccess; @@ -107,7 +108,7 @@ class Arr /** * Get all the given array except for a specified array of keys. */ - public static function except(array $array, array|string|int $keys): array + public static function except(array $array, array|int|string $keys): array { static::forget($array, $keys); return $array; @@ -159,7 +160,7 @@ class Arr /** * Flatten a multi-dimensional array into a single level. */ - public static function flatten(array $array, int|float $depth = INF): array + public static function flatten(array $array, float|int $depth = INF): array { $result = []; foreach ($array as $item) { @@ -184,7 +185,7 @@ class Arr * * @param array|string $keys */ - public static function forget(array &$array, array|string|int $keys): void + public static function forget(array &$array, array|int|string $keys): void { $original = &$array; $keys = (array) $keys; @@ -215,7 +216,7 @@ class Arr /** * Get an item from an array using "dot" notation. */ - public static function get(mixed $array, int|string|null $key = null, mixed $default = null) + public static function get(mixed $array, null|int|string $key = null, mixed $default = null) { if (! static::accessible($array)) { return value($default); @@ -244,7 +245,7 @@ class Arr * * @param null|array|string $keys */ - public static function has(array|ArrayAccess $array, int|string|null|array $keys): bool + public static function has(array|ArrayAccess $array, null|array|int|string $keys): bool { if (is_null($keys)) { return false; @@ -276,7 +277,7 @@ class Arr /** * Determine if any of the keys exist in an array using "dot" notation. */ - public static function hasAny(array|ArrayAccess $array, int|string|null|array $keys): bool + public static function hasAny(array|ArrayAccess $array, null|array|int|string $keys): bool { if (is_null($keys)) { return false; @@ -353,7 +354,7 @@ class Arr /** * Get a subset of the items from the given array. */ - public static function only(array $array, int|string|array $keys): array + public static function only(array $array, array|int|string $keys): array { return array_intersect_key($array, array_flip((array) $keys)); } @@ -394,7 +395,7 @@ class Arr * @param TValue $value * @return array */ - public static function prepend(array $array, mixed $value, string|int|null $key = null): array + public static function prepend(array $array, mixed $value, null|int|string $key = null): array { if (is_null($key)) { array_unshift($array, $value); diff --git a/src/collection/src/Collection.php b/src/collection/src/Collection.php index 90e523708..ad92fa08a 100644 --- a/src/collection/src/Collection.php +++ b/src/collection/src/Collection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Collection; use ArrayAccess; @@ -185,7 +186,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * * @template TTimesValue * - * @param (callable(int): TTimesValue)|null $callback + * @param null|(callable(int): TTimesValue) $callback * @return static */ public static function times(int $number, ?callable $callback = null): self @@ -212,7 +213,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Get the average value of a given key. * - * @param (callable(TValue): float|int)|string|null $callback + * @param null|(callable(TValue): float|int)|string $callback */ public function avg($callback = null) { @@ -231,7 +232,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Alias for the "avg" method. * - * @param (callable(TValue): float|int)|string|null $callback + * @param null|(callable(TValue): float|int)|string $callback * @return null|float|int */ public function average($callback = null) @@ -307,7 +308,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * * @param null|mixed $operator * @param null|mixed $value - * @param (callable(TValue): bool)|TValue|string $key + * @param (callable(TValue): bool)|string|TValue $key */ public function contains($key, $operator = null, $value = null): bool { @@ -471,7 +472,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Determine if all items in the collection pass the given test. * - * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param (callable(TValue, TKey): bool)|string|TValue $key * @param mixed $operator * @param mixed $value */ @@ -511,7 +512,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Run a filter over each of the items. * - * @param (callable(TValue, TKey): bool)|null $callback + * @param null|(callable(TValue, TKey): bool) $callback * @return static */ public function filter(?callable $callback = null): self @@ -544,7 +545,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * Apply the callback if the value is falsy. * * @param callable($this): $this $callback - * @param callable($this): null|$this $default + * @param $this|callable($this): null $default * @return $this */ public function unless(bool $value, callable $callback, ?callable $default = null): self @@ -643,8 +644,8 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * * @template TFirstDefault * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @param null|(callable(TValue, TKey): bool) $callback + * @param (Closure(): TFirstDefault)|TFirstDefault $default * @return TFirstDefault|TValue */ public function first(?callable $callback = null, $default = null) @@ -705,7 +706,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * @template TGetDefault * * @param TKey $key - * @param TGetDefault|(\Closure(): TGetDefault) $default + * @param (Closure(): TGetDefault)|TGetDefault $default * @return TGetDefault|TValue */ public function get($key, $default = null) @@ -751,7 +752,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Key an associative array by a field or using a callback. * - * @param (callable(TValue, TKey): array-key)|array|string $keyBy + * @param array|(callable(TValue, TKey): array-key)|string $keyBy * @return static> */ public function keyBy($keyBy): self @@ -846,8 +847,8 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * * @template TLastDefault * - * @param (callable(TValue, TKey): bool)|null $callback - * @param TLastDefault|(\Closure(): TLastDefault) $default + * @param null|(callable(TValue, TKey): bool) $callback + * @param (Closure(): TLastDefault)|TLastDefault $default * @return TLastDefault|TValue */ public function last(?callable $callback = null, $default = null) @@ -974,7 +975,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Get the max value of a given key. * - * @param (callable(TValue):mixed)|string|null $callback + * @param null|(callable(TValue):mixed)|string $callback * @return TValue */ public function max($callback = null) @@ -1025,7 +1026,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Get the min value of a given key. * - * @param (callable(TValue):mixed)|string|null $callback + * @param null|(callable(TValue):mixed)|string $callback * @return TValue */ public function min($callback = null) @@ -1170,7 +1171,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate * @template TPullDefault * * @param TKey $key - * @param TPullDefault|(\Closure(): TPullDefault) $default + * @param (Closure(): TPullDefault)|TPullDefault $default * @return TPullDefault|TValue */ public function pull($key, $default = null) @@ -1223,7 +1224,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Create a collection of all elements that do not pass a given truth test. * - * @param callable(TValue, TKey): bool|bool $callback + * @param bool|callable(TValue, TKey): bool $callback * @return static */ public function reject($callback): self @@ -1273,7 +1274,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Search the collection for a given value and return the corresponding key if successful. * - * @param TValue|(callable(TValue,TKey): bool) $value + * @param (callable(TValue,TKey): bool)|TValue $value * @return bool|TKey */ public function search($value, bool $strict = false) @@ -1379,7 +1380,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Sort the collection using the given callback. * - * @param (callable(TValue, TKey): mixed)|string|array $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @return static */ public function sortBy($callback, int $options = SORT_REGULAR, bool $descending = false): self @@ -1409,7 +1410,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Sort the collection in descending order using the given callback. * - * @param (callable(TValue, TKey): mixed)|string $callback + * @param (callable(TValue, TKey): mixed)|string $callback * @return static */ public function sortByDesc($callback, int $options = SORT_REGULAR): self @@ -1456,7 +1457,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Get the sum of the given values. * - * @param (callable(TValue): mixed)|string|null $callback + * @param null|(callable(TValue): mixed)|string $callback * @return mixed */ public function sum($callback = null) @@ -1510,7 +1511,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Return only unique items from the collection array. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param null|(callable(TValue, TKey): mixed)|string $key * @return static */ public function unique($key = null, bool $strict = false): self @@ -1528,7 +1529,7 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate /** * Return only unique items from the collection array using strict comparison. * - * @param (callable(TValue, TKey): mixed)|string|null $key + * @param null|(callable(TValue, TKey): mixed)|string $key * @return static */ public function uniqueStrict($key = null): self diff --git a/src/collection/src/Functions.php b/src/collection/src/Functions.php index 527f79c7d..5df6151d5 100644 --- a/src/collection/src/Functions.php +++ b/src/collection/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Collection; use Closure; diff --git a/src/collection/src/HigherOrderCollectionProxy.php b/src/collection/src/HigherOrderCollectionProxy.php index e481ea25d..ff637dc6b 100644 --- a/src/collection/src/HigherOrderCollectionProxy.php +++ b/src/collection/src/HigherOrderCollectionProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Collection; /** diff --git a/src/collection/tests/ArrTest.php b/src/collection/tests/ArrTest.php index a29fe802e..e0c828bf2 100644 --- a/src/collection/tests/ArrTest.php +++ b/src/collection/tests/ArrTest.php @@ -9,9 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Collections; use Hyperf\Collection\Arr; +use Hyperf\Coroutine\Coroutine; +use Hyperf\Di\Resolver\ResolverDispatcher; +use Monolog\Handler\StreamHandler; +use Monolog\Logger; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; use stdClass; @@ -89,10 +94,10 @@ class ArrTest extends TestCase 'logger' => [ 'default' => [ 'handler' => [ - 'class' => \Monolog\Handler\StreamHandler::class, + 'class' => StreamHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => \Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], ], ], @@ -105,7 +110,7 @@ class ArrTest extends TestCase 'mixin', ], 'class_map' => [ - \Hyperf\Coroutine\Coroutine::class => BASE_PATH . '/app/Kernel/ClassMap/Coroutine.php', + Coroutine::class => BASE_PATH . '/app/Kernel/ClassMap/Coroutine.php', ], ], ]; @@ -114,10 +119,10 @@ class ArrTest extends TestCase 'logger' => [ 'default' => [ 'handler' => [ - 'class' => \Monolog\Handler\StreamHandler::class, + 'class' => StreamHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => \Monolog\Logger::INFO, + 'level' => Logger::INFO, ], ], ], @@ -128,15 +133,15 @@ class ArrTest extends TestCase 'author', ], 'class_map' => [ - \Hyperf\Coroutine\Coroutine::class => BASE_PATH . '/app/Kernel/ClassMap/Coroutine.php', - \Hyperf\Di\Resolver\ResolverDispatcher::class => BASE_PATH . '/vendor/hyperf/di/class_map/Resolver/ResolverDispatcher.php', + Coroutine::class => BASE_PATH . '/app/Kernel/ClassMap/Coroutine.php', + ResolverDispatcher::class => BASE_PATH . '/vendor/hyperf/di/class_map/Resolver/ResolverDispatcher.php', ], ], ]; $result = Arr::merge($array1, $array2); - $array1['logger']['default']['handler']['constructor']['level'] = \Monolog\Logger::INFO; - $array1['scan']['class_map'][\Hyperf\Di\Resolver\ResolverDispatcher::class] = BASE_PATH . '/vendor/hyperf/di/class_map/Resolver/ResolverDispatcher.php'; + $array1['logger']['default']['handler']['constructor']['level'] = Logger::INFO; + $array1['scan']['class_map'][ResolverDispatcher::class] = BASE_PATH . '/vendor/hyperf/di/class_map/Resolver/ResolverDispatcher.php'; $array1['scan']['ignore_annotations'][] = 'author'; $this->assertSame($array1, $result); diff --git a/src/collection/tests/CollectionTest.php b/src/collection/tests/CollectionTest.php index e78e0e24b..07fb4dce9 100644 --- a/src/collection/tests/CollectionTest.php +++ b/src/collection/tests/CollectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Collections; use Hyperf\Collection\Collection; diff --git a/src/collection/tests/FunctionsTest.php b/src/collection/tests/FunctionsTest.php index 1c862abc6..a55fafdba 100644 --- a/src/collection/tests/FunctionsTest.php +++ b/src/collection/tests/FunctionsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Collection; use ArrayAccess; diff --git a/src/command/src/Annotation/AsCommand.php b/src/command/src/Annotation/AsCommand.php index 967850d47..93f5e1528 100644 --- a/src/command/src/Annotation/AsCommand.php +++ b/src/command/src/Annotation/AsCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Annotation; use Attribute; diff --git a/src/command/src/Annotation/Command.php b/src/command/src/Annotation/Command.php index 6a73dbcad..07af45947 100644 --- a/src/command/src/Annotation/Command.php +++ b/src/command/src/Annotation/Command.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Annotation; use Attribute; diff --git a/src/command/src/AsCommand.php b/src/command/src/AsCommand.php index 24ab8037f..9fed49dbc 100644 --- a/src/command/src/AsCommand.php +++ b/src/command/src/AsCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Hyperf\Command\Concerns\InteractsWithIO; diff --git a/src/command/src/ClosureCommand.php b/src/command/src/ClosureCommand.php index 16f9e4308..9de4f85fa 100644 --- a/src/command/src/ClosureCommand.php +++ b/src/command/src/ClosureCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Closure; @@ -49,7 +50,7 @@ final class ClosureCommand extends Command } /** - * @param callable(Crontab $crontab):Crontab|null $callback + * @param null|callable(Crontab $crontab):Crontab $callback */ public function cron(string $rule, array $arguments = [], ?callable $callback = null): self { diff --git a/src/command/src/Command.php b/src/command/src/Command.php index 4bfd0b621..bcab90fb6 100644 --- a/src/command/src/Command.php +++ b/src/command/src/Command.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Hyperf\Coroutine\Coroutine; diff --git a/src/command/src/Concerns/Confirmable.php b/src/command/src/Concerns/Confirmable.php index c614b60dd..915a6e2ba 100644 --- a/src/command/src/Concerns/Confirmable.php +++ b/src/command/src/Concerns/Confirmable.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Concerns; use Closure; +use Composer\InstalledVersions; use function Hyperf\Support\value; @@ -50,6 +52,6 @@ trait Confirmable protected function isShouldConfirm(): bool { return is_callable(['Composer\InstalledVersions', 'getRootPackage']) - && (\Composer\InstalledVersions::getRootPackage()['dev'] ?? false) === false; + && (InstalledVersions::getRootPackage()['dev'] ?? false) === false; } } diff --git a/src/command/src/Concerns/DisableEventDispatcher.php b/src/command/src/Concerns/DisableEventDispatcher.php index 88b3c286d..14a96fc96 100644 --- a/src/command/src/Concerns/DisableEventDispatcher.php +++ b/src/command/src/Concerns/DisableEventDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Concerns; use Hyperf\Context\ApplicationContext; diff --git a/src/command/src/Concerns/HasParameters.php b/src/command/src/Concerns/HasParameters.php index bba0f9258..83d1011d4 100644 --- a/src/command/src/Concerns/HasParameters.php +++ b/src/command/src/Concerns/HasParameters.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Concerns; use Symfony\Component\Console\Input\InputArgument; diff --git a/src/command/src/Concerns/InteractsWithIO.php b/src/command/src/Concerns/InteractsWithIO.php index 0d971581a..78d495522 100644 --- a/src/command/src/Concerns/InteractsWithIO.php +++ b/src/command/src/Concerns/InteractsWithIO.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Concerns; use Closure; @@ -16,6 +17,7 @@ use Hyperf\Contract\Arrayable; use Hyperf\Stringable\Str; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Helper\Table; +use Symfony\Component\Console\Helper\TableStyle; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ChoiceQuestion; @@ -214,7 +216,7 @@ trait InteractsWithIO * * @param array $headers * @param array|Arrayable $rows - * @param string|\Symfony\Component\Console\Helper\TableStyle $tableStyle + * @param string|TableStyle $tableStyle */ public function table($headers, $rows, $tableStyle = 'default', array $columnStyles = []) { diff --git a/src/command/src/Concerns/NullDisableEventDispatcher.php b/src/command/src/Concerns/NullDisableEventDispatcher.php index 81fdee570..98eea6e3a 100644 --- a/src/command/src/Concerns/NullDisableEventDispatcher.php +++ b/src/command/src/Concerns/NullDisableEventDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Concerns; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/command/src/ConfigProvider.php b/src/command/src/ConfigProvider.php index 9c3e8e1bf..d44a9f017 100644 --- a/src/command/src/ConfigProvider.php +++ b/src/command/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Hyperf\Command\Listener\RegisterCommandListener; diff --git a/src/command/src/Console.php b/src/command/src/Console.php index 5f2d7f6a6..1e947045e 100644 --- a/src/command/src/Console.php +++ b/src/command/src/Console.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Closure; diff --git a/src/command/src/Event/AfterExecute.php b/src/command/src/Event/AfterExecute.php index d1fc53608..93a6afed7 100644 --- a/src/command/src/Event/AfterExecute.php +++ b/src/command/src/Event/AfterExecute.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Event; use Hyperf\Command\Command; diff --git a/src/command/src/Event/AfterHandle.php b/src/command/src/Event/AfterHandle.php index 56b948529..c646accde 100644 --- a/src/command/src/Event/AfterHandle.php +++ b/src/command/src/Event/AfterHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Event; class AfterHandle extends Event diff --git a/src/command/src/Event/BeforeHandle.php b/src/command/src/Event/BeforeHandle.php index d937a89cc..361d78d34 100644 --- a/src/command/src/Event/BeforeHandle.php +++ b/src/command/src/Event/BeforeHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Event; class BeforeHandle extends Event diff --git a/src/command/src/Event/Event.php b/src/command/src/Event/Event.php index 6d16990b0..9eaa0dd62 100644 --- a/src/command/src/Event/Event.php +++ b/src/command/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Event; use Hyperf\Command\Command; diff --git a/src/command/src/Event/FailToHandle.php b/src/command/src/Event/FailToHandle.php index 5a6861fe0..126fde41f 100644 --- a/src/command/src/Event/FailToHandle.php +++ b/src/command/src/Event/FailToHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Event; use Hyperf\Command\Command; diff --git a/src/command/src/Listener/ClearTimerListener.php b/src/command/src/Listener/ClearTimerListener.php index acaa8e579..8a6e1e2f3 100644 --- a/src/command/src/Listener/ClearTimerListener.php +++ b/src/command/src/Listener/ClearTimerListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Listener; use Hyperf\Command\Event\AfterExecute; diff --git a/src/command/src/Listener/FailToHandleListener.php b/src/command/src/Listener/FailToHandleListener.php index 234644a1c..9c9e84363 100644 --- a/src/command/src/Listener/FailToHandleListener.php +++ b/src/command/src/Listener/FailToHandleListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Listener; use Hyperf\Command\Event\FailToHandle; diff --git a/src/command/src/Listener/RegisterCommandListener.php b/src/command/src/Listener/RegisterCommandListener.php index 17d21c720..82a1fa320 100644 --- a/src/command/src/Listener/RegisterCommandListener.php +++ b/src/command/src/Listener/RegisterCommandListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Listener; use Hyperf\Command\Annotation\AsCommand as AsCommandAnnotation; @@ -18,6 +19,7 @@ use Hyperf\Contract\ConfigInterface; use Hyperf\Contract\ContainerInterface as ContainerPlusInterface; use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Di\Annotation\AnnotationCollector; +use Hyperf\Di\Annotation\MultipleAnnotation; use Hyperf\Event\Contract\ListenerInterface; use Hyperf\Framework\Event\BootApplication; use Psr\Container\ContainerInterface; @@ -72,7 +74,7 @@ class RegisterCommandListener implements ListenerInterface $commands = AnnotationCollector::getMethodsByAnnotation(AsCommandAnnotation::class); foreach ($commands as $metadata) { - /** @var \Hyperf\Di\Annotation\MultipleAnnotation $multiAnnotation */ + /** @var MultipleAnnotation $multiAnnotation */ $multiAnnotation = $metadata['annotation']; /** @var AsCommandAnnotation[] $annotations */ $annotations = $multiAnnotation->toAnnotations(); diff --git a/src/command/src/ParameterParser.php b/src/command/src/ParameterParser.php index b73a0a0d7..a67301747 100644 --- a/src/command/src/ParameterParser.php +++ b/src/command/src/ParameterParser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Closure; diff --git a/src/command/src/Parser.php b/src/command/src/Parser.php index bf5777c81..948e9de0c 100644 --- a/src/command/src/Parser.php +++ b/src/command/src/Parser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command; use Hyperf\Stringable\Str; diff --git a/src/command/tests/Command/DefaultSwooleFlagsCommand.php b/src/command/tests/Command/DefaultSwooleFlagsCommand.php index a78560f57..4c260abf9 100644 --- a/src/command/tests/Command/DefaultSwooleFlagsCommand.php +++ b/src/command/tests/Command/DefaultSwooleFlagsCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command; use Hyperf\Command\Command; diff --git a/src/command/tests/Command/FooCommand.php b/src/command/tests/Command/FooCommand.php index 81242d133..439f0ec51 100644 --- a/src/command/tests/Command/FooCommand.php +++ b/src/command/tests/Command/FooCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command; use Hyperf\Command\Command; diff --git a/src/command/tests/Command/FooExceptionCommand.php b/src/command/tests/Command/FooExceptionCommand.php index 1c0425c29..739c64e76 100644 --- a/src/command/tests/Command/FooExceptionCommand.php +++ b/src/command/tests/Command/FooExceptionCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command; use Hyperf\Command\Command; diff --git a/src/command/tests/Command/FooExitCommand.php b/src/command/tests/Command/FooExitCommand.php index 6137150bd..7589da4fe 100644 --- a/src/command/tests/Command/FooExitCommand.php +++ b/src/command/tests/Command/FooExitCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command; use Hyperf\Command\Command; diff --git a/src/command/tests/Command/FooTraitCommand.php b/src/command/tests/Command/FooTraitCommand.php index 9906947f7..056794d66 100644 --- a/src/command/tests/Command/FooTraitCommand.php +++ b/src/command/tests/Command/FooTraitCommand.php @@ -9,9 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command; -class FooTraitCommand extends \Hyperf\Command\Command +use Hyperf\Command\Command; + +class FooTraitCommand extends Command { use Traits\Foo; diff --git a/src/command/tests/Command/SwooleFlagsCommand.php b/src/command/tests/Command/SwooleFlagsCommand.php index f09d4930c..b657cbf78 100644 --- a/src/command/tests/Command/SwooleFlagsCommand.php +++ b/src/command/tests/Command/SwooleFlagsCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command; use Hyperf\Command\Command; diff --git a/src/command/tests/Command/Traits/Foo.php b/src/command/tests/Command/Traits/Foo.php index f3930fba1..abd23c118 100644 --- a/src/command/tests/Command/Traits/Foo.php +++ b/src/command/tests/Command/Traits/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command\Command\Traits; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/command/tests/CommandParserTest.php b/src/command/tests/CommandParserTest.php index c867e1656..cfe2dcf0a 100644 --- a/src/command/tests/CommandParserTest.php +++ b/src/command/tests/CommandParserTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command; use Hyperf\Command\Parser; diff --git a/src/command/tests/CommandTest.php b/src/command/tests/CommandTest.php index fe1ce9991..65c062775 100644 --- a/src/command/tests/CommandTest.php +++ b/src/command/tests/CommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Command; use Hyperf\Context\ApplicationContext; @@ -19,8 +20,10 @@ use HyperfTest\Command\Command\FooExceptionCommand; use HyperfTest\Command\Command\FooExitCommand; use HyperfTest\Command\Command\FooTraitCommand; use HyperfTest\Command\Command\SwooleFlagsCommand; +use HyperfTest\Command\Command\Traits\Foo; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; @@ -48,7 +51,7 @@ class CommandTest extends TestCase $this->assertSame(SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL, $command->getHookFlags()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testExitCodeWhenThrowException() { ApplicationContext::setContainer($container = Mockery::mock(ContainerInterface::class)); @@ -75,7 +78,7 @@ class CommandTest extends TestCase $this->assertSame(0, $exitCode); $command = new FooTraitCommand(); - $this->assertArrayHasKey(\HyperfTest\Command\Command\Traits\Foo::class, (fn () => $this->setUpTraits($input, $output))->call($command)); + $this->assertArrayHasKey(Foo::class, (fn () => $this->setUpTraits($input, $output))->call($command)); $this->assertSame('foo', (fn () => $this->propertyFoo)->call($command)); } diff --git a/src/conditionable/src/Conditionable.php b/src/conditionable/src/Conditionable.php index 1d225cd6d..d8649454b 100644 --- a/src/conditionable/src/Conditionable.php +++ b/src/conditionable/src/Conditionable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Conditionable; use Closure; @@ -21,9 +22,9 @@ trait Conditionable * @template TWhenParameter * @template TWhenReturnType * - * @param (\Closure($this): TWhenParameter)|TWhenParameter|null $value - * @param (callable($this, TWhenParameter): TWhenReturnType)|null $callback - * @param (callable($this, TWhenParameter): TWhenReturnType)|null $default + * @param null|(Closure($this): TWhenParameter)|TWhenParameter $value + * @param null|(callable($this, TWhenParameter): TWhenReturnType) $callback + * @param null|(callable($this, TWhenParameter): TWhenReturnType) $default * @param null|mixed $value * @return $this|TWhenReturnType */ @@ -55,9 +56,9 @@ trait Conditionable * @template TUnlessParameter * @template TUnlessReturnType * - * @param (\Closure($this): TUnlessParameter)|TUnlessParameter|null $value - * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $callback - * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default + * @param null|(Closure($this): TUnlessParameter)|TUnlessParameter $value + * @param null|(callable($this, TUnlessParameter): TUnlessReturnType) $callback + * @param null|(callable($this, TUnlessParameter): TUnlessReturnType) $default * @param null|mixed $value * @return $this|TUnlessReturnType */ diff --git a/src/conditionable/src/HigherOrderWhenProxy.php b/src/conditionable/src/HigherOrderWhenProxy.php index 7e55fc03f..165f44355 100644 --- a/src/conditionable/src/HigherOrderWhenProxy.php +++ b/src/conditionable/src/HigherOrderWhenProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Conditionable; class HigherOrderWhenProxy diff --git a/src/conditionable/tests/ConditionableTest.php b/src/conditionable/tests/ConditionableTest.php index cdfe9fb70..94d19532b 100644 --- a/src/conditionable/tests/ConditionableTest.php +++ b/src/conditionable/tests/ConditionableTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Conditionable; use Hyperf\Conditionable\Conditionable; diff --git a/src/config-aliyun-acm/src/AliyunAcmDriver.php b/src/config-aliyun-acm/src/AliyunAcmDriver.php index d94e4f855..a121a15aa 100644 --- a/src/config-aliyun-acm/src/AliyunAcmDriver.php +++ b/src/config-aliyun-acm/src/AliyunAcmDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigAliyunAcm; use Hyperf\ConfigCenter\AbstractDriver; diff --git a/src/config-aliyun-acm/src/Client.php b/src/config-aliyun-acm/src/Client.php index 10fdc0ef4..d61b197d5 100644 --- a/src/config-aliyun-acm/src/Client.php +++ b/src/config-aliyun-acm/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigAliyunAcm; use GuzzleHttp; diff --git a/src/config-aliyun-acm/src/ClientInterface.php b/src/config-aliyun-acm/src/ClientInterface.php index 393a15dff..5aaf59e9f 100644 --- a/src/config-aliyun-acm/src/ClientInterface.php +++ b/src/config-aliyun-acm/src/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigAliyunAcm; interface ClientInterface extends \Hyperf\ConfigCenter\Contract\ClientInterface diff --git a/src/config-aliyun-acm/src/ConfigProvider.php b/src/config-aliyun-acm/src/ConfigProvider.php index 1ad8ec894..67e3de962 100644 --- a/src/config-aliyun-acm/src/ConfigProvider.php +++ b/src/config-aliyun-acm/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigAliyunAcm; class ConfigProvider diff --git a/src/config-apollo/src/ApolloDriver.php b/src/config-apollo/src/ApolloDriver.php index 70c2f9d60..0d1867045 100644 --- a/src/config-apollo/src/ApolloDriver.php +++ b/src/config-apollo/src/ApolloDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; use Hyperf\ConfigApollo\ClientInterface as ApolloClientInterface; diff --git a/src/config-apollo/src/Client.php b/src/config-apollo/src/Client.php index 8326a7602..ac1db0879 100644 --- a/src/config-apollo/src/Client.php +++ b/src/config-apollo/src/Client.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; use Closure; +use Exception; use Hyperf\Contract\ConfigInterface; use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Coroutine\Parallel; @@ -106,7 +108,7 @@ class Client implements ClientInterface 'notifications' => json_encode(array_values($notifications)), ], ]); - } catch (\Exception) { + } catch (Exception) { // Do nothing return null; } diff --git a/src/config-apollo/src/ClientFactory.php b/src/config-apollo/src/ClientFactory.php index d3cace684..d1976fdf2 100644 --- a/src/config-apollo/src/ClientFactory.php +++ b/src/config-apollo/src/ClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; use Hyperf\Contract\ConfigInterface; @@ -23,7 +24,7 @@ class ClientFactory public function __invoke(ContainerInterface $container) { $config = $container->get(ConfigInterface::class); - /** @var \Hyperf\ConfigApollo\Option $option */ + /** @var Option $option */ $option = make(Option::class); $option->setServer($config->get('config_center.drivers.apollo.server', 'http://127.0.0.1:8080')) ->setAppid($config->get('config_center.drivers.apollo.appid', '')) diff --git a/src/config-apollo/src/ClientInterface.php b/src/config-apollo/src/ClientInterface.php index 11e411fd2..e4d5c50a0 100644 --- a/src/config-apollo/src/ClientInterface.php +++ b/src/config-apollo/src/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; use Psr\Http\Message\ResponseInterface; diff --git a/src/config-apollo/src/ConfigProvider.php b/src/config-apollo/src/ConfigProvider.php index 4846bef39..e64cf8c2a 100644 --- a/src/config-apollo/src/ConfigProvider.php +++ b/src/config-apollo/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; class ConfigProvider diff --git a/src/config-apollo/src/Option.php b/src/config-apollo/src/Option.php index 493e18665..173daec11 100644 --- a/src/config-apollo/src/Option.php +++ b/src/config-apollo/src/Option.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; use Hyperf\Stringable\Str; diff --git a/src/config-apollo/src/PullMode.php b/src/config-apollo/src/PullMode.php index 169629560..e15fa6bc0 100644 --- a/src/config-apollo/src/PullMode.php +++ b/src/config-apollo/src/PullMode.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigApollo; class PullMode diff --git a/src/config-apollo/tests/ClientTest.php b/src/config-apollo/tests/ClientTest.php index ae665e79a..e2b55724c 100644 --- a/src/config-apollo/tests/ClientTest.php +++ b/src/config-apollo/tests/ClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigApollo; use GuzzleHttp; diff --git a/src/config-apollo/tests/OptionTest.php b/src/config-apollo/tests/OptionTest.php index 12e2f3de0..f85f9cbb3 100644 --- a/src/config-apollo/tests/OptionTest.php +++ b/src/config-apollo/tests/OptionTest.php @@ -9,16 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigApollo; use Hyperf\ConfigApollo\Option; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\ConfigApollo\Option::class)] +#[CoversClass(Option::class)] class OptionTest extends TestCase { public function testBuildUrl() diff --git a/src/config-center/publish/config_center.php b/src/config-center/publish/config_center.php index 1d3e404ea..6fc937e6e 100644 --- a/src/config-center/publish/config_center.php +++ b/src/config-center/publish/config_center.php @@ -9,8 +9,16 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Codec\Packer\JsonPacker; +use Hyperf\ConfigAliyunAcm\AliyunAcmDriver; +use Hyperf\ConfigApollo\ApolloDriver; use Hyperf\ConfigApollo\PullMode; use Hyperf\ConfigCenter\Mode; +use Hyperf\ConfigEtcd\EtcdDriver; +use Hyperf\ConfigNacos\Constants; +use Hyperf\ConfigNacos\NacosDriver; +use Hyperf\ConfigZookeeper\ZookeeperDriver; +use Hyperf\Support\Network; use function Hyperf\Support\env; @@ -20,7 +28,7 @@ return [ 'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS), 'drivers' => [ 'apollo' => [ - 'driver' => Hyperf\ConfigApollo\ApolloDriver::class, + 'driver' => ApolloDriver::class, 'pull_mode' => PullMode::INTERVAL, 'server' => 'http://127.0.0.1:9080', 'appid' => 'test', @@ -30,13 +38,13 @@ return [ ], 'interval' => 5, 'strict_mode' => false, - 'client_ip' => \Hyperf\Support\Network::ip(), + 'client_ip' => Network::ip(), 'pullTimeout' => 10, 'interval_timeout' => 1, ], 'nacos' => [ - 'driver' => Hyperf\ConfigNacos\NacosDriver::class, - 'merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE, + 'driver' => NacosDriver::class, + 'merge_mode' => Constants::CONFIG_MERGE_OVERWRITE, 'interval' => 3, 'default_key' => 'nacos_config', 'listener_config' => [ @@ -70,7 +78,7 @@ return [ ], ], 'aliyun_acm' => [ - 'driver' => Hyperf\ConfigAliyunAcm\AliyunAcmDriver::class, + 'driver' => AliyunAcmDriver::class, 'interval' => 5, 'endpoint' => env('ALIYUN_ACM_ENDPOINT', 'acm.aliyun.com'), 'namespace' => env('ALIYUN_ACM_NAMESPACE', ''), @@ -81,8 +89,8 @@ return [ 'ecs_ram_role' => env('ALIYUN_ACM_RAM_ROLE', ''), ], 'etcd' => [ - 'driver' => Hyperf\ConfigEtcd\EtcdDriver::class, - 'packer' => Hyperf\Codec\Packer\JsonPacker::class, + 'driver' => EtcdDriver::class, + 'packer' => JsonPacker::class, 'namespaces' => [ '/application', ], @@ -101,7 +109,7 @@ return [ ], ], 'zookeeper' => [ - 'driver' => Hyperf\ConfigZookeeper\ZookeeperDriver::class, + 'driver' => ZookeeperDriver::class, 'server' => env('ZOOKEEPER_SERVER', '127.0.0.1:2181'), 'path' => env('ZOOKEEPER_CONFIG_PATH', '/conf'), 'interval' => 5, diff --git a/src/config-center/src/AbstractDriver.php b/src/config-center/src/AbstractDriver.php index 4f609b33f..18d0fcb61 100644 --- a/src/config-center/src/AbstractDriver.php +++ b/src/config-center/src/AbstractDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter; use Hyperf\ConfigCenter\Contract\ClientInterface; @@ -25,6 +26,7 @@ use InvalidArgumentException; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Log\LoggerInterface; +use Swoole\Process; use Swoole\Server; use Throwable; @@ -166,7 +168,7 @@ abstract class AbstractDriver implements DriverInterface $processes = ProcessCollector::all(); if ($processes) { $string = serialize($message); - /** @var \Swoole\Process $process */ + /** @var Process $process */ foreach ($processes as $process) { $result = $process->exportSocket()->send($string, 10); if ($result === false) { diff --git a/src/config-center/src/ConfigProvider.php b/src/config-center/src/ConfigProvider.php index d80790aad..d43519371 100644 --- a/src/config-center/src/ConfigProvider.php +++ b/src/config-center/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter; use Hyperf\ConfigCenter\Listener\CreateMessageFetcherLoopListener; diff --git a/src/config-center/src/Contract/ClientInterface.php b/src/config-center/src/Contract/ClientInterface.php index 742939484..ce8e90662 100644 --- a/src/config-center/src/Contract/ClientInterface.php +++ b/src/config-center/src/Contract/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Contract; interface ClientInterface diff --git a/src/config-center/src/Contract/DriverInterface.php b/src/config-center/src/Contract/DriverInterface.php index 0befea8d3..1871d69c5 100644 --- a/src/config-center/src/Contract/DriverInterface.php +++ b/src/config-center/src/Contract/DriverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Contract; interface DriverInterface diff --git a/src/config-center/src/Contract/PipeMessageInterface.php b/src/config-center/src/Contract/PipeMessageInterface.php index 854492f24..bde1656ea 100644 --- a/src/config-center/src/Contract/PipeMessageInterface.php +++ b/src/config-center/src/Contract/PipeMessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Contract; interface PipeMessageInterface diff --git a/src/config-center/src/DriverFactory.php b/src/config-center/src/DriverFactory.php index 8ced27f2b..2bee14d62 100644 --- a/src/config-center/src/DriverFactory.php +++ b/src/config-center/src/DriverFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter; use Hyperf\ConfigCenter\Contract\DriverInterface; diff --git a/src/config-center/src/Event/ConfigChanged.php b/src/config-center/src/Event/ConfigChanged.php index 14a4aafd6..9d73ae72c 100644 --- a/src/config-center/src/Event/ConfigChanged.php +++ b/src/config-center/src/Event/ConfigChanged.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Event; class ConfigChanged diff --git a/src/config-center/src/Listener/CreateMessageFetcherLoopListener.php b/src/config-center/src/Listener/CreateMessageFetcherLoopListener.php index 951635183..0d1c2ed98 100644 --- a/src/config-center/src/Listener/CreateMessageFetcherLoopListener.php +++ b/src/config-center/src/Listener/CreateMessageFetcherLoopListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Listener; use Hyperf\Command\Event\BeforeHandle; diff --git a/src/config-center/src/Listener/FetchConfigOnBootListener.php b/src/config-center/src/Listener/FetchConfigOnBootListener.php index c611ede0f..efdcd2cb6 100644 --- a/src/config-center/src/Listener/FetchConfigOnBootListener.php +++ b/src/config-center/src/Listener/FetchConfigOnBootListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Listener; use Hyperf\Command\Event\BeforeHandle; diff --git a/src/config-center/src/Listener/OnPipeMessageListener.php b/src/config-center/src/Listener/OnPipeMessageListener.php index adda19405..b144fd91d 100644 --- a/src/config-center/src/Listener/OnPipeMessageListener.php +++ b/src/config-center/src/Listener/OnPipeMessageListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Listener; use Hyperf\ConfigCenter\Contract\DriverInterface; diff --git a/src/config-center/src/Mode.php b/src/config-center/src/Mode.php index fab11a141..6a4114160 100644 --- a/src/config-center/src/Mode.php +++ b/src/config-center/src/Mode.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter; class Mode diff --git a/src/config-center/src/PipeMessage.php b/src/config-center/src/PipeMessage.php index 0d7c9381c..0297e4e7f 100644 --- a/src/config-center/src/PipeMessage.php +++ b/src/config-center/src/PipeMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter; use Hyperf\ConfigCenter\Contract\PipeMessageInterface; diff --git a/src/config-center/src/Process/ConfigFetcherProcess.php b/src/config-center/src/Process/ConfigFetcherProcess.php index 01a235f4d..b1027242f 100644 --- a/src/config-center/src/Process/ConfigFetcherProcess.php +++ b/src/config-center/src/Process/ConfigFetcherProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigCenter\Process; use Hyperf\ConfigCenter\DriverFactory; diff --git a/src/config-center/tests/AbstractDriverTest.php b/src/config-center/tests/AbstractDriverTest.php index 037a61efd..e4224f050 100644 --- a/src/config-center/tests/AbstractDriverTest.php +++ b/src/config-center/tests/AbstractDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigCenter; use Hyperf\Codec\Json; @@ -23,6 +24,7 @@ use Hyperf\Coordinator\Constants; use Hyperf\Coordinator\CoordinatorManager; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -39,7 +41,7 @@ class AbstractDriverTest extends TestCase CoordinatorManager::clear(Constants::WORKER_EXIT); } - #[\PHPUnit\Framework\Attributes\DataProvider('getConfig')] + #[DataProvider('getConfig')] public function testCreateMessageFetcherLoopForCoroutineMode(Config $config) { ContainerStub::mockContainer($config); @@ -52,7 +54,7 @@ class AbstractDriverTest extends TestCase $this->assertSame(['message' => 'Hello Hyperf', 'id' => 1], $config->get('test')); } - #[\PHPUnit\Framework\Attributes\DataProvider('getConfigAndPipeMessage')] + #[DataProvider('getConfigAndPipeMessage')] public function testOnPipeMessage(Config $config, PipeMessageInterface $pipeMessage, array $assert) { ContainerStub::mockContainer($config); diff --git a/src/config-center/tests/ContainerStub.php b/src/config-center/tests/ContainerStub.php index 9e592efe7..95afb40a4 100644 --- a/src/config-center/tests/ContainerStub.php +++ b/src/config-center/tests/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigCenter; use Hyperf\Codec\Json; diff --git a/src/config-center/tests/Listener/CreateMessageFetcherLoopListenerTest.php b/src/config-center/tests/Listener/CreateMessageFetcherLoopListenerTest.php index 6bc3af249..36d0c446f 100644 --- a/src/config-center/tests/Listener/CreateMessageFetcherLoopListenerTest.php +++ b/src/config-center/tests/Listener/CreateMessageFetcherLoopListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigCenter\Listener; use Hyperf\Config\Config; diff --git a/src/config-center/tests/Listener/OnPipeMessageListenerTest.php b/src/config-center/tests/Listener/OnPipeMessageListenerTest.php index d9d710a09..e9da074f2 100644 --- a/src/config-center/tests/Listener/OnPipeMessageListenerTest.php +++ b/src/config-center/tests/Listener/OnPipeMessageListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigCenter\Listener; use Hyperf\Config\Config; diff --git a/src/config-center/tests/Process/ConfigFetcherProcessTest.php b/src/config-center/tests/Process/ConfigFetcherProcessTest.php index db50ce004..f61a8acd7 100644 --- a/src/config-center/tests/Process/ConfigFetcherProcessTest.php +++ b/src/config-center/tests/Process/ConfigFetcherProcessTest.php @@ -9,13 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigCenter\Process; use Hyperf\Config\Config; use Hyperf\ConfigCenter\DriverFactory; use Hyperf\ConfigCenter\Mode; use Hyperf\ConfigCenter\Process\ConfigFetcherProcess; -use Hyperf\ConfigEtcd; use Hyperf\ConfigEtcd\EtcdDriver; use Hyperf\Context\ApplicationContext; use Hyperf\Contract\ConfigInterface; @@ -101,8 +101,8 @@ class ConfigFetcherProcessTest extends TestCase return $logger; }); $container->shouldReceive('get')->with(DriverFactory::class)->andReturn(new DriverFactory($config)); - $container->shouldReceive('make')->with(ConfigEtcd\EtcdDriver::class, Mockery::any())->andReturnUsing(function () { - $driver = Mockery::mock(ConfigEtcd\EtcdDriver::class); + $container->shouldReceive('make')->with(EtcdDriver::class, Mockery::any())->andReturnUsing(function () { + $driver = Mockery::mock(EtcdDriver::class); $driver->shouldReceive('setServer')->once()->andReturnSelf(); $driver->shouldReceive('createMessageFetcherLoop')->once()->andReturnNull(); return $driver; diff --git a/src/config-etcd/src/Client.php b/src/config-etcd/src/Client.php index 853fb7be7..e3da3a279 100644 --- a/src/config-etcd/src/Client.php +++ b/src/config-etcd/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; use Hyperf\Contract\ConfigInterface; diff --git a/src/config-etcd/src/ClientFactory.php b/src/config-etcd/src/ClientFactory.php index 0a855ded7..381eb67f3 100644 --- a/src/config-etcd/src/ClientFactory.php +++ b/src/config-etcd/src/ClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; use Hyperf\Contract\ConfigInterface; diff --git a/src/config-etcd/src/ClientInterface.php b/src/config-etcd/src/ClientInterface.php index 9e1bd6137..9d0f4d9c5 100644 --- a/src/config-etcd/src/ClientInterface.php +++ b/src/config-etcd/src/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; interface ClientInterface extends \Hyperf\ConfigCenter\Contract\ClientInterface diff --git a/src/config-etcd/src/ConfigProvider.php b/src/config-etcd/src/ConfigProvider.php index a2b69926c..14ea46ca1 100644 --- a/src/config-etcd/src/ConfigProvider.php +++ b/src/config-etcd/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; class ConfigProvider diff --git a/src/config-etcd/src/EtcdDriver.php b/src/config-etcd/src/EtcdDriver.php index ee7150f6a..5d5d9a872 100644 --- a/src/config-etcd/src/EtcdDriver.php +++ b/src/config-etcd/src/EtcdDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; use Hyperf\Codec\Packer\JsonPacker; diff --git a/src/config-etcd/src/KV.php b/src/config-etcd/src/KV.php index 5d89f906e..f38e7617e 100644 --- a/src/config-etcd/src/KV.php +++ b/src/config-etcd/src/KV.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; class KV diff --git a/src/config-etcd/src/KVFactory.php b/src/config-etcd/src/KVFactory.php index d772674c5..1b1b5d45d 100644 --- a/src/config-etcd/src/KVFactory.php +++ b/src/config-etcd/src/KVFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; use Hyperf\Contract\ConfigInterface; diff --git a/src/config-etcd/src/KVInterface.php b/src/config-etcd/src/KVInterface.php index d1a022d04..8c7cc66b0 100644 --- a/src/config-etcd/src/KVInterface.php +++ b/src/config-etcd/src/KVInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigEtcd; interface KVInterface extends \Hyperf\Etcd\KVInterface diff --git a/src/config-etcd/tests/KVFactoryTest.php b/src/config-etcd/tests/KVFactoryTest.php index 81c36b671..c1f9253d6 100644 --- a/src/config-etcd/tests/KVFactoryTest.php +++ b/src/config-etcd/tests/KVFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigEtcd; use Hyperf\Config\Config; diff --git a/src/config-nacos/composer.json b/src/config-nacos/composer.json index ec02740c0..4e2f8d35e 100644 --- a/src/config-nacos/composer.json +++ b/src/config-nacos/composer.json @@ -34,7 +34,8 @@ "hyperf/guzzle": "~3.1.0", "hyperf/nacos": "~3.1.0", "hyperf/support": "~3.1.0", - "hyperf/utils": "~3.1.0" + "hyperf/utils": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0" }, "suggest": { "ext-json": "*", diff --git a/src/config-nacos/src/Client.php b/src/config-nacos/src/Client.php index 0f4864f96..a799f1ec8 100644 --- a/src/config-nacos/src/Client.php +++ b/src/config-nacos/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; use Hyperf\Codec\Json; @@ -17,6 +18,7 @@ use Hyperf\Contract\ConfigInterface; use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Nacos\Application; use Hyperf\Nacos\Exception\RequestException; +use JetBrains\PhpStorm\ArrayShape; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; @@ -77,16 +79,16 @@ class Client implements ClientInterface } } - /** - * @param $optional = [ - * 'groupName' => '', - * 'namespaceId' => '', - * 'clusters' => '', // 集群名称(字符串,多个集群用逗号分隔) - * 'healthyOnly' => false, - * ] - */ - public function getValidNodes(string $serviceName, array $optional = []): array - { + public function getValidNodes( + string $serviceName, + #[ArrayShape([ + 'groupName' => 'string', + 'namespaceId' => 'string', + 'clusters' => 'string', // 集群名称(字符串,多个集群用逗号分隔) + 'healthyOnly' => 'bool', + ])] + array $optional = [] + ): array { $response = $this->client->instance->list($serviceName, $optional); if ($response->getStatusCode() !== 200) { throw new RequestException((string) $response->getBody(), $response->getStatusCode()); diff --git a/src/config-nacos/src/ClientInterface.php b/src/config-nacos/src/ClientInterface.php index aa249096e..bb429b0a4 100644 --- a/src/config-nacos/src/ClientInterface.php +++ b/src/config-nacos/src/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; interface ClientInterface extends \Hyperf\ConfigCenter\Contract\ClientInterface diff --git a/src/config-nacos/src/ConfigProvider.php b/src/config-nacos/src/ConfigProvider.php index e480d38b7..d26044781 100644 --- a/src/config-nacos/src/ConfigProvider.php +++ b/src/config-nacos/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; class ConfigProvider diff --git a/src/config-nacos/src/Constants.php b/src/config-nacos/src/Constants.php index aa7f2d55b..2a817576d 100644 --- a/src/config-nacos/src/Constants.php +++ b/src/config-nacos/src/Constants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; class Constants diff --git a/src/config-nacos/src/NacosClient.php b/src/config-nacos/src/NacosClient.php index 066800bce..ab30062db 100644 --- a/src/config-nacos/src/NacosClient.php +++ b/src/config-nacos/src/NacosClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; use Hyperf\Nacos\Application; diff --git a/src/config-nacos/src/NacosClientFactory.php b/src/config-nacos/src/NacosClientFactory.php index 6841dfef5..b2bec522f 100644 --- a/src/config-nacos/src/NacosClientFactory.php +++ b/src/config-nacos/src/NacosClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; use Hyperf\Contract\ConfigInterface; diff --git a/src/config-nacos/src/NacosDriver.php b/src/config-nacos/src/NacosDriver.php index c13692add..c3484c52d 100644 --- a/src/config-nacos/src/NacosDriver.php +++ b/src/config-nacos/src/NacosDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigNacos; use Hyperf\Collection\Arr; diff --git a/src/config-nacos/tests/ClientTest.php b/src/config-nacos/tests/ClientTest.php index 4d8b32315..c1bd13b70 100644 --- a/src/config-nacos/tests/ClientTest.php +++ b/src/config-nacos/tests/ClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigNacos; use Hyperf\ConfigNacos\Client; diff --git a/src/config-nacos/tests/ContainerStub.php b/src/config-nacos/tests/ContainerStub.php index 1a9ea7cde..fd00faed9 100644 --- a/src/config-nacos/tests/ContainerStub.php +++ b/src/config-nacos/tests/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigNacos; use Hyperf\ConfigNacos\Client; diff --git a/src/config-nacos/tests/HandlerMockery.php b/src/config-nacos/tests/HandlerMockery.php index c5c822d85..6fed46a85 100644 --- a/src/config-nacos/tests/HandlerMockery.php +++ b/src/config-nacos/tests/HandlerMockery.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigNacos; use GuzzleHttp\Promise\FulfilledPromise; diff --git a/src/config-zookeeper/src/Client.php b/src/config-zookeeper/src/Client.php index cdebc11a2..358c263a0 100644 --- a/src/config-zookeeper/src/Client.php +++ b/src/config-zookeeper/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigZookeeper; use Hyperf\Contract\ConfigInterface; diff --git a/src/config-zookeeper/src/ClientInterface.php b/src/config-zookeeper/src/ClientInterface.php index 6f7d033cd..a249bfa05 100644 --- a/src/config-zookeeper/src/ClientInterface.php +++ b/src/config-zookeeper/src/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigZookeeper; interface ClientInterface extends \Hyperf\ConfigCenter\Contract\ClientInterface diff --git a/src/config-zookeeper/src/ConfigProvider.php b/src/config-zookeeper/src/ConfigProvider.php index da0a49b5e..de9170954 100644 --- a/src/config-zookeeper/src/ConfigProvider.php +++ b/src/config-zookeeper/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigZookeeper; class ConfigProvider diff --git a/src/config-zookeeper/src/ZookeeperDriver.php b/src/config-zookeeper/src/ZookeeperDriver.php index 00d527466..97614a19a 100644 --- a/src/config-zookeeper/src/ZookeeperDriver.php +++ b/src/config-zookeeper/src/ZookeeperDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ConfigZookeeper; use Hyperf\ConfigCenter\AbstractDriver; diff --git a/src/config-zookeeper/tests/ClientTest.php b/src/config-zookeeper/tests/ClientTest.php index cff56b51f..a26621a56 100644 --- a/src/config-zookeeper/tests/ClientTest.php +++ b/src/config-zookeeper/tests/ClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigZookeeper; use Hyperf\Config\Config; diff --git a/src/config-zookeeper/tests/Stub/Server.php b/src/config-zookeeper/tests/Stub/Server.php index 12ac62f99..1103588bd 100644 --- a/src/config-zookeeper/tests/Stub/Server.php +++ b/src/config-zookeeper/tests/Stub/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ConfigZookeeper\Stub; class Server extends \Swoole\Server diff --git a/src/config/src/Annotation/Value.php b/src/config/src/Annotation/Value.php index b16b7da4c..b4e454bd0 100644 --- a/src/config/src/Annotation/Value.php +++ b/src/config/src/Annotation/Value.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config\Annotation; use Attribute; diff --git a/src/config/src/Annotation/ValueAspect.php b/src/config/src/Annotation/ValueAspect.php index e4e2f0e3b..226710e33 100644 --- a/src/config/src/Annotation/ValueAspect.php +++ b/src/config/src/Annotation/ValueAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config\Annotation; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/config/src/Config.php b/src/config/src/Config.php index 79797542f..5cb1b0091 100644 --- a/src/config/src/Config.php +++ b/src/config/src/Config.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config; use Hyperf\Collection\Arr; diff --git a/src/config/src/ConfigFactory.php b/src/config/src/ConfigFactory.php index ca39b491b..5578b3226 100644 --- a/src/config/src/ConfigFactory.php +++ b/src/config/src/ConfigFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config; use Hyperf\Collection\Arr; diff --git a/src/config/src/ConfigProvider.php b/src/config/src/ConfigProvider.php index 670d54ee2..8e754022c 100644 --- a/src/config/src/ConfigProvider.php +++ b/src/config/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config; use Hyperf\Config\Annotation\ValueAspect; diff --git a/src/config/src/Functions.php b/src/config/src/Functions.php index 31995d46a..1afb52723 100644 --- a/src/config/src/Functions.php +++ b/src/config/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config; use Hyperf\Context\ApplicationContext; diff --git a/src/config/src/Listener/RegisterPropertyHandlerListener.php b/src/config/src/Listener/RegisterPropertyHandlerListener.php index d4f20115c..55ccd8f50 100644 --- a/src/config/src/Listener/RegisterPropertyHandlerListener.php +++ b/src/config/src/Listener/RegisterPropertyHandlerListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config\Listener; use Hyperf\Config\Annotation\Value; diff --git a/src/config/src/ProviderConfig.php b/src/config/src/ProviderConfig.php index 17ffec966..3a47021b0 100644 --- a/src/config/src/ProviderConfig.php +++ b/src/config/src/ProviderConfig.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config; use Hyperf\Di\Definition\PriorityDefinition; diff --git a/src/config/tests/ConfigFactoryTest.php b/src/config/tests/ConfigFactoryTest.php index 8126dadf4..f39ab94bc 100644 --- a/src/config/tests/ConfigFactoryTest.php +++ b/src/config/tests/ConfigFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Config; use Hyperf\Config\Config; diff --git a/src/config/tests/ConfigTest.php b/src/config/tests/ConfigTest.php index 76522eca1..1e52579be 100644 --- a/src/config/tests/ConfigTest.php +++ b/src/config/tests/ConfigTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Config; use Hyperf\Config\Config; diff --git a/src/config/tests/ProviderConfigTest.php b/src/config/tests/ProviderConfigTest.php index 507e6437c..7bc621794 100644 --- a/src/config/tests/ProviderConfigTest.php +++ b/src/config/tests/ProviderConfigTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Config; use Hyperf\Collection\Arr; diff --git a/src/config/tests/Stub/Foo.php b/src/config/tests/Stub/Foo.php index 14f38bb4d..def9a6a39 100644 --- a/src/config/tests/Stub/Foo.php +++ b/src/config/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Config\Stub; class Foo diff --git a/src/config/tests/Stub/FooConfigProvider.php b/src/config/tests/Stub/FooConfigProvider.php index 48d16cd68..970657188 100644 --- a/src/config/tests/Stub/FooConfigProvider.php +++ b/src/config/tests/Stub/FooConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Config\Stub; class FooConfigProvider diff --git a/src/config/tests/Stub/ProviderConfig.php b/src/config/tests/Stub/ProviderConfig.php index 86509f4cd..ee0b5fc99 100644 --- a/src/config/tests/Stub/ProviderConfig.php +++ b/src/config/tests/Stub/ProviderConfig.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Config\Stub; class ProviderConfig extends \Hyperf\Config\ProviderConfig diff --git a/src/constants/src/AbstractConstants.php b/src/constants/src/AbstractConstants.php index e9b1c91af..e148bee41 100644 --- a/src/constants/src/AbstractConstants.php +++ b/src/constants/src/AbstractConstants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; /** diff --git a/src/constants/src/Annotation/Constants.php b/src/constants/src/Annotation/Constants.php index 53a3406f9..6e585184e 100644 --- a/src/constants/src/Annotation/Constants.php +++ b/src/constants/src/Annotation/Constants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants\Annotation; use Attribute; diff --git a/src/constants/src/AnnotationReader.php b/src/constants/src/AnnotationReader.php index b8488b70a..e83e640c4 100644 --- a/src/constants/src/AnnotationReader.php +++ b/src/constants/src/AnnotationReader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; use BackedEnum; diff --git a/src/constants/src/ConfigProvider.php b/src/constants/src/ConfigProvider.php index 7d0b3ffa8..e0ac3f0e4 100644 --- a/src/constants/src/ConfigProvider.php +++ b/src/constants/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; class ConfigProvider diff --git a/src/constants/src/ConstantsCollector.php b/src/constants/src/ConstantsCollector.php index 89401e007..bf8b5c1dc 100644 --- a/src/constants/src/ConstantsCollector.php +++ b/src/constants/src/ConstantsCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; use Hyperf\Di\MetadataCollector; diff --git a/src/constants/src/ConstantsTrait.php b/src/constants/src/ConstantsTrait.php index 513e36172..d21409a66 100644 --- a/src/constants/src/ConstantsTrait.php +++ b/src/constants/src/ConstantsTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; use Hyperf\Constants\Exception\ConstantsException; @@ -27,7 +28,7 @@ trait ConstantsTrait * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - public static function __callStatic(string $name, array $arguments): string|array + public static function __callStatic(string $name, array $arguments): array|string { return static::getValue($name, $arguments); } diff --git a/src/constants/src/EnumConstantsTrait.php b/src/constants/src/EnumConstantsTrait.php index c55c6683f..60a618ec2 100644 --- a/src/constants/src/EnumConstantsTrait.php +++ b/src/constants/src/EnumConstantsTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; use BackedEnum; @@ -28,10 +29,10 @@ trait EnumConstantsTrait /** * @throws ContainerExceptionInterface - * @throws Exception\ConstantsException + * @throws ConstantsException * @throws NotFoundExceptionInterface */ - public function __call(string $name, array $arguments): string|array + public function __call(string $name, array $arguments): array|string { $code = match (true) { $this instanceof BackedEnum => $this->value, @@ -42,11 +43,11 @@ trait EnumConstantsTrait } /** - * @throws Exception\ConstantsException + * @throws ConstantsException * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - public static function __callStatic(string $name, array $arguments): string|array + public static function __callStatic(string $name, array $arguments): array|string { if (! is_subclass_of(static::class, UnitEnum::class)) { throw new ConstantsException('This trait must in enum'); diff --git a/src/constants/src/Exception/ConstantsException.php b/src/constants/src/Exception/ConstantsException.php index 8e84b28be..72700152f 100644 --- a/src/constants/src/Exception/ConstantsException.php +++ b/src/constants/src/Exception/ConstantsException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants\Exception; use Exception; diff --git a/src/constants/src/GetterTrait.php b/src/constants/src/GetterTrait.php index c5cbf18ce..01ed87baa 100644 --- a/src/constants/src/GetterTrait.php +++ b/src/constants/src/GetterTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants; use Hyperf\Constants\Exception\ConstantsException; @@ -30,7 +31,7 @@ trait GetterTrait * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - public static function getValue(string $name, array $arguments): string|array + public static function getValue(string $name, array $arguments): array|string { if (! str_starts_with($name, 'get')) { throw new ConstantsException("The function {$name} is not defined!"); @@ -62,7 +63,7 @@ trait GetterTrait * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ - protected static function translate(string $key, array $arguments): array|string|null + protected static function translate(string $key, array $arguments): null|array|string { if (! ApplicationContext::hasContainer() || ! ApplicationContext::getContainer()->has(TranslatorInterface::class)) { return null; diff --git a/src/constants/tests/AnnotationReaderTest.php b/src/constants/tests/AnnotationReaderTest.php index a18ac53a3..d8c8a6038 100644 --- a/src/constants/tests/AnnotationReaderTest.php +++ b/src/constants/tests/AnnotationReaderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Constants; use Hyperf\Constants\AnnotationReader; diff --git a/src/constants/tests/Stub/ErrorCodeStub.php b/src/constants/tests/Stub/ErrorCodeStub.php index 6014e295d..6ebcb0d1b 100644 --- a/src/constants/tests/Stub/ErrorCodeStub.php +++ b/src/constants/tests/Stub/ErrorCodeStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Constants\Stub; use Hyperf\Constants\AbstractConstants; diff --git a/src/consul/src/Agent.php b/src/consul/src/Agent.php index e29cc7efa..98de6a710 100644 --- a/src/consul/src/Agent.php +++ b/src/consul/src/Agent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; class Agent extends Client implements AgentInterface diff --git a/src/consul/src/AgentInterface.php b/src/consul/src/AgentInterface.php index acf1f9808..14fea6e3c 100644 --- a/src/consul/src/AgentInterface.php +++ b/src/consul/src/AgentInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; interface AgentInterface diff --git a/src/consul/src/Catalog.php b/src/consul/src/Catalog.php index ea127e3b2..7daa17fbc 100644 --- a/src/consul/src/Catalog.php +++ b/src/consul/src/Catalog.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; class Catalog extends Client implements CatalogInterface diff --git a/src/consul/src/CatalogInterface.php b/src/consul/src/CatalogInterface.php index cd8e579cb..3bdee0939 100644 --- a/src/consul/src/CatalogInterface.php +++ b/src/consul/src/CatalogInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; interface CatalogInterface diff --git a/src/consul/src/Client.php b/src/consul/src/Client.php index 9279f888c..03edd0245 100644 --- a/src/consul/src/Client.php +++ b/src/consul/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; use Closure; diff --git a/src/consul/src/ConfigProvider.php b/src/consul/src/ConfigProvider.php index 07ea3384d..74e5e8a0f 100644 --- a/src/consul/src/ConfigProvider.php +++ b/src/consul/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; class ConfigProvider diff --git a/src/consul/src/ConsulResponse.php b/src/consul/src/ConsulResponse.php index 1faf950cd..6887a79b6 100644 --- a/src/consul/src/ConsulResponse.php +++ b/src/consul/src/ConsulResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; use Hyperf\Collection\Arr; diff --git a/src/consul/src/Exception/ClientException.php b/src/consul/src/Exception/ClientException.php index 2eacd9f5c..859ec4467 100644 --- a/src/consul/src/Exception/ClientException.php +++ b/src/consul/src/Exception/ClientException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul\Exception; use RuntimeException; diff --git a/src/consul/src/Exception/ConsulException.php b/src/consul/src/Exception/ConsulException.php index f3ed78a13..f9153dc1a 100644 --- a/src/consul/src/Exception/ConsulException.php +++ b/src/consul/src/Exception/ConsulException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul\Exception; interface ConsulException diff --git a/src/consul/src/Exception/InvalidArgumentException.php b/src/consul/src/Exception/InvalidArgumentException.php index 067c64459..2493e234c 100644 --- a/src/consul/src/Exception/InvalidArgumentException.php +++ b/src/consul/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul\Exception; class InvalidArgumentException extends \InvalidArgumentException implements ConsulException diff --git a/src/consul/src/Exception/ServerException.php b/src/consul/src/Exception/ServerException.php index 620223f43..efe518fc2 100644 --- a/src/consul/src/Exception/ServerException.php +++ b/src/consul/src/Exception/ServerException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul\Exception; use RuntimeException; diff --git a/src/consul/src/Health.php b/src/consul/src/Health.php index 54b400bc4..f3407d749 100644 --- a/src/consul/src/Health.php +++ b/src/consul/src/Health.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; class Health extends Client implements HealthInterface diff --git a/src/consul/src/HealthInterface.php b/src/consul/src/HealthInterface.php index 7b2a7ae04..b85dd6ef5 100644 --- a/src/consul/src/HealthInterface.php +++ b/src/consul/src/HealthInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; interface HealthInterface diff --git a/src/consul/src/KV.php b/src/consul/src/KV.php index b44cdcf3e..6ee1a32f3 100644 --- a/src/consul/src/KV.php +++ b/src/consul/src/KV.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; class KV extends Client implements KVInterface diff --git a/src/consul/src/KVInterface.php b/src/consul/src/KVInterface.php index e13f89faa..e94263618 100644 --- a/src/consul/src/KVInterface.php +++ b/src/consul/src/KVInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; interface KVInterface diff --git a/src/consul/src/Session.php b/src/consul/src/Session.php index e735235d3..d7d68297f 100644 --- a/src/consul/src/Session.php +++ b/src/consul/src/Session.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; class Session extends Client implements SessionInterface diff --git a/src/consul/src/SessionInterface.php b/src/consul/src/SessionInterface.php index 61b1f45b6..5b140f967 100644 --- a/src/consul/src/SessionInterface.php +++ b/src/consul/src/SessionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; interface SessionInterface diff --git a/src/consul/src/Utils.php b/src/consul/src/Utils.php index a0ea2a9ea..9d43742e3 100644 --- a/src/consul/src/Utils.php +++ b/src/consul/src/Utils.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Consul; use Psr\Http\Message\RequestInterface; diff --git a/src/consul/tests/AgentTest.php b/src/consul/tests/AgentTest.php index 2b319ed36..b583ecb5a 100644 --- a/src/consul/tests/AgentTest.php +++ b/src/consul/tests/AgentTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Consul; use GuzzleHttp\Client; @@ -19,6 +20,7 @@ use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Di\Container; use Hyperf\Guzzle\ClientFactory; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -26,7 +28,7 @@ use Psr\Log\NullLogger; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Consul\Agent::class)] +#[CoversClass(Agent::class)] class AgentTest extends TestCase { /** diff --git a/src/consul/tests/ClientTest.php b/src/consul/tests/ClientTest.php index 5cf381a79..c095094a5 100644 --- a/src/consul/tests/ClientTest.php +++ b/src/consul/tests/ClientTest.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Consul; use HyperfTest\Consul\Stub\Client; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use ReflectionClass; use ReflectionMethod; @@ -21,11 +23,7 @@ use ReflectionMethod; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Consul\Client::class)] -/** - * @internal - * @coversNothing - */ +#[CoversClass(\Hyperf\Consul\Client::class)] class ClientTest extends TestCase { /** diff --git a/src/consul/tests/KVTest.php b/src/consul/tests/KVTest.php index c5c59ed11..96ae48499 100644 --- a/src/consul/tests/KVTest.php +++ b/src/consul/tests/KVTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Consul; use Exception; @@ -21,6 +22,7 @@ use Hyperf\Contract\StdoutLoggerInterface; use Hyperf\Di\Container; use Hyperf\Guzzle\ClientFactory; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -28,7 +30,7 @@ use Psr\Log\NullLogger; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Consul\KV::class)] +#[CoversClass(KV::class)] class KVTest extends TestCase { private $kv; diff --git a/src/consul/tests/Stub/Client.php b/src/consul/tests/Stub/Client.php index 94337ab61..241d824cd 100644 --- a/src/consul/tests/Stub/Client.php +++ b/src/consul/tests/Stub/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Consul\Stub; class Client extends \Hyperf\Consul\Client diff --git a/src/context/src/ApplicationContext.php b/src/context/src/ApplicationContext.php index 8b53af7ef..17ae3e218 100644 --- a/src/context/src/ApplicationContext.php +++ b/src/context/src/ApplicationContext.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Context; use Psr\Container\ContainerInterface; diff --git a/src/context/src/Context.php b/src/context/src/Context.php index f38d7f402..b49d5c433 100644 --- a/src/context/src/Context.php +++ b/src/context/src/Context.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Context; use Closure; diff --git a/src/context/src/RequestContext.php b/src/context/src/RequestContext.php index b8cb6901c..30680922d 100644 --- a/src/context/src/RequestContext.php +++ b/src/context/src/RequestContext.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Context; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/context/src/ResponseContext.php b/src/context/src/ResponseContext.php index 4cca36fe7..8b0d4e2f6 100644 --- a/src/context/src/ResponseContext.php +++ b/src/context/src/ResponseContext.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Context; use Psr\Http\Message\ResponseInterface; diff --git a/src/context/src/Traits/CoroutineProxy.php b/src/context/src/Traits/CoroutineProxy.php index abeb265b7..5a2b081f2 100644 --- a/src/context/src/Traits/CoroutineProxy.php +++ b/src/context/src/Traits/CoroutineProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Context\Traits; use Hyperf\Context\Context; diff --git a/src/context/tests/ApplicationContextTest.php b/src/context/tests/ApplicationContextTest.php index 9a1d9616f..3857a5552 100644 --- a/src/context/tests/ApplicationContextTest.php +++ b/src/context/tests/ApplicationContextTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Context; use Hyperf\Context\ApplicationContext; diff --git a/src/context/tests/ContextTest.php b/src/context/tests/ContextTest.php index 992661733..b55763211 100644 --- a/src/context/tests/ContextTest.php +++ b/src/context/tests/ContextTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Context; use Hyperf\Context\Context; diff --git a/src/context/tests/Traits/CoroutineProxyTest.php b/src/context/tests/Traits/CoroutineProxyTest.php index b9a6dab3e..e3ab0422e 100644 --- a/src/context/tests/Traits/CoroutineProxyTest.php +++ b/src/context/tests/Traits/CoroutineProxyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Context\Traits; use Hyperf\Context\Context; diff --git a/src/contract/src/ApplicationInterface.php b/src/contract/src/ApplicationInterface.php index 95b66fb46..b0cecb4e3 100644 --- a/src/contract/src/ApplicationInterface.php +++ b/src/contract/src/ApplicationInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Hyperf\Framework\ApplicationFactory; diff --git a/src/contract/src/Arrayable.php b/src/contract/src/Arrayable.php index 2ff01a1e1..64bf41a02 100644 --- a/src/contract/src/Arrayable.php +++ b/src/contract/src/Arrayable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; /** diff --git a/src/contract/src/Castable.php b/src/contract/src/Castable.php index 83eef908e..940e46dc1 100644 --- a/src/contract/src/Castable.php +++ b/src/contract/src/Castable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface Castable diff --git a/src/contract/src/CastsAttributes.php b/src/contract/src/CastsAttributes.php index 66ca73b0d..e992b9b24 100644 --- a/src/contract/src/CastsAttributes.php +++ b/src/contract/src/CastsAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface CastsAttributes diff --git a/src/contract/src/CastsInboundAttributes.php b/src/contract/src/CastsInboundAttributes.php index 2bf448d45..ad036d82f 100644 --- a/src/contract/src/CastsInboundAttributes.php +++ b/src/contract/src/CastsInboundAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface CastsInboundAttributes diff --git a/src/contract/src/CompressInterface.php b/src/contract/src/CompressInterface.php index e0300a2b3..d29583fab 100644 --- a/src/contract/src/CompressInterface.php +++ b/src/contract/src/CompressInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface CompressInterface diff --git a/src/contract/src/ConfigInterface.php b/src/contract/src/ConfigInterface.php index 582f75d52..8eec4798f 100644 --- a/src/contract/src/ConfigInterface.php +++ b/src/contract/src/ConfigInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface ConfigInterface diff --git a/src/contract/src/ConnectionInterface.php b/src/contract/src/ConnectionInterface.php index 2e7f1a427..ca04c1c03 100644 --- a/src/contract/src/ConnectionInterface.php +++ b/src/contract/src/ConnectionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface ConnectionInterface diff --git a/src/contract/src/ContainerInterface.php b/src/contract/src/ContainerInterface.php index bc374c699..3ff6b33ae 100644 --- a/src/contract/src/ContainerInterface.php +++ b/src/contract/src/ContainerInterface.php @@ -9,9 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; +use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface as PsrContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use Throwable; interface ContainerInterface extends PsrContainerInterface { @@ -25,8 +29,8 @@ interface ContainerInterface extends PsrContainerInterface * @param array $parameters Optional parameters to use to build the entry. Use this to force specific parameters * to specific values. Parameters not defined in this array will be resolved using * the container. - * @throws InvalidArgumentException the name parameter must be of type string - * @throws NotFoundException no entry found for the given name + * @throws ContainerExceptionInterface&Throwable the name parameter must be of type string + * @throws NotFoundExceptionInterface&Throwable no entry found for the given name */ public function make(string $name, array $parameters = []); diff --git a/src/contract/src/DispatcherInterface.php b/src/contract/src/DispatcherInterface.php index d6e06f69c..97da801b0 100644 --- a/src/contract/src/DispatcherInterface.php +++ b/src/contract/src/DispatcherInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface DispatcherInterface diff --git a/src/contract/src/FrequencyInterface.php b/src/contract/src/FrequencyInterface.php index e0053e6c4..c7d25afed 100644 --- a/src/contract/src/FrequencyInterface.php +++ b/src/contract/src/FrequencyInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface FrequencyInterface diff --git a/src/contract/src/IPReaderInterface.php b/src/contract/src/IPReaderInterface.php index 9ba191510..4ad43b9c8 100644 --- a/src/contract/src/IPReaderInterface.php +++ b/src/contract/src/IPReaderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface IPReaderInterface diff --git a/src/contract/src/IdGeneratorInterface.php b/src/contract/src/IdGeneratorInterface.php index 8a0682bd9..5c68342a4 100644 --- a/src/contract/src/IdGeneratorInterface.php +++ b/src/contract/src/IdGeneratorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface IdGeneratorInterface diff --git a/src/contract/src/JsonDeSerializable.php b/src/contract/src/JsonDeSerializable.php index 672cbb6a0..8dec6a063 100644 --- a/src/contract/src/JsonDeSerializable.php +++ b/src/contract/src/JsonDeSerializable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface JsonDeSerializable diff --git a/src/contract/src/Jsonable.php b/src/contract/src/Jsonable.php index 8d6abcb66..65c05e2c0 100644 --- a/src/contract/src/Jsonable.php +++ b/src/contract/src/Jsonable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Stringable; diff --git a/src/contract/src/LengthAwarePaginatorInterface.php b/src/contract/src/LengthAwarePaginatorInterface.php index c4413d89c..8e7e648e2 100644 --- a/src/contract/src/LengthAwarePaginatorInterface.php +++ b/src/contract/src/LengthAwarePaginatorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface LengthAwarePaginatorInterface extends PaginatorInterface diff --git a/src/contract/src/MessageBag.php b/src/contract/src/MessageBag.php index 4da9cdc88..996f2fa49 100644 --- a/src/contract/src/MessageBag.php +++ b/src/contract/src/MessageBag.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface MessageBag diff --git a/src/contract/src/MessageProvider.php b/src/contract/src/MessageProvider.php index 9242a96ee..05ba7e55c 100644 --- a/src/contract/src/MessageProvider.php +++ b/src/contract/src/MessageProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface MessageProvider diff --git a/src/contract/src/MiddlewareInitializerInterface.php b/src/contract/src/MiddlewareInitializerInterface.php index 6de3fd63d..63e23a082 100644 --- a/src/contract/src/MiddlewareInitializerInterface.php +++ b/src/contract/src/MiddlewareInitializerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface MiddlewareInitializerInterface diff --git a/src/contract/src/NormalizerInterface.php b/src/contract/src/NormalizerInterface.php index e9dfe7f2a..db76d44f6 100644 --- a/src/contract/src/NormalizerInterface.php +++ b/src/contract/src/NormalizerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use ArrayObject; diff --git a/src/contract/src/OnCloseInterface.php b/src/contract/src/OnCloseInterface.php index f06d1bf8c..ed92cb45a 100644 --- a/src/contract/src/OnCloseInterface.php +++ b/src/contract/src/OnCloseInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Swoole\Http\Response; diff --git a/src/contract/src/OnHandShakeInterface.php b/src/contract/src/OnHandShakeInterface.php index 42054041b..4b0faaec2 100644 --- a/src/contract/src/OnHandShakeInterface.php +++ b/src/contract/src/OnHandShakeInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Swoole\Http\Request; diff --git a/src/contract/src/OnMessageInterface.php b/src/contract/src/OnMessageInterface.php index 506022955..cbd2dbbdd 100644 --- a/src/contract/src/OnMessageInterface.php +++ b/src/contract/src/OnMessageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Swoole\Http\Response; diff --git a/src/contract/src/OnOpenInterface.php b/src/contract/src/OnOpenInterface.php index 13677647c..0f87033d7 100644 --- a/src/contract/src/OnOpenInterface.php +++ b/src/contract/src/OnOpenInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Swoole\Http\Request; diff --git a/src/contract/src/OnPacketInterface.php b/src/contract/src/OnPacketInterface.php index 3cef99546..15b1ac971 100644 --- a/src/contract/src/OnPacketInterface.php +++ b/src/contract/src/OnPacketInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Swoole\WebSocket\Server; diff --git a/src/contract/src/OnReceiveInterface.php b/src/contract/src/OnReceiveInterface.php index af6d65e7a..c16dde7a8 100644 --- a/src/contract/src/OnReceiveInterface.php +++ b/src/contract/src/OnReceiveInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Hyperf\Server\Connection as HyperfConnection; diff --git a/src/contract/src/OnRequestInterface.php b/src/contract/src/OnRequestInterface.php index a9dd4478c..5a81f075b 100644 --- a/src/contract/src/OnRequestInterface.php +++ b/src/contract/src/OnRequestInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface OnRequestInterface diff --git a/src/contract/src/PackerInterface.php b/src/contract/src/PackerInterface.php index 23ee2e3a3..26794bec4 100644 --- a/src/contract/src/PackerInterface.php +++ b/src/contract/src/PackerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface PackerInterface diff --git a/src/contract/src/PaginatorInterface.php b/src/contract/src/PaginatorInterface.php index cb16029c2..72ff113da 100644 --- a/src/contract/src/PaginatorInterface.php +++ b/src/contract/src/PaginatorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface PaginatorInterface diff --git a/src/contract/src/PoolInterface.php b/src/contract/src/PoolInterface.php index d330afa26..8853dcd4c 100644 --- a/src/contract/src/PoolInterface.php +++ b/src/contract/src/PoolInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface PoolInterface diff --git a/src/contract/src/PoolOptionInterface.php b/src/contract/src/PoolOptionInterface.php index cf5f29c88..ab5ec355b 100644 --- a/src/contract/src/PoolOptionInterface.php +++ b/src/contract/src/PoolOptionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface PoolOptionInterface diff --git a/src/contract/src/ProcessInterface.php b/src/contract/src/ProcessInterface.php index 830353fb3..5dac4e00b 100644 --- a/src/contract/src/ProcessInterface.php +++ b/src/contract/src/ProcessInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Swoole\Coroutine\Http\Server as CoHttpServer; diff --git a/src/contract/src/ResponseEmitterInterface.php b/src/contract/src/ResponseEmitterInterface.php index 6c9a02033..6db1a5508 100644 --- a/src/contract/src/ResponseEmitterInterface.php +++ b/src/contract/src/ResponseEmitterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Psr\Http\Message\ResponseInterface; diff --git a/src/contract/src/SessionInterface.php b/src/contract/src/SessionInterface.php index 4e419eb8f..659bc737e 100644 --- a/src/contract/src/SessionInterface.php +++ b/src/contract/src/SessionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use RuntimeException; diff --git a/src/contract/src/StdoutLoggerInterface.php b/src/contract/src/StdoutLoggerInterface.php index f4f234e17..bf834794d 100644 --- a/src/contract/src/StdoutLoggerInterface.php +++ b/src/contract/src/StdoutLoggerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Psr\Log\LoggerInterface; diff --git a/src/contract/src/Synchronized.php b/src/contract/src/Synchronized.php index 46a2a8f8a..f4afb2568 100644 --- a/src/contract/src/Synchronized.php +++ b/src/contract/src/Synchronized.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface Synchronized diff --git a/src/contract/src/TranslatorInterface.php b/src/contract/src/TranslatorInterface.php index 78b823dfa..596176da7 100644 --- a/src/contract/src/TranslatorInterface.php +++ b/src/contract/src/TranslatorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Countable; diff --git a/src/contract/src/TranslatorLoaderInterface.php b/src/contract/src/TranslatorLoaderInterface.php index 052a09b6c..19ec2711c 100644 --- a/src/contract/src/TranslatorLoaderInterface.php +++ b/src/contract/src/TranslatorLoaderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface TranslatorLoaderInterface diff --git a/src/contract/src/UnCompressInterface.php b/src/contract/src/UnCompressInterface.php index 20e07966b..7a1685343 100644 --- a/src/contract/src/UnCompressInterface.php +++ b/src/contract/src/UnCompressInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface UnCompressInterface diff --git a/src/contract/src/ValidatorInterface.php b/src/contract/src/ValidatorInterface.php index 84ca731e2..c6b7d38f1 100644 --- a/src/contract/src/ValidatorInterface.php +++ b/src/contract/src/ValidatorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; interface ValidatorInterface extends MessageProvider diff --git a/src/contract/src/Xmlable.php b/src/contract/src/Xmlable.php index a3449cf15..4bd200084 100644 --- a/src/contract/src/Xmlable.php +++ b/src/contract/src/Xmlable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Contract; use Stringable; diff --git a/src/coordinator/src/Constants.php b/src/coordinator/src/Constants.php index 44acf2481..4959f0f22 100644 --- a/src/coordinator/src/Constants.php +++ b/src/coordinator/src/Constants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coordinator; class Constants diff --git a/src/coordinator/src/Coordinator.php b/src/coordinator/src/Coordinator.php index fb857a2f8..9d2c8fb57 100644 --- a/src/coordinator/src/Coordinator.php +++ b/src/coordinator/src/Coordinator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coordinator; use Hyperf\Engine\Channel; diff --git a/src/coordinator/src/CoordinatorManager.php b/src/coordinator/src/CoordinatorManager.php index 86a7de898..771556ba1 100644 --- a/src/coordinator/src/CoordinatorManager.php +++ b/src/coordinator/src/CoordinatorManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coordinator; use RuntimeException; diff --git a/src/coordinator/src/Listener/ResumeExitCoordinatorListener.php b/src/coordinator/src/Listener/ResumeExitCoordinatorListener.php index 7d6282a2b..bb1a51414 100644 --- a/src/coordinator/src/Listener/ResumeExitCoordinatorListener.php +++ b/src/coordinator/src/Listener/ResumeExitCoordinatorListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coordinator\Listener; use Hyperf\Command\Event\AfterExecute; diff --git a/src/coordinator/src/Timer.php b/src/coordinator/src/Timer.php index d6095f189..05b075f0b 100644 --- a/src/coordinator/src/Timer.php +++ b/src/coordinator/src/Timer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coordinator; use Psr\Log\LoggerInterface; diff --git a/src/coordinator/tests/CoordinatorTest.php b/src/coordinator/tests/CoordinatorTest.php index 2f661a584..d44fdd387 100644 --- a/src/coordinator/tests/CoordinatorTest.php +++ b/src/coordinator/tests/CoordinatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coordinator; use Hyperf\Coordinator\Coordinator; diff --git a/src/coordinator/tests/TimerTest.php b/src/coordinator/tests/TimerTest.php index feab37011..fc6168b85 100644 --- a/src/coordinator/tests/TimerTest.php +++ b/src/coordinator/tests/TimerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coordinator; use Closure; diff --git a/src/coroutine/src/Channel/Caller.php b/src/coroutine/src/Channel/Caller.php index b4ecbbc38..245da997b 100644 --- a/src/coroutine/src/Channel/Caller.php +++ b/src/coroutine/src/Channel/Caller.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Channel; use Closure; diff --git a/src/coroutine/src/Channel/Manager.php b/src/coroutine/src/Channel/Manager.php index 7ff85b92a..7ec46464f 100644 --- a/src/coroutine/src/Channel/Manager.php +++ b/src/coroutine/src/Channel/Manager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Channel; use Hyperf\Engine\Channel; diff --git a/src/coroutine/src/Channel/Pool.php b/src/coroutine/src/Channel/Pool.php index 43da649b2..d64f4632e 100644 --- a/src/coroutine/src/Channel/Pool.php +++ b/src/coroutine/src/Channel/Pool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Channel; use Hyperf\Engine\Channel; diff --git a/src/coroutine/src/Concurrent.php b/src/coroutine/src/Concurrent.php index c66a14b69..968a43bf4 100644 --- a/src/coroutine/src/Concurrent.php +++ b/src/coroutine/src/Concurrent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use Hyperf\Context\ApplicationContext; diff --git a/src/coroutine/src/Coroutine.php b/src/coroutine/src/Coroutine.php index 39ad513ff..a65dfb2a7 100644 --- a/src/coroutine/src/Coroutine.php +++ b/src/coroutine/src/Coroutine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use Hyperf\Context\ApplicationContext; @@ -84,7 +85,7 @@ class Coroutine try { return $coroutine->getId(); - } catch (\Throwable) { + } catch (Throwable) { return -1; } } diff --git a/src/coroutine/src/Exception/ChannelClosedException.php b/src/coroutine/src/Exception/ChannelClosedException.php index a90c44469..d3529189e 100644 --- a/src/coroutine/src/Exception/ChannelClosedException.php +++ b/src/coroutine/src/Exception/ChannelClosedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Exception; use RuntimeException; diff --git a/src/coroutine/src/Exception/ExceptionThrower.php b/src/coroutine/src/Exception/ExceptionThrower.php index 5b2f94ee5..4568efced 100644 --- a/src/coroutine/src/Exception/ExceptionThrower.php +++ b/src/coroutine/src/Exception/ExceptionThrower.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Exception; use Throwable; diff --git a/src/coroutine/src/Exception/InvalidArgumentException.php b/src/coroutine/src/Exception/InvalidArgumentException.php index c9b8614f8..0676d7161 100644 --- a/src/coroutine/src/Exception/InvalidArgumentException.php +++ b/src/coroutine/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/coroutine/src/Exception/ParallelExecutionException.php b/src/coroutine/src/Exception/ParallelExecutionException.php index c674dca48..304a43db4 100644 --- a/src/coroutine/src/Exception/ParallelExecutionException.php +++ b/src/coroutine/src/Exception/ParallelExecutionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Exception; use RuntimeException; diff --git a/src/coroutine/src/Exception/TimeoutException.php b/src/coroutine/src/Exception/TimeoutException.php index fae85761e..77e353c63 100644 --- a/src/coroutine/src/Exception/TimeoutException.php +++ b/src/coroutine/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Exception; use RuntimeException; diff --git a/src/coroutine/src/Exception/WaitTimeoutException.php b/src/coroutine/src/Exception/WaitTimeoutException.php index 839323185..1ad129608 100644 --- a/src/coroutine/src/Exception/WaitTimeoutException.php +++ b/src/coroutine/src/Exception/WaitTimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine\Exception; class WaitTimeoutException extends TimeoutException diff --git a/src/coroutine/src/Functions.php b/src/coroutine/src/Functions.php index e4c97ac95..aafaf8e12 100644 --- a/src/coroutine/src/Functions.php +++ b/src/coroutine/src/Functions.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use Closure; use Hyperf\Context\ApplicationContext; use RuntimeException; +use Swoole\Runtime; /** * @param callable[] $callables @@ -65,11 +67,11 @@ function run($callbacks, int $flags = SWOOLE_HOOK_ALL): bool throw new RuntimeException('Function \'run\' only execute in non-coroutine environment.'); } - \Swoole\Runtime::enableCoroutine($flags); + Runtime::enableCoroutine($flags); /* @phpstan-ignore-next-line */ $result = \Swoole\Coroutine\run(...(array) $callbacks); - \Swoole\Runtime::enableCoroutine(false); + Runtime::enableCoroutine(false); return $result; } diff --git a/src/coroutine/src/Locker.php b/src/coroutine/src/Locker.php index b8deaa2cc..3d59473c8 100644 --- a/src/coroutine/src/Locker.php +++ b/src/coroutine/src/Locker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use Hyperf\Engine\Channel; diff --git a/src/coroutine/src/Parallel.php b/src/coroutine/src/Parallel.php index 22d408358..14f464a2b 100644 --- a/src/coroutine/src/Parallel.php +++ b/src/coroutine/src/Parallel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use Hyperf\Coroutine\Exception\ParallelExecutionException; diff --git a/src/coroutine/src/WaitGroup.php b/src/coroutine/src/WaitGroup.php index 67837d998..fa1fa0cd1 100644 --- a/src/coroutine/src/WaitGroup.php +++ b/src/coroutine/src/WaitGroup.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use BadMethodCallException; diff --git a/src/coroutine/src/Waiter.php b/src/coroutine/src/Waiter.php index 7d41ed04c..febb0ec96 100644 --- a/src/coroutine/src/Waiter.php +++ b/src/coroutine/src/Waiter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Coroutine; use Closure; diff --git a/src/coroutine/tests/Channel/CallerTest.php b/src/coroutine/tests/Channel/CallerTest.php index bb390f426..9a480ac95 100644 --- a/src/coroutine/tests/Channel/CallerTest.php +++ b/src/coroutine/tests/Channel/CallerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine\Channel; use Hyperf\Coroutine\Channel\Caller; diff --git a/src/coroutine/tests/Channel/ChannelManagerTest.php b/src/coroutine/tests/Channel/ChannelManagerTest.php index 2a34074ce..19c830f58 100644 --- a/src/coroutine/tests/Channel/ChannelManagerTest.php +++ b/src/coroutine/tests/Channel/ChannelManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine\Channel; use Hyperf\Coroutine\Channel\Manager as ChannelManager; diff --git a/src/coroutine/tests/ConcurrentTest.php b/src/coroutine/tests/ConcurrentTest.php index 928694503..9b5168b86 100644 --- a/src/coroutine/tests/ConcurrentTest.php +++ b/src/coroutine/tests/ConcurrentTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Exception; diff --git a/src/coroutine/tests/ContainerTest.php b/src/coroutine/tests/ContainerTest.php index d585df261..6943fcfdc 100644 --- a/src/coroutine/tests/ContainerTest.php +++ b/src/coroutine/tests/ContainerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use HyperfTest\Coroutine\Stub\Bar; diff --git a/src/coroutine/tests/CoroutineTest.php b/src/coroutine/tests/CoroutineTest.php index 6498284c7..a8c67dc95 100644 --- a/src/coroutine/tests/CoroutineTest.php +++ b/src/coroutine/tests/CoroutineTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Exception; @@ -20,6 +21,7 @@ use Hyperf\Engine\Exception\CoroutineDestroyedException; use Hyperf\ExceptionHandler\Formatter\FormatterInterface; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Throwable; @@ -70,7 +72,7 @@ class CoroutineTest extends TestCase } } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testCoroutineInTopCoroutine() { run(function () { diff --git a/src/coroutine/tests/FunctionTest.php b/src/coroutine/tests/FunctionTest.php index 342f6871d..b1dcc6c21 100644 --- a/src/coroutine/tests/FunctionTest.php +++ b/src/coroutine/tests/FunctionTest.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Hyperf\Coroutine\Coroutine; use Hyperf\Engine\Channel; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Swoole\Runtime; @@ -40,7 +42,7 @@ class FunctionTest extends TestCase $this->assertSame('Hyperf', $uniqid); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testRun() { $asserts = [ diff --git a/src/coroutine/tests/LockerTest.php b/src/coroutine/tests/LockerTest.php index e20cc7633..91fc2a853 100644 --- a/src/coroutine/tests/LockerTest.php +++ b/src/coroutine/tests/LockerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Hyperf\Coroutine\Locker; diff --git a/src/coroutine/tests/ParallelTest.php b/src/coroutine/tests/ParallelTest.php index f26716191..00d74759a 100644 --- a/src/coroutine/tests/ParallelTest.php +++ b/src/coroutine/tests/ParallelTest.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Exception; use Hyperf\Coroutine\Coroutine; use Hyperf\Coroutine\Exception\ParallelExecutionException; use Hyperf\Coroutine\Parallel; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use RuntimeException; use Throwable; @@ -25,7 +27,7 @@ use function Hyperf\Coroutine\parallel; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Coroutine\Parallel::class)] +#[CoversClass(Parallel::class)] class ParallelTest extends TestCase { public function testParallel() diff --git a/src/coroutine/tests/Stub/Bar.php b/src/coroutine/tests/Stub/Bar.php index 0f66e10a4..e59fae58d 100644 --- a/src/coroutine/tests/Stub/Bar.php +++ b/src/coroutine/tests/Stub/Bar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine\Stub; use Hyperf\Support\Traits\Container; diff --git a/src/coroutine/tests/Stub/Foo.php b/src/coroutine/tests/Stub/Foo.php index bf9d907d0..192764c7f 100644 --- a/src/coroutine/tests/Stub/Foo.php +++ b/src/coroutine/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine\Stub; use Hyperf\Support\Traits\Container; diff --git a/src/coroutine/tests/WaitGroupTest.php b/src/coroutine/tests/WaitGroupTest.php index 7670d01d5..09f57aa42 100644 --- a/src/coroutine/tests/WaitGroupTest.php +++ b/src/coroutine/tests/WaitGroupTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Hyperf\Coroutine\WaitGroup; diff --git a/src/coroutine/tests/WaiterTest.php b/src/coroutine/tests/WaiterTest.php index 5f93850af..f81268cad 100644 --- a/src/coroutine/tests/WaiterTest.php +++ b/src/coroutine/tests/WaiterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Coroutine; use Hyperf\Context\ApplicationContext; diff --git a/src/crontab/src/Annotation/Crontab.php b/src/crontab/src/Annotation/Crontab.php index 5e2217f90..cc9d77f36 100644 --- a/src/crontab/src/Annotation/Crontab.php +++ b/src/crontab/src/Annotation/Crontab.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Annotation; use Attribute; @@ -29,9 +30,9 @@ class Crontab extends AbstractAnnotation public ?string $mutexPool = null, public ?int $mutexExpires = null, public ?bool $onOneServer = null, - public array|string|null $callback = null, + public null|array|string $callback = null, public ?string $memo = null, - public array|string|bool $enable = true, + public array|bool|string $enable = true, public ?string $timezone = null, public array|string $environments = [], public array $options = [], diff --git a/src/crontab/src/Command/RunCommand.php b/src/crontab/src/Command/RunCommand.php index 59a572631..28eaa4138 100644 --- a/src/crontab/src/Command/RunCommand.php +++ b/src/crontab/src/Command/RunCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Command; use Hyperf\Command\Command; diff --git a/src/crontab/src/ConfigProvider.php b/src/crontab/src/ConfigProvider.php index 4372688c8..b7ea24dd4 100644 --- a/src/crontab/src/ConfigProvider.php +++ b/src/crontab/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; use Hyperf\Crontab\Command\RunCommand; diff --git a/src/crontab/src/Crontab.php b/src/crontab/src/Crontab.php index 00387e2dc..0e9dad63c 100644 --- a/src/crontab/src/Crontab.php +++ b/src/crontab/src/Crontab.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; use Carbon\Carbon; @@ -43,7 +44,7 @@ class Crontab protected bool $enable = true; - protected null|string|DateTimeZone $timezone = null; + protected null|DateTimeZone|string $timezone = null; protected ?Channel $running = null; @@ -221,7 +222,7 @@ class Crontab return $this->timezone; } - public function setTimezone(string|DateTimeZone $timezone): static + public function setTimezone(DateTimeZone|string $timezone): static { $this->timezone = $timezone; return $this; diff --git a/src/crontab/src/CrontabManager.php b/src/crontab/src/CrontabManager.php index 6e7836009..ca63e1658 100644 --- a/src/crontab/src/CrontabManager.php +++ b/src/crontab/src/CrontabManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; class CrontabManager diff --git a/src/crontab/src/Event/AfterExecute.php b/src/crontab/src/Event/AfterExecute.php index 62952c034..54c332f6f 100644 --- a/src/crontab/src/Event/AfterExecute.php +++ b/src/crontab/src/Event/AfterExecute.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Event; class AfterExecute extends Event diff --git a/src/crontab/src/Event/BeforeExecute.php b/src/crontab/src/Event/BeforeExecute.php index 1c5a9cfaa..e740eff51 100644 --- a/src/crontab/src/Event/BeforeExecute.php +++ b/src/crontab/src/Event/BeforeExecute.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Event; class BeforeExecute extends Event diff --git a/src/crontab/src/Event/CrontabDispatcherStarted.php b/src/crontab/src/Event/CrontabDispatcherStarted.php index 5b0629abd..f0a0edd14 100644 --- a/src/crontab/src/Event/CrontabDispatcherStarted.php +++ b/src/crontab/src/Event/CrontabDispatcherStarted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Event; class CrontabDispatcherStarted diff --git a/src/crontab/src/Event/Event.php b/src/crontab/src/Event/Event.php index d92fd3799..f8422618c 100644 --- a/src/crontab/src/Event/Event.php +++ b/src/crontab/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Event; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/src/Event/FailToExecute.php b/src/crontab/src/Event/FailToExecute.php index b0a089887..8b98062f9 100644 --- a/src/crontab/src/Event/FailToExecute.php +++ b/src/crontab/src/Event/FailToExecute.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Event; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/src/Exception/InvalidArgumentException.php b/src/crontab/src/Exception/InvalidArgumentException.php index 03da5fa99..6fe6ab3fc 100644 --- a/src/crontab/src/Exception/InvalidArgumentException.php +++ b/src/crontab/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/crontab/src/Listener/CrontabRegisterListener.php b/src/crontab/src/Listener/CrontabRegisterListener.php index b65d7149e..b93ba075f 100644 --- a/src/crontab/src/Listener/CrontabRegisterListener.php +++ b/src/crontab/src/Listener/CrontabRegisterListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Listener; use Hyperf\Context\ApplicationContext; diff --git a/src/crontab/src/Listener/OnPipeMessageListener.php b/src/crontab/src/Listener/OnPipeMessageListener.php index 13d8946a8..12549601a 100644 --- a/src/crontab/src/Listener/OnPipeMessageListener.php +++ b/src/crontab/src/Listener/OnPipeMessageListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Listener; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/crontab/src/LoggerInterface.php b/src/crontab/src/LoggerInterface.php index f68983d02..2859fd8a8 100644 --- a/src/crontab/src/LoggerInterface.php +++ b/src/crontab/src/LoggerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; interface LoggerInterface extends \Psr\Log\LoggerInterface diff --git a/src/crontab/src/ManagesFrequencies.php b/src/crontab/src/ManagesFrequencies.php index 9acdb3a08..b292d9c2a 100644 --- a/src/crontab/src/ManagesFrequencies.php +++ b/src/crontab/src/ManagesFrequencies.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; use Carbon\Carbon; diff --git a/src/crontab/src/Mutex/RedisServerMutex.php b/src/crontab/src/Mutex/RedisServerMutex.php index f8d45e52b..a0f15411c 100644 --- a/src/crontab/src/Mutex/RedisServerMutex.php +++ b/src/crontab/src/Mutex/RedisServerMutex.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Mutex; use Hyperf\Collection\Arr; @@ -25,7 +26,7 @@ class RedisServerMutex implements ServerMutex /** * The unique name for node, like mac address. */ - private null|string $macAddress; + private ?string $macAddress; private Timer $timer; diff --git a/src/crontab/src/Mutex/RedisTaskMutex.php b/src/crontab/src/Mutex/RedisTaskMutex.php index acc4f70c6..fb479e3bb 100644 --- a/src/crontab/src/Mutex/RedisTaskMutex.php +++ b/src/crontab/src/Mutex/RedisTaskMutex.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Mutex; use Hyperf\Coordinator\Timer; diff --git a/src/crontab/src/Mutex/ServerMutex.php b/src/crontab/src/Mutex/ServerMutex.php index 4fe613eb5..b0c60f107 100644 --- a/src/crontab/src/Mutex/ServerMutex.php +++ b/src/crontab/src/Mutex/ServerMutex.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Mutex; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/src/Mutex/ServerNodeInterface.php b/src/crontab/src/Mutex/ServerNodeInterface.php index daafa5317..5d7cb8c9a 100644 --- a/src/crontab/src/Mutex/ServerNodeInterface.php +++ b/src/crontab/src/Mutex/ServerNodeInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Mutex; interface ServerNodeInterface diff --git a/src/crontab/src/Mutex/TaskMutex.php b/src/crontab/src/Mutex/TaskMutex.php index 9e6b07eb3..f5166bace 100644 --- a/src/crontab/src/Mutex/TaskMutex.php +++ b/src/crontab/src/Mutex/TaskMutex.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Mutex; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/src/Parser.php b/src/crontab/src/Parser.php index e2cc33c1d..ec2625449 100644 --- a/src/crontab/src/Parser.php +++ b/src/crontab/src/Parser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; use Carbon\Carbon; @@ -36,7 +37,7 @@ class Parser * @return Carbon[] * @throws InvalidArgumentException */ - public function parse(string $crontabString, $startTime = null, null|string|DateTimeZone $timezone = null): array + public function parse(string $crontabString, $startTime = null, null|DateTimeZone|string $timezone = null): array { if (! $this->isValid($crontabString)) { throw new InvalidArgumentException('Invalid cron string: ' . $crontabString); diff --git a/src/crontab/src/PipeMessage.php b/src/crontab/src/PipeMessage.php index 13482a7df..bb90046e3 100644 --- a/src/crontab/src/PipeMessage.php +++ b/src/crontab/src/PipeMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; class PipeMessage diff --git a/src/crontab/src/Process/CrontabDispatcherProcess.php b/src/crontab/src/Process/CrontabDispatcherProcess.php index 98d514b0a..e85ba36b9 100644 --- a/src/crontab/src/Process/CrontabDispatcherProcess.php +++ b/src/crontab/src/Process/CrontabDispatcherProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Process; use Hyperf\Contract\ConfigInterface; diff --git a/src/crontab/src/Schedule.php b/src/crontab/src/Schedule.php index 717e34f4b..c85969ce3 100644 --- a/src/crontab/src/Schedule.php +++ b/src/crontab/src/Schedule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; use Closure; diff --git a/src/crontab/src/Scheduler.php b/src/crontab/src/Scheduler.php index 509eeb4c5..f827771c0 100644 --- a/src/crontab/src/Scheduler.php +++ b/src/crontab/src/Scheduler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab; use SplQueue; diff --git a/src/crontab/src/Strategy/AbstractStrategy.php b/src/crontab/src/Strategy/AbstractStrategy.php index 89cc96275..125485ddb 100644 --- a/src/crontab/src/Strategy/AbstractStrategy.php +++ b/src/crontab/src/Strategy/AbstractStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Psr\Container\ContainerInterface; diff --git a/src/crontab/src/Strategy/CoroutineStrategy.php b/src/crontab/src/Strategy/CoroutineStrategy.php index 1fae28195..3f12eab40 100644 --- a/src/crontab/src/Strategy/CoroutineStrategy.php +++ b/src/crontab/src/Strategy/CoroutineStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Hyperf\Coroutine\Coroutine; diff --git a/src/crontab/src/Strategy/Executor.php b/src/crontab/src/Strategy/Executor.php index edb74bf1d..bab0d6a0d 100644 --- a/src/crontab/src/Strategy/Executor.php +++ b/src/crontab/src/Strategy/Executor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Carbon\Carbon; @@ -28,6 +29,7 @@ use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Log\LoggerInterface as PsrLoggerInterface; use RuntimeException; +use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; use Throwable; @@ -86,7 +88,7 @@ class Executor case 'command': $input = make(ArrayInput::class, [$crontab->getCallback()]); $output = make(NullOutput::class); - /** @var \Symfony\Component\Console\Application */ + /** @var Application */ $application = $this->container->get(ApplicationInterface::class); $application->setAutoExit(false); $application->setCatchExceptions(false); diff --git a/src/crontab/src/Strategy/ProcessStrategy.php b/src/crontab/src/Strategy/ProcessStrategy.php index be7f3f0de..a519ed809 100644 --- a/src/crontab/src/Strategy/ProcessStrategy.php +++ b/src/crontab/src/Strategy/ProcessStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Swoole\Server; diff --git a/src/crontab/src/Strategy/StrategyInterface.php b/src/crontab/src/Strategy/StrategyInterface.php index e5e899ead..541890f4b 100644 --- a/src/crontab/src/Strategy/StrategyInterface.php +++ b/src/crontab/src/Strategy/StrategyInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/src/Strategy/TaskWorkerStrategy.php b/src/crontab/src/Strategy/TaskWorkerStrategy.php index 6f0b6869d..21e222d91 100644 --- a/src/crontab/src/Strategy/TaskWorkerStrategy.php +++ b/src/crontab/src/Strategy/TaskWorkerStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Swoole\Server; diff --git a/src/crontab/src/Strategy/WorkerStrategy.php b/src/crontab/src/Strategy/WorkerStrategy.php index dd0dab37e..546fcf346 100644 --- a/src/crontab/src/Strategy/WorkerStrategy.php +++ b/src/crontab/src/Strategy/WorkerStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Strategy; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/crontab/tests/CrontabAnnotationTest.php b/src/crontab/tests/CrontabAnnotationTest.php index 1bfef6e8f..416e48b75 100644 --- a/src/crontab/tests/CrontabAnnotationTest.php +++ b/src/crontab/tests/CrontabAnnotationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Crontab\Annotation\Crontab; diff --git a/src/crontab/tests/CrontabManagerTest.php b/src/crontab/tests/CrontabManagerTest.php index ac57120eb..9e013ceb6 100644 --- a/src/crontab/tests/CrontabManagerTest.php +++ b/src/crontab/tests/CrontabManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/tests/CrontabRegisterListenerTest.php b/src/crontab/tests/CrontabRegisterListenerTest.php index 944cd3566..ff18c025a 100644 --- a/src/crontab/tests/CrontabRegisterListenerTest.php +++ b/src/crontab/tests/CrontabRegisterListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Config\Config; diff --git a/src/crontab/tests/CrontabTest.php b/src/crontab/tests/CrontabTest.php index 9196b2029..2212fe381 100644 --- a/src/crontab/tests/CrontabTest.php +++ b/src/crontab/tests/CrontabTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Crontab\Crontab; diff --git a/src/crontab/tests/DispatcherTest.php b/src/crontab/tests/DispatcherTest.php index b80daa42d..41a26de93 100644 --- a/src/crontab/tests/DispatcherTest.php +++ b/src/crontab/tests/DispatcherTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Context\ApplicationContext; diff --git a/src/crontab/tests/ExecutorTest.php b/src/crontab/tests/ExecutorTest.php index 8af2da2bd436b4c8cc1aadfd238f0c91ff7b5f49..c6edfa4ef09d7cee4e6f90eebdf8b2d62fbfce91 100644 GIT binary patch delta 10 RcmeyY^F?REyNz$#L;)h21@`~| delta 10 RcmeyO^I2!YyN&N#MFAq91^55} diff --git a/src/crontab/tests/FrequencyTest.php b/src/crontab/tests/FrequencyTest.php index fab3afd29..b8ae81e1e 100644 --- a/src/crontab/tests/FrequencyTest.php +++ b/src/crontab/tests/FrequencyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Carbon\Carbon; diff --git a/src/crontab/tests/ParserCronNumberTest.php b/src/crontab/tests/ParserCronNumberTest.php index 2c1fe00ee..4492617aa 100644 --- a/src/crontab/tests/ParserCronNumberTest.php +++ b/src/crontab/tests/ParserCronNumberTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Crontab\Parser; diff --git a/src/crontab/tests/ParserTest.php b/src/crontab/tests/ParserTest.php index 53a6d475f..caddf60ff 100644 --- a/src/crontab/tests/ParserTest.php +++ b/src/crontab/tests/ParserTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Carbon\Carbon; diff --git a/src/crontab/tests/SchedulerTest.php b/src/crontab/tests/SchedulerTest.php index 381916b56..1b728b74f 100644 --- a/src/crontab/tests/SchedulerTest.php +++ b/src/crontab/tests/SchedulerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab; use Hyperf\Crontab\CrontabManager; diff --git a/src/crontab/tests/Stub/FooCron.php b/src/crontab/tests/Stub/FooCron.php index f859b89bf..ddf0afd6b 100644 --- a/src/crontab/tests/Stub/FooCron.php +++ b/src/crontab/tests/Stub/FooCron.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab\Stub; use Hyperf\Contract\ConfigInterface; diff --git a/src/crontab/tests/Stub/FooCron2.php b/src/crontab/tests/Stub/FooCron2.php index 14ae00d66..f7dc34604 100644 --- a/src/crontab/tests/Stub/FooCron2.php +++ b/src/crontab/tests/Stub/FooCron2.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Crontab\Stub; class FooCron2 diff --git a/src/dag/src/Dag.php b/src/dag/src/Dag.php index 45ae38c37..ff0d16ba9 100644 --- a/src/dag/src/Dag.php +++ b/src/dag/src/Dag.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dag; use Hyperf\Coroutine\Concurrent; diff --git a/src/dag/src/Exception/InvalidArgumentException.php b/src/dag/src/Exception/InvalidArgumentException.php index 196dd639e..ef418fe5f 100644 --- a/src/dag/src/Exception/InvalidArgumentException.php +++ b/src/dag/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dag\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/dag/src/Runner.php b/src/dag/src/Runner.php index f98d363e8..85ff6b900 100644 --- a/src/dag/src/Runner.php +++ b/src/dag/src/Runner.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dag; interface Runner diff --git a/src/dag/src/Vertex.php b/src/dag/src/Vertex.php index 5445fcfda..6753fe9c6 100644 --- a/src/dag/src/Vertex.php +++ b/src/dag/src/Vertex.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dag; use Closure; diff --git a/src/dag/tests/DagTest.php b/src/dag/tests/DagTest.php index 136b20d3d..39d453c2f 100644 --- a/src/dag/tests/DagTest.php +++ b/src/dag/tests/DagTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Dag; use Hyperf\Coroutine\Coroutine; @@ -29,31 +30,31 @@ class DagTest extends TestCase { $dag = new Dag(); $chan = new Channel(1); - $a = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $a = Vertex::make(function () use ($chan) { $chan->push('A'); }); - $b = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $b = Vertex::make(function () use ($chan) { $chan->push('B'); }); - $c = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $c = Vertex::make(function () use ($chan) { $chan->push('C'); }); - $d = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $d = Vertex::make(function () use ($chan) { $chan->push('D'); }); - $e = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $e = Vertex::make(function () use ($chan) { $chan->push('E'); }); - $f = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $f = Vertex::make(function () use ($chan) { $chan->push('F'); }); - $g = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $g = Vertex::make(function () use ($chan) { $chan->push('G'); }); - $h = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $h = Vertex::make(function () use ($chan) { $chan->push('H'); }); - $i = \Hyperf\Dag\Vertex::make(function () use ($chan) { + $i = Vertex::make(function () use ($chan) { $chan->push('I'); }); $dag->addVertex($a) @@ -237,16 +238,16 @@ class DagTest extends TestCase public function testCheckCircularDependences() { $key = 1; - $dag = new \Hyperf\Dag\Dag(); - $a = \Hyperf\Dag\Vertex::make(function () {echo "A\n"; }, (string) $key++); - $b = \Hyperf\Dag\Vertex::make(function () {echo "B\n"; }, (string) $key++); - $c = \Hyperf\Dag\Vertex::make(function () {echo "C\n"; }, (string) $key++); - $d = \Hyperf\Dag\Vertex::make(function () {echo "D\n"; }, (string) $key++); - $e = \Hyperf\Dag\Vertex::make(function () {echo "E\n"; }, (string) $key++); - $f = \Hyperf\Dag\Vertex::make(function () {echo "F\n"; }, (string) $key++); - $g = \Hyperf\Dag\Vertex::make(function () {echo "G\n"; }, (string) $key++); - $h = \Hyperf\Dag\Vertex::make(function () {echo "H\n"; }, (string) $key++); - $i = \Hyperf\Dag\Vertex::make(function () {echo "I\n"; }, (string) $key++); + $dag = new Dag(); + $a = Vertex::make(function () {echo "A\n"; }, (string) $key++); + $b = Vertex::make(function () {echo "B\n"; }, (string) $key++); + $c = Vertex::make(function () {echo "C\n"; }, (string) $key++); + $d = Vertex::make(function () {echo "D\n"; }, (string) $key++); + $e = Vertex::make(function () {echo "E\n"; }, (string) $key++); + $f = Vertex::make(function () {echo "F\n"; }, (string) $key++); + $g = Vertex::make(function () {echo "G\n"; }, (string) $key++); + $h = Vertex::make(function () {echo "H\n"; }, (string) $key++); + $i = Vertex::make(function () {echo "I\n"; }, (string) $key++); $dag->addVertex($a) ->addVertex($b) ->addVertex($c) diff --git a/src/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php b/src/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php index 136cfec38..ccaeb2222 100644 --- a/src/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php +++ b/src/database-pgsql/src/Concerns/PostgreSqlSwooleExtManagesTransactions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Concerns; use Closure; diff --git a/src/database-pgsql/src/ConfigProvider.php b/src/database-pgsql/src/ConfigProvider.php index 1cfce5184..ad3a1f696 100644 --- a/src/database-pgsql/src/ConfigProvider.php +++ b/src/database-pgsql/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL; use Hyperf\Database\PgSQL\Connectors\PostgresConnector; diff --git a/src/database-pgsql/src/Connectors/PostgresConnector.php b/src/database-pgsql/src/Connectors/PostgresConnector.php index 1113d1f02..e2d9f0177 100644 --- a/src/database-pgsql/src/Connectors/PostgresConnector.php +++ b/src/database-pgsql/src/Connectors/PostgresConnector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Connectors; use Hyperf\Database\Connectors\Connector; diff --git a/src/database-pgsql/src/Connectors/PostgresSqlSwooleExtConnector.php b/src/database-pgsql/src/Connectors/PostgresSqlSwooleExtConnector.php index 5089178db..bf98eed51 100644 --- a/src/database-pgsql/src/Connectors/PostgresSqlSwooleExtConnector.php +++ b/src/database-pgsql/src/Connectors/PostgresSqlSwooleExtConnector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Connectors; use Exception; diff --git a/src/database-pgsql/src/DBAL/Connection.php b/src/database-pgsql/src/DBAL/Connection.php index 1b0994f64..68248cdc6 100644 --- a/src/database-pgsql/src/DBAL/Connection.php +++ b/src/database-pgsql/src/DBAL/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\DBAL; use Doctrine\DBAL\Driver\Result as ResultInterface; diff --git a/src/database-pgsql/src/DBAL/Exception.php b/src/database-pgsql/src/DBAL/Exception.php index b3144ae5a..af00dfd86 100644 --- a/src/database-pgsql/src/DBAL/Exception.php +++ b/src/database-pgsql/src/DBAL/Exception.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\DBAL; use Doctrine\DBAL\Driver\Exception as DriverExceptionInterface; @@ -35,9 +36,6 @@ class Exception extends BaseException implements DriverExceptionInterface $this->sqlState = $sqlState; } - /** - * {@inheritdoc} - */ public function getSQLState() { return $this->sqlState; diff --git a/src/database-pgsql/src/DBAL/PostgresDriver.php b/src/database-pgsql/src/DBAL/PostgresDriver.php index 9ec139ed0..55548edbc 100644 --- a/src/database-pgsql/src/DBAL/PostgresDriver.php +++ b/src/database-pgsql/src/DBAL/PostgresDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\DBAL; use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver; diff --git a/src/database-pgsql/src/DBAL/Result.php b/src/database-pgsql/src/DBAL/Result.php index bfb01e952..ce3d13e24 100644 --- a/src/database-pgsql/src/DBAL/Result.php +++ b/src/database-pgsql/src/DBAL/Result.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\DBAL; use Doctrine\DBAL\Driver\Result as ResultInterface; @@ -20,19 +21,16 @@ final class Result implements ResultInterface { } - /** {@inheritdoc} */ public function fetchNumeric() { return $this->result->fetchArray(result_type: SW_PGSQL_NUM); } - /** {@inheritdoc} */ public function fetchAssociative() { return $this->result->fetchAssoc(); } - /** {@inheritdoc} */ public function fetchOne() { $row = $this->fetchNumeric(); @@ -43,19 +41,16 @@ final class Result implements ResultInterface return $row[0]; } - /** {@inheritdoc} */ public function fetchAllNumeric(): array { return $this->result->fetchAll(SW_PGSQL_NUM); } - /** {@inheritdoc} */ public function fetchAllAssociative(): array { return $this->result->fetchAll(SW_PGSQL_ASSOC); } - /** {@inheritdoc} */ public function fetchFirstColumn(): array { $resultSet = $this->result->fetchAll(SW_PGSQL_NUM); diff --git a/src/database-pgsql/src/DBAL/Statement.php b/src/database-pgsql/src/DBAL/Statement.php index cd1ee0860..1cc2e7df9 100644 --- a/src/database-pgsql/src/DBAL/Statement.php +++ b/src/database-pgsql/src/DBAL/Statement.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\DBAL; use Doctrine\DBAL\Driver\Statement as StatementInterface; @@ -25,21 +26,18 @@ final class Statement implements StatementInterface { } - /** {@inheritdoc} */ public function bindValue($param, $value, $type = ParameterType::STRING): bool { $this->parameters[$param] = $value; return true; } - /** {@inheritdoc} */ public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null): bool { $this->parameters[$param] = &$variable; return true; } - /** {@inheritdoc} */ public function execute($params = null): Result { if (! empty($params)) { diff --git a/src/database-pgsql/src/Listener/RegisterConnectionListener.php b/src/database-pgsql/src/Listener/RegisterConnectionListener.php index 9c480c0d2..8a01f6aa6 100644 --- a/src/database-pgsql/src/Listener/RegisterConnectionListener.php +++ b/src/database-pgsql/src/Listener/RegisterConnectionListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Listener; use Hyperf\Database\Connection; diff --git a/src/database-pgsql/src/PostgreSqlConnection.php b/src/database-pgsql/src/PostgreSqlConnection.php index 4b8d74522..2bfda763c 100644 --- a/src/database-pgsql/src/PostgreSqlConnection.php +++ b/src/database-pgsql/src/PostgreSqlConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL; use Hyperf\Database\Connection; @@ -17,6 +18,7 @@ use Hyperf\Database\PgSQL\Query\Grammars\PostgresGrammar as QueryGrammar; use Hyperf\Database\PgSQL\Query\Processors\PostgresProcessor; use Hyperf\Database\PgSQL\Schema\Grammars\PostgresGrammar as SchemaGrammar; use Hyperf\Database\PgSQL\Schema\PostgresBuilder; +use Hyperf\Database\Query\Grammars\PostgresGrammar; use PDOStatement; class PostgreSqlConnection extends Connection @@ -48,7 +50,7 @@ class PostgreSqlConnection extends Connection /** * Get the default query grammar instance. - * @return \Hyperf\Database\Query\Grammars\PostgresGrammar + * @return PostgresGrammar */ protected function getDefaultQueryGrammar(): QueryGrammar { diff --git a/src/database-pgsql/src/PostgreSqlSwooleExtConnection.php b/src/database-pgsql/src/PostgreSqlSwooleExtConnection.php index 058bde70a..96e12321b 100644 --- a/src/database-pgsql/src/PostgreSqlSwooleExtConnection.php +++ b/src/database-pgsql/src/PostgreSqlSwooleExtConnection.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL; use Exception; use Generator; use Hyperf\Database\Connection; use Hyperf\Database\Exception\QueryException; +use Hyperf\Database\Grammar; use Hyperf\Database\PgSQL\Concerns\PostgreSqlSwooleExtManagesTransactions; use Hyperf\Database\PgSQL\DBAL\PostgresDriver; use Hyperf\Database\PgSQL\Query\Grammars\PostgresSqlSwooleExtGrammar as QueryGrammar; @@ -195,7 +197,7 @@ class PostgreSqlSwooleExtConnection extends Connection /** * Get the default query grammar instance. - * @return \Hyperf\Database\Grammar + * @return Grammar */ protected function getDefaultQueryGrammar(): QueryGrammar { diff --git a/src/database-pgsql/src/Query/Grammars/PostgresGrammar.php b/src/database-pgsql/src/Query/Grammars/PostgresGrammar.php index 388b32f51..0f5b9cf34 100644 --- a/src/database-pgsql/src/Query/Grammars/PostgresGrammar.php +++ b/src/database-pgsql/src/Query/Grammars/PostgresGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Query\Grammars; use Hyperf\Collection\Arr; @@ -198,8 +199,6 @@ class PostgresGrammar extends Grammar } /** - * {@inheritdoc} - * * @param array $where */ protected function whereBasic(Builder $query, $where): string diff --git a/src/database-pgsql/src/Query/Grammars/PostgresSqlSwooleExtGrammar.php b/src/database-pgsql/src/Query/Grammars/PostgresSqlSwooleExtGrammar.php index 46b48c87f..f78fae235 100644 --- a/src/database-pgsql/src/Query/Grammars/PostgresSqlSwooleExtGrammar.php +++ b/src/database-pgsql/src/Query/Grammars/PostgresSqlSwooleExtGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Query\Grammars; use Hyperf\Database\PgSQL\Query\Grammars\PostgresGrammar as QueryPostgresGrammar; diff --git a/src/database-pgsql/src/Query/Processors/PostgresProcessor.php b/src/database-pgsql/src/Query/Processors/PostgresProcessor.php index a3b0fd992..f4cae3e02 100644 --- a/src/database-pgsql/src/Query/Processors/PostgresProcessor.php +++ b/src/database-pgsql/src/Query/Processors/PostgresProcessor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Query\Processors; use Hyperf\Database\Query\Builder; diff --git a/src/database-pgsql/src/Schema/ForeignIdColumnDefinition.php b/src/database-pgsql/src/Schema/ForeignIdColumnDefinition.php index a076f1cfe..144ab4ea2 100644 --- a/src/database-pgsql/src/Schema/ForeignIdColumnDefinition.php +++ b/src/database-pgsql/src/Schema/ForeignIdColumnDefinition.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Schema; use Hyperf\Database\Schema\Blueprint; use Hyperf\Database\Schema\ColumnDefinition; +use Hyperf\Database\Schema\ForeignKeyDefinition; use Hyperf\Stringable\Str; class ForeignIdColumnDefinition extends ColumnDefinition @@ -39,7 +41,7 @@ class ForeignIdColumnDefinition extends ColumnDefinition * * @param null|string $table * @param string $column - * @return \Hyperf\Database\Schema\ForeignKeyDefinition + * @return ForeignKeyDefinition */ public function constrained($table = null, $column = 'id') { @@ -50,7 +52,7 @@ class ForeignIdColumnDefinition extends ColumnDefinition * Specify which column this foreign ID references on another table. * * @param string $column - * @return \Hyperf\Database\Schema\ForeignKeyDefinition + * @return ForeignKeyDefinition */ public function references($column) { diff --git a/src/database-pgsql/src/Schema/Grammars/PostgresGrammar.php b/src/database-pgsql/src/Schema/Grammars/PostgresGrammar.php index 75a3a0fd6..762c4ac02 100644 --- a/src/database-pgsql/src/Schema/Grammars/PostgresGrammar.php +++ b/src/database-pgsql/src/Schema/Grammars/PostgresGrammar.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Schema\Grammars; +use Hyperf\Database\Connection; use Hyperf\Database\Schema\Blueprint; use Hyperf\Database\Schema\Grammars\Grammar; use Hyperf\Support\Fluent; @@ -51,7 +53,7 @@ class PostgresGrammar extends Grammar * Compile a create database command. * * @param string $name - * @param \Hyperf\Database\Connection $connection + * @param Connection $connection */ public function compileCreateDatabase($name, $connection): string { diff --git a/src/database-pgsql/src/Schema/Grammars/PostgresSqlSwooleExtGrammar.php b/src/database-pgsql/src/Schema/Grammars/PostgresSqlSwooleExtGrammar.php index 51d44499c..ce1336026 100644 --- a/src/database-pgsql/src/Schema/Grammars/PostgresSqlSwooleExtGrammar.php +++ b/src/database-pgsql/src/Schema/Grammars/PostgresSqlSwooleExtGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Schema\Grammars; class PostgresSqlSwooleExtGrammar extends PostgresGrammar diff --git a/src/database-pgsql/src/Schema/PostgresBuilder.php b/src/database-pgsql/src/Schema/PostgresBuilder.php index b74602736..59f08e3f0 100644 --- a/src/database-pgsql/src/Schema/PostgresBuilder.php +++ b/src/database-pgsql/src/Schema/PostgresBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\PgSQL\Schema; use Hyperf\Database\PgSQL\Query\Processors\PostgresProcessor; diff --git a/src/database-pgsql/tests/Cases/DatabasePostgresBuilderTest.php b/src/database-pgsql/tests/Cases/DatabasePostgresBuilderTest.php index 4c551e76b..3fb122acb 100644 --- a/src/database-pgsql/tests/Cases/DatabasePostgresBuilderTest.php +++ b/src/database-pgsql/tests/Cases/DatabasePostgresBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Cases; use Hyperf\Database\Connection; diff --git a/src/database-pgsql/tests/Cases/DatabasePostgresProcessorTest.php b/src/database-pgsql/tests/Cases/DatabasePostgresProcessorTest.php index 0da9bf3b3..7be85c747 100644 --- a/src/database-pgsql/tests/Cases/DatabasePostgresProcessorTest.php +++ b/src/database-pgsql/tests/Cases/DatabasePostgresProcessorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Cases; use Hyperf\Database\PgSQL\Query\Processors\PostgresProcessor; diff --git a/src/database-pgsql/tests/Cases/DatabasePostgresQueryGrammarTest.php b/src/database-pgsql/tests/Cases/DatabasePostgresQueryGrammarTest.php index 29342e2ed..4f0beded6 100644 --- a/src/database-pgsql/tests/Cases/DatabasePostgresQueryGrammarTest.php +++ b/src/database-pgsql/tests/Cases/DatabasePostgresQueryGrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Cases; use Hyperf\Database\Connection; diff --git a/src/database-pgsql/tests/Cases/DatabasePostgresSchemaGrammarTest.php b/src/database-pgsql/tests/Cases/DatabasePostgresSchemaGrammarTest.php index 58662cf20..7800b3a09 100644 --- a/src/database-pgsql/tests/Cases/DatabasePostgresSchemaGrammarTest.php +++ b/src/database-pgsql/tests/Cases/DatabasePostgresSchemaGrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Cases; use Hyperf\Database\Connection; diff --git a/src/database-pgsql/tests/Cases/PostgreSqlProcessorTest.php b/src/database-pgsql/tests/Cases/PostgreSqlProcessorTest.php index 8450fc68e..de552b1f5 100644 --- a/src/database-pgsql/tests/Cases/PostgreSqlProcessorTest.php +++ b/src/database-pgsql/tests/Cases/PostgreSqlProcessorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Cases; use Hyperf\Database\PgSQL\Query\Processors\PostgresProcessor; diff --git a/src/database-pgsql/tests/Cases/PostgreSqlSwooleExtConnectionTest.php b/src/database-pgsql/tests/Cases/PostgreSqlSwooleExtConnectionTest.php index 4ce27462d..d1aac1909 100644 --- a/src/database-pgsql/tests/Cases/PostgreSqlSwooleExtConnectionTest.php +++ b/src/database-pgsql/tests/Cases/PostgreSqlSwooleExtConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Cases; use Exception; diff --git a/src/database-pgsql/tests/DBAL/ConnectionTest.php b/src/database-pgsql/tests/DBAL/ConnectionTest.php index fd3bdfe9e..516c06f8c 100644 --- a/src/database-pgsql/tests/DBAL/ConnectionTest.php +++ b/src/database-pgsql/tests/DBAL/ConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\DBAL; use Hyperf\Database\PgSQL\DBAL\Connection; diff --git a/src/database-pgsql/tests/Stubs/ContainerStub.php b/src/database-pgsql/tests/Stubs/ContainerStub.php index 22d72a846..f5c9a048f 100644 --- a/src/database-pgsql/tests/Stubs/ContainerStub.php +++ b/src/database-pgsql/tests/Stubs/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\PgSQL\Stubs; use Hyperf\Context\ApplicationContext; diff --git a/src/database-sqlite/src/ConfigProvider.php b/src/database-sqlite/src/ConfigProvider.php index 8adb77b2d..3ebe05699 100644 --- a/src/database-sqlite/src/ConfigProvider.php +++ b/src/database-sqlite/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite; use Hyperf\Database\SQLite\Connectors\SQLiteConnector; diff --git a/src/database-sqlite/src/Connectors/SQLiteConnector.php b/src/database-sqlite/src/Connectors/SQLiteConnector.php index ee4133586..6f4d0299f 100644 --- a/src/database-sqlite/src/Connectors/SQLiteConnector.php +++ b/src/database-sqlite/src/Connectors/SQLiteConnector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite\Connectors; use Hyperf\Database\Connectors\Connector; diff --git a/src/database-sqlite/src/Listener/RegisterConnectionListener.php b/src/database-sqlite/src/Listener/RegisterConnectionListener.php index 9cbeba5dd..dd76011fd 100644 --- a/src/database-sqlite/src/Listener/RegisterConnectionListener.php +++ b/src/database-sqlite/src/Listener/RegisterConnectionListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite\Listener; use Hyperf\Context\ApplicationContext; diff --git a/src/database-sqlite/src/Query/Grammars/SQLiteGrammar.php b/src/database-sqlite/src/Query/Grammars/SQLiteGrammar.php index 3b643f62e..59b23b67d 100644 --- a/src/database-sqlite/src/Query/Grammars/SQLiteGrammar.php +++ b/src/database-sqlite/src/Query/Grammars/SQLiteGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite\Query\Grammars; use Hyperf\Collection\Arr; diff --git a/src/database-sqlite/src/Query/Processors/SQLiteProcessor.php b/src/database-sqlite/src/Query/Processors/SQLiteProcessor.php index 0e72d0372..20fb46ccc 100644 --- a/src/database-sqlite/src/Query/Processors/SQLiteProcessor.php +++ b/src/database-sqlite/src/Query/Processors/SQLiteProcessor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite\Query\Processors; use Hyperf\Database\Query\Processors\Processor; diff --git a/src/database-sqlite/src/SQLiteConnection.php b/src/database-sqlite/src/SQLiteConnection.php index 261e9f3cd..89e5abca9 100644 --- a/src/database-sqlite/src/SQLiteConnection.php +++ b/src/database-sqlite/src/SQLiteConnection.php @@ -9,15 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite; use Closure; +use Doctrine\DBAL\Driver\PDO\SQLite\Driver; use Doctrine\DBAL\Driver\PDO\SQLite\Driver as DoctrineDriver; use Hyperf\Database\Connection; use Hyperf\Database\Query\Grammars\Grammar as HyperfQueryGrammar; use Hyperf\Database\Query\Processors\Processor; use Hyperf\Database\Schema\Builder as SchemaBuilder; use Hyperf\Database\Schema\Grammars\Grammar as HyperfSchemaGrammar; +use Hyperf\Database\SQLite\Query\Grammars\SQLiteGrammar; use Hyperf\Database\SQLite\Query\Grammars\SQLiteGrammar as QueryGrammar; use Hyperf\Database\SQLite\Query\Processors\SQLiteProcessor; use Hyperf\Database\SQLite\Schema\Grammars\SQLiteGrammar as SchemaGrammar; @@ -51,7 +54,7 @@ class SQLiteConnection extends Connection /** * Get a schema builder instance for the connection. * - * @return \Hyperf\Database\SQLite\Schema\SQLiteBuilder + * @return SQLiteBuilder */ public function getSchemaBuilder(): SchemaBuilder { @@ -65,7 +68,7 @@ class SQLiteConnection extends Connection /** * Get the default query grammar instance. * - * @return \Hyperf\Database\SQLite\Query\Grammars\SQLiteGrammar + * @return SQLiteGrammar */ protected function getDefaultQueryGrammar(): HyperfQueryGrammar { @@ -76,7 +79,7 @@ class SQLiteConnection extends Connection /** * Get the default schema grammar instance. * - * @return \Hyperf\Database\SQLite\Schema\Grammars\SQLiteGrammar + * @return SchemaGrammar */ protected function getDefaultSchemaGrammar(): HyperfSchemaGrammar { @@ -87,7 +90,7 @@ class SQLiteConnection extends Connection /** * Get the default post processor instance. * - * @return \Hyperf\Database\SQLite\Query\Processors\SQLiteProcessor + * @return SQLiteProcessor */ protected function getDefaultPostProcessor(): Processor { @@ -97,7 +100,7 @@ class SQLiteConnection extends Connection /** * Get the Doctrine DBAL driver. * - * @return \Doctrine\DBAL\Driver\PDO\SQLite\Driver + * @return Driver */ protected function getDoctrineDriver() { diff --git a/src/database-sqlite/src/Schema/Grammars/SQLiteGrammar.php b/src/database-sqlite/src/Schema/Grammars/SQLiteGrammar.php index 487e8599b..133c1a137 100644 --- a/src/database-sqlite/src/Schema/Grammars/SQLiteGrammar.php +++ b/src/database-sqlite/src/Schema/Grammars/SQLiteGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite\Schema\Grammars; use Hyperf\Collection\Arr; @@ -581,7 +582,7 @@ SQL; /** * Get the SQL for the foreign key. * - * @param \Hyperf\Support\Fluent $foreign + * @param Fluent $foreign */ protected function getForeignKey($foreign): string { diff --git a/src/database-sqlite/src/Schema/SQLiteBuilder.php b/src/database-sqlite/src/Schema/SQLiteBuilder.php index 224b69e4c..589c03795 100644 --- a/src/database-sqlite/src/Schema/SQLiteBuilder.php +++ b/src/database-sqlite/src/Schema/SQLiteBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\SQLite\Schema; use Hyperf\Context\ApplicationContext; diff --git a/src/database-sqlite/tests/DatabaseSQLiteBuilderTest.php b/src/database-sqlite/tests/DatabaseSQLiteBuilderTest.php index 7caca32de..f86d03fd6 100644 --- a/src/database-sqlite/tests/DatabaseSQLiteBuilderTest.php +++ b/src/database-sqlite/tests/DatabaseSQLiteBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\SQLite; use Hyperf\Context\ApplicationContext; diff --git a/src/database-sqlite/tests/DatabaseSQLiteProcessorTest.php b/src/database-sqlite/tests/DatabaseSQLiteProcessorTest.php index 7409b5f93..654fed371 100644 --- a/src/database-sqlite/tests/DatabaseSQLiteProcessorTest.php +++ b/src/database-sqlite/tests/DatabaseSQLiteProcessorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\SQLite; use Hyperf\Database\Schema\Column; diff --git a/src/database-sqlite/tests/DatabaseSQLiteQueryGrammarTest.php b/src/database-sqlite/tests/DatabaseSQLiteQueryGrammarTest.php index 22a867748..1b8c0d18d 100644 --- a/src/database-sqlite/tests/DatabaseSQLiteQueryGrammarTest.php +++ b/src/database-sqlite/tests/DatabaseSQLiteQueryGrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\SQLite; use Hyperf\Database\Connection; diff --git a/src/database-sqlite/tests/DatabaseSQLiteSchemaGrammarTest.php b/src/database-sqlite/tests/DatabaseSQLiteSchemaGrammarTest.php index 45275c5fd..678e45556 100644 --- a/src/database-sqlite/tests/DatabaseSQLiteSchemaGrammarTest.php +++ b/src/database-sqlite/tests/DatabaseSQLiteSchemaGrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\SQLite; use Hyperf\Collection\Collection; diff --git a/src/database/ide/ModelIDE.php b/src/database/ide/ModelIDE.php index 995ee3b7b..ab7147d5c 100644 --- a/src/database/ide/ModelIDE.php +++ b/src/database/ide/ModelIDE.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use BadMethodCallException; @@ -16,6 +17,12 @@ use Closure; use DateTimeInterface; use Generator; use Hyperf\Contract\Arrayable; +use Hyperf\Contract\LengthAwarePaginatorInterface; +use Hyperf\Contract\PaginatorInterface; +use Hyperf\Database\Model\Relations\Relation; +use Hyperf\Database\Query\Expression; +use Hyperf\Database\Query\Grammars\Grammar; +use Hyperf\Database\Query\Processors\Processor; use InvalidArgumentException; use ReflectionException; use RuntimeException; @@ -359,7 +366,7 @@ class ModelIDE * @param array $columns * @param string $pageName * @param null|int $page - * @return \Hyperf\Contract\LengthAwarePaginatorInterface + * @return LengthAwarePaginatorInterface * @throws InvalidArgumentException */ public static function paginate($perPage = null, $columns = [], $pageName = 'page', $page = null) @@ -374,7 +381,7 @@ class ModelIDE * @param array $columns * @param string $pageName * @param null|int $page - * @return \Hyperf\Contract\PaginatorInterface + * @return PaginatorInterface */ public static function simplePaginate($perPage = null, $columns = [], $pageName = 'page', $page = null) { @@ -651,7 +658,7 @@ class ModelIDE /** * Add a relationship count / exists condition to the query. * - * @param \Hyperf\Database\Model\Relations\Relation|string $relation + * @param Relation|string $relation * @param string $operator * @param int $count * @param string $boolean @@ -2180,7 +2187,7 @@ class ModelIDE * Create a raw database expression. * * @param mixed $value - * @return \Hyperf\Database\Query\Expression + * @return Expression */ public static function raw($value) { @@ -2247,7 +2254,7 @@ class ModelIDE /** * Get the database query processor instance. * - * @return \Hyperf\Database\Query\Processors\Processor + * @return Processor */ public static function getProcessor() { @@ -2257,7 +2264,7 @@ class ModelIDE /** * Get the query grammar instance. * - * @return \Hyperf\Database\Query\Grammars\Grammar + * @return Grammar */ public static function getGrammar() { diff --git a/src/database/src/Commands/Annotations/RewriteReturnType.php b/src/database/src/Commands/Annotations/RewriteReturnType.php index 42ea8bf14..40034167d 100644 --- a/src/database/src/Commands/Annotations/RewriteReturnType.php +++ b/src/database/src/Commands/Annotations/RewriteReturnType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Annotations; use Attribute; diff --git a/src/database/src/Commands/Ast/AbstractVisitor.php b/src/database/src/Commands/Ast/AbstractVisitor.php index c7439853a..28b6c3499 100644 --- a/src/database/src/Commands/Ast/AbstractVisitor.php +++ b/src/database/src/Commands/Ast/AbstractVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\Database\Commands\ModelData; diff --git a/src/database/src/Commands/Ast/GenerateModelIDEVisitor.php b/src/database/src/Commands/Ast/GenerateModelIDEVisitor.php index 921f3be4a..29f74af54 100644 --- a/src/database/src/Commands/Ast/GenerateModelIDEVisitor.php +++ b/src/database/src/Commands/Ast/GenerateModelIDEVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\CodeParser\PhpParser; @@ -61,7 +62,7 @@ class GenerateModelIDEVisitor extends AbstractVisitor if ($node instanceof Node\Stmt\Class_) { $this->originClassName = $node->name->toString(); $this->class = new Node\Stmt\Class_( - new Node\Identifier(self::toIDEClass($this->nsp . '\\' . $this->originClassName)) + new Identifier(self::toIDEClass($this->nsp . '\\' . $this->originClassName)) ); } @@ -89,7 +90,7 @@ class GenerateModelIDEVisitor extends AbstractVisitor new Node\Name('static'), new Node\VarLikeIdentifier('builder') ), - new Node\Identifier('dynamicWhere'), + new Identifier('dynamicWhere'), [ new Node\Arg(new Node\Scalar\String_($name)), new Node\Arg(new Node\Expr\Variable('value')), diff --git a/src/database/src/Commands/Ast/ModelRewriteConnectionVisitor.php b/src/database/src/Commands/Ast/ModelRewriteConnectionVisitor.php index 5edecf6cb..fe183b74a 100644 --- a/src/database/src/Commands/Ast/ModelRewriteConnectionVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteConnectionVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use PhpParser\Node; diff --git a/src/database/src/Commands/Ast/ModelRewriteGetterSetterVisitor.php b/src/database/src/Commands/Ast/ModelRewriteGetterSetterVisitor.php index 86057964f..c04902077 100644 --- a/src/database/src/Commands/Ast/ModelRewriteGetterSetterVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteGetterSetterVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\CodeParser\PhpParser; diff --git a/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php b/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php index 5260845f8..2250ec658 100644 --- a/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\Database\Commands\ModelData; diff --git a/src/database/src/Commands/Ast/ModelRewriteKeyInfoVisitor.php b/src/database/src/Commands/Ast/ModelRewriteKeyInfoVisitor.php index ad33faed8..cf0a2000a 100644 --- a/src/database/src/Commands/Ast/ModelRewriteKeyInfoVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteKeyInfoVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\Collection\Arr; diff --git a/src/database/src/Commands/Ast/ModelRewriteSoftDeletesVisitor.php b/src/database/src/Commands/Ast/ModelRewriteSoftDeletesVisitor.php index 436702c7e..8a26e0f54 100644 --- a/src/database/src/Commands/Ast/ModelRewriteSoftDeletesVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteSoftDeletesVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\Collection\Collection; diff --git a/src/database/src/Commands/Ast/ModelRewriteTimestampsVisitor.php b/src/database/src/Commands/Ast/ModelRewriteTimestampsVisitor.php index 71026b48e..0ab813f9e 100644 --- a/src/database/src/Commands/Ast/ModelRewriteTimestampsVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteTimestampsVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\Collection\Collection; diff --git a/src/database/src/Commands/Ast/ModelUpdateVisitor.php b/src/database/src/Commands/Ast/ModelUpdateVisitor.php index d315c402d..3b6f5fbf5 100644 --- a/src/database/src/Commands/Ast/ModelUpdateVisitor.php +++ b/src/database/src/Commands/Ast/ModelUpdateVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Ast; use Hyperf\CodeParser\PhpDocReader; diff --git a/src/database/src/Commands/CommandCollector.php b/src/database/src/Commands/CommandCollector.php index d5bf462d6..946852442 100644 --- a/src/database/src/Commands/CommandCollector.php +++ b/src/database/src/Commands/CommandCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands; use Hyperf\Database\Commands\Migrations\FreshCommand; diff --git a/src/database/src/Commands/Migrations/BaseCommand.php b/src/database/src/Commands/Migrations/BaseCommand.php index da8643960..771bd4383 100755 --- a/src/database/src/Commands/Migrations/BaseCommand.php +++ b/src/database/src/Commands/Migrations/BaseCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Command\Command; diff --git a/src/database/src/Commands/Migrations/FreshCommand.php b/src/database/src/Commands/Migrations/FreshCommand.php index dc5f79d0d..39057eb37 100644 --- a/src/database/src/Commands/Migrations/FreshCommand.php +++ b/src/database/src/Commands/Migrations/FreshCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Command\Command; diff --git a/src/database/src/Commands/Migrations/GenMigrateCommand.php b/src/database/src/Commands/Migrations/GenMigrateCommand.php index a3f013c8b..edb6030f4 100644 --- a/src/database/src/Commands/Migrations/GenMigrateCommand.php +++ b/src/database/src/Commands/Migrations/GenMigrateCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Database\Migrations\MigrationCreator; diff --git a/src/database/src/Commands/Migrations/InstallCommand.php b/src/database/src/Commands/Migrations/InstallCommand.php index d354b443f..4272f0007 100755 --- a/src/database/src/Commands/Migrations/InstallCommand.php +++ b/src/database/src/Commands/Migrations/InstallCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Database\Migrations\MigrationRepositoryInterface; diff --git a/src/database/src/Commands/Migrations/MigrateCommand.php b/src/database/src/Commands/Migrations/MigrateCommand.php index dfeaf63fa..fb7e8bb88 100755 --- a/src/database/src/Commands/Migrations/MigrateCommand.php +++ b/src/database/src/Commands/Migrations/MigrateCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Command\Concerns\Confirmable as ConfirmableTrait; diff --git a/src/database/src/Commands/Migrations/RefreshCommand.php b/src/database/src/Commands/Migrations/RefreshCommand.php index 14bd5e95b..7de6aa93f 100755 --- a/src/database/src/Commands/Migrations/RefreshCommand.php +++ b/src/database/src/Commands/Migrations/RefreshCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Command\Command; diff --git a/src/database/src/Commands/Migrations/ResetCommand.php b/src/database/src/Commands/Migrations/ResetCommand.php index ddb173e68..d4682d1da 100755 --- a/src/database/src/Commands/Migrations/ResetCommand.php +++ b/src/database/src/Commands/Migrations/ResetCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Command\Concerns\Confirmable as ConfirmableTrait; diff --git a/src/database/src/Commands/Migrations/RollbackCommand.php b/src/database/src/Commands/Migrations/RollbackCommand.php index 1e88d8d7f..6d93cf6ff 100755 --- a/src/database/src/Commands/Migrations/RollbackCommand.php +++ b/src/database/src/Commands/Migrations/RollbackCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Command\Concerns\Confirmable as ConfirmableTrait; diff --git a/src/database/src/Commands/Migrations/StatusCommand.php b/src/database/src/Commands/Migrations/StatusCommand.php index 4b9e03495..016edc0d4 100644 --- a/src/database/src/Commands/Migrations/StatusCommand.php +++ b/src/database/src/Commands/Migrations/StatusCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; use Hyperf\Collection\Collection; @@ -51,7 +52,7 @@ class StatusCommand extends BaseCommand /** * Get the status for the given ran migrations. * - * @return \Hyperf\Collection\Collection + * @return Collection */ protected function getStatusFor(array $ran, array $batches) { diff --git a/src/database/src/Commands/Migrations/TableGuesser.php b/src/database/src/Commands/Migrations/TableGuesser.php index fcbeeba84..ab436193e 100644 --- a/src/database/src/Commands/Migrations/TableGuesser.php +++ b/src/database/src/Commands/Migrations/TableGuesser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Migrations; class TableGuesser diff --git a/src/database/src/Commands/ModelCommand.php b/src/database/src/Commands/ModelCommand.php index 1a0c01b13..28db48c28 100644 --- a/src/database/src/Commands/ModelCommand.php +++ b/src/database/src/Commands/ModelCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands; use Hyperf\CodeParser\Project; diff --git a/src/database/src/Commands/ModelData.php b/src/database/src/Commands/ModelData.php index d29e05b0b..d3b25984a 100644 --- a/src/database/src/Commands/ModelData.php +++ b/src/database/src/Commands/ModelData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands; class ModelData diff --git a/src/database/src/Commands/ModelOption.php b/src/database/src/Commands/ModelOption.php index c52399920..453add2f5 100644 --- a/src/database/src/Commands/ModelOption.php +++ b/src/database/src/Commands/ModelOption.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands; class ModelOption diff --git a/src/database/src/Commands/Seeders/BaseCommand.php b/src/database/src/Commands/Seeders/BaseCommand.php index 7296c1330..a35753b2b 100644 --- a/src/database/src/Commands/Seeders/BaseCommand.php +++ b/src/database/src/Commands/Seeders/BaseCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Seeders; use Hyperf\Command\Command; diff --git a/src/database/src/Commands/Seeders/GenSeederCommand.php b/src/database/src/Commands/Seeders/GenSeederCommand.php index 3d91b6f0c..4bedb076f 100644 --- a/src/database/src/Commands/Seeders/GenSeederCommand.php +++ b/src/database/src/Commands/Seeders/GenSeederCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Seeders; use Hyperf\Database\Seeders\SeederCreator; diff --git a/src/database/src/Commands/Seeders/SeedCommand.php b/src/database/src/Commands/Seeders/SeedCommand.php index 77570d422..7ed270cc4 100644 --- a/src/database/src/Commands/Seeders/SeedCommand.php +++ b/src/database/src/Commands/Seeders/SeedCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Commands\Seeders; use Hyperf\Command\Concerns\Confirmable as ConfirmableTrait; diff --git a/src/database/src/Concerns/BuildsQueries.php b/src/database/src/Concerns/BuildsQueries.php index e3125ff5b..336273251 100644 --- a/src/database/src/Concerns/BuildsQueries.php +++ b/src/database/src/Concerns/BuildsQueries.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Concerns; use Closure; diff --git a/src/database/src/Concerns/ManagesTransactions.php b/src/database/src/Concerns/ManagesTransactions.php index e8013178c..c33da199b 100644 --- a/src/database/src/Concerns/ManagesTransactions.php +++ b/src/database/src/Concerns/ManagesTransactions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Concerns; use Closure; diff --git a/src/database/src/Connection.php b/src/database/src/Connection.php index 87c43be64..3268f3999 100755 --- a/src/database/src/Connection.php +++ b/src/database/src/Connection.php @@ -9,14 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; use Closure; use DateTimeInterface; use Doctrine\DBAL\Connection as DoctrineConnection; +use Doctrine\DBAL\Schema\AbstractSchemaManager; +use Doctrine\DBAL\Schema\Column; use Exception; use Generator; use Hyperf\Collection\Arr; +use Hyperf\Contracts\Events\Dispatcher; use Hyperf\Database\Events\QueryExecuted; use Hyperf\Database\Exception\InvalidArgumentException; use Hyperf\Database\Exception\QueryException; @@ -129,7 +133,7 @@ class Connection implements ConnectionInterface /** * The instance of Doctrine connection. * - * @var \Doctrine\DBAL\Connection + * @var DoctrineConnection */ protected mixed $doctrineConnection = null; @@ -510,7 +514,7 @@ class Connection implements ConnectionInterface public function listen(Closure $callback) { // FIXME: Dynamic register query event. - $this->events?->listen(Events\QueryExecuted::class, $callback); + $this->events?->listen(QueryExecuted::class, $callback); } /** @@ -583,7 +587,7 @@ class Connection implements ConnectionInterface * * @param string $table * @param string $column - * @return \Doctrine\DBAL\Schema\Column + * @return Column */ public function getDoctrineColumn($table, $column) { @@ -595,7 +599,7 @@ class Connection implements ConnectionInterface /** * Get the Doctrine DBAL schema manager for the connection. * - * @return \Doctrine\DBAL\Schema\AbstractSchemaManager + * @return AbstractSchemaManager */ public function getDoctrineSchemaManager() { @@ -610,7 +614,7 @@ class Connection implements ConnectionInterface /** * Get the Doctrine DBAL database connection instance. * - * @return \Doctrine\DBAL\Connection + * @return DoctrineConnection */ public function getDoctrineConnection() { @@ -740,7 +744,7 @@ class Connection implements ConnectionInterface /** * Get the query grammar used by the connection. * - * @return \Hyperf\Database\Query\Grammars\Grammar + * @return QueryGrammar */ public function getQueryGrammar() { @@ -750,10 +754,9 @@ class Connection implements ConnectionInterface /** * Set the query grammar used by the connection. * - * @param \Hyperf\Database\Query\Grammars\Grammar $grammar * @return $this */ - public function setQueryGrammar(Query\Grammars\Grammar $grammar) + public function setQueryGrammar(QueryGrammar $grammar) { $this->queryGrammar = $grammar; @@ -775,10 +778,9 @@ class Connection implements ConnectionInterface /** * Set the schema grammar used by the connection. * - * @param \Hyperf\Database\Schema\Grammars\Grammar $grammar * @return $this */ - public function setSchemaGrammar(Schema\Grammars\Grammar $grammar) + public function setSchemaGrammar(SchemaGrammar $grammar) { $this->schemaGrammar = $grammar; @@ -806,7 +808,7 @@ class Connection implements ConnectionInterface /** * Get the event dispatcher used by the connection. * - * @return \Hyperf\Contracts\Events\Dispatcher + * @return Dispatcher */ public function getEventDispatcher() { diff --git a/src/database/src/ConnectionInterface.php b/src/database/src/ConnectionInterface.php index 55bd6b88e..e5a76ed58 100755 --- a/src/database/src/ConnectionInterface.php +++ b/src/database/src/ConnectionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; use Closure; diff --git a/src/database/src/ConnectionResolver.php b/src/database/src/ConnectionResolver.php index 1fafca219..451f7451c 100755 --- a/src/database/src/ConnectionResolver.php +++ b/src/database/src/ConnectionResolver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; class ConnectionResolver implements ConnectionResolverInterface @@ -35,9 +36,6 @@ class ConnectionResolver implements ConnectionResolverInterface /** * Get a database connection instance. - * - * @param string $name - * @return \Hyperf\Database\ConnectionInterface */ public function connection(?string $name = null): ConnectionInterface { @@ -52,7 +50,6 @@ class ConnectionResolver implements ConnectionResolverInterface * Add a connection to the resolver. * * @param string $name - * @param \Hyperf\Database\ConnectionInterface $connection */ public function addConnection($name, ConnectionInterface $connection) { diff --git a/src/database/src/ConnectionResolverInterface.php b/src/database/src/ConnectionResolverInterface.php index 00a780cc6..b4e65a680 100755 --- a/src/database/src/ConnectionResolverInterface.php +++ b/src/database/src/ConnectionResolverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; interface ConnectionResolverInterface diff --git a/src/database/src/Connectors/ConnectionFactory.php b/src/database/src/Connectors/ConnectionFactory.php index b85d4e501..80790d4d7 100755 --- a/src/database/src/Connectors/ConnectionFactory.php +++ b/src/database/src/Connectors/ConnectionFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Connectors; use Closure; @@ -238,7 +239,7 @@ class ConnectionFactory * @param Closure|PDO $connection * @param string $database * @param string $prefix - * @return \Hyperf\Database\Connection + * @return Connection * @throws InvalidArgumentException */ protected function createConnection($driver, $connection, $database, $prefix = '', array $config = []) diff --git a/src/database/src/Connectors/Connector.php b/src/database/src/Connectors/Connector.php index c6f5e0768..7b424d223 100755 --- a/src/database/src/Connectors/Connector.php +++ b/src/database/src/Connectors/Connector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Connectors; use Exception; diff --git a/src/database/src/Connectors/ConnectorInterface.php b/src/database/src/Connectors/ConnectorInterface.php index 87deab8f8..17f9c3fe0 100755 --- a/src/database/src/Connectors/ConnectorInterface.php +++ b/src/database/src/Connectors/ConnectorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Connectors; use PDO; diff --git a/src/database/src/Connectors/MySqlConnector.php b/src/database/src/Connectors/MySqlConnector.php index fdfce8677..6064a3a4b 100755 --- a/src/database/src/Connectors/MySqlConnector.php +++ b/src/database/src/Connectors/MySqlConnector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Connectors; use PDO; diff --git a/src/database/src/DBAL/Concerns/ConnectsToDatabase.php b/src/database/src/DBAL/Concerns/ConnectsToDatabase.php index ba347530d..cfa8d256d 100644 --- a/src/database/src/DBAL/Concerns/ConnectsToDatabase.php +++ b/src/database/src/DBAL/Concerns/ConnectsToDatabase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\DBAL\Concerns; use Hyperf\Database\DBAL\Connection; diff --git a/src/database/src/DBAL/Connection.php b/src/database/src/DBAL/Connection.php index 34abe3f71..4c25ff781 100644 --- a/src/database/src/DBAL/Connection.php +++ b/src/database/src/DBAL/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\DBAL; use Doctrine\DBAL\Driver\PDO\Exception; diff --git a/src/database/src/DBAL/MySqlDriver.php b/src/database/src/DBAL/MySqlDriver.php index ffc4c6150..669a2a092 100644 --- a/src/database/src/DBAL/MySqlDriver.php +++ b/src/database/src/DBAL/MySqlDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\DBAL; use Doctrine\DBAL\Driver\AbstractMySQLDriver; diff --git a/src/database/src/DetectsDeadlocks.php b/src/database/src/DetectsDeadlocks.php index 4e3ba994f..e7a314c25 100644 --- a/src/database/src/DetectsDeadlocks.php +++ b/src/database/src/DetectsDeadlocks.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; use Exception; diff --git a/src/database/src/DetectsLostConnections.php b/src/database/src/DetectsLostConnections.php index a3bfc683d..a110334ab 100644 --- a/src/database/src/DetectsLostConnections.php +++ b/src/database/src/DetectsLostConnections.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; use Hyperf\Stringable\Str; diff --git a/src/database/src/Events/ConnectionEvent.php b/src/database/src/Events/ConnectionEvent.php index 7d2acec3d..6859c7c8d 100644 --- a/src/database/src/Events/ConnectionEvent.php +++ b/src/database/src/Events/ConnectionEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Events; use Hyperf\Database\Connection; diff --git a/src/database/src/Events/QueryExecuted.php b/src/database/src/Events/QueryExecuted.php index 970ea320e..ce765684a 100644 --- a/src/database/src/Events/QueryExecuted.php +++ b/src/database/src/Events/QueryExecuted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Events; use Hyperf\Database\Connection; diff --git a/src/database/src/Events/StatementPrepared.php b/src/database/src/Events/StatementPrepared.php index 03ddc96ec..be51e55e0 100644 --- a/src/database/src/Events/StatementPrepared.php +++ b/src/database/src/Events/StatementPrepared.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Events; use Hyperf\Database\Connection; diff --git a/src/database/src/Events/TransactionBeginning.php b/src/database/src/Events/TransactionBeginning.php index 18b6da2a3..f59febae8 100644 --- a/src/database/src/Events/TransactionBeginning.php +++ b/src/database/src/Events/TransactionBeginning.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Events; class TransactionBeginning extends ConnectionEvent diff --git a/src/database/src/Events/TransactionCommitted.php b/src/database/src/Events/TransactionCommitted.php index 706614559..3b6b78537 100644 --- a/src/database/src/Events/TransactionCommitted.php +++ b/src/database/src/Events/TransactionCommitted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Events; class TransactionCommitted extends ConnectionEvent diff --git a/src/database/src/Events/TransactionRolledBack.php b/src/database/src/Events/TransactionRolledBack.php index 6f91d50ae..b35bd5fc9 100644 --- a/src/database/src/Events/TransactionRolledBack.php +++ b/src/database/src/Events/TransactionRolledBack.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Events; class TransactionRolledBack extends ConnectionEvent diff --git a/src/database/src/Exception/InvalidArgumentException.php b/src/database/src/Exception/InvalidArgumentException.php index 513d05db1..510d56d44 100644 --- a/src/database/src/Exception/InvalidArgumentException.php +++ b/src/database/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/database/src/Exception/InvalidBindingException.php b/src/database/src/Exception/InvalidBindingException.php index 4fdea4a60..d16bdd690 100644 --- a/src/database/src/Exception/InvalidBindingException.php +++ b/src/database/src/Exception/InvalidBindingException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Exception; use InvalidArgumentException; diff --git a/src/database/src/Exception/InvalidCastException.php b/src/database/src/Exception/InvalidCastException.php index 0e2ce1771..839801546 100644 --- a/src/database/src/Exception/InvalidCastException.php +++ b/src/database/src/Exception/InvalidCastException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Exception; use RuntimeException; diff --git a/src/database/src/Exception/QueryException.php b/src/database/src/Exception/QueryException.php index 270b20dec..cfb936ce5 100644 --- a/src/database/src/Exception/QueryException.php +++ b/src/database/src/Exception/QueryException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Exception; use Exception; diff --git a/src/database/src/Grammar.php b/src/database/src/Grammar.php index afc16fb50..6b38aeb03 100755 --- a/src/database/src/Grammar.php +++ b/src/database/src/Grammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; use Hyperf\Database\Query\Expression; diff --git a/src/database/src/Migrations/DatabaseMigrationRepository.php b/src/database/src/Migrations/DatabaseMigrationRepository.php index 337789dce..845345329 100755 --- a/src/database/src/Migrations/DatabaseMigrationRepository.php +++ b/src/database/src/Migrations/DatabaseMigrationRepository.php @@ -9,9 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Migrations; +use Hyperf\Database\Connection; +use Hyperf\Database\ConnectionResolverInterface; use Hyperf\Database\ConnectionResolverInterface as Resolver; +use Hyperf\Database\Query\Builder; class DatabaseMigrationRepository implements MigrationRepositoryInterface { @@ -159,7 +163,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface /** * Get the connection resolver instance. * - * @return \Hyperf\Database\ConnectionResolverInterface + * @return ConnectionResolverInterface */ public function getConnectionResolver() { @@ -169,7 +173,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface /** * Resolve the database connection instance. * - * @return \Hyperf\Database\Connection + * @return Connection */ public function getConnection() { @@ -187,7 +191,7 @@ class DatabaseMigrationRepository implements MigrationRepositoryInterface /** * Get a query builder for the migration table. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ protected function table() { diff --git a/src/database/src/Migrations/Migration.php b/src/database/src/Migrations/Migration.php index 3e7e170bf..288896b2b 100755 --- a/src/database/src/Migrations/Migration.php +++ b/src/database/src/Migrations/Migration.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Migrations; abstract class Migration diff --git a/src/database/src/Migrations/MigrationCreator.php b/src/database/src/Migrations/MigrationCreator.php index ff2f702f6..e01fc7b53 100755 --- a/src/database/src/Migrations/MigrationCreator.php +++ b/src/database/src/Migrations/MigrationCreator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Migrations; use Closure; diff --git a/src/database/src/Migrations/MigrationRepositoryInterface.php b/src/database/src/Migrations/MigrationRepositoryInterface.php index 9d41e20d9..db06bf915 100755 --- a/src/database/src/Migrations/MigrationRepositoryInterface.php +++ b/src/database/src/Migrations/MigrationRepositoryInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Migrations; interface MigrationRepositoryInterface @@ -78,8 +79,6 @@ interface MigrationRepositoryInterface /** * Set the information source to gather data. - * - * @param string $name */ public function setSource(?string $name); } diff --git a/src/database/src/Migrations/Migrator.php b/src/database/src/Migrations/Migrator.php index 3f6a47ab7..98b5c4729 100755 --- a/src/database/src/Migrations/Migrator.php +++ b/src/database/src/Migrations/Migrator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Migrations; use Hyperf\Collection\Arr; diff --git a/src/database/src/Model/Booted.php b/src/database/src/Model/Booted.php index 6ceaf26d3..c9bbc0846 100644 --- a/src/database/src/Model/Booted.php +++ b/src/database/src/Model/Booted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; class Booted diff --git a/src/database/src/Model/Builder.php b/src/database/src/Model/Builder.php index 93d4cd7c4..5a4cf7108 100755 --- a/src/database/src/Model/Builder.php +++ b/src/database/src/Model/Builder.php @@ -9,15 +9,19 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use BadMethodCallException; use Closure; use Generator; use Hyperf\Collection\Arr; +use Hyperf\Collection\Collection; use Hyperf\Contract\Arrayable; use Hyperf\Contract\LengthAwarePaginatorInterface; +use Hyperf\Contract\PaginatorInterface; use Hyperf\Database\Concerns\BuildsQueries; +use Hyperf\Database\Model\Collection as ModelCollection; use Hyperf\Database\Model\Relations\Relation; use Hyperf\Database\Query\Builder as QueryBuilder; use Hyperf\Paginator\Paginator; @@ -43,14 +47,14 @@ class Builder /** * The base query builder instance. * - * @var \Hyperf\Database\Query\Builder + * @var QueryBuilder */ protected $query; /** * The model being queried. * - * @var \Hyperf\Database\Model\Model + * @var Model */ protected $model; @@ -212,7 +216,7 @@ class Builder /** * Create and return an un-saved model instance. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function make(array $attributes = []) { @@ -223,7 +227,7 @@ class Builder * Register a new global scope. * * @param string $identifier - * @param Closure|\Hyperf\Database\Model\Scope $scope + * @param Closure|Scope $scope * @return $this */ public function withGlobalScope($identifier, $scope) @@ -240,7 +244,7 @@ class Builder /** * Remove a registered global scope. * - * @param \Hyperf\Database\Model\Scope|string $scope + * @param Scope|string $scope * @return $this */ public function withoutGlobalScope($scope) @@ -346,7 +350,7 @@ class Builder * @param array|Closure|string $column * @param null|mixed $operator * @param null|mixed $value - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function orWhere($column, $operator = null, $value = null) { @@ -396,7 +400,7 @@ class Builder /** * Create a collection of models from plain arrays. * - * @return \Hyperf\Database\Model\Collection + * @return ModelCollection */ public function hydrate(array $items) { @@ -412,7 +416,7 @@ class Builder * * @param string $query * @param array $bindings - * @return \Hyperf\Database\Model\Collection + * @return ModelCollection */ public function fromQuery($query, $bindings = []) { @@ -426,7 +430,7 @@ class Builder * * @param array $columns * @param array|int|string $id - * @return null|\Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model|static|static[] + * @return null|Model|ModelCollection|static|static[] */ public function find($id, $columns = ['*']) { @@ -442,7 +446,7 @@ class Builder * * @param array|Arrayable $ids * @param array $columns - * @return \Hyperf\Database\Model\Collection + * @return ModelCollection */ public function findMany($ids, $columns = ['*']) { @@ -458,8 +462,8 @@ class Builder * * @param array $columns * @param mixed $id - * @return \Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model|static|static[] - * @throws \Hyperf\Database\Model\ModelNotFoundException + * @return Model|ModelCollection|static|static[] + * @throws ModelNotFoundException */ public function findOrFail($id, $columns = ['*']) { @@ -484,7 +488,7 @@ class Builder * * @param array $columns * @param mixed $id - * @return \Hyperf\Database\Model\Model|static + * @return Model|static */ public function findOrNew($id, $columns = ['*']) { @@ -498,7 +502,7 @@ class Builder /** * Get the first record matching the attributes or instantiate it. * - * @return \Hyperf\Database\Model\Model|static + * @return Model|static */ public function firstOrNew(array $attributes, array $values = []) { @@ -512,7 +516,7 @@ class Builder /** * Get the first record matching the attributes or create it. * - * @return \Hyperf\Database\Model\Model|static + * @return Model|static */ public function firstOrCreate(array $attributes, array $values = []) { @@ -528,7 +532,7 @@ class Builder /** * Create or update a record matching the attributes, and fill it with values. * - * @return \Hyperf\Database\Model\Model|static + * @return Model|static */ public function updateOrCreate(array $attributes, array $values = []) { @@ -541,8 +545,8 @@ class Builder * Execute the query and get the first result or throw an exception. * * @param array $columns - * @return \Hyperf\Database\Model\Model|static - * @throws \Hyperf\Database\Model\ModelNotFoundException + * @return Model|static + * @throws ModelNotFoundException */ public function firstOrFail($columns = ['*']) { @@ -557,7 +561,7 @@ class Builder * Execute the query and get the first result or call a callback. * * @param array|Closure $columns - * @return \Hyperf\Database\Model\Model|mixed|static + * @return mixed|Model|static */ public function firstOr($columns = ['*'], ?Closure $callback = null) { @@ -590,7 +594,7 @@ class Builder * Execute the query as a "select" statement. * * @param array $columns - * @return \Hyperf\Database\Model\Collection|static[] + * @return ModelCollection|static[] */ public function get($columns = ['*']) { @@ -642,7 +646,7 @@ class Builder * Get the relation instance for the given relation name. * * @param string $name - * @return \Hyperf\Database\Model\Relations\Relation + * @return Relation */ public function getRelation($name) { @@ -735,7 +739,7 @@ class Builder * * @param string $column * @param null|string $key - * @return \Hyperf\Collection\Collection + * @return Collection */ public function pluck($column, $key = null) { @@ -783,7 +787,7 @@ class Builder * @param array $columns * @param string $pageName * @param null|int $page - * @return \Hyperf\Contract\PaginatorInterface + * @return PaginatorInterface */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { @@ -928,7 +932,7 @@ class Builder /** * Apply the scopes to the Model builder instance and return it. * - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function applyScopes() { @@ -997,7 +1001,7 @@ class Builder * Create a new instance of the model being queried. * * @param array $attributes - * @return \Hyperf\Database\Model\Model|static + * @return Model|static */ public function newModelInstance($attributes = []) { @@ -1019,7 +1023,7 @@ class Builder /** * Get the underlying query builder instance. * - * @return \Hyperf\Database\Query\Builder + * @return QueryBuilder */ public function getQuery() { @@ -1029,7 +1033,7 @@ class Builder /** * Set the underlying query builder instance. * - * @param \Hyperf\Database\Query\Builder $query + * @param QueryBuilder $query * @return $this */ public function setQuery($query) @@ -1042,7 +1046,7 @@ class Builder /** * Get a base query builder instance. * - * @return \Hyperf\Database\Query\Builder + * @return QueryBuilder */ public function toBase() { @@ -1074,7 +1078,7 @@ class Builder /** * Get the model instance being queried. * - * @return \Hyperf\Database\Model\Model|static + * @return Model|static */ public function getModel() { @@ -1084,7 +1088,6 @@ class Builder /** * Set a model instance for the model being queried. * - * @param \Hyperf\Database\Model\Model $model * @return $this */ public function setModel(Model $model) diff --git a/src/database/src/Model/CastsValue.php b/src/database/src/Model/CastsValue.php index d3a2e68d6..6b2d53143 100644 --- a/src/database/src/Model/CastsValue.php +++ b/src/database/src/Model/CastsValue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Hyperf\Contract\Arrayable; diff --git a/src/database/src/Model/Collection.php b/src/database/src/Model/Collection.php index 6c3216924..c09673b6d 100755 --- a/src/database/src/Model/Collection.php +++ b/src/database/src/Model/Collection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Hyperf\Collection\Arr; @@ -64,7 +65,7 @@ class Collection extends BaseCollection implements CompressInterface /** * Load a set of relationships onto the collection. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function load($relations) @@ -85,7 +86,7 @@ class Collection extends BaseCollection implements CompressInterface /** * Load a set of relationship counts onto the collection. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function loadCount($relations) @@ -117,7 +118,7 @@ class Collection extends BaseCollection implements CompressInterface /** * Load a set of relationships onto the collection if they are not already eager loaded. * - * @param array|string $relations + * @param array|string $relations * @return $this */ public function loadMissing($relations) @@ -153,7 +154,7 @@ class Collection extends BaseCollection implements CompressInterface * Load a set of relationships onto the mixed relationship collection. * * @param string $relation - * @param array|string $relations + * @param array|string $relations * @return $this */ public function loadMorph($relation, $relations) @@ -190,7 +191,7 @@ class Collection extends BaseCollection implements CompressInterface /** * Determine if a key exists in the collection. * - * @param (callable(TModel, TKey): bool)|TModel|string $key + * @param (callable(TModel, TKey): bool)|string|TModel $key * @param mixed $operator * @param mixed $value */ @@ -328,7 +329,7 @@ class Collection extends BaseCollection implements CompressInterface /** * Return only unique items from the collection. * - * @param (callable(TModel, TKey): bool)|string|null $key + * @param null|(callable(TModel, TKey): bool)|string $key * @return static */ public function unique($key = null, bool $strict = false): BaseCollection @@ -563,8 +564,6 @@ class Collection extends BaseCollection implements CompressInterface /** * Load a relationship path if it is not already eager loaded. - * - * @param \Hyperf\Database\Model\Collection $models */ protected function loadMissingRelation(Collection $models, array $path) { diff --git a/src/database/src/Model/CollectionMeta.php b/src/database/src/Model/CollectionMeta.php index 4f7a8c8a0..fa4ce1bad 100644 --- a/src/database/src/Model/CollectionMeta.php +++ b/src/database/src/Model/CollectionMeta.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Hyperf\Contract\CompressInterface; diff --git a/src/database/src/Model/Concerns/CamelCase.php b/src/database/src/Model/Concerns/CamelCase.php index 390feae41..4cc276afd 100644 --- a/src/database/src/Model/Concerns/CamelCase.php +++ b/src/database/src/Model/Concerns/CamelCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Hyperf\Stringable\StrCache; diff --git a/src/database/src/Model/Concerns/GuardsAttributes.php b/src/database/src/Model/Concerns/GuardsAttributes.php index d0d699d0b..20c5387e0 100644 --- a/src/database/src/Model/Concerns/GuardsAttributes.php +++ b/src/database/src/Model/Concerns/GuardsAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Hyperf\Stringable\Str; diff --git a/src/database/src/Model/Concerns/HasAttributes.php b/src/database/src/Model/Concerns/HasAttributes.php index 2ce88dc33..625aabde3 100644 --- a/src/database/src/Model/Concerns/HasAttributes.php +++ b/src/database/src/Model/Concerns/HasAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use BackedEnum; @@ -1154,7 +1155,7 @@ trait HasAttributes /** * Encode the given value as JSON. */ - protected function asJson(mixed $value): string|false + protected function asJson(mixed $value): false|string { return json_encode($value); } @@ -1238,7 +1239,7 @@ trait HasAttributes /** * Return a timestamp as unix timestamp. */ - protected function asTimestamp(mixed $value): int|false + protected function asTimestamp(mixed $value): false|int { return $this->asDateTime($value)->getTimestamp(); } diff --git a/src/database/src/Model/Concerns/HasEvents.php b/src/database/src/Model/Concerns/HasEvents.php index 977462a3c..255a7cf90 100644 --- a/src/database/src/Model/Concerns/HasEvents.php +++ b/src/database/src/Model/Concerns/HasEvents.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Hyperf\Database\Model\Events\Booted; diff --git a/src/database/src/Model/Concerns/HasGlobalScopes.php b/src/database/src/Model/Concerns/HasGlobalScopes.php index ad9648390..759875018 100644 --- a/src/database/src/Model/Concerns/HasGlobalScopes.php +++ b/src/database/src/Model/Concerns/HasGlobalScopes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Closure; @@ -22,7 +23,7 @@ trait HasGlobalScopes /** * Register a new global scope on the model. * - * @param Closure|\Hyperf\Database\Model\Scope|string $scope + * @param Closure|Scope|string $scope * * @throws InvalidArgumentException */ @@ -44,7 +45,7 @@ trait HasGlobalScopes /** * Determine if a model has a global scope. * - * @param \Hyperf\Database\Model\Scope|string $scope + * @param Scope|string $scope */ public static function hasGlobalScope($scope): bool { @@ -54,8 +55,8 @@ trait HasGlobalScopes /** * Get a global scope registered with the model. * - * @param \Hyperf\Database\Model\Scope|string $scope - * @return null|Closure|\Hyperf\Database\Model\Scope + * @param Scope|string $scope + * @return null|Closure|Scope */ public static function getGlobalScope($scope) { diff --git a/src/database/src/Model/Concerns/HasRelationships.php b/src/database/src/Model/Concerns/HasRelationships.php index 07faeb329..cd32e2af6 100644 --- a/src/database/src/Model/Concerns/HasRelationships.php +++ b/src/database/src/Model/Concerns/HasRelationships.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Closure; @@ -100,7 +101,7 @@ trait HasRelationships * @param string $related * @param string $foreignKey * @param string $localKey - * @return \Hyperf\Database\Model\Relations\HasOne + * @return HasOne */ public function hasOne($related, $foreignKey = null, $localKey = null) { @@ -122,7 +123,7 @@ trait HasRelationships * @param null|string $secondKey * @param null|string $localKey * @param null|string $secondLocalKey - * @return \Hyperf\Database\Model\Relations\HasOneThrough + * @return HasOneThrough */ public function hasOneThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) { @@ -151,7 +152,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $localKey - * @return \Hyperf\Database\Model\Relations\MorphOne + * @return MorphOne */ public function morphOne($related, $name, $type = null, $id = null, $localKey = null) { @@ -173,7 +174,7 @@ trait HasRelationships * @param string $foreignKey * @param string $ownerKey * @param string $relation - * @return \Hyperf\Database\Model\Relations\BelongsTo + * @return BelongsTo */ public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null) { @@ -214,7 +215,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $ownerKey - * @return \Hyperf\Database\Model\Relations\MorphTo + * @return MorphTo */ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null) { @@ -254,7 +255,7 @@ trait HasRelationships * @param string $related * @param string $foreignKey * @param string $localKey - * @return \Hyperf\Database\Model\Relations\HasMany + * @return HasMany */ public function hasMany($related, $foreignKey = null, $localKey = null) { @@ -281,7 +282,7 @@ trait HasRelationships * @param null|string $secondKey * @param null|string $localKey * @param null|string $secondLocalKey - * @return \Hyperf\Database\Model\Relations\HasManyThrough + * @return HasManyThrough */ public function hasManyThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) { @@ -310,7 +311,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $localKey - * @return \Hyperf\Database\Model\Relations\MorphMany + * @return MorphMany */ public function morphMany($related, $name, $type = null, $id = null, $localKey = null) { @@ -338,7 +339,7 @@ trait HasRelationships * @param string $parentKey * @param string $relatedKey * @param string $relation - * @return \Hyperf\Database\Model\Relations\BelongsToMany + * @return BelongsToMany */ public function belongsToMany( $related, @@ -395,7 +396,7 @@ trait HasRelationships * @param string $parentKey * @param string $relatedKey * @param bool $inverse - * @return \Hyperf\Database\Model\Relations\MorphToMany + * @return MorphToMany */ public function morphToMany( $related, @@ -453,7 +454,7 @@ trait HasRelationships * @param string $relatedPivotKey * @param string $parentKey * @param string $relatedKey - * @return \Hyperf\Database\Model\Relations\MorphToMany + * @return MorphToMany */ public function morphedByMany( $related, @@ -487,7 +488,7 @@ trait HasRelationships * Get the joining table name for a many-to-many relation. * * @param string $related - * @param null|\Hyperf\Database\Model\Model $instance + * @param null|Model $instance * @return string */ public function joiningTable($related, $instance = null) @@ -663,7 +664,7 @@ trait HasRelationships * * @param string $foreignKey * @param string $localKey - * @return \Hyperf\Database\Model\Relations\HasOne + * @return HasOne */ protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey) { @@ -677,7 +678,7 @@ trait HasRelationships * @param string $secondKey * @param string $localKey * @param string $secondLocalKey - * @return \Hyperf\Database\Model\Relations\HasOneThrough + * @return HasOneThrough */ protected function newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { @@ -690,7 +691,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $localKey - * @return \Hyperf\Database\Model\Relations\MorphOne + * @return MorphOne */ protected function newMorphOne(Builder $query, Model $parent, $type, $id, $localKey) { @@ -703,7 +704,7 @@ trait HasRelationships * @param string $foreignKey * @param string $ownerKey * @param string $relation - * @return \Hyperf\Database\Model\Relations\BelongsTo + * @return BelongsTo */ protected function newBelongsTo(Builder $query, Model $child, $foreignKey, $ownerKey, $relation) { @@ -717,7 +718,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $ownerKey - * @return \Hyperf\Database\Model\Relations\MorphTo + * @return MorphTo */ protected function morphEagerTo($name, $type, $id, $ownerKey) { @@ -739,7 +740,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $ownerKey - * @return \Hyperf\Database\Model\Relations\MorphTo + * @return MorphTo */ protected function morphInstanceTo($target, $name, $type, $id, $ownerKey) { @@ -764,7 +765,7 @@ trait HasRelationships * @param string $ownerKey * @param string $type * @param string $relation - * @return \Hyperf\Database\Model\Relations\MorphTo + * @return MorphTo */ protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) { @@ -788,7 +789,7 @@ trait HasRelationships * * @param string $foreignKey * @param string $localKey - * @return \Hyperf\Database\Model\Relations\HasMany + * @return HasMany */ protected function newHasMany(Builder $query, Model $parent, $foreignKey, $localKey) { @@ -802,7 +803,7 @@ trait HasRelationships * @param string $secondKey * @param string $localKey * @param string $secondLocalKey - * @return \Hyperf\Database\Model\Relations\HasManyThrough + * @return HasManyThrough */ protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { @@ -815,7 +816,7 @@ trait HasRelationships * @param string $type * @param string $id * @param string $localKey - * @return \Hyperf\Database\Model\Relations\MorphMany + * @return MorphMany */ protected function newMorphMany(Builder $query, Model $parent, $type, $id, $localKey) { @@ -831,7 +832,7 @@ trait HasRelationships * @param string $parentKey * @param string $relatedKey * @param string $relationName - * @return \Hyperf\Database\Model\Relations\BelongsToMany + * @return BelongsToMany */ protected function newBelongsToMany( Builder $query, @@ -857,7 +858,7 @@ trait HasRelationships * @param string $relatedKey * @param string $relationName * @param bool $inverse - * @return \Hyperf\Database\Model\Relations\MorphToMany + * @return MorphToMany */ protected function newMorphToMany( Builder $query, diff --git a/src/database/src/Model/Concerns/HasTimestamps.php b/src/database/src/Model/Concerns/HasTimestamps.php index da7afe516..f01391ed0 100644 --- a/src/database/src/Model/Concerns/HasTimestamps.php +++ b/src/database/src/Model/Concerns/HasTimestamps.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Carbon\Carbon; diff --git a/src/database/src/Model/Concerns/HasUlids.php b/src/database/src/Model/Concerns/HasUlids.php index 4dae2ac57..c6b067cf5 100644 --- a/src/database/src/Model/Concerns/HasUlids.php +++ b/src/database/src/Model/Concerns/HasUlids.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Hyperf\Stringable\Str; diff --git a/src/database/src/Model/Concerns/HasUuids.php b/src/database/src/Model/Concerns/HasUuids.php index 608f3d958..3bd3603a3 100644 --- a/src/database/src/Model/Concerns/HasUuids.php +++ b/src/database/src/Model/Concerns/HasUuids.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Hyperf\Stringable\Str; diff --git a/src/database/src/Model/Concerns/HidesAttributes.php b/src/database/src/Model/Concerns/HidesAttributes.php index b2eb12792..362672253 100644 --- a/src/database/src/Model/Concerns/HidesAttributes.php +++ b/src/database/src/Model/Concerns/HidesAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; trait HidesAttributes diff --git a/src/database/src/Model/Concerns/QueriesRelationships.php b/src/database/src/Model/Concerns/QueriesRelationships.php index 121a43842..b3065e6a6 100644 --- a/src/database/src/Model/Concerns/QueriesRelationships.php +++ b/src/database/src/Model/Concerns/QueriesRelationships.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Concerns; use Closure; @@ -30,7 +31,7 @@ trait QueriesRelationships * @param string $operator * @param int $count * @param string $boolean - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null) { @@ -80,7 +81,7 @@ trait QueriesRelationships * @param string $relation * @param string $operator * @param int $count - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function orHas($relation, $operator = '>=', $count = 1) { @@ -92,7 +93,7 @@ trait QueriesRelationships * * @param string $relation * @param string $boolean - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function doesntHave($relation, $boolean = 'and', ?Closure $callback = null) { @@ -103,7 +104,7 @@ trait QueriesRelationships * Add a relationship count / exists condition to the query with an "or". * * @param string $relation - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function orDoesntHave($relation) { @@ -116,7 +117,7 @@ trait QueriesRelationships * @param string $relation * @param string $operator * @param int $count - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function whereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1) { @@ -127,10 +128,9 @@ trait QueriesRelationships * Add a relationship count / exists condition to the query with where clauses and an "or". * * @param string $relation - * @param Closure $callback * @param string $operator * @param int $count - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function orWhereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1) { @@ -141,7 +141,7 @@ trait QueriesRelationships * Add a relationship count / exists condition to the query with where clauses. * * @param string $relation - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function whereDoesntHave($relation, ?Closure $callback = null) { @@ -152,8 +152,7 @@ trait QueriesRelationships * Add a relationship count / exists condition to the query with where clauses and an "or". * * @param string $relation - * @param Closure $callback - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function orWhereDoesntHave($relation, ?Closure $callback = null) { @@ -302,7 +301,7 @@ trait QueriesRelationships /** * Merge the where constraints from another query to the current query. * - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function mergeConstraintsFrom(Builder $from) { @@ -337,7 +336,6 @@ trait QueriesRelationships * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". * * @param array|string $types - * @param Closure $callback * @return $this */ public function orWhereHasMorph(string $relation, $types, ?Closure $callback = null, string $operator = '>=', int $count = 1) @@ -360,7 +358,6 @@ trait QueriesRelationships * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". * * @param array|string $types - * @param Closure $callback * @return $this */ public function orWhereDoesntHaveMorph(string $relation, $types, ?Closure $callback = null) @@ -432,7 +429,7 @@ trait QueriesRelationships * @param int $count * @param string $boolean * @param null|Closure $callback - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ protected function hasNested($relations, $operator = '>=', $count = 1, $boolean = 'and', $callback = null) { @@ -463,7 +460,7 @@ trait QueriesRelationships * @param string $operator * @param int $count * @param string $boolean - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator, $count, $boolean) { @@ -498,7 +495,7 @@ trait QueriesRelationships * Get the "has relation" base query instance. * * @param string $relation - * @return \Hyperf\Database\Model\Relations\Relation + * @return Relation */ protected function getRelationWithoutConstraints($relation) { diff --git a/src/database/src/Model/EnumCollector.php b/src/database/src/Model/EnumCollector.php index d9966053b..865badded 100644 --- a/src/database/src/Model/EnumCollector.php +++ b/src/database/src/Model/EnumCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use BackedEnum; diff --git a/src/database/src/Model/Events/Booted.php b/src/database/src/Model/Events/Booted.php index d38dcb88e..29a28e536 100644 --- a/src/database/src/Model/Events/Booted.php +++ b/src/database/src/Model/Events/Booted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Booted extends Event diff --git a/src/database/src/Model/Events/Booting.php b/src/database/src/Model/Events/Booting.php index 4bef0fd18..24a0987a4 100644 --- a/src/database/src/Model/Events/Booting.php +++ b/src/database/src/Model/Events/Booting.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Booting extends Event diff --git a/src/database/src/Model/Events/Created.php b/src/database/src/Model/Events/Created.php index de60ac0e2..26f4db68b 100644 --- a/src/database/src/Model/Events/Created.php +++ b/src/database/src/Model/Events/Created.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Created extends Event diff --git a/src/database/src/Model/Events/Creating.php b/src/database/src/Model/Events/Creating.php index 2a1bc5deb..840cbe2b5 100644 --- a/src/database/src/Model/Events/Creating.php +++ b/src/database/src/Model/Events/Creating.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Creating extends Event diff --git a/src/database/src/Model/Events/Deleted.php b/src/database/src/Model/Events/Deleted.php index 7347ea72d..e18310dfd 100644 --- a/src/database/src/Model/Events/Deleted.php +++ b/src/database/src/Model/Events/Deleted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Deleted extends Event diff --git a/src/database/src/Model/Events/Deleting.php b/src/database/src/Model/Events/Deleting.php index 75cd6c975..7751ada3a 100644 --- a/src/database/src/Model/Events/Deleting.php +++ b/src/database/src/Model/Events/Deleting.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Deleting extends Event diff --git a/src/database/src/Model/Events/Event.php b/src/database/src/Model/Events/Event.php index 67aa8c367..ee34855c2 100644 --- a/src/database/src/Model/Events/Event.php +++ b/src/database/src/Model/Events/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; use Hyperf\Database\Model\Model; diff --git a/src/database/src/Model/Events/ForceDeleted.php b/src/database/src/Model/Events/ForceDeleted.php index 44f191388..071893457 100644 --- a/src/database/src/Model/Events/ForceDeleted.php +++ b/src/database/src/Model/Events/ForceDeleted.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class ForceDeleted extends Event diff --git a/src/database/src/Model/Events/ForceDeleting.php b/src/database/src/Model/Events/ForceDeleting.php index ecf8b7be4..f52fcf519 100644 --- a/src/database/src/Model/Events/ForceDeleting.php +++ b/src/database/src/Model/Events/ForceDeleting.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class ForceDeleting extends Event diff --git a/src/database/src/Model/Events/Restored.php b/src/database/src/Model/Events/Restored.php index 72f870b64..300e7688e 100644 --- a/src/database/src/Model/Events/Restored.php +++ b/src/database/src/Model/Events/Restored.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Restored extends Event diff --git a/src/database/src/Model/Events/Restoring.php b/src/database/src/Model/Events/Restoring.php index c23597d88..e3cc77fc6 100644 --- a/src/database/src/Model/Events/Restoring.php +++ b/src/database/src/Model/Events/Restoring.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Restoring extends Event diff --git a/src/database/src/Model/Events/Retrieved.php b/src/database/src/Model/Events/Retrieved.php index c01b63515..5200b24a0 100644 --- a/src/database/src/Model/Events/Retrieved.php +++ b/src/database/src/Model/Events/Retrieved.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Retrieved extends Event diff --git a/src/database/src/Model/Events/Saved.php b/src/database/src/Model/Events/Saved.php index 431113ee3..41c1d9d5b 100644 --- a/src/database/src/Model/Events/Saved.php +++ b/src/database/src/Model/Events/Saved.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Saved extends Event diff --git a/src/database/src/Model/Events/Saving.php b/src/database/src/Model/Events/Saving.php index e0f6404e7..5b0b066f1 100644 --- a/src/database/src/Model/Events/Saving.php +++ b/src/database/src/Model/Events/Saving.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Saving extends Event diff --git a/src/database/src/Model/Events/Updated.php b/src/database/src/Model/Events/Updated.php index 46affc2c0..71b60f2f2 100644 --- a/src/database/src/Model/Events/Updated.php +++ b/src/database/src/Model/Events/Updated.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Updated extends Event diff --git a/src/database/src/Model/Events/Updating.php b/src/database/src/Model/Events/Updating.php index d144fc3dd..8215e437e 100644 --- a/src/database/src/Model/Events/Updating.php +++ b/src/database/src/Model/Events/Updating.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Events; class Updating extends Event diff --git a/src/database/src/Model/Factory.php b/src/database/src/Model/Factory.php index 575a073c2..539bca2ab 100644 --- a/src/database/src/Model/Factory.php +++ b/src/database/src/Model/Factory.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use ArrayAccess; +use Faker\Generator; use Faker\Generator as Faker; use Symfony\Component\Finder\Finder; @@ -48,7 +50,7 @@ class Factory implements ArrayAccess /** * The Faker instance for the builder. * - * @var \Faker\Generator + * @var Generator */ protected $faker; @@ -240,7 +242,7 @@ class Factory implements ArrayAccess * * @param string $class * @param string $name - * @return \Hyperf\Database\Model\FactoryBuilder + * @return FactoryBuilder */ public function of($class, $name = 'default') { diff --git a/src/database/src/Model/FactoryBuilder.php b/src/database/src/Model/FactoryBuilder.php index cbb1a1c49..805f3e5da 100644 --- a/src/database/src/Model/FactoryBuilder.php +++ b/src/database/src/Model/FactoryBuilder.php @@ -9,10 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Closure; +use Faker\Generator; use Faker\Generator as Faker; +use Hyperf\Collection\Collection; use Hyperf\Macroable\Macroable; use InvalidArgumentException; @@ -82,7 +85,7 @@ class FactoryBuilder /** * The Faker instance for the builder. * - * @var \Faker\Generator + * @var Generator */ protected $faker; @@ -244,7 +247,7 @@ class FactoryBuilder /** * Run after making callbacks on a collection of models. * - * @param \Hyperf\Collection\Collection $models + * @param Collection $models */ public function callAfterMaking($models) { @@ -254,7 +257,7 @@ class FactoryBuilder /** * Run after creating callbacks on a collection of models. * - * @param \Hyperf\Collection\Collection $models + * @param Collection $models */ public function callAfterCreating($models) { @@ -264,7 +267,7 @@ class FactoryBuilder /** * Set the connection name on the results and store them. * - * @param \Hyperf\Collection\Collection $results + * @param Collection $results */ protected function store($results) { @@ -302,7 +305,7 @@ class FactoryBuilder /** * Make an instance of the model with the given attributes. * - * @return \Hyperf\Database\Model\Model + * @return Model */ protected function makeInstance(array $attributes = []) { @@ -393,7 +396,7 @@ class FactoryBuilder /** * Call after callbacks for each model and state. * - * @param \Hyperf\Collection\Collection $models + * @param Collection $models */ protected function callAfter(array $afterCallbacks, $models) { @@ -409,7 +412,7 @@ class FactoryBuilder /** * Call after callbacks for each model and state. * - * @param \Hyperf\Database\Model\Model $model + * @param Model $model * @param string $state */ protected function callAfterCallbacks(array $afterCallbacks, $model, $state) diff --git a/src/database/src/Model/GlobalScope.php b/src/database/src/Model/GlobalScope.php index 5f94ba611..90a5fe3fa 100644 --- a/src/database/src/Model/GlobalScope.php +++ b/src/database/src/Model/GlobalScope.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; class GlobalScope diff --git a/src/database/src/Model/IgnoreOnTouch.php b/src/database/src/Model/IgnoreOnTouch.php index 1b1ef8b30..286217c9d 100644 --- a/src/database/src/Model/IgnoreOnTouch.php +++ b/src/database/src/Model/IgnoreOnTouch.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; class IgnoreOnTouch diff --git a/src/database/src/Model/JsonEncodingException.php b/src/database/src/Model/JsonEncodingException.php index 195c0414b..9fe1e4f1e 100644 --- a/src/database/src/Model/JsonEncodingException.php +++ b/src/database/src/Model/JsonEncodingException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use RuntimeException; diff --git a/src/database/src/Model/MassAssignmentException.php b/src/database/src/Model/MassAssignmentException.php index cad98fd35..d5ef9b588 100755 --- a/src/database/src/Model/MassAssignmentException.php +++ b/src/database/src/Model/MassAssignmentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use RuntimeException; diff --git a/src/database/src/Model/Model.php b/src/database/src/Model/Model.php index 6f4361868..593cbaeeb 100644 --- a/src/database/src/Model/Model.php +++ b/src/database/src/Model/Model.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use ArrayAccess; @@ -280,7 +281,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * Fill the model with an array of attributes. * * @return $this - * @throws \Hyperf\Database\Model\MassAssignmentException + * @throws MassAssignmentException */ public function fill(array $attributes) { @@ -378,7 +379,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * Begin querying the model on a given connection. * * @param null|string $connection - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public static function on($connection = null) { @@ -395,7 +396,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Begin querying the model on the write connection. * - * @return \Hyperf\Database\Query\Builder + * @return QueryBuilder */ public static function onWriteConnection() { @@ -406,7 +407,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * Get all of the models from the database. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Collection|static[] + * @return Collection|static[] */ public static function all($columns = ['*']) { @@ -417,7 +418,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * Begin querying a model with eager loading. * * @param array|string $relations - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public static function with($relations) { @@ -602,7 +603,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Destroy the models for the given IDs. * - * @param array|\Hyperf\Collection\Collection|int $ids + * @param array|BaseCollection|int $ids */ public static function destroy($ids): int { @@ -687,7 +688,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Begin querying the model. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public static function query() { @@ -697,7 +698,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Get a new query builder for the model's table. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function newQuery() { @@ -707,7 +708,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Get a new query builder that doesn't have any global scopes or eager loading. * - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function newModelQuery() { @@ -717,7 +718,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Get a new query builder with no relationships loaded. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function newQueryWithoutRelationships() { @@ -727,8 +728,8 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Register the global scopes for this builder instance. * - * @param \Hyperf\Database\Model\Builder $builder - * @return \Hyperf\Database\Model\Builder + * @param Builder $builder + * @return Builder */ public function registerGlobalScopes($builder) { @@ -742,7 +743,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Get a new query builder that doesn't have any global scopes. * - * @return \Hyperf\Database\Model\Builder|static + * @return Builder|static */ public function newQueryWithoutScopes() { @@ -752,8 +753,8 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Get a new query instance without a given scope. * - * @param \Hyperf\Database\Model\Scope|string $scope - * @return \Hyperf\Database\Model\Builder + * @param Scope|string $scope + * @return Builder */ public function newQueryWithoutScope($scope) { @@ -764,7 +765,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * Get a new query to restore one or more models by their queueable IDs. * * @param array|int $ids - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function newQueryForRestoration($ids) { @@ -775,8 +776,8 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Create a new Model query builder for the model. * - * @param \Hyperf\Database\Query\Builder $query - * @return \Hyperf\Database\Model\Builder|static + * @param QueryBuilder $query + * @return Builder|static */ public function newModelBuilder($query) { @@ -786,7 +787,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Create a new Model Collection instance. * - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function newCollection(array $models = []) { @@ -796,11 +797,10 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Create a new pivot model instance. * - * @param \Hyperf\Database\Model\Model $parent * @param string $table * @param bool $exists * @param null|string $using - * @return \Hyperf\Database\Model\Relations\Pivot + * @return Pivot */ public function newPivot(self $parent, array $attributes, $table, $exists, $using = null) { @@ -820,7 +820,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * * @param int $options * @return string - * @throws \Hyperf\Database\Model\JsonEncodingException + * @throws JsonEncodingException */ public function toJson($options = 0) { @@ -904,7 +904,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Determine if two models have the same ID and belong to the same table. * - * @param null|\Hyperf\Database\Model\Model $model + * @param null|Model $model * @return bool */ public function is($model) @@ -915,7 +915,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Determine if two models are not the same. * - * @param null|\Hyperf\Database\Model\Model $model + * @param null|Model $model * @return bool */ public function isNot($model) @@ -1094,7 +1094,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab * Retrieve the model for a bound value. * * @param mixed $value - * @return null|\Hyperf\Database\Model\Model + * @return null|Model */ public function resolveRouteBinding($value) { @@ -1300,7 +1300,6 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Perform a model update operation. * - * @param \Hyperf\Database\Model\Builder $query * @return bool */ protected function performUpdate(Builder $query) @@ -1340,8 +1339,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Set the keys for a save update query. * - * @param \Hyperf\Database\Model\Builder $query - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function setKeysForSaveQuery(Builder $query) { @@ -1361,7 +1359,6 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Perform a model insert operation. * - * @param \Hyperf\Database\Model\Builder $query * @return bool */ protected function performInsert(Builder $query) @@ -1414,7 +1411,6 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Insert the given attributes and set the ID on the model. * - * @param \Hyperf\Database\Model\Builder $query * @param array $attributes */ protected function insertAndSetId(Builder $query, $attributes) @@ -1437,7 +1433,7 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Get a new query builder instance for the connection. * - * @return \Hyperf\Database\Query\Builder + * @return QueryBuilder */ protected function newBaseQueryBuilder() { diff --git a/src/database/src/Model/ModelMeta.php b/src/database/src/Model/ModelMeta.php index 5aea3a204..4b4b164c7 100644 --- a/src/database/src/Model/ModelMeta.php +++ b/src/database/src/Model/ModelMeta.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Hyperf\Contract\UnCompressInterface; diff --git a/src/database/src/Model/ModelNotFoundException.php b/src/database/src/Model/ModelNotFoundException.php index 9fd99755f..9c6bdd4f6 100755 --- a/src/database/src/Model/ModelNotFoundException.php +++ b/src/database/src/Model/ModelNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Hyperf\Collection\Arr; @@ -50,8 +51,6 @@ class ModelNotFoundException extends RuntimeException /** * Get the affected Model model. - * - * @return string */ public function getModel(): ?string { diff --git a/src/database/src/Model/Register.php b/src/database/src/Model/Register.php index b864d1d85..02ef323be 100644 --- a/src/database/src/Model/Register.php +++ b/src/database/src/Model/Register.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Hyperf\Database\ConnectionInterface; diff --git a/src/database/src/Model/RelationNotFoundException.php b/src/database/src/Model/RelationNotFoundException.php index 530b29c4d..87ed7f31b 100755 --- a/src/database/src/Model/RelationNotFoundException.php +++ b/src/database/src/Model/RelationNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use RuntimeException; diff --git a/src/database/src/Model/Relations/BelongsTo.php b/src/database/src/Model/Relations/BelongsTo.php index a49f74b9e..5a310273a 100755 --- a/src/database/src/Model/Relations/BelongsTo.php +++ b/src/database/src/Model/Relations/BelongsTo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Builder; @@ -171,8 +172,8 @@ class BelongsTo extends Relation /** * Associate the model instance to the given parent. * - * @param \Hyperf\Database\Model\Model|int|string $model - * @return \Hyperf\Database\Model\Model + * @param int|Model|string $model + * @return Model */ public function associate($model) { @@ -192,7 +193,7 @@ class BelongsTo extends Relation /** * Dissociate previously associated model from the given parent. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function dissociate() { @@ -205,7 +206,7 @@ class BelongsTo extends Relation * Add the constraints for a relationship query. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -224,7 +225,7 @@ class BelongsTo extends Relation * Add the constraints for a relationship query on the same table. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -244,7 +245,7 @@ class BelongsTo extends Relation /** * Get the child of the relationship. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function getChild() { @@ -355,7 +356,7 @@ class BelongsTo extends Relation /** * Make a new related instance for the given model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ protected function newRelatedInstanceFor(Model $parent) { diff --git a/src/database/src/Model/Relations/BelongsToMany.php b/src/database/src/Model/Relations/BelongsToMany.php index 8e73805f9..4ac4ba40d 100755 --- a/src/database/src/Model/Relations/BelongsToMany.php +++ b/src/database/src/Model/Relations/BelongsToMany.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Contract\LengthAwarePaginatorInterface; +use Hyperf\Contract\PaginatorInterface; use Hyperf\Database\Model\Builder; use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Model; @@ -361,7 +363,7 @@ class BelongsToMany extends Relation * * @param array $columns * @param mixed $id - * @return \Hyperf\Collection\Collection|\Hyperf\Database\Model\Model + * @return \Hyperf\Collection\Collection|Model */ public function findOrNew($id, $columns = ['*']) { @@ -375,7 +377,7 @@ class BelongsToMany extends Relation /** * Get the first related model record matching the attributes or instantiate it. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function firstOrNew(array $attributes) { @@ -390,7 +392,7 @@ class BelongsToMany extends Relation * Get the first related record matching the attributes or create it. * * @param bool $touch - * @return \Hyperf\Database\Model\Model + * @return Model */ public function firstOrCreate(array $attributes, array $joining = [], $touch = true) { @@ -405,7 +407,7 @@ class BelongsToMany extends Relation * Create or update a related record matching the attributes, and fill it with values. * * @param bool $touch - * @return \Hyperf\Database\Model\Model + * @return Model */ public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true) { @@ -425,7 +427,7 @@ class BelongsToMany extends Relation * * @param array $columns * @param mixed $id - * @return null|\Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model + * @return null|Collection|Model */ public function find($id, $columns = ['*']) { @@ -441,7 +443,7 @@ class BelongsToMany extends Relation * * @param array $columns * @param mixed $ids - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function findMany($ids, $columns = ['*']) { @@ -456,8 +458,8 @@ class BelongsToMany extends Relation * * @param array $columns * @param mixed $id - * @return \Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model - * @throws \Hyperf\Database\Model\ModelNotFoundException + * @return Collection|Model + * @throws ModelNotFoundException */ public function findOrFail($id, $columns = ['*']) { @@ -490,8 +492,8 @@ class BelongsToMany extends Relation * Execute the query and get the first result or throw an exception. * * @param array $columns - * @return \Hyperf\Database\Model\Model|static - * @throws \Hyperf\Database\Model\ModelNotFoundException + * @return Model|static + * @throws ModelNotFoundException */ public function firstOrFail($columns = ['*']) { @@ -514,7 +516,7 @@ class BelongsToMany extends Relation * Execute the query as a "select" statement. * * @param array $columns - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function get($columns = ['*']) { @@ -560,7 +562,7 @@ class BelongsToMany extends Relation * @param array $columns * @param string $pageName * @param null|int $page - * @return \Hyperf\Contract\PaginatorInterface + * @return PaginatorInterface */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { @@ -654,7 +656,7 @@ class BelongsToMany extends Relation * Save a new model and attach it to the parent model. * * @param bool $touch - * @return \Hyperf\Database\Model\Model + * @return Model */ public function save(Model $model, array $pivotAttributes = [], $touch = true) { @@ -686,7 +688,7 @@ class BelongsToMany extends Relation * Create a new instance of the related model. * * @param bool $touch - * @return \Hyperf\Database\Model\Model + * @return Model */ public function create(array $attributes = [], array $joining = [], $touch = true) { @@ -724,7 +726,7 @@ class BelongsToMany extends Relation * Add the constraints for a relationship query. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -741,7 +743,7 @@ class BelongsToMany extends Relation * Add the constraints for a relationship query on the same table. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQueryForSelfJoin(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -906,7 +908,7 @@ class BelongsToMany extends Relation /** * Set the join clause for the relation query. * - * @param null|\Hyperf\Database\Model\Builder $query + * @param null|Builder $query * @return $this */ protected function performJoin($query = null) diff --git a/src/database/src/Model/Relations/Concerns/AsPivot.php b/src/database/src/Model/Relations/Concerns/AsPivot.php index fcc6ac81e..916344939 100644 --- a/src/database/src/Model/Relations/Concerns/AsPivot.php +++ b/src/database/src/Model/Relations/Concerns/AsPivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations\Concerns; use Hyperf\Database\Model\Builder; @@ -23,7 +24,7 @@ trait AsPivot /** * The parent model of the relationship. * - * @var \Hyperf\Database\Model\Model + * @var Model */ public $pivotParent; @@ -202,7 +203,7 @@ trait AsPivot * Get a new query to restore one or more models by their queueable IDs. * * @param array|string $ids - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function newQueryForRestoration($ids) { @@ -224,7 +225,7 @@ trait AsPivot /** * Set the keys for a save update query. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function setKeysForSaveQuery(Builder $query) { @@ -246,7 +247,7 @@ trait AsPivot /** * Get the query builder for a delete operation on the pivot. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function getDeleteQuery() { @@ -260,7 +261,7 @@ trait AsPivot * Get a new query to restore multiple models by their queueable IDs. * * @param array|int $ids - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function newQueryForCollectionRestoration(array $ids) { diff --git a/src/database/src/Model/Relations/Concerns/InteractsWithPivotTable.php b/src/database/src/Model/Relations/Concerns/InteractsWithPivotTable.php index ce2597a5d..fe4f94797 100644 --- a/src/database/src/Model/Relations/Concerns/InteractsWithPivotTable.php +++ b/src/database/src/Model/Relations/Concerns/InteractsWithPivotTable.php @@ -9,11 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations\Concerns; use Hyperf\Collection\Collection as BaseCollection; use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Model; +use Hyperf\Database\Model\Relations\Pivot; +use Hyperf\Database\Query\Builder; use function Hyperf\Collection\collect; @@ -75,7 +78,7 @@ trait InteractsWithPivotTable /** * Sync the intermediate tables with a list of IDs without detaching. * - * @param array|\Hyperf\Collection\Collection|\Hyperf\Database\Model\Model $ids + * @param array|BaseCollection|Model $ids * @return array */ public function syncWithoutDetaching($ids) @@ -86,7 +89,7 @@ trait InteractsWithPivotTable /** * Sync the intermediate tables with a list of IDs or collection of models. * - * @param array|\Hyperf\Collection\Collection|\Hyperf\Database\Model\Model $ids + * @param array|BaseCollection|Model $ids * @param bool $detaching * @return array */ @@ -220,7 +223,7 @@ trait InteractsWithPivotTable * Create a new pivot model instance. * * @param bool $exists - * @return \Hyperf\Database\Model\Relations\Pivot + * @return Pivot */ public function newPivot(array $attributes = [], $exists = false) { @@ -238,7 +241,7 @@ trait InteractsWithPivotTable /** * Create a new existing pivot model instance. * - * @return \Hyperf\Database\Model\Relations\Pivot + * @return Pivot */ public function newExistingPivot(array $attributes = []) { @@ -248,7 +251,7 @@ trait InteractsWithPivotTable /** * Get a new plain query builder for the pivot table. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function newPivotStatement() { @@ -259,7 +262,7 @@ trait InteractsWithPivotTable * Get a new pivot statement for a given "other" ID. * * @param mixed $id - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function newPivotStatementForId($id) { @@ -459,7 +462,7 @@ trait InteractsWithPivotTable /** * Create a new query builder for the pivot table. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ protected function newPivotQuery() { diff --git a/src/database/src/Model/Relations/Concerns/SupportsDefaultModels.php b/src/database/src/Model/Relations/Concerns/SupportsDefaultModels.php index 2932a2389..4b925dfcf 100644 --- a/src/database/src/Model/Relations/Concerns/SupportsDefaultModels.php +++ b/src/database/src/Model/Relations/Concerns/SupportsDefaultModels.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations\Concerns; use Closure; @@ -41,14 +42,14 @@ trait SupportsDefaultModels /** * Make a new related instance for the given model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ abstract protected function newRelatedInstanceFor(Model $parent); /** * Get the default value for this relation. * - * @return null|\Hyperf\Database\Model\Model + * @return null|Model */ protected function getDefaultFor(Model $parent) { diff --git a/src/database/src/Model/Relations/Constraint.php b/src/database/src/Model/Relations/Constraint.php index e68ec4978..a0c59e79c 100644 --- a/src/database/src/Model/Relations/Constraint.php +++ b/src/database/src/Model/Relations/Constraint.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Context\Context; diff --git a/src/database/src/Model/Relations/HasMany.php b/src/database/src/Model/Relations/HasMany.php index 315717e22..344b04372 100755 --- a/src/database/src/Model/Relations/HasMany.php +++ b/src/database/src/Model/Relations/HasMany.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Collection; diff --git a/src/database/src/Model/Relations/HasManyThrough.php b/src/database/src/Model/Relations/HasManyThrough.php index 2c2102f3f..7a416a41c 100644 --- a/src/database/src/Model/Relations/HasManyThrough.php +++ b/src/database/src/Model/Relations/HasManyThrough.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Generator; use Hyperf\Contract\LengthAwarePaginatorInterface; +use Hyperf\Contract\PaginatorInterface; use Hyperf\Database\Model\Builder; use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Model; @@ -26,14 +28,14 @@ class HasManyThrough extends Relation /** * The "through" parent model instance. * - * @var \Hyperf\Database\Model\Model + * @var Model */ protected $throughParent; /** * The far parent model instance. * - * @var \Hyperf\Database\Model\Model + * @var Model */ protected $farParent; @@ -182,7 +184,7 @@ class HasManyThrough extends Relation /** * Get the first related model record matching the attributes or instantiate it. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function firstOrNew(array $attributes) { @@ -196,7 +198,7 @@ class HasManyThrough extends Relation /** * Create or update a related record matching the attributes, and fill it with values. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function updateOrCreate(array $attributes, array $values = []) { @@ -223,8 +225,8 @@ class HasManyThrough extends Relation * Execute the query and get the first result or throw an exception. * * @param array $columns - * @return \Hyperf\Database\Model\Model|static - * @throws \Hyperf\Database\Model\ModelNotFoundException + * @return Model|static + * @throws ModelNotFoundException */ public function firstOrFail($columns = ['*']) { @@ -240,7 +242,7 @@ class HasManyThrough extends Relation * * @param array $columns * @param mixed $id - * @return null|\Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model + * @return null|Collection|Model */ public function find($id, $columns = ['*']) { @@ -260,7 +262,7 @@ class HasManyThrough extends Relation * * @param array $columns * @param mixed $ids - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function findMany($ids, $columns = ['*']) { @@ -279,8 +281,8 @@ class HasManyThrough extends Relation * * @param array $columns * @param mixed $id - * @return \Hyperf\Database\Model\Collection|\Hyperf\Database\Model\Model - * @throws \Hyperf\Database\Model\ModelNotFoundException + * @return Collection|Model + * @throws ModelNotFoundException */ public function findOrFail($id, $columns = ['*']) { @@ -309,7 +311,7 @@ class HasManyThrough extends Relation * Execute the query as a "select" statement. * * @param array $columns - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function get($columns = ['*']) { @@ -344,7 +346,7 @@ class HasManyThrough extends Relation * @param array $columns * @param string $pageName * @param null|int $page - * @return \Hyperf\Contract\PaginatorInterface + * @return PaginatorInterface */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { @@ -395,7 +397,7 @@ class HasManyThrough extends Relation * Add the constraints for a relationship query. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -420,7 +422,7 @@ class HasManyThrough extends Relation * Add the constraints for a relationship query on the same table. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -445,7 +447,7 @@ class HasManyThrough extends Relation * Add the constraints for a relationship query on the same table as the through parent. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQueryForThroughSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -597,7 +599,7 @@ class HasManyThrough extends Relation * Prepare the query builder for query execution. * * @param array $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function prepareQueryBuilder($columns = ['*']) { diff --git a/src/database/src/Model/Relations/HasOne.php b/src/database/src/Model/Relations/HasOne.php index 2848fb444..9387c65d7 100755 --- a/src/database/src/Model/Relations/HasOne.php +++ b/src/database/src/Model/Relations/HasOne.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Collection; @@ -56,7 +57,7 @@ class HasOne extends HasOneOrMany /** * Make a new related instance for the given model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function newRelatedInstanceFor(Model $parent) { diff --git a/src/database/src/Model/Relations/HasOneOrMany.php b/src/database/src/Model/Relations/HasOneOrMany.php index caec294a5..7d0c209b3 100755 --- a/src/database/src/Model/Relations/HasOneOrMany.php +++ b/src/database/src/Model/Relations/HasOneOrMany.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Builder; @@ -58,7 +59,7 @@ abstract class HasOneOrMany extends Relation /** * Create and return an un-saved instance of the related model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function make(array $attributes = []) { @@ -119,7 +120,7 @@ abstract class HasOneOrMany extends Relation * * @param array $columns * @param mixed $id - * @return \Hyperf\Collection\Collection|\Hyperf\Database\Model\Model + * @return \Hyperf\Collection\Collection|Model */ public function findOrNew($id, $columns = ['*']) { @@ -135,7 +136,7 @@ abstract class HasOneOrMany extends Relation /** * Get the first related model record matching the attributes or instantiate it. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function firstOrNew(array $attributes, array $values = []) { @@ -151,7 +152,7 @@ abstract class HasOneOrMany extends Relation /** * Get the first related record matching the attributes or create it. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function firstOrCreate(array $attributes, array $values = []) { @@ -165,7 +166,7 @@ abstract class HasOneOrMany extends Relation /** * Create or update a related record matching the attributes, and fill it with values. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function updateOrCreate(array $attributes, array $values = []) { @@ -179,7 +180,7 @@ abstract class HasOneOrMany extends Relation /** * Attach a model instance to the parent model. * - * @return false|\Hyperf\Database\Model\Model + * @return false|Model */ public function save(Model $model) { @@ -206,7 +207,7 @@ abstract class HasOneOrMany extends Relation /** * Create a new instance of the related model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function create(array $attributes = []) { @@ -220,7 +221,7 @@ abstract class HasOneOrMany extends Relation /** * Create a Collection of new instances of the related model. * - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function createMany(array $records) { @@ -251,7 +252,7 @@ abstract class HasOneOrMany extends Relation * Add the constraints for a relationship query. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -266,7 +267,7 @@ abstract class HasOneOrMany extends Relation * Add the constraints for a relationship query on the same table. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) { diff --git a/src/database/src/Model/Relations/HasOneThrough.php b/src/database/src/Model/Relations/HasOneThrough.php index a31045751..6423a07e7 100644 --- a/src/database/src/Model/Relations/HasOneThrough.php +++ b/src/database/src/Model/Relations/HasOneThrough.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Collection; @@ -71,7 +72,7 @@ class HasOneThrough extends HasManyThrough /** * Make a new related instance for the given model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function newRelatedInstanceFor(Model $parent) { diff --git a/src/database/src/Model/Relations/MorphMany.php b/src/database/src/Model/Relations/MorphMany.php index 9bcb5a7c0..63e64eebe 100755 --- a/src/database/src/Model/Relations/MorphMany.php +++ b/src/database/src/Model/Relations/MorphMany.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Collection; diff --git a/src/database/src/Model/Relations/MorphOne.php b/src/database/src/Model/Relations/MorphOne.php index 3e18b9d66..d7ab77b89 100755 --- a/src/database/src/Model/Relations/MorphOne.php +++ b/src/database/src/Model/Relations/MorphOne.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Collection; @@ -56,7 +57,7 @@ class MorphOne extends MorphOneOrMany /** * Make a new related instance for the given model. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function newRelatedInstanceFor(Model $parent) { diff --git a/src/database/src/Model/Relations/MorphOneOrMany.php b/src/database/src/Model/Relations/MorphOneOrMany.php index dc4544617..33939b873 100755 --- a/src/database/src/Model/Relations/MorphOneOrMany.php +++ b/src/database/src/Model/Relations/MorphOneOrMany.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Builder; @@ -74,7 +75,7 @@ abstract class MorphOneOrMany extends HasOneOrMany * Get the relationship query. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { diff --git a/src/database/src/Model/Relations/MorphPivot.php b/src/database/src/Model/Relations/MorphPivot.php index 98d7e4f48..7fa106ffb 100644 --- a/src/database/src/Model/Relations/MorphPivot.php +++ b/src/database/src/Model/Relations/MorphPivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Builder; @@ -65,7 +66,7 @@ class MorphPivot extends Pivot * Set the morph class for the pivot. * * @param string $morphClass - * @return \Hyperf\Database\Model\Relations\MorphPivot + * @return MorphPivot */ public function setMorphClass($morphClass) { @@ -78,7 +79,7 @@ class MorphPivot extends Pivot * Get a new query to restore one or more models by their queueable IDs. * * @param array|int $ids - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function newQueryForRestoration($ids) { @@ -101,7 +102,7 @@ class MorphPivot extends Pivot /** * Set the keys for a save update query. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function setKeysForSaveQuery(Builder $query) { @@ -114,7 +115,7 @@ class MorphPivot extends Pivot * Get a new query to restore multiple models by their queueable IDs. * * @param array $ids - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function newQueryForCollectionRestoration(array $ids) { diff --git a/src/database/src/Model/Relations/MorphTo.php b/src/database/src/Model/Relations/MorphTo.php index 2e00c4ab6..a924b6c21 100644 --- a/src/database/src/Model/Relations/MorphTo.php +++ b/src/database/src/Model/Relations/MorphTo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use BadMethodCallException; @@ -31,7 +32,7 @@ class MorphTo extends BelongsTo /** * The models whose relations are being eager loaded. * - * @var \Hyperf\Database\Model\Collection + * @var Collection */ protected $models; @@ -133,7 +134,7 @@ class MorphTo extends BelongsTo * Create a new model instance by type. * * @param string $type - * @return \Hyperf\Database\Model\Model + * @return Model */ public function createModelByType($type) { @@ -156,8 +157,8 @@ class MorphTo extends BelongsTo /** * Associate the model instance to the given parent. * - * @param \Hyperf\Database\Model\Model $model - * @return \Hyperf\Database\Model\Model + * @param Model $model + * @return Model */ public function associate($model) { @@ -177,7 +178,7 @@ class MorphTo extends BelongsTo /** * Dissociate previously associated model from the given parent. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function dissociate() { @@ -249,7 +250,7 @@ class MorphTo extends BelongsTo * Get all of the relation results for a type. * * @param string $type - * @return \Hyperf\Database\Model\Collection + * @return Collection */ protected function getResultsByType($type) { @@ -306,7 +307,7 @@ class MorphTo extends BelongsTo /** * Replay stored macro calls on the actual related instance. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ protected function replayMacros(Builder $query) { diff --git a/src/database/src/Model/Relations/MorphToMany.php b/src/database/src/Model/Relations/MorphToMany.php index 7492481b0..c360385da 100644 --- a/src/database/src/Model/Relations/MorphToMany.php +++ b/src/database/src/Model/Relations/MorphToMany.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Collection\Arr; @@ -96,7 +97,7 @@ class MorphToMany extends BelongsToMany * Add the constraints for a relationship count query. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -110,7 +111,7 @@ class MorphToMany extends BelongsToMany * Create a new pivot model instance. * * @param bool $exists - * @return \Hyperf\Database\Model\Relations\Pivot + * @return Pivot */ public function newPivot(array $attributes = [], $exists = false) { diff --git a/src/database/src/Model/Relations/Pivot.php b/src/database/src/Model/Relations/Pivot.php index 35c8454e6..a39dd8f8d 100755 --- a/src/database/src/Model/Relations/Pivot.php +++ b/src/database/src/Model/Relations/Pivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Hyperf\Database\Model\Model; diff --git a/src/database/src/Model/Relations/Relation.php b/src/database/src/Model/Relations/Relation.php index 87f6224c8..a1cd915d8 100755 --- a/src/database/src/Model/Relations/Relation.php +++ b/src/database/src/Model/Relations/Relation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model\Relations; use Closure; @@ -42,21 +43,21 @@ abstract class Relation /** * The Model query builder instance. * - * @var \Hyperf\Database\Model\Builder + * @var Builder */ protected $query; /** * The parent model instance. * - * @var \Hyperf\Database\Model\Model + * @var Model */ protected $parent; /** * The related model instance. * - * @var \Hyperf\Database\Model\Model + * @var Model */ protected $related; @@ -154,7 +155,7 @@ abstract class Relation /** * Get the relationship for eager loading. * - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function getEager() { @@ -165,7 +166,7 @@ abstract class Relation * Execute the query as a "select" statement. * * @param array $columns - * @return \Hyperf\Database\Model\Collection + * @return Collection */ public function get($columns = ['*']) { @@ -199,7 +200,7 @@ abstract class Relation /** * Add the constraints for a relationship count query. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceCountQuery(Builder $query, Builder $parentQuery) { @@ -216,7 +217,7 @@ abstract class Relation * Essentially, these queries compare on column names like whereColumn. * * @param array|mixed $columns - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) { @@ -230,7 +231,7 @@ abstract class Relation /** * Get the underlying query for the relation. * - * @return \Hyperf\Database\Model\Builder + * @return Builder */ public function getQuery() { @@ -250,7 +251,7 @@ abstract class Relation /** * Get the parent model of the relation. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function getParent() { @@ -270,7 +271,7 @@ abstract class Relation /** * Get the related model of the relation. * - * @return \Hyperf\Database\Model\Model + * @return Model */ public function getRelated() { diff --git a/src/database/src/Model/Scope.php b/src/database/src/Model/Scope.php index f1e9f33ff..958c4bb83 100644 --- a/src/database/src/Model/Scope.php +++ b/src/database/src/Model/Scope.php @@ -9,15 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; interface Scope { /** * Apply the scope to a given Model query builder. - * - * @param \Hyperf\Database\Model\Builder $builder - * @param \Hyperf\Database\Model\Model $model */ public function apply(Builder $builder, Model $model); } diff --git a/src/database/src/Model/SoftDeletes.php b/src/database/src/Model/SoftDeletes.php index 1910e823e..0d8c6e927 100644 --- a/src/database/src/Model/SoftDeletes.php +++ b/src/database/src/Model/SoftDeletes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use Psr\EventDispatcher\StoppableEventInterface; diff --git a/src/database/src/Model/SoftDeletingScope.php b/src/database/src/Model/SoftDeletingScope.php index cb4e75b5d..d20785427 100644 --- a/src/database/src/Model/SoftDeletingScope.php +++ b/src/database/src/Model/SoftDeletingScope.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; use function Hyperf\Tappable\tap; @@ -22,9 +23,6 @@ class SoftDeletingScope implements Scope /** * Apply the scope to a given Model query builder. - * - * @param \Hyperf\Database\Model\Builder $builder - * @param \Hyperf\Database\Model\Model $model */ public function apply(Builder $builder, Model $model) { @@ -33,8 +31,6 @@ class SoftDeletingScope implements Scope /** * Extend the query builder with the needed functions. - * - * @param \Hyperf\Database\Model\Builder $builder */ public function extend(Builder $builder) { @@ -54,7 +50,6 @@ class SoftDeletingScope implements Scope /** * Get the "deleted at" column for the builder. * - * @param \Hyperf\Database\Model\Builder $builder * @return string */ protected function getDeletedAtColumn(Builder $builder) @@ -68,8 +63,6 @@ class SoftDeletingScope implements Scope /** * Add the restore extension to the builder. - * - * @param \Hyperf\Database\Model\Builder $builder */ protected function addRestore(Builder $builder) { @@ -82,8 +75,6 @@ class SoftDeletingScope implements Scope /** * Add the restore-or-create extension to the builder. - * - * @param \Hyperf\Database\Model\Builder $builder */ protected function addRestoreOrCreate(Builder $builder) { @@ -98,8 +89,6 @@ class SoftDeletingScope implements Scope /** * Add the with-trashed extension to the builder. - * - * @param \Hyperf\Database\Model\Builder $builder */ protected function addWithTrashed(Builder $builder) { @@ -114,8 +103,6 @@ class SoftDeletingScope implements Scope /** * Add the without-trashed extension to the builder. - * - * @param \Hyperf\Database\Model\Builder $builder */ protected function addWithoutTrashed(Builder $builder) { @@ -132,8 +119,6 @@ class SoftDeletingScope implements Scope /** * Add the only-trashed extension to the builder. - * - * @param \Hyperf\Database\Model\Builder $builder */ protected function addOnlyTrashed(Builder $builder) { diff --git a/src/database/src/Model/TraitInitializers.php b/src/database/src/Model/TraitInitializers.php index 98edd05b8..83c806f49 100644 --- a/src/database/src/Model/TraitInitializers.php +++ b/src/database/src/Model/TraitInitializers.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Model; class TraitInitializers diff --git a/src/database/src/MySqlBitConnection.php b/src/database/src/MySqlBitConnection.php index 79f47f87f..cbc561d87 100644 --- a/src/database/src/MySqlBitConnection.php +++ b/src/database/src/MySqlBitConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; use PDO; diff --git a/src/database/src/MySqlConnection.php b/src/database/src/MySqlConnection.php index b6f864ce2..b2543f4ad 100755 --- a/src/database/src/MySqlConnection.php +++ b/src/database/src/MySqlConnection.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database; +use Doctrine\DBAL\Driver\PDO\MySQL\Driver; use Hyperf\Database\DBAL\MySqlDriver; use Hyperf\Database\Query\Grammars\MySqlGrammar as QueryGrammar; use Hyperf\Database\Query\Processors\MySqlProcessor; @@ -72,7 +74,7 @@ class MySqlConnection extends Connection /** * Get the Doctrine DBAL driver. * - * @return \Doctrine\DBAL\Driver\PDO\MySQL\Driver + * @return Driver */ protected function getDoctrineDriver() { diff --git a/src/database/src/Query/Builder.php b/src/database/src/Query/Builder.php index 87d7ddf1c..1933a32aa 100755 --- a/src/database/src/Query/Builder.php +++ b/src/database/src/Query/Builder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query; use BackedEnum; @@ -57,14 +58,14 @@ class Builder /** * The database query grammar instance. * - * @var \Hyperf\Database\Query\Grammars\Grammar + * @var Grammar */ public $grammar; /** * The database query post processor instance. * - * @var \Hyperf\Database\Query\Processors\Processor + * @var Processor */ public $processor; @@ -250,9 +251,6 @@ class Builder /** * Create a new query builder instance. - * - * @param \Hyperf\Database\Query\Grammars\Grammar $grammar - * @param \Hyperf\Database\Query\Processors\Processor $processor */ public function __construct( ConnectionInterface $connection, @@ -299,9 +297,9 @@ class Builder /** * Add a subselect expression to the query. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @param string $as - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static * @throws InvalidArgumentException */ public function selectSub($query, $as) @@ -315,7 +313,7 @@ class Builder * Add a new "raw" select expression to the query. * * @param string $expression - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function selectRaw($expression, array $bindings = []) { @@ -331,9 +329,9 @@ class Builder /** * Makes "from" fetch from a subquery. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @param string $as - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static * @throws InvalidArgumentException */ public function fromSub($query, $as) @@ -348,7 +346,7 @@ class Builder * * @param string $expression * @param mixed $bindings - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function fromRaw($expression, $bindings = []) { @@ -472,7 +470,7 @@ class Builder * @param string $operator * @param string $second * @param string $type - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function joinWhere($table, $first, $operator, $second, $type = 'inner') { @@ -482,14 +480,14 @@ class Builder /** * Add a subquery join clause to the query. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @param string $as * @param Closure|string $first * @param null|string $operator * @param null|string $second * @param string $type * @param bool $where - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static * @throws InvalidArgumentException */ public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false) @@ -510,7 +508,7 @@ class Builder * @param Closure|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function leftJoin($table, $first, $operator = null, $second = null) { @@ -524,7 +522,7 @@ class Builder * @param Closure|string $first * @param string $operator * @param string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function leftJoinWhere($table, $first, $operator, $second) { @@ -534,12 +532,12 @@ class Builder /** * Add a subquery left join to the query. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @param string $as * @param Closure|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function leftJoinSub($query, $as, $first, $operator = null, $second = null) { @@ -553,7 +551,7 @@ class Builder * @param Closure|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function rightJoin($table, $first, $operator = null, $second = null) { @@ -567,7 +565,7 @@ class Builder * @param Closure|string $first * @param string $operator * @param string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function rightJoinWhere($table, $first, $operator, $second) { @@ -577,12 +575,12 @@ class Builder /** * Add a subquery right join to the query. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @param string $as * @param Closure|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function rightJoinSub($query, $as, $first, $operator = null, $second = null) { @@ -596,7 +594,7 @@ class Builder * @param null|Closure|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function crossJoin($table, $first = null, $operator = null, $second = null) { @@ -725,7 +723,7 @@ class Builder * @param array|Closure|string $column * @param null|mixed $operator * @param null|mixed $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhere($column, $operator = null, $value = null) { @@ -741,7 +739,7 @@ class Builder * @param null|string $operator * @param null|string $second * @param null|string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') { @@ -775,7 +773,7 @@ class Builder * @param array|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereColumn($first, $operator = null, $second = null) { @@ -804,7 +802,7 @@ class Builder * * @param string $sql * @param mixed $bindings - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereRaw($sql, $bindings = []) { @@ -857,7 +855,7 @@ class Builder * * @param string $column * @param mixed $values - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereIn($column, $values) { @@ -870,7 +868,7 @@ class Builder * @param string $column * @param string $boolean * @param mixed $values - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereNotIn($column, $values, $boolean = 'and') { @@ -882,7 +880,7 @@ class Builder * * @param string $column * @param mixed $values - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereNotIn($column, $values) { @@ -951,7 +949,7 @@ class Builder * Add an "or where null" clause to the query. * * @param string $column - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereNull($column) { @@ -963,7 +961,7 @@ class Builder * * @param string $column * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereNotNull($column, $boolean = 'and') { @@ -993,7 +991,7 @@ class Builder * Add an or where between statement to the query. * * @param string $column - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereBetween($column, array $values) { @@ -1005,7 +1003,7 @@ class Builder * * @param string $column * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereNotBetween($column, array $values, $boolean = 'and') { @@ -1016,7 +1014,7 @@ class Builder * Add an or where not between statement to the query. * * @param string $column - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereNotBetween($column, array $values) { @@ -1027,7 +1025,7 @@ class Builder * Add an "or where not null" clause to the query. * * @param string $column - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereNotNull($column) { @@ -1041,7 +1039,7 @@ class Builder * @param string $operator * @param DateTimeInterface|string $value * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereDate($column, $operator, $value = null, $boolean = 'and') { @@ -1060,7 +1058,7 @@ class Builder * @param string $column * @param string $operator * @param DateTimeInterface|string $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereDate($column, $operator, $value = null) { @@ -1076,7 +1074,7 @@ class Builder * @param string $operator * @param DateTimeInterface|string $value * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereTime($column, $operator, $value = null, $boolean = 'and') { @@ -1095,7 +1093,7 @@ class Builder * @param string $column * @param string $operator * @param DateTimeInterface|string $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereTime($column, $operator, $value = null) { @@ -1111,7 +1109,7 @@ class Builder * @param string $operator * @param DateTimeInterface|string $value * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereDay($column, $operator, $value = null, $boolean = 'and') { @@ -1130,7 +1128,7 @@ class Builder * @param string $column * @param string $operator * @param DateTimeInterface|string $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereDay($column, $operator, $value = null) { @@ -1146,7 +1144,7 @@ class Builder * @param string $operator * @param DateTimeInterface|string $value * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereMonth($column, $operator, $value = null, $boolean = 'and') { @@ -1165,7 +1163,7 @@ class Builder * @param string $column * @param string $operator * @param DateTimeInterface|string $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereMonth($column, $operator, $value = null) { @@ -1181,7 +1179,7 @@ class Builder * @param string $operator * @param DateTimeInterface|int|string $value * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereYear($column, $operator, $value = null, $boolean = 'and') { @@ -1200,7 +1198,7 @@ class Builder * @param string $column * @param string $operator * @param DateTimeInterface|int|string $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereYear($column, $operator, $value = null) { @@ -1213,7 +1211,7 @@ class Builder * Add a nested where statement to the query. * * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereNested(Closure $callback, $boolean = 'and') { @@ -1225,7 +1223,7 @@ class Builder /** * Create a new query instance for nested where condition. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function forNestedWhere() { @@ -1235,7 +1233,7 @@ class Builder /** * Add another query builder as a nested where to the query builder. * - * @param \Hyperf\Database\Query\Builder|static $query + * @param Builder|static $query * @param string $boolean * @return $this */ @@ -1275,7 +1273,7 @@ class Builder * Add an or exists clause to the query. * * @param bool $not - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereExists(Closure $callback, $not = false) { @@ -1286,7 +1284,7 @@ class Builder * Add a where not exists clause to the query. * * @param string $boolean - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function whereNotExists(Closure $callback, $boolean = 'and') { @@ -1296,7 +1294,7 @@ class Builder /** * Add a where not exists clause to the query. * - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orWhereNotExists(Closure $callback) { @@ -1306,7 +1304,6 @@ class Builder /** * Add an exists clause to the query. * - * @param \Hyperf\Database\Query\Builder $query * @param string $boolean * @param bool $not * @return $this @@ -1582,7 +1579,7 @@ class Builder * @param string $column * @param null|string $operator * @param null|string $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orHaving($column, $operator = null, $value = null) { @@ -1597,7 +1594,7 @@ class Builder * @param string $column * @param string $boolean * @param bool $not - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function havingBetween($column, array $values, $boolean = 'and', $not = false) { @@ -1632,7 +1629,7 @@ class Builder * Add a raw or having clause to the query. * * @param string $sql - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function orHavingRaw($sql, array $bindings = []) { @@ -1671,7 +1668,7 @@ class Builder * Add an "order by" clause for a timestamp to the query. * * @param string $column - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function latest($column = 'created_at') { @@ -1682,7 +1679,7 @@ class Builder * Add an "order by" clause for a timestamp to the query. * * @param string $column - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function oldest($column = 'created_at') { @@ -1722,7 +1719,7 @@ class Builder * Alias to set the "offset" value of the query. * * @param int $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function skip($value) { @@ -1748,7 +1745,7 @@ class Builder * Alias to set the "limit" value of the query. * * @param int $value - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function take($value) { @@ -1777,7 +1774,7 @@ class Builder * * @param int $page * @param int $perPage - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function forPage($page, $perPage = 15) { @@ -1825,9 +1822,9 @@ class Builder /** * Add a union statement to the query. * - * @param Closure|\Hyperf\Database\Query\Builder $query + * @param Builder|Closure $query * @param bool $all - * @return \Hyperf\Database\Query\Builder|static + * @return Builder|static */ public function union($query, $all = false) { @@ -1845,8 +1842,8 @@ class Builder /** * Add a union all statement to the query. * - * @param Closure|\Hyperf\Database\Query\Builder $query - * @return \Hyperf\Database\Query\Builder|static + * @param Builder|Closure $query + * @return Builder|static */ public function unionAll($query) { @@ -1873,7 +1870,7 @@ class Builder /** * Lock the selected rows in the table for updating. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function lockForUpdate() { @@ -1883,7 +1880,7 @@ class Builder /** * Share lock the selected rows in the table. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function sharedLock() { @@ -2079,7 +2076,7 @@ class Builder * * @param string $column * @param null|string $key - * @return \Hyperf\Collection\Collection + * @return Collection */ public function pluck($column, $key = null) { @@ -2309,7 +2306,7 @@ class Builder /** * Insert new records into the table using a subquery. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @return bool */ public function insertUsing(array $columns, $query) @@ -2481,7 +2478,7 @@ class Builder /** * Get a new instance of the query builder. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function newQuery() { @@ -2492,7 +2489,7 @@ class Builder * Create a raw database expression. * * @param mixed $value - * @return \Hyperf\Database\Query\Expression + * @return Expression */ public function raw($value) { @@ -2588,7 +2585,6 @@ class Builder /** * Merge an array of bindings into our bindings. * - * @param \Hyperf\Database\Query\Builder $query * @return $this */ public function mergeBindings(self $query) @@ -2601,7 +2597,7 @@ class Builder /** * Get the database connection instance. * - * @return \Hyperf\Database\ConnectionInterface + * @return ConnectionInterface */ public function getConnection() { @@ -2611,7 +2607,7 @@ class Builder /** * Get the database query processor instance. * - * @return \Hyperf\Database\Query\Processors\Processor + * @return Processor */ public function getProcessor() { @@ -2621,7 +2617,7 @@ class Builder /** * Get the query grammar instance. * - * @return \Hyperf\Database\Query\Grammars\Grammar + * @return Grammar */ public function getGrammar() { @@ -2695,7 +2691,7 @@ class Builder /** * Creates a subquery and parse it. * - * @param Closure|\Hyperf\Database\Query\Builder|string $query + * @param Builder|Closure|string $query * @return array */ protected function createSub($query) @@ -2805,7 +2801,7 @@ class Builder * Add an external sub-select to the query. * * @param string $column - * @param \Hyperf\Database\Query\Builder|static $query + * @param Builder|static $query * @param string $boolean * @param bool $not * @return $this @@ -2990,7 +2986,7 @@ class Builder * @param array $queryResult * @param string $column * @param string $key - * @return \Hyperf\Collection\Collection + * @return Collection */ protected function pluckFromObjectColumn($queryResult, $column, $key) { @@ -3015,7 +3011,7 @@ class Builder * @param array $queryResult * @param string $column * @param string $key - * @return \Hyperf\Collection\Collection + * @return Collection */ protected function pluckFromArrayColumn($queryResult, $column, $key) { @@ -3079,7 +3075,7 @@ class Builder /** * Create a new query instance for a sub-query. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ protected function forSubQuery() { diff --git a/src/database/src/Query/Expression.php b/src/database/src/Query/Expression.php index 52ba6c385..77f53f36f 100755 --- a/src/database/src/Query/Expression.php +++ b/src/database/src/Query/Expression.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query; use Stringable; diff --git a/src/database/src/Query/Grammars/Grammar.php b/src/database/src/Query/Grammars/Grammar.php index 63379c937..6feff9681 100755 --- a/src/database/src/Query/Grammars/Grammar.php +++ b/src/database/src/Query/Grammars/Grammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query\Grammars; use Hyperf\Collection\Arr; @@ -466,7 +467,7 @@ class Grammar extends BaseGrammar /** * Get an array of all the where clauses for the query. * - * @param \Hyperf\Database\Query\Builder $query + * @param Builder $query */ protected function compileWheresToArray($query): array { @@ -478,7 +479,7 @@ class Grammar extends BaseGrammar /** * Format the where clause statements into one string. * - * @param \Hyperf\Database\Query\Builder $query + * @param Builder $query * @param array $sql */ protected function concatenateWhereClauses($query, $sql): string @@ -514,7 +515,6 @@ class Grammar extends BaseGrammar /** * Compile a "where JSON boolean" clause. * - * @param string $value * @param array $where * @return string */ diff --git a/src/database/src/Query/Grammars/MySqlGrammar.php b/src/database/src/Query/Grammars/MySqlGrammar.php index 472b58077..65aecc6af 100755 --- a/src/database/src/Query/Grammars/MySqlGrammar.php +++ b/src/database/src/Query/Grammars/MySqlGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query\Grammars; use Hyperf\Collection\Arr; @@ -274,7 +275,7 @@ class MySqlGrammar extends Grammar /** * Compile a delete query that does not use joins. * - * @param \Hyperf\Database\Query\Builder $query + * @param Builder $query * @param string $table * @param array $where */ @@ -299,7 +300,7 @@ class MySqlGrammar extends Grammar /** * Compile a delete query that uses joins. * - * @param \Hyperf\Database\Query\Builder $query + * @param Builder $query * @param string $table * @param array $where */ diff --git a/src/database/src/Query/JoinClause.php b/src/database/src/Query/JoinClause.php index 8ec13d1b5..82036fc51 100755 --- a/src/database/src/Query/JoinClause.php +++ b/src/database/src/Query/JoinClause.php @@ -9,9 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query; use Closure; +use Hyperf\Database\ConnectionInterface; +use Hyperf\Database\Query\Grammars\Grammar; +use Hyperf\Database\Query\Processors\Processor; use InvalidArgumentException; class JoinClause extends Builder @@ -33,21 +37,21 @@ class JoinClause extends Builder /** * The connection of the parent query builder. * - * @var \Hyperf\Database\ConnectionInterface + * @var ConnectionInterface */ protected $parentConnection; /** * The grammar of the parent query builder. * - * @var \Hyperf\Database\Query\Grammars\Grammar + * @var Grammar */ protected $parentGrammar; /** * The processor of the parent query builder. * - * @var \Hyperf\Database\Query\Processors\Processor + * @var Processor */ protected $parentProcessor; @@ -94,7 +98,7 @@ class JoinClause extends Builder * * @param Closure|string $first * @param null|string $operator - * @param null|\Hyperf\Database\Query\Expression|string $second + * @param null|Expression|string $second * @param string $boolean * @return $this * @throws InvalidArgumentException @@ -114,7 +118,7 @@ class JoinClause extends Builder * @param Closure|string $first * @param null|string $operator * @param null|string $second - * @return \Hyperf\Database\Query\JoinClause + * @return JoinClause */ public function orOn($first, $operator = null, $second = null) { @@ -124,7 +128,7 @@ class JoinClause extends Builder /** * Get a new instance of the join clause builder. * - * @return \Hyperf\Database\Query\JoinClause + * @return JoinClause */ public function newQuery() { @@ -134,7 +138,7 @@ class JoinClause extends Builder /** * Create a new query instance for sub-query. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ protected function forSubQuery() { @@ -144,7 +148,7 @@ class JoinClause extends Builder /** * Create a new parent query instance. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ protected function newParentQuery() { diff --git a/src/database/src/Query/JsonExpression.php b/src/database/src/Query/JsonExpression.php index 6f9f1bcea..397a3a433 100644 --- a/src/database/src/Query/JsonExpression.php +++ b/src/database/src/Query/JsonExpression.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query; use InvalidArgumentException; diff --git a/src/database/src/Query/Processors/MySqlProcessor.php b/src/database/src/Query/Processors/MySqlProcessor.php index 601ec6a47..afe5c1f89 100644 --- a/src/database/src/Query/Processors/MySqlProcessor.php +++ b/src/database/src/Query/Processors/MySqlProcessor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query\Processors; use Hyperf\Database\Schema\Column; diff --git a/src/database/src/Query/Processors/Processor.php b/src/database/src/Query/Processors/Processor.php index e831f6668..e423aa110 100755 --- a/src/database/src/Query/Processors/Processor.php +++ b/src/database/src/Query/Processors/Processor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Query\Processors; use Hyperf\Database\Query\Builder; diff --git a/src/database/src/Schema/Blueprint.php b/src/database/src/Schema/Blueprint.php index 16c83eafc..f8b4351d3 100755 --- a/src/database/src/Schema/Blueprint.php +++ b/src/database/src/Schema/Blueprint.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use BadMethodCallException; use Closure; +use Hyperf\Collection\Collection; use Hyperf\Database\Connection; use Hyperf\Database\Query\Expression; use Hyperf\Database\Schema\Grammars\Grammar; @@ -443,7 +445,7 @@ class Blueprint * * @param array|string $columns * @param string $name - * @return Fluent|\Hyperf\Database\Schema\ForeignKeyDefinition + * @return Fluent|ForeignKeyDefinition */ public function foreign($columns, $name = null) { @@ -454,7 +456,7 @@ class Blueprint * Create a new auto-incrementing integer (4-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function increments($column) { @@ -465,7 +467,7 @@ class Blueprint * Create a new auto-incrementing integer (4-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function integerIncrements($column) { @@ -476,7 +478,7 @@ class Blueprint * Create a new auto-incrementing tiny integer (1-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function tinyIncrements($column) { @@ -487,7 +489,7 @@ class Blueprint * Create a new auto-incrementing small integer (2-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function smallIncrements($column) { @@ -498,7 +500,7 @@ class Blueprint * Create a new auto-incrementing medium integer (3-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function mediumIncrements($column) { @@ -509,7 +511,7 @@ class Blueprint * Create a new auto-incrementing big integer (8-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function bigIncrements($column) { @@ -521,7 +523,7 @@ class Blueprint * * @param string $column * @param int $length - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function char($column, $length = null) { @@ -535,7 +537,7 @@ class Blueprint * * @param string $column * @param int $length - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function string($column, $length = null) { @@ -548,7 +550,7 @@ class Blueprint * Create a new text column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function text($column) { @@ -559,7 +561,7 @@ class Blueprint * Create a new medium text column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function mediumText($column) { @@ -570,7 +572,7 @@ class Blueprint * Create a new long text column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function longText($column) { @@ -583,7 +585,7 @@ class Blueprint * @param string $column * @param bool $autoIncrement * @param bool $unsigned - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function integer($column, $autoIncrement = false, $unsigned = false) { @@ -596,7 +598,7 @@ class Blueprint * @param string $column * @param bool $autoIncrement * @param bool $unsigned - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function tinyInteger($column, $autoIncrement = false, $unsigned = false) { @@ -609,7 +611,7 @@ class Blueprint * @param string $column * @param bool $autoIncrement * @param bool $unsigned - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function smallInteger($column, $autoIncrement = false, $unsigned = false) { @@ -622,7 +624,7 @@ class Blueprint * @param string $column * @param bool $autoIncrement * @param bool $unsigned - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function mediumInteger($column, $autoIncrement = false, $unsigned = false) { @@ -635,7 +637,7 @@ class Blueprint * @param string $column * @param bool $autoIncrement * @param bool $unsigned - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function bigInteger($column, $autoIncrement = false, $unsigned = false) { @@ -647,7 +649,7 @@ class Blueprint * * @param string $column * @param bool $autoIncrement - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function unsignedInteger($column, $autoIncrement = false) { @@ -659,7 +661,7 @@ class Blueprint * * @param string $column * @param bool $autoIncrement - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function unsignedTinyInteger($column, $autoIncrement = false) { @@ -671,7 +673,7 @@ class Blueprint * * @param string $column * @param bool $autoIncrement - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function unsignedSmallInteger($column, $autoIncrement = false) { @@ -683,7 +685,7 @@ class Blueprint * * @param string $column * @param bool $autoIncrement - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function unsignedMediumInteger($column, $autoIncrement = false) { @@ -695,7 +697,7 @@ class Blueprint * * @param string $column * @param bool $autoIncrement - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function unsignedBigInteger($column, $autoIncrement = false) { @@ -708,7 +710,7 @@ class Blueprint * @param string $column * @param int $total * @param int $places - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function float($column, $total = 8, $places = 2) { @@ -721,7 +723,7 @@ class Blueprint * @param string $column * @param null|int $total * @param null|int $places - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function double($column, $total = null, $places = null) { @@ -734,7 +736,7 @@ class Blueprint * @param string $column * @param int $total * @param int $places - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function decimal($column, $total = 8, $places = 2) { @@ -747,7 +749,7 @@ class Blueprint * @param string $column * @param int $total * @param int $places - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function unsignedDecimal($column, $total = 8, $places = 2) { @@ -760,7 +762,7 @@ class Blueprint * Create a new boolean column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function boolean($column) { @@ -771,7 +773,7 @@ class Blueprint * Create a new enum column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function enum($column, array $allowed) { @@ -782,7 +784,7 @@ class Blueprint * Create a new json column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function json($column) { @@ -793,7 +795,7 @@ class Blueprint * Create a new jsonb column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function jsonb($column) { @@ -804,7 +806,7 @@ class Blueprint * Create a new date column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function date($column) { @@ -816,7 +818,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function dateTime($column, $precision = 0) { @@ -828,7 +830,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function dateTimeTz($column, $precision = 0) { @@ -840,7 +842,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function time($column, $precision = 0) { @@ -852,7 +854,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function timeTz($column, $precision = 0) { @@ -864,7 +866,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function timestamp($column, $precision = 0) { @@ -876,7 +878,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function timestampTz($column, $precision = 0) { @@ -936,7 +938,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function softDeletes($column = 'deleted_at', $precision = 0) { @@ -948,7 +950,7 @@ class Blueprint * * @param string $column * @param int $precision - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function softDeletesTz($column = 'deleted_at', $precision = 0) { @@ -959,7 +961,7 @@ class Blueprint * Create a new year column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function year($column) { @@ -970,7 +972,7 @@ class Blueprint * Create a new binary column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function binary($column) { @@ -981,7 +983,7 @@ class Blueprint * Create a new auto-incrementing big integer (8-byte) column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function id($column = 'id') { @@ -993,7 +995,7 @@ class Blueprint * * @param string $column * @param null|int $length - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function ulid($column = 'ulid', $length = 26) { @@ -1004,7 +1006,7 @@ class Blueprint * Create a new uuid column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function uuid($column) { @@ -1015,7 +1017,7 @@ class Blueprint * Create a new IP address column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function ipAddress($column) { @@ -1026,7 +1028,7 @@ class Blueprint * Create a new MAC address column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function macAddress($column) { @@ -1037,7 +1039,7 @@ class Blueprint * Create a new geometry column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function geometry($column) { @@ -1049,7 +1051,7 @@ class Blueprint * * @param string $column * @param null|int $srid - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function point($column, $srid = null) { @@ -1060,7 +1062,7 @@ class Blueprint * Create a new linestring column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function lineString($column) { @@ -1071,7 +1073,7 @@ class Blueprint * Create a new polygon column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function polygon($column) { @@ -1082,7 +1084,7 @@ class Blueprint * Create a new geometrycollection column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function geometryCollection($column) { @@ -1093,7 +1095,7 @@ class Blueprint * Create a new multipoint column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function multiPoint($column) { @@ -1104,7 +1106,7 @@ class Blueprint * Create a new multilinestring column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function multiLineString($column) { @@ -1115,7 +1117,7 @@ class Blueprint * Create a new multipolygon column on the table. * * @param string $column - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function multiPolygon($column) { @@ -1155,7 +1157,7 @@ class Blueprint /** * Adds the `remember_token` column to the table. * - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function rememberToken() { @@ -1167,7 +1169,7 @@ class Blueprint * * @param string $type * @param string $name - * @return \Hyperf\Database\Schema\ColumnDefinition + * @return ColumnDefinition */ public function addColumn($type, $name, array $parameters = []) { @@ -1328,7 +1330,7 @@ class Blueprint * Create a new UUID column on the table with a foreign key constraint. * * @param string $column - * @return \Hyperf\Database\Schema\ForeignIdColumnDefinition + * @return ForeignIdColumnDefinition */ public function foreignUuid($column) { @@ -1363,7 +1365,7 @@ class Blueprint /** * Get all of the commands matching the given names. * - * @return \Hyperf\Collection\Collection + * @return Collection */ protected function commandsNamed(array $names) { @@ -1516,8 +1518,8 @@ class Blueprint /** * Add a new column definition to the blueprint. * - * @param \Hyperf\Database\Schema\ColumnDefinition $definition - * @return \Hyperf\Database\Schema\ColumnDefinition + * @param ColumnDefinition $definition + * @return ColumnDefinition */ protected function addColumnDefinition($definition) { diff --git a/src/database/src/Schema/Builder.php b/src/database/src/Schema/Builder.php index 1a3e2d664..3b3a7a5c7 100755 --- a/src/database/src/Schema/Builder.php +++ b/src/database/src/Schema/Builder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use Closure; @@ -259,7 +260,7 @@ class Builder /** * Get the database connection instance. * - * @return \Hyperf\Database\Connection + * @return Connection */ public function getConnection() { @@ -288,8 +289,6 @@ class Builder /** * Execute the blueprint to build / modify the table. - * - * @param \Hyperf\Database\Schema\Blueprint $blueprint */ protected function build(Blueprint $blueprint) { @@ -300,7 +299,7 @@ class Builder * Create a new command set with a Closure. * * @param string $table - * @return \Hyperf\Database\Schema\Blueprint + * @return Blueprint */ protected function createBlueprint($table, ?Closure $callback = null) { diff --git a/src/database/src/Schema/Column.php b/src/database/src/Schema/Column.php index e3b7f9f8f..9c01b3e3e 100644 --- a/src/database/src/Schema/Column.php +++ b/src/database/src/Schema/Column.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; class Column diff --git a/src/database/src/Schema/ColumnDefinition.php b/src/database/src/Schema/ColumnDefinition.php index 723f4b146..32dab7828 100644 --- a/src/database/src/Schema/ColumnDefinition.php +++ b/src/database/src/Schema/ColumnDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use Hyperf\Support\Fluent; diff --git a/src/database/src/Schema/ForeignIdColumnDefinition.php b/src/database/src/Schema/ForeignIdColumnDefinition.php index f4c5149e1..cfce585ae 100644 --- a/src/database/src/Schema/ForeignIdColumnDefinition.php +++ b/src/database/src/Schema/ForeignIdColumnDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use Hyperf\Stringable\Str; diff --git a/src/database/src/Schema/ForeignKeyDefinition.php b/src/database/src/Schema/ForeignKeyDefinition.php index 38b0c4ea1..9d72f8412 100644 --- a/src/database/src/Schema/ForeignKeyDefinition.php +++ b/src/database/src/Schema/ForeignKeyDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use Hyperf\Support\Fluent; diff --git a/src/database/src/Schema/Grammars/ChangeColumn.php b/src/database/src/Schema/Grammars/ChangeColumn.php index cee9fc1b8..4405f2ca6 100644 --- a/src/database/src/Schema/Grammars/ChangeColumn.php +++ b/src/database/src/Schema/Grammars/ChangeColumn.php @@ -9,11 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema\Grammars; use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager; +use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Table; +use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Types\Type; use Hyperf\Database\Connection; use Hyperf\Database\Schema\Blueprint; @@ -25,7 +28,7 @@ class ChangeColumn /** * Compile a change column command into a series of SQL statements. * - * @param \Hyperf\Database\Schema\Grammars\Grammar $grammar + * @param Grammar $grammar * @throws RuntimeException */ public static function compile($grammar, Blueprint $blueprint, Fluent $command, Connection $connection): array @@ -53,8 +56,8 @@ class ChangeColumn /** * Get the Doctrine table difference for the given changes. * - * @param \Hyperf\Database\Schema\Grammars\Grammar $grammar - * @return bool|\Doctrine\DBAL\Schema\TableDiff + * @param Grammar $grammar + * @return bool|TableDiff */ protected static function getChangedDiff($grammar, Blueprint $blueprint, SchemaManager $schema) { @@ -69,7 +72,7 @@ class ChangeColumn /** * Get a copy of the given Doctrine table after making the column changes. * - * @return \Doctrine\DBAL\Schema\Table + * @return Table */ protected static function getTableWithColumnChanges(Blueprint $blueprint, Table $table) { @@ -96,7 +99,7 @@ class ChangeColumn /** * Get the Doctrine column instance for a column change. * - * @return \Doctrine\DBAL\Schema\Column + * @return Column */ protected static function getDoctrineColumn(Table $table, Fluent $fluent) { @@ -133,7 +136,7 @@ class ChangeColumn * Get the doctrine column type. * * @param string $type - * @return \Doctrine\DBAL\Types\Type + * @return Type */ protected static function getDoctrineColumnType($type) { diff --git a/src/database/src/Schema/Grammars/Grammar.php b/src/database/src/Schema/Grammars/Grammar.php index 60262fff1..94cc90c74 100755 --- a/src/database/src/Schema/Grammars/Grammar.php +++ b/src/database/src/Schema/Grammars/Grammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema\Grammars; use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager; @@ -136,11 +137,11 @@ abstract class Grammar extends BaseGrammar /** * Wrap a value in keyword identifiers. * - * @param \Hyperf\Database\Query\Expression|string $value + * @param Expression|string $value * @param bool $prefixAlias * @return string */ - public function wrap(Fluent|Expression|string $value, $prefixAlias = false) + public function wrap(Expression|Fluent|string $value, $prefixAlias = false) { return parent::wrap( $value instanceof Fluent ? $value->name : $value, @@ -151,7 +152,7 @@ abstract class Grammar extends BaseGrammar /** * Create an empty Doctrine DBAL TableDiff from the Blueprint. * - * @return \Doctrine\DBAL\Schema\TableDiff + * @return TableDiff */ public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema) { diff --git a/src/database/src/Schema/Grammars/MySqlGrammar.php b/src/database/src/Schema/Grammars/MySqlGrammar.php index a91743136..9d4728491 100755 --- a/src/database/src/Schema/Grammars/MySqlGrammar.php +++ b/src/database/src/Schema/Grammars/MySqlGrammar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema\Grammars; use Hyperf\Database\Connection; diff --git a/src/database/src/Schema/Grammars/RenameColumn.php b/src/database/src/Schema/Grammars/RenameColumn.php index 8cfab1e78..e08e0aa4c 100644 --- a/src/database/src/Schema/Grammars/RenameColumn.php +++ b/src/database/src/Schema/Grammars/RenameColumn.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema\Grammars; use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager; @@ -22,8 +23,6 @@ class RenameColumn { /** * Compile a rename column command. - * - * @param \Hyperf\Database\Schema\Grammars\Grammar $grammar */ public static function compile(Grammar $grammar, Blueprint $blueprint, Fluent $command, Connection $connection): array { @@ -46,8 +45,7 @@ class RenameColumn /** * Get a new column instance with the new column name. * - * @param \Hyperf\Database\Schema\Grammars\Grammar $grammar - * @return \Doctrine\DBAL\Schema\TableDiff + * @return TableDiff */ protected static function getRenamedDiff(Grammar $grammar, Blueprint $blueprint, Fluent $command, Column $column, SchemaManager $schema) { @@ -61,7 +59,7 @@ class RenameColumn /** * Set the renamed columns on the table diff. * - * @return \Doctrine\DBAL\Schema\TableDiff + * @return TableDiff */ protected static function setRenamedColumns(TableDiff $tableDiff, Fluent $command, Column $column) { diff --git a/src/database/src/Schema/MySqlBuilder.php b/src/database/src/Schema/MySqlBuilder.php index 7ac9f5c83..b4a599074 100755 --- a/src/database/src/Schema/MySqlBuilder.php +++ b/src/database/src/Schema/MySqlBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use Hyperf\Database\Query\Processors\MySqlProcessor; diff --git a/src/database/src/Schema/Schema.php b/src/database/src/Schema/Schema.php index 03e699759..93fdf2b4a 100644 --- a/src/database/src/Schema/Schema.php +++ b/src/database/src/Schema/Schema.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Schema; use Hyperf\Context\ApplicationContext; diff --git a/src/database/src/Seeders/Seed.php b/src/database/src/Seeders/Seed.php index 5c9cec3d1..9c0befeb0 100644 --- a/src/database/src/Seeders/Seed.php +++ b/src/database/src/Seeders/Seed.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Seeders; use Hyperf\Collection\Collection; diff --git a/src/database/src/Seeders/Seeder.php b/src/database/src/Seeders/Seeder.php index 7e86fe820..3cabe625e 100644 --- a/src/database/src/Seeders/Seeder.php +++ b/src/database/src/Seeders/Seeder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Seeders; abstract class Seeder diff --git a/src/database/src/Seeders/SeederCreator.php b/src/database/src/Seeders/SeederCreator.php index 5f6030cd3..f039d2a00 100644 --- a/src/database/src/Seeders/SeederCreator.php +++ b/src/database/src/Seeders/SeederCreator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Database\Seeders; use Hyperf\Stringable\Str; diff --git a/src/database/tests/ConnectionTest.php b/src/database/tests/ConnectionTest.php index aa9f5dcfb..2ac3e65c5 100644 --- a/src/database/tests/ConnectionTest.php +++ b/src/database/tests/ConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Connection; diff --git a/src/database/tests/DatabaseConnectionTest.php b/src/database/tests/DatabaseConnectionTest.php index 19bb2e54e..158790407 100755 --- a/src/database/tests/DatabaseConnectionTest.php +++ b/src/database/tests/DatabaseConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use DateTime; diff --git a/src/database/tests/DatabaseGenMigrationCommandTest.php b/src/database/tests/DatabaseGenMigrationCommandTest.php index 5025dc179..3040116f2 100755 --- a/src/database/tests/DatabaseGenMigrationCommandTest.php +++ b/src/database/tests/DatabaseGenMigrationCommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Migrations\GenMigrateCommand; diff --git a/src/database/tests/DatabaseMigrationCreatorTest.php b/src/database/tests/DatabaseMigrationCreatorTest.php index 9518568b1..c117ac6f0 100755 --- a/src/database/tests/DatabaseMigrationCreatorTest.php +++ b/src/database/tests/DatabaseMigrationCreatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Migrations\MigrationCreator; diff --git a/src/database/tests/DatabaseMigrationInstallCommandTest.php b/src/database/tests/DatabaseMigrationInstallCommandTest.php index a958b6152..2c04db677 100755 --- a/src/database/tests/DatabaseMigrationInstallCommandTest.php +++ b/src/database/tests/DatabaseMigrationInstallCommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Migrations\InstallCommand; diff --git a/src/database/tests/DatabaseMigrationMigrateCommandTest.php b/src/database/tests/DatabaseMigrationMigrateCommandTest.php index 0e38d1803..6437f7f87 100755 --- a/src/database/tests/DatabaseMigrationMigrateCommandTest.php +++ b/src/database/tests/DatabaseMigrationMigrateCommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Migrations\MigrateCommand; @@ -115,7 +116,7 @@ class DatabaseMigrationMigrateCommandTest extends TestCase class ApplicationDatabaseMigrationStub { /** - * @var \Psr\Container\ContainerInterface + * @var ContainerInterface */ private $container; diff --git a/src/database/tests/DatabaseMigrationRepositoryTest.php b/src/database/tests/DatabaseMigrationRepositoryTest.php index 2b55b2879..afe2e561b 100755 --- a/src/database/tests/DatabaseMigrationRepositoryTest.php +++ b/src/database/tests/DatabaseMigrationRepositoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Closure; diff --git a/src/database/tests/DatabaseMigrationResetCommandTest.php b/src/database/tests/DatabaseMigrationResetCommandTest.php index 8a85e2b3a..50ccfcdaf 100755 --- a/src/database/tests/DatabaseMigrationResetCommandTest.php +++ b/src/database/tests/DatabaseMigrationResetCommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Migrations\ResetCommand; diff --git a/src/database/tests/DatabaseMigrationRollbackCommandTest.php b/src/database/tests/DatabaseMigrationRollbackCommandTest.php index b189b5616..b6adb470f 100755 --- a/src/database/tests/DatabaseMigrationRollbackCommandTest.php +++ b/src/database/tests/DatabaseMigrationRollbackCommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Migrations\RollbackCommand; diff --git a/src/database/tests/DatabaseMigratorIntegrationTest.php b/src/database/tests/DatabaseMigratorIntegrationTest.php index f7efe8940..e0c4fed66 100644 --- a/src/database/tests/DatabaseMigratorIntegrationTest.php +++ b/src/database/tests/DatabaseMigratorIntegrationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Context\ApplicationContext; diff --git a/src/database/tests/DatabaseModelCustomCastingTest.php b/src/database/tests/DatabaseModelCustomCastingTest.php index a370334a0..7e503c015 100644 --- a/src/database/tests/DatabaseModelCustomCastingTest.php +++ b/src/database/tests/DatabaseModelCustomCastingTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Collection\Arr; diff --git a/src/database/tests/DatabaseMySqlQueryGrammarTest.php b/src/database/tests/DatabaseMySqlQueryGrammarTest.php index 49ac3ac7e..37c93d5b0 100644 --- a/src/database/tests/DatabaseMySqlQueryGrammarTest.php +++ b/src/database/tests/DatabaseMySqlQueryGrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Connection; diff --git a/src/database/tests/DatabaseQueryBuilderTest.php b/src/database/tests/DatabaseQueryBuilderTest.php index 6ddfc030f..9b370f131 100644 --- a/src/database/tests/DatabaseQueryBuilderTest.php +++ b/src/database/tests/DatabaseQueryBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Context\ApplicationContext; diff --git a/src/database/tests/GenModelTest.php b/src/database/tests/GenModelTest.php index 12f4bf109..f7097360e 100644 --- a/src/database/tests/GenModelTest.php +++ b/src/database/tests/GenModelTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Ast\ModelUpdateVisitor; @@ -134,12 +135,13 @@ class UserExtEmpty extends Model $this->assertEquals($this->license . " namespace HyperfTest\\Database\\Stubs\\Model; +use Carbon\\Carbon; /** * @property int \$id * @property string \$name * @property \\HyperfTest\\Database\\Stubs\\Model\\Gender \$gender - * @property \\Carbon\\Carbon \$created_at - * @property \\Carbon\\Carbon \$updated_at + * @property Carbon \$created_at + * @property Carbon \$updated_at * @property-read null|Book \$book */ class UserEnum extends Model diff --git a/src/database/tests/GrammarTest.php b/src/database/tests/GrammarTest.php index 29175c1e6..065355bd5 100644 --- a/src/database/tests/GrammarTest.php +++ b/src/database/tests/GrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\MySqlConnection; diff --git a/src/database/tests/Model/CollectionTest.php b/src/database/tests/Model/CollectionTest.php index 423e5e0b6..eef502cb5 100644 --- a/src/database/tests/Model/CollectionTest.php +++ b/src/database/tests/Model/CollectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Model; use Hyperf\Database\Model\Collection; diff --git a/src/database/tests/ModelBuilderTest.php b/src/database/tests/ModelBuilderTest.php index 6facc6714..cc528ea8c 100755 --- a/src/database/tests/ModelBuilderTest.php +++ b/src/database/tests/ModelBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use BadMethodCallException; @@ -23,7 +24,9 @@ use Hyperf\Database\ConnectionResolverInterface; use Hyperf\Database\Model\Builder; use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Model; +use Hyperf\Database\Model\ModelNotFoundException; use Hyperf\Database\Model\Register; +use Hyperf\Database\Model\RelationNotFoundException; use Hyperf\Database\Model\SoftDeletes; use Hyperf\Database\Query\Builder as BaseBuilder; use Hyperf\Database\Query\Grammars\Grammar; @@ -101,7 +104,7 @@ class ModelBuilderTest extends TestCase public function testFindOrFailMethodThrowsModelNotFoundException() { - $this->expectException(\Hyperf\Database\Model\ModelNotFoundException::class); + $this->expectException(ModelNotFoundException::class); $builder = Mockery::mock(Builder::class . '[first]', [$this->getMockQueryBuilder()]); $builder->setModel($this->getMockModel()); @@ -112,7 +115,7 @@ class ModelBuilderTest extends TestCase public function testFindOrFailMethodWithManyThrowsModelNotFoundException() { - $this->expectException(\Hyperf\Database\Model\ModelNotFoundException::class); + $this->expectException(ModelNotFoundException::class); $builder = Mockery::mock(Builder::class . '[get]', [$this->getMockQueryBuilder()]); $builder->setModel($this->getMockModel()); @@ -123,7 +126,7 @@ class ModelBuilderTest extends TestCase public function testFirstOrFailMethodThrowsModelNotFoundException() { - $this->expectException(\Hyperf\Database\Model\ModelNotFoundException::class); + $this->expectException(ModelNotFoundException::class); $builder = Mockery::mock(Builder::class . '[first]', [$this->getMockQueryBuilder()]); $builder->setModel($this->getMockModel()); @@ -536,7 +539,7 @@ class ModelBuilderTest extends TestCase public function testGetRelationThrowsException() { - $this->expectException(\Hyperf\Database\Model\RelationNotFoundException::class); + $this->expectException(RelationNotFoundException::class); $builder = $this->getBuilder(); $builder->setModel($this->getMockModel()); @@ -1180,18 +1183,18 @@ class ModelBuilderTest extends TestCase public function testMixin() { - \Hyperf\Database\Model\Builder::macro('testAbc', fn () => 'abc'); + Builder::macro('testAbc', fn () => 'abc'); $this->assertEquals('abc', ModelStub::testAbc()); - \Hyperf\Database\Model\Builder::mixin(new UserMixin()); + Builder::mixin(new UserMixin()); - $this->assertInstanceOf(\Hyperf\Database\Model\Builder::class, ModelStub::whereFoo()); - $this->assertInstanceOf(\Hyperf\Database\Model\Builder::class, ModelStub::whereBar()); + $this->assertInstanceOf(Builder::class, ModelStub::whereFoo()); + $this->assertInstanceOf(Builder::class, ModelStub::whereBar()); } public function testClone() { - $builder = \HyperfTest\Database\Stubs\ModelStub::query(); + $builder = ModelStub::query(); $clone = $builder->clone(); $clone->select(['id']); diff --git a/src/database/tests/ModelCollectionTest.php b/src/database/tests/ModelCollectionTest.php index 40ee763c1..d0dd8fe41 100644 --- a/src/database/tests/ModelCollectionTest.php +++ b/src/database/tests/ModelCollectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Collection\Collection as BaseCollection; diff --git a/src/database/tests/ModelDynamicRelationsTest.php b/src/database/tests/ModelDynamicRelationsTest.php index 11148ecaa..0cda2d8ae 100644 --- a/src/database/tests/ModelDynamicRelationsTest.php +++ b/src/database/tests/ModelDynamicRelationsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\ConnectionInterface; diff --git a/src/database/tests/ModelGenerateTest.php b/src/database/tests/ModelGenerateTest.php index 2b494f1da..6ff41271d 100644 --- a/src/database/tests/ModelGenerateTest.php +++ b/src/database/tests/ModelGenerateTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Commands\Ast\GenerateModelIDEVisitor; diff --git a/src/database/tests/ModelMorphEagerLoadingTest.php b/src/database/tests/ModelMorphEagerLoadingTest.php index c5b0fd089..49351a28c 100644 --- a/src/database/tests/ModelMorphEagerLoadingTest.php +++ b/src/database/tests/ModelMorphEagerLoadingTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Events\QueryExecuted; diff --git a/src/database/tests/ModelRealBuilderTest.php b/src/database/tests/ModelRealBuilderTest.php index 1326c8dac..9eb6a962b 100644 --- a/src/database/tests/ModelRealBuilderTest.php +++ b/src/database/tests/ModelRealBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Carbon\Carbon; @@ -410,7 +411,7 @@ class ModelRealBuilderTest extends TestCase public function testGetRawQueryLog() { $container = $this->getContainer(); - /** @var \Hyperf\Database\Connection $conn */ + /** @var Connection $conn */ $conn = $container->get(ConnectionResolverInterface::class)->connection(); $conn->statement('CREATE TABLE `test` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, @@ -781,25 +782,25 @@ class ModelRealBuilderTest extends TestCase }); // test insert with enum - DB::table('test_enum_cast')->insert([ + Db::table('test_enum_cast')->insert([ 'string_status' => StringStatus::Active, 'integer_status' => IntegerStatus::Active, ]); // test select with enum - $record = DB::table('test_enum_cast')->where('string_status', StringStatus::Active)->first(); + $record = Db::table('test_enum_cast')->where('string_status', StringStatus::Active)->first(); $this->assertNotNull($record); $this->assertEquals('active', $record->string_status); $this->assertEquals(1, $record->integer_status); // test update with enum - DB::table('test_enum_cast')->where('id', $record->id)->update([ + Db::table('test_enum_cast')->where('id', $record->id)->update([ 'string_status' => StringStatus::Inactive, 'integer_status' => IntegerStatus::Inactive, ]); - $record2 = DB::table('test_enum_cast')->where('id', $record->id)->first(); + $record2 = Db::table('test_enum_cast')->where('id', $record->id)->first(); $this->assertNotNull($record2); $this->assertEquals('inactive', $record2->string_status); diff --git a/src/database/tests/ModelTest.php b/src/database/tests/ModelTest.php index 1b63828e3..98d517f7a 100644 --- a/src/database/tests/ModelTest.php +++ b/src/database/tests/ModelTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Carbon\Carbon; @@ -29,6 +30,8 @@ use Hyperf\Database\Model\Booted; use Hyperf\Database\Model\Builder; use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Events; +use Hyperf\Database\Model\JsonEncodingException; +use Hyperf\Database\Model\MassAssignmentException; use Hyperf\Database\Model\Model; use Hyperf\Database\Model\Register; use Hyperf\Database\Model\Relations\BelongsTo; @@ -1050,7 +1053,7 @@ class ModelTest extends TestCase public function testGlobalGuarded() { - $this->expectException(\Hyperf\Database\Model\MassAssignmentException::class); + $this->expectException(MassAssignmentException::class); $this->expectExceptionMessage('name'); $model = new ModelStub(); @@ -1756,7 +1759,7 @@ class ModelTest extends TestCase public function testModelAttributeCastingFailsOnUnencodableData() { - $this->expectException(\Hyperf\Database\Model\JsonEncodingException::class); + $this->expectException(JsonEncodingException::class); $this->expectExceptionMessage('Unable to encode attribute [objectAttribute] for model [HyperfTest\Database\Stubs\ModelCastingStub] to JSON: Malformed UTF-8 characters, possibly incorrectly encoded.'); $model = new ModelCastingStub(); diff --git a/src/database/tests/MySqlProcessorTest.php b/src/database/tests/MySqlProcessorTest.php index c62c4300a..766b8270f 100644 --- a/src/database/tests/MySqlProcessorTest.php +++ b/src/database/tests/MySqlProcessorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Connection; diff --git a/src/database/tests/MySqlSchemaGrammarTest.php b/src/database/tests/MySqlSchemaGrammarTest.php index 16af1da4d..6d18a4844 100755 --- a/src/database/tests/MySqlSchemaGrammarTest.php +++ b/src/database/tests/MySqlSchemaGrammarTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\Connection; diff --git a/src/database/tests/ProcessorTest.php b/src/database/tests/ProcessorTest.php index ec8cff203..c585dc17c 100644 --- a/src/database/tests/ProcessorTest.php +++ b/src/database/tests/ProcessorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use Hyperf\Database\ConnectionInterface; @@ -52,7 +53,7 @@ class ProcessorTestPDOStub extends PDO { } - public function lastInsertId($sequence = null): string|false + public function lastInsertId($sequence = null): false|string { } } diff --git a/src/database/tests/QueryBuilderTest.php b/src/database/tests/QueryBuilderTest.php index 84cb6c3bb..c5fb12a76 100644 --- a/src/database/tests/QueryBuilderTest.php +++ b/src/database/tests/QueryBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database; use BadMethodCallException; @@ -28,6 +29,7 @@ use Hyperf\Paginator\LengthAwarePaginator; use Hyperf\Paginator\Paginator; use InvalidArgumentException; use Mockery; +use Mockery\MockInterface; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -3054,7 +3056,7 @@ class QueryBuilderTest extends TestCase } /** - * @return Builder|\Mockery\MockInterface + * @return Builder|MockInterface */ protected function getMockQueryBuilder() { diff --git a/src/database/tests/Stubs/ContainerStub.php b/src/database/tests/Stubs/ContainerStub.php index 75abe159c..f212fb47a 100644 --- a/src/database/tests/Stubs/ContainerStub.php +++ b/src/database/tests/Stubs/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Context\ApplicationContext; diff --git a/src/database/tests/Stubs/DateModelStub.php b/src/database/tests/Stubs/DateModelStub.php index 25a88f9e9..857b55512 100644 --- a/src/database/tests/Stubs/DateModelStub.php +++ b/src/database/tests/Stubs/DateModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class DateModelStub extends ModelStub diff --git a/src/database/tests/Stubs/DifferentConnectionModelStub.php b/src/database/tests/Stubs/DifferentConnectionModelStub.php index 4b9a00f43..8d25a4395 100644 --- a/src/database/tests/Stubs/DifferentConnectionModelStub.php +++ b/src/database/tests/Stubs/DifferentConnectionModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class DifferentConnectionModelStub extends ModelStub diff --git a/src/database/tests/Stubs/ExceptionPDO.php b/src/database/tests/Stubs/ExceptionPDO.php index fa80b8c54..2f8b0d09a 100644 --- a/src/database/tests/Stubs/ExceptionPDO.php +++ b/src/database/tests/Stubs/ExceptionPDO.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use PDO; diff --git a/src/database/tests/Stubs/FooBarTrait.php b/src/database/tests/Stubs/FooBarTrait.php index b7640ee30..cb3716efe 100644 --- a/src/database/tests/Stubs/FooBarTrait.php +++ b/src/database/tests/Stubs/FooBarTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; trait FooBarTrait diff --git a/src/database/tests/Stubs/IntegerStatus.php b/src/database/tests/Stubs/IntegerStatus.php index 3bbe4d803..429f292e7 100644 --- a/src/database/tests/Stubs/IntegerStatus.php +++ b/src/database/tests/Stubs/IntegerStatus.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; enum IntegerStatus: int diff --git a/src/database/tests/Stubs/KeyTypeModelStub.php b/src/database/tests/Stubs/KeyTypeModelStub.php index b891017e6..895ab7eb9 100644 --- a/src/database/tests/Stubs/KeyTypeModelStub.php +++ b/src/database/tests/Stubs/KeyTypeModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class KeyTypeModelStub extends ModelStub diff --git a/src/database/tests/Stubs/MigrationCreatorFakeMigration.php b/src/database/tests/Stubs/MigrationCreatorFakeMigration.php index 0f7f54168..f01a8ba44 100644 --- a/src/database/tests/Stubs/MigrationCreatorFakeMigration.php +++ b/src/database/tests/Stubs/MigrationCreatorFakeMigration.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class MigrationCreatorFakeMigration diff --git a/src/database/tests/Stubs/Model/Book.php b/src/database/tests/Stubs/Model/Book.php index 121a3cc48..4dbb83a03 100644 --- a/src/database/tests/Stubs/Model/Book.php +++ b/src/database/tests/Stubs/Model/Book.php @@ -9,14 +9,17 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property int $user_id * @property string $title - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class Book extends Model { diff --git a/src/database/tests/Stubs/Model/Gender.php b/src/database/tests/Stubs/Model/Gender.php index 4a79879d1..56870db09 100644 --- a/src/database/tests/Stubs/Model/Gender.php +++ b/src/database/tests/Stubs/Model/Gender.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; enum Gender: int diff --git a/src/database/tests/Stubs/Model/Image.php b/src/database/tests/Stubs/Model/Image.php index f9b612edc..d0e9ba043 100644 --- a/src/database/tests/Stubs/Model/Image.php +++ b/src/database/tests/Stubs/Model/Image.php @@ -9,15 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property string $url * @property int $imageable_id * @property string $imageable_type - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class Image extends Model { diff --git a/src/database/tests/Stubs/Model/Model.php b/src/database/tests/Stubs/Model/Model.php index 2a07c14ff..e5a7fe51e 100644 --- a/src/database/tests/Stubs/Model/Model.php +++ b/src/database/tests/Stubs/Model/Model.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; use Hyperf\DbConnection\Model\Model as BaseModel; diff --git a/src/database/tests/Stubs/Model/Role.php b/src/database/tests/Stubs/Model/Role.php index f15832ce1..e7aa37385 100644 --- a/src/database/tests/Stubs/Model/Role.php +++ b/src/database/tests/Stubs/Model/Role.php @@ -9,13 +9,16 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property string $name - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class Role extends Model { diff --git a/src/database/tests/Stubs/Model/TestGenerateIdeModel.php b/src/database/tests/Stubs/Model/TestGenerateIdeModel.php index e470ec971..c4a807d54 100644 --- a/src/database/tests/Stubs/Model/TestGenerateIdeModel.php +++ b/src/database/tests/Stubs/Model/TestGenerateIdeModel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; class TestGenerateIdeModel extends Model @@ -46,15 +47,15 @@ class TestGenerateIdeModel extends Model { } - public function scopeUnion($query, int $appId, string|int $uid) + public function scopeUnion($query, int $appId, int|string $uid) { } - public function scopeUnionOrNull($query, int $appId, string|int|null $uid) + public function scopeUnionOrNull($query, int $appId, null|int|string $uid) { } - public function scopeSingleOrNull($query, null|string $test) + public function scopeSingleOrNull($query, ?string $test) { } diff --git a/src/database/tests/Stubs/Model/TestModel.php b/src/database/tests/Stubs/Model/TestModel.php index 4d860bb77..786e58635 100644 --- a/src/database/tests/Stubs/Model/TestModel.php +++ b/src/database/tests/Stubs/Model/TestModel.php @@ -9,14 +9,17 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property int $user_id * @property int $uid - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class TestModel extends Model { diff --git a/src/database/tests/Stubs/Model/TestVersionModel.php b/src/database/tests/Stubs/Model/TestVersionModel.php index f19c2406e..9dec5a3e8 100644 --- a/src/database/tests/Stubs/Model/TestVersionModel.php +++ b/src/database/tests/Stubs/Model/TestVersionModel.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; use Hyperf\Database\Model\Builder; /** @@ -18,8 +20,8 @@ use Hyperf\Database\Model\Builder; * @property int $user_id * @property int $uid * @property int $version - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class TestVersionModel extends Model { diff --git a/src/database/tests/Stubs/Model/User.php b/src/database/tests/Stubs/Model/User.php index df016776d..a70cd4e3f 100644 --- a/src/database/tests/Stubs/Model/User.php +++ b/src/database/tests/Stubs/Model/User.php @@ -9,14 +9,17 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property string $name * @property int $gender - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at * @property Book $book * @property Book[]|\Hyperf\Database\Model\Collection $books */ diff --git a/src/database/tests/Stubs/Model/UserBit.php b/src/database/tests/Stubs/Model/UserBit.php index 918d0e01d..13e0a1bbe 100644 --- a/src/database/tests/Stubs/Model/UserBit.php +++ b/src/database/tests/Stubs/Model/UserBit.php @@ -9,13 +9,16 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property string $bit - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class UserBit extends Model { diff --git a/src/database/tests/Stubs/Model/UserEnum.php b/src/database/tests/Stubs/Model/UserEnum.php index 34f0bd4c3..79a34f5fa 100644 --- a/src/database/tests/Stubs/Model/UserEnum.php +++ b/src/database/tests/Stubs/Model/UserEnum.php @@ -9,14 +9,17 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property string $name * @property Gender $gender - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class UserEnum extends Model { diff --git a/src/database/tests/Stubs/Model/UserExt.php b/src/database/tests/Stubs/Model/UserExt.php index c9ddc0867..43fa80b32 100644 --- a/src/database/tests/Stubs/Model/UserExt.php +++ b/src/database/tests/Stubs/Model/UserExt.php @@ -9,16 +9,19 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property int $count * @property float $float_num * @property string $str * @property string $json - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class UserExt extends Model { diff --git a/src/database/tests/Stubs/Model/UserExtCamel.php b/src/database/tests/Stubs/Model/UserExtCamel.php index 90b7c612e..7102c5d33 100644 --- a/src/database/tests/Stubs/Model/UserExtCamel.php +++ b/src/database/tests/Stubs/Model/UserExtCamel.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; use Hyperf\Database\Model\Concerns\CamelCase; /** @@ -19,8 +21,8 @@ use Hyperf\Database\Model\Concerns\CamelCase; * @property string $floatNum * @property string $str * @property string $json - * @property \Carbon\Carbon $createdAt - * @property \Carbon\Carbon $updatedAt + * @property Carbon $createdAt + * @property Carbon $updatedAt */ class UserExtCamel extends Model { diff --git a/src/database/tests/Stubs/Model/UserExtEmpty.php b/src/database/tests/Stubs/Model/UserExtEmpty.php index 9c70edbdb..96cbde691 100644 --- a/src/database/tests/Stubs/Model/UserExtEmpty.php +++ b/src/database/tests/Stubs/Model/UserExtEmpty.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; class UserExtEmpty extends Model diff --git a/src/database/tests/Stubs/Model/UserRole.php b/src/database/tests/Stubs/Model/UserRole.php index aa6d509fa..b8a4966a2 100644 --- a/src/database/tests/Stubs/Model/UserRole.php +++ b/src/database/tests/Stubs/Model/UserRole.php @@ -9,14 +9,17 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; +use Carbon\Carbon; + /** * @property int $id * @property int $user_id * @property int $role_id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at * @property \App\Model\User[]|\Hyperf\Database\Model\Collection $users */ class UserRole extends Model diff --git a/src/database/tests/Stubs/Model/UserRoleMorphPivot.php b/src/database/tests/Stubs/Model/UserRoleMorphPivot.php index b393e2330..98810973f 100644 --- a/src/database/tests/Stubs/Model/UserRoleMorphPivot.php +++ b/src/database/tests/Stubs/Model/UserRoleMorphPivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; use Hyperf\DbConnection\Model\Relations\MorphPivot; diff --git a/src/database/tests/Stubs/Model/UserRolePivot.php b/src/database/tests/Stubs/Model/UserRolePivot.php index 8c33d8af1..53475b83f 100644 --- a/src/database/tests/Stubs/Model/UserRolePivot.php +++ b/src/database/tests/Stubs/Model/UserRolePivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs\Model; use Hyperf\DbConnection\Model\Relations\Pivot; diff --git a/src/database/tests/Stubs/ModelAppendsStub.php b/src/database/tests/Stubs/ModelAppendsStub.php index 43861a3e4..5fe425311 100644 --- a/src/database/tests/Stubs/ModelAppendsStub.php +++ b/src/database/tests/Stubs/ModelAppendsStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelBootingTestStub.php b/src/database/tests/Stubs/ModelBootingTestStub.php index d2b85d7c2..2d14db469 100644 --- a/src/database/tests/Stubs/ModelBootingTestStub.php +++ b/src/database/tests/Stubs/ModelBootingTestStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Booted; diff --git a/src/database/tests/Stubs/ModelCamelStub.php b/src/database/tests/Stubs/ModelCamelStub.php index de531c540..1d54098b5 100644 --- a/src/database/tests/Stubs/ModelCamelStub.php +++ b/src/database/tests/Stubs/ModelCamelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class ModelCamelStub extends ModelStub diff --git a/src/database/tests/Stubs/ModelCastingStub.php b/src/database/tests/Stubs/ModelCastingStub.php index ec034865d..56d7e1138 100644 --- a/src/database/tests/Stubs/ModelCastingStub.php +++ b/src/database/tests/Stubs/ModelCastingStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelDestroyStub.php b/src/database/tests/Stubs/ModelDestroyStub.php index 1c79e059d..186a41689 100644 --- a/src/database/tests/Stubs/ModelDestroyStub.php +++ b/src/database/tests/Stubs/ModelDestroyStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Builder; diff --git a/src/database/tests/Stubs/ModelDynamicHiddenStub.php b/src/database/tests/Stubs/ModelDynamicHiddenStub.php index d9c37bd8c..569e2bd46 100644 --- a/src/database/tests/Stubs/ModelDynamicHiddenStub.php +++ b/src/database/tests/Stubs/ModelDynamicHiddenStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelDynamicVisibleStub.php b/src/database/tests/Stubs/ModelDynamicVisibleStub.php index 23275febb..146cf829f 100644 --- a/src/database/tests/Stubs/ModelDynamicVisibleStub.php +++ b/src/database/tests/Stubs/ModelDynamicVisibleStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelEventListenerStub.php b/src/database/tests/Stubs/ModelEventListenerStub.php index 995809beb..0df454c73 100644 --- a/src/database/tests/Stubs/ModelEventListenerStub.php +++ b/src/database/tests/Stubs/ModelEventListenerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Events\Event; diff --git a/src/database/tests/Stubs/ModelEventObjectStub.php b/src/database/tests/Stubs/ModelEventObjectStub.php index 84fb24d2b..de4304ff4 100644 --- a/src/database/tests/Stubs/ModelEventObjectStub.php +++ b/src/database/tests/Stubs/ModelEventObjectStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelFindWithWritePdoStub.php b/src/database/tests/Stubs/ModelFindWithWritePdoStub.php index f14729ecf..6321f9e41 100644 --- a/src/database/tests/Stubs/ModelFindWithWritePdoStub.php +++ b/src/database/tests/Stubs/ModelFindWithWritePdoStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Builder; diff --git a/src/database/tests/Stubs/ModelGetMutatorsStub.php b/src/database/tests/Stubs/ModelGetMutatorsStub.php index cbf9423d1..ce8494e3d 100644 --- a/src/database/tests/Stubs/ModelGetMutatorsStub.php +++ b/src/database/tests/Stubs/ModelGetMutatorsStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelHydrateRawStub.php b/src/database/tests/Stubs/ModelHydrateRawStub.php index 72be80283..7fbad9558 100644 --- a/src/database/tests/Stubs/ModelHydrateRawStub.php +++ b/src/database/tests/Stubs/ModelHydrateRawStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\ConnectionInterface; diff --git a/src/database/tests/Stubs/ModelNamespacedStub.php b/src/database/tests/Stubs/ModelNamespacedStub.php index 86584879a..a703a6d3d 100644 --- a/src/database/tests/Stubs/ModelNamespacedStub.php +++ b/src/database/tests/Stubs/ModelNamespacedStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelNonIncrementingStub.php b/src/database/tests/Stubs/ModelNonIncrementingStub.php index 7a704e356..7261b1679 100644 --- a/src/database/tests/Stubs/ModelNonIncrementingStub.php +++ b/src/database/tests/Stubs/ModelNonIncrementingStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelObserverStub.php b/src/database/tests/Stubs/ModelObserverStub.php index cc2fcc780..7b79684cc 100644 --- a/src/database/tests/Stubs/ModelObserverStub.php +++ b/src/database/tests/Stubs/ModelObserverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Events\Updating; diff --git a/src/database/tests/Stubs/ModelSaveStub.php b/src/database/tests/Stubs/ModelSaveStub.php index 1c61ecbe3..d85b9a7b4 100644 --- a/src/database/tests/Stubs/ModelSaveStub.php +++ b/src/database/tests/Stubs/ModelSaveStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Context\Context; diff --git a/src/database/tests/Stubs/ModelSavingEventStub.php b/src/database/tests/Stubs/ModelSavingEventStub.php index e4218d20e..bdcc9ab40 100644 --- a/src/database/tests/Stubs/ModelSavingEventStub.php +++ b/src/database/tests/Stubs/ModelSavingEventStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Psr\EventDispatcher\StoppableEventInterface; diff --git a/src/database/tests/Stubs/ModelStub.php b/src/database/tests/Stubs/ModelStub.php index ffe25e081..e4ea6e404 100644 --- a/src/database/tests/Stubs/ModelStub.php +++ b/src/database/tests/Stubs/ModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Builder; diff --git a/src/database/tests/Stubs/ModelStubWithTrait.php b/src/database/tests/Stubs/ModelStubWithTrait.php index 91ff0098d..062e70606 100644 --- a/src/database/tests/Stubs/ModelStubWithTrait.php +++ b/src/database/tests/Stubs/ModelStubWithTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class ModelStubWithTrait extends ModelStub diff --git a/src/database/tests/Stubs/ModelStubWithUlid.php b/src/database/tests/Stubs/ModelStubWithUlid.php index df4f79638..5d0c6c64f 100644 --- a/src/database/tests/Stubs/ModelStubWithUlid.php +++ b/src/database/tests/Stubs/ModelStubWithUlid.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Concerns\HasUlids; diff --git a/src/database/tests/Stubs/ModelStubWithUuid.php b/src/database/tests/Stubs/ModelStubWithUuid.php index ab15abfff..c3ec932a9 100644 --- a/src/database/tests/Stubs/ModelStubWithUuid.php +++ b/src/database/tests/Stubs/ModelStubWithUuid.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Concerns\HasUuids; diff --git a/src/database/tests/Stubs/ModelWithStub.php b/src/database/tests/Stubs/ModelWithStub.php index dbf996fb6..276cafce1 100644 --- a/src/database/tests/Stubs/ModelWithStub.php +++ b/src/database/tests/Stubs/ModelWithStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Builder; diff --git a/src/database/tests/Stubs/ModelWithoutRelationStub.php b/src/database/tests/Stubs/ModelWithoutRelationStub.php index 6021a98d1..8aeadbb17 100644 --- a/src/database/tests/Stubs/ModelWithoutRelationStub.php +++ b/src/database/tests/Stubs/ModelWithoutRelationStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/ModelWithoutTableStub.php b/src/database/tests/Stubs/ModelWithoutTableStub.php index 1567255b8..e48917855 100644 --- a/src/database/tests/Stubs/ModelWithoutTableStub.php +++ b/src/database/tests/Stubs/ModelWithoutTableStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Database\Model\Model; diff --git a/src/database/tests/Stubs/NoConnectionModelStub.php b/src/database/tests/Stubs/NoConnectionModelStub.php index 7bef851bf..d2c0e9bc9 100644 --- a/src/database/tests/Stubs/NoConnectionModelStub.php +++ b/src/database/tests/Stubs/NoConnectionModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class NoConnectionModelStub extends ModelStub diff --git a/src/database/tests/Stubs/StringStatus.php b/src/database/tests/Stubs/StringStatus.php index 4054d99a1..351849cb2 100644 --- a/src/database/tests/Stubs/StringStatus.php +++ b/src/database/tests/Stubs/StringStatus.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; enum StringStatus: string diff --git a/src/database/tests/Stubs/TestAnotherObserverStub.php b/src/database/tests/Stubs/TestAnotherObserverStub.php index a5cf674d9..31b9111a5 100644 --- a/src/database/tests/Stubs/TestAnotherObserverStub.php +++ b/src/database/tests/Stubs/TestAnotherObserverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class TestAnotherObserverStub diff --git a/src/database/tests/Stubs/TestObserverStub.php b/src/database/tests/Stubs/TestObserverStub.php index 970a4bcb8..d2f73f5e1 100644 --- a/src/database/tests/Stubs/TestObserverStub.php +++ b/src/database/tests/Stubs/TestObserverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; class TestObserverStub diff --git a/src/database/tests/Stubs/User.php b/src/database/tests/Stubs/User.php index 32b986e88..bda801ac8 100644 --- a/src/database/tests/Stubs/User.php +++ b/src/database/tests/Stubs/User.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Database\Stubs; use Hyperf\Context\ApplicationContext; diff --git a/src/db-connection/publish/DbQueryExecutedListener.php b/src/db-connection/publish/DbQueryExecutedListener.php index 0238c5d94..f09a5f6b3 100644 --- a/src/db-connection/publish/DbQueryExecutedListener.php +++ b/src/db-connection/publish/DbQueryExecutedListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace App\Listener; use Hyperf\Collection\Arr; diff --git a/src/db-connection/publish/databases.php b/src/db-connection/publish/databases.php index d291593d4..0393f7cde 100644 --- a/src/db-connection/publish/databases.php +++ b/src/db-connection/publish/databases.php @@ -9,6 +9,8 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\ModelCache\Handler\RedisHandler; + use function Hyperf\Support\env; return [ @@ -31,7 +33,7 @@ return [ 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60), ], 'cache' => [ - 'handler' => Hyperf\ModelCache\Handler\RedisHandler::class, + 'handler' => RedisHandler::class, 'cache_key' => 'mc:%s:m:%s:%s:%s', 'prefix' => 'default', 'ttl' => 3600 * 24, diff --git a/src/db-connection/src/Annotation/Transactional.php b/src/db-connection/src/Annotation/Transactional.php index e39583d10..bd170c066 100644 --- a/src/db-connection/src/Annotation/Transactional.php +++ b/src/db-connection/src/Annotation/Transactional.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Annotation; use Attribute; diff --git a/src/db-connection/src/Aspect/TransactionAspect.php b/src/db-connection/src/Aspect/TransactionAspect.php index 664208a2d..8f9068447 100644 --- a/src/db-connection/src/Aspect/TransactionAspect.php +++ b/src/db-connection/src/Aspect/TransactionAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Aspect; use Hyperf\DbConnection\Annotation\Transactional; diff --git a/src/db-connection/src/Collector/TableCollector.php b/src/db-connection/src/Collector/TableCollector.php index fa73a6f50..e64ac8338 100644 --- a/src/db-connection/src/Collector/TableCollector.php +++ b/src/db-connection/src/Collector/TableCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Collector; use Hyperf\Database\Schema\Column; diff --git a/src/db-connection/src/ConfigProvider.php b/src/db-connection/src/ConfigProvider.php index aaad5f590..20e83bc17 100644 --- a/src/db-connection/src/ConfigProvider.php +++ b/src/db-connection/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection; use Hyperf\Database\ConnectionResolverInterface; diff --git a/src/db-connection/src/Connection.php b/src/db-connection/src/Connection.php index 10a1f0a38..b9ec56f4a 100644 --- a/src/db-connection/src/Connection.php +++ b/src/db-connection/src/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection; use Hyperf\Contract\ConnectionInterface; diff --git a/src/db-connection/src/ConnectionResolver.php b/src/db-connection/src/ConnectionResolver.php index 0ce7e7e41..7459915b9 100644 --- a/src/db-connection/src/ConnectionResolver.php +++ b/src/db-connection/src/ConnectionResolver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection; use Hyperf\Context\Context; diff --git a/src/db-connection/src/DatabaseMigrationRepositoryFactory.php b/src/db-connection/src/DatabaseMigrationRepositoryFactory.php index 1006149b3..f76ecdc56 100644 --- a/src/db-connection/src/DatabaseMigrationRepositoryFactory.php +++ b/src/db-connection/src/DatabaseMigrationRepositoryFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection; use Hyperf\Contract\ConfigInterface; diff --git a/src/db-connection/src/Db.php b/src/db-connection/src/Db.php index fb96a9d90..fe21abbda 100644 --- a/src/db-connection/src/Db.php +++ b/src/db-connection/src/Db.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection; use Closure; diff --git a/src/db-connection/src/Frequency.php b/src/db-connection/src/Frequency.php index ebd64f309..6dd3b99fe 100644 --- a/src/db-connection/src/Frequency.php +++ b/src/db-connection/src/Frequency.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection; use Hyperf\Pool\Frequency as DefaultFrequency; diff --git a/src/db-connection/src/Listener/InitTableCollectorListener.php b/src/db-connection/src/Listener/InitTableCollectorListener.php index cd62a7e6a..6cb1fbe74 100644 --- a/src/db-connection/src/Listener/InitTableCollectorListener.php +++ b/src/db-connection/src/Listener/InitTableCollectorListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Listener; use Hyperf\Command\Event\BeforeHandle; diff --git a/src/db-connection/src/Listener/InitUidOnCreatingListener.php b/src/db-connection/src/Listener/InitUidOnCreatingListener.php index e7ce54e4f..dd780ead9 100644 --- a/src/db-connection/src/Listener/InitUidOnCreatingListener.php +++ b/src/db-connection/src/Listener/InitUidOnCreatingListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Listener; use Hyperf\Database\Model\Concerns\HasUlids; diff --git a/src/db-connection/src/Listener/RegisterConnectionResolverListener.php b/src/db-connection/src/Listener/RegisterConnectionResolverListener.php index 442a78956..393a8006a 100644 --- a/src/db-connection/src/Listener/RegisterConnectionResolverListener.php +++ b/src/db-connection/src/Listener/RegisterConnectionResolverListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Listener; use Hyperf\Database\ConnectionResolverInterface; diff --git a/src/db-connection/src/Listener/UnsetContextInTaskWorkerListener.php b/src/db-connection/src/Listener/UnsetContextInTaskWorkerListener.php index 3991f36f6..fc8acfbb0 100644 --- a/src/db-connection/src/Listener/UnsetContextInTaskWorkerListener.php +++ b/src/db-connection/src/Listener/UnsetContextInTaskWorkerListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Listener; use Hyperf\Context\Context; diff --git a/src/db-connection/src/Model/Model.php b/src/db-connection/src/Model/Model.php index 433d98d57..2f9d2165e 100644 --- a/src/db-connection/src/Model/Model.php +++ b/src/db-connection/src/Model/Model.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Model; use Hyperf\Database\Model\Model as BaseModel; diff --git a/src/db-connection/src/Model/Relations/MorphPivot.php b/src/db-connection/src/Model/Relations/MorphPivot.php index 1a297bfe5..862072bf7 100644 --- a/src/db-connection/src/Model/Relations/MorphPivot.php +++ b/src/db-connection/src/Model/Relations/MorphPivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Model\Relations; use Hyperf\Database\Model\Relations\MorphPivot as BaseMorphPivot; diff --git a/src/db-connection/src/Model/Relations/Pivot.php b/src/db-connection/src/Model/Relations/Pivot.php index 06db8357c..7331bb15e 100644 --- a/src/db-connection/src/Model/Relations/Pivot.php +++ b/src/db-connection/src/Model/Relations/Pivot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Model\Relations; use Hyperf\Database\Model\Relations\Pivot as BasePivot; diff --git a/src/db-connection/src/Pool/DbPool.php b/src/db-connection/src/Pool/DbPool.php index a3a206cfc..cb64607f5 100644 --- a/src/db-connection/src/Pool/DbPool.php +++ b/src/db-connection/src/Pool/DbPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Pool; use Hyperf\Collection\Arr; diff --git a/src/db-connection/src/Pool/PoolFactory.php b/src/db-connection/src/Pool/PoolFactory.php index cc8707f7f..9ad44f693 100644 --- a/src/db-connection/src/Pool/PoolFactory.php +++ b/src/db-connection/src/Pool/PoolFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Pool; use Hyperf\Di\Container; diff --git a/src/db-connection/src/Traits/DbConnection.php b/src/db-connection/src/Traits/DbConnection.php index 12cd933d1..154b83b72 100644 --- a/src/db-connection/src/Traits/DbConnection.php +++ b/src/db-connection/src/Traits/DbConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Traits; use Closure; diff --git a/src/db-connection/src/Traits/HasContainer.php b/src/db-connection/src/Traits/HasContainer.php index f5b6b36ed..d39715df2 100644 --- a/src/db-connection/src/Traits/HasContainer.php +++ b/src/db-connection/src/Traits/HasContainer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Traits; use Hyperf\Context\ApplicationContext; diff --git a/src/db-connection/src/Traits/HasRepository.php b/src/db-connection/src/Traits/HasRepository.php index 648ec5903..fee803617 100644 --- a/src/db-connection/src/Traits/HasRepository.php +++ b/src/db-connection/src/Traits/HasRepository.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Traits; use Hyperf\Database\Model\Model; diff --git a/src/db-connection/tests/ConnectionTest.php b/src/db-connection/tests/ConnectionTest.php index b2be215bb..e979c3de2 100644 --- a/src/db-connection/tests/ConnectionTest.php +++ b/src/db-connection/tests/ConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection; use Exception; diff --git a/src/db-connection/tests/FooModel.php b/src/db-connection/tests/FooModel.php index 9dea6e80d..65dd7889b 100644 --- a/src/db-connection/tests/FooModel.php +++ b/src/db-connection/tests/FooModel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection; use Hyperf\DbConnection\Model\Model; diff --git a/src/db-connection/tests/FrequencyTest.php b/src/db-connection/tests/FrequencyTest.php index 3dfea05f3..002437aab 100644 --- a/src/db-connection/tests/FrequencyTest.php +++ b/src/db-connection/tests/FrequencyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection; use Hyperf\DbConnection\Frequency; diff --git a/src/db-connection/tests/RelationTest.php b/src/db-connection/tests/RelationTest.php index e3dd27185..02c35b6b8 100644 --- a/src/db-connection/tests/RelationTest.php +++ b/src/db-connection/tests/RelationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection; use Hyperf\Context\Context; diff --git a/src/db-connection/tests/Stubs/ConnectionStub.php b/src/db-connection/tests/Stubs/ConnectionStub.php index 9af867410..f2aaba217 100644 --- a/src/db-connection/tests/Stubs/ConnectionStub.php +++ b/src/db-connection/tests/Stubs/ConnectionStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use Hyperf\DbConnection\Connection; diff --git a/src/db-connection/tests/Stubs/ContainerStub.php b/src/db-connection/tests/Stubs/ContainerStub.php index a63af8b76..9de07521d 100644 --- a/src/db-connection/tests/Stubs/ContainerStub.php +++ b/src/db-connection/tests/Stubs/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use Hyperf\Config\Config; diff --git a/src/db-connection/tests/Stubs/FrequencyStub.php b/src/db-connection/tests/Stubs/FrequencyStub.php index 3cb2272ed..85b870c00 100644 --- a/src/db-connection/tests/Stubs/FrequencyStub.php +++ b/src/db-connection/tests/Stubs/FrequencyStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use Hyperf\DbConnection\Frequency; diff --git a/src/db-connection/tests/Stubs/MySqlConnectorStub.php b/src/db-connection/tests/Stubs/MySqlConnectorStub.php index f279f059c..815098404 100644 --- a/src/db-connection/tests/Stubs/MySqlConnectorStub.php +++ b/src/db-connection/tests/Stubs/MySqlConnectorStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use Hyperf\Database\Connectors\MySqlConnector; diff --git a/src/db-connection/tests/Stubs/PDOStatementStub.php b/src/db-connection/tests/Stubs/PDOStatementStub.php index 0e449657a..5d91b4645 100644 --- a/src/db-connection/tests/Stubs/PDOStatementStub.php +++ b/src/db-connection/tests/Stubs/PDOStatementStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use PDO; diff --git a/src/db-connection/tests/Stubs/PDOStatementStubPHP8.php b/src/db-connection/tests/Stubs/PDOStatementStubPHP8.php index 7ff08fa5a..dc4c89b34 100644 --- a/src/db-connection/tests/Stubs/PDOStatementStubPHP8.php +++ b/src/db-connection/tests/Stubs/PDOStatementStubPHP8.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use PDO; diff --git a/src/db-connection/tests/Stubs/PDOStub.php b/src/db-connection/tests/Stubs/PDOStub.php index 02099eae7..d6c6503b9 100644 --- a/src/db-connection/tests/Stubs/PDOStub.php +++ b/src/db-connection/tests/Stubs/PDOStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection\Stubs; use PDO; diff --git a/src/db-connection/tests/TableCollectorTest.php b/src/db-connection/tests/TableCollectorTest.php index 8d1c2a1a9..51a6cfb95 100644 --- a/src/db-connection/tests/TableCollectorTest.php +++ b/src/db-connection/tests/TableCollectorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/db-connection/tests/TransactionalTest.php b/src/db-connection/tests/TransactionalTest.php index 98941363b..a45258ab6 100644 --- a/src/db-connection/tests/TransactionalTest.php +++ b/src/db-connection/tests/TransactionalTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DbConnection; use Hyperf\Context\ApplicationContext; diff --git a/src/db/src/AbstractConnection.php b/src/db/src/AbstractConnection.php index 466352a08..f750ec05c 100644 --- a/src/db/src/AbstractConnection.php +++ b/src/db/src/AbstractConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/db/src/ConfigProvider.php b/src/db/src/ConfigProvider.php index 784719607..2a6faedbd 100644 --- a/src/db/src/ConfigProvider.php +++ b/src/db/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; class ConfigProvider diff --git a/src/db/src/ConnectionInterface.php b/src/db/src/ConnectionInterface.php index 7349b7fdc..2f796b7a8 100644 --- a/src/db/src/ConnectionInterface.php +++ b/src/db/src/ConnectionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Closure; diff --git a/src/db/src/DB.php b/src/db/src/DB.php index ff3a561d6..0bdf66ddf 100644 --- a/src/db/src/DB.php +++ b/src/db/src/DB.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Closure; diff --git a/src/db/src/DetectsLostConnections.php b/src/db/src/DetectsLostConnections.php index afb38dfec..2cf55609d 100644 --- a/src/db/src/DetectsLostConnections.php +++ b/src/db/src/DetectsLostConnections.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Hyperf\Stringable\Str; diff --git a/src/db/src/Exception/DriverNotFoundException.php b/src/db/src/Exception/DriverNotFoundException.php index 5870fd93b..4cc48676a 100644 --- a/src/db/src/Exception/DriverNotFoundException.php +++ b/src/db/src/Exception/DriverNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Exception; class DriverNotFoundException extends RuntimeException diff --git a/src/db/src/Exception/InvalidDriverException.php b/src/db/src/Exception/InvalidDriverException.php index cf1fbb014..bcc668315 100644 --- a/src/db/src/Exception/InvalidDriverException.php +++ b/src/db/src/Exception/InvalidDriverException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Exception; class InvalidDriverException extends RuntimeException diff --git a/src/db/src/Exception/QueryException.php b/src/db/src/Exception/QueryException.php index 4f7df21df..3c4f3a610 100644 --- a/src/db/src/Exception/QueryException.php +++ b/src/db/src/Exception/QueryException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Exception; use PDOException; diff --git a/src/db/src/Exception/RuntimeException.php b/src/db/src/Exception/RuntimeException.php index f884622af..3435c14e5 100644 --- a/src/db/src/Exception/RuntimeException.php +++ b/src/db/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Exception; class RuntimeException extends \RuntimeException diff --git a/src/db/src/Frequency.php b/src/db/src/Frequency.php index 981a13091..d497cebf7 100644 --- a/src/db/src/Frequency.php +++ b/src/db/src/Frequency.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Hyperf\Pool\Frequency as DefaultFrequency; diff --git a/src/db/src/ManagesTransactions.php b/src/db/src/ManagesTransactions.php index 4aeaefe6c..dd533c699 100644 --- a/src/db/src/ManagesTransactions.php +++ b/src/db/src/ManagesTransactions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Throwable; diff --git a/src/db/src/MySQLConnection.php b/src/db/src/MySQLConnection.php index e8f220466..9eebbdf23 100644 --- a/src/db/src/MySQLConnection.php +++ b/src/db/src/MySQLConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB; use Closure; diff --git a/src/db/src/PgSQL/PgSQLConnection.php b/src/db/src/PgSQL/PgSQLConnection.php index 48a9b143a..82535fd51 100644 --- a/src/db/src/PgSQL/PgSQLConnection.php +++ b/src/db/src/PgSQL/PgSQLConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\PgSQL; use Closure; diff --git a/src/db/src/PgSQL/PgSQLPool.php b/src/db/src/PgSQL/PgSQLPool.php index c1e445c18..72d84b45f 100644 --- a/src/db/src/PgSQL/PgSQLPool.php +++ b/src/db/src/PgSQL/PgSQLPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\PgSQL; use Hyperf\Contract\ConnectionInterface; diff --git a/src/db/src/Pool/MySQLPool.php b/src/db/src/Pool/MySQLPool.php index 9f94f471f..8e4bf41d1 100644 --- a/src/db/src/Pool/MySQLPool.php +++ b/src/db/src/Pool/MySQLPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Pool; use Hyperf\Contract\ConnectionInterface; diff --git a/src/db/src/Pool/Pool.php b/src/db/src/Pool/Pool.php index 508b24715..c0a29cb55 100644 --- a/src/db/src/Pool/Pool.php +++ b/src/db/src/Pool/Pool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Pool; use Hyperf\Collection\Arr; diff --git a/src/db/src/Pool/PoolFactory.php b/src/db/src/Pool/PoolFactory.php index 8cde2d6cb..6f25cbdc2 100644 --- a/src/db/src/Pool/PoolFactory.php +++ b/src/db/src/Pool/PoolFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DB\Pool; use Hyperf\Contract\ConfigInterface; diff --git a/src/db/tests/Cases/AbstractTestCase.php b/src/db/tests/Cases/AbstractTestCase.php index 756a997e0..7dba28716 100644 --- a/src/db/tests/Cases/AbstractTestCase.php +++ b/src/db/tests/Cases/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DB\Cases; use Hyperf\Config\Config; diff --git a/src/db/tests/Cases/CustomDriverTest.php b/src/db/tests/Cases/CustomDriverTest.php index 842367204..85e8762b5 100644 --- a/src/db/tests/Cases/CustomDriverTest.php +++ b/src/db/tests/Cases/CustomDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DB\Cases; use Hyperf\Config\Config; diff --git a/src/db/tests/Cases/DBTest.php b/src/db/tests/Cases/DBTest.php index 598baffea..f954216ba 100644 --- a/src/db/tests/Cases/DBTest.php +++ b/src/db/tests/Cases/DBTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DB\Cases; use Hyperf\DB\DB; diff --git a/src/db/tests/Cases/MySQLDriverTest.php b/src/db/tests/Cases/MySQLDriverTest.php index 5993a4d6d..b84906212 100644 --- a/src/db/tests/Cases/MySQLDriverTest.php +++ b/src/db/tests/Cases/MySQLDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\DB\Cases; use Hyperf\DB\DB; diff --git a/src/db/tests/Cases/PgSQL/PgSQLTest.php b/src/db/tests/Cases/PgSQL/PgSQLTest.php index c3fdee236..4ba61bb23 100644 --- a/src/db/tests/Cases/PgSQL/PgSQLTest.php +++ b/src/db/tests/Cases/PgSQL/PgSQLTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Cases\PgSQL; use Hyperf\DB\DB; diff --git a/src/devtool/src/Adapter/AbstractAdapter.php b/src/devtool/src/Adapter/AbstractAdapter.php index d79e336f1..0f84ba48e 100644 --- a/src/devtool/src/Adapter/AbstractAdapter.php +++ b/src/devtool/src/Adapter/AbstractAdapter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Adapter; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/devtool/src/Adapter/Aspects.php b/src/devtool/src/Adapter/Aspects.php index 249c10ed4..4629bc514 100644 --- a/src/devtool/src/Adapter/Aspects.php +++ b/src/devtool/src/Adapter/Aspects.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Adapter; use Hyperf\Di\Annotation\AspectCollector; diff --git a/src/devtool/src/ConfigProvider.php b/src/devtool/src/ConfigProvider.php index 5267444dd..4edebdfe4 100644 --- a/src/devtool/src/ConfigProvider.php +++ b/src/devtool/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool; use Hyperf\Database\Commands\CommandCollector; diff --git a/src/devtool/src/Describe/AspectsCommand.php b/src/devtool/src/Describe/AspectsCommand.php index 75241c8a0..1fe690fdb 100644 --- a/src/devtool/src/Describe/AspectsCommand.php +++ b/src/devtool/src/Describe/AspectsCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Describe; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Describe/ListenersCommand.php b/src/devtool/src/Describe/ListenersCommand.php index 2bda52371..a0919decc 100644 --- a/src/devtool/src/Describe/ListenersCommand.php +++ b/src/devtool/src/Describe/ListenersCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Describe; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Describe/RoutesCommand.php b/src/devtool/src/Describe/RoutesCommand.php index 756cb5e20..20254260c 100644 --- a/src/devtool/src/Describe/RoutesCommand.php +++ b/src/devtool/src/Describe/RoutesCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Describe; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/AmqpConsumerCommand.php b/src/devtool/src/Generator/AmqpConsumerCommand.php index d4642a9c4..b1f170069 100644 --- a/src/devtool/src/Generator/AmqpConsumerCommand.php +++ b/src/devtool/src/Generator/AmqpConsumerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/AmqpProducerCommand.php b/src/devtool/src/Generator/AmqpProducerCommand.php index 5810cab62..7e43ce335 100644 --- a/src/devtool/src/Generator/AmqpProducerCommand.php +++ b/src/devtool/src/Generator/AmqpProducerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/AspectCommand.php b/src/devtool/src/Generator/AspectCommand.php index 3340b0e14..e7eb6c8e9 100644 --- a/src/devtool/src/Generator/AspectCommand.php +++ b/src/devtool/src/Generator/AspectCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/ClassCommand.php b/src/devtool/src/Generator/ClassCommand.php index fe5699722..1f1a1d00e 100644 --- a/src/devtool/src/Generator/ClassCommand.php +++ b/src/devtool/src/Generator/ClassCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/CommandCommand.php b/src/devtool/src/Generator/CommandCommand.php index 0c05b54c3..96b1af105 100644 --- a/src/devtool/src/Generator/CommandCommand.php +++ b/src/devtool/src/Generator/CommandCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/ConstantCommand.php b/src/devtool/src/Generator/ConstantCommand.php index f9b6d6d5b..db9e2856b 100644 --- a/src/devtool/src/Generator/ConstantCommand.php +++ b/src/devtool/src/Generator/ConstantCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/ControllerCommand.php b/src/devtool/src/Generator/ControllerCommand.php index c4a2fb973..0a4fa0eee 100644 --- a/src/devtool/src/Generator/ControllerCommand.php +++ b/src/devtool/src/Generator/ControllerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/GeneratorCommand.php b/src/devtool/src/Generator/GeneratorCommand.php index e401e69d8..be949c6ee 100644 --- a/src/devtool/src/Generator/GeneratorCommand.php +++ b/src/devtool/src/Generator/GeneratorCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\CodeParser\Project; diff --git a/src/devtool/src/Generator/JobCommand.php b/src/devtool/src/Generator/JobCommand.php index a87de7022..ae30d840f 100644 --- a/src/devtool/src/Generator/JobCommand.php +++ b/src/devtool/src/Generator/JobCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/KafkaConsumerCommand.php b/src/devtool/src/Generator/KafkaConsumerCommand.php index 8e8cda2b2..196d81d24 100644 --- a/src/devtool/src/Generator/KafkaConsumerCommand.php +++ b/src/devtool/src/Generator/KafkaConsumerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/ListenerCommand.php b/src/devtool/src/Generator/ListenerCommand.php index aec3ba583..5bfedec48 100644 --- a/src/devtool/src/Generator/ListenerCommand.php +++ b/src/devtool/src/Generator/ListenerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/MiddlewareCommand.php b/src/devtool/src/Generator/MiddlewareCommand.php index cbf2adf39..1045a982b 100644 --- a/src/devtool/src/Generator/MiddlewareCommand.php +++ b/src/devtool/src/Generator/MiddlewareCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/NatsConsumerCommand.php b/src/devtool/src/Generator/NatsConsumerCommand.php index 23013a498..0a3901785 100644 --- a/src/devtool/src/Generator/NatsConsumerCommand.php +++ b/src/devtool/src/Generator/NatsConsumerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/NsqConsumerCommand.php b/src/devtool/src/Generator/NsqConsumerCommand.php index 9ce27f41a..6ce1abc6c 100644 --- a/src/devtool/src/Generator/NsqConsumerCommand.php +++ b/src/devtool/src/Generator/NsqConsumerCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/ProcessCommand.php b/src/devtool/src/Generator/ProcessCommand.php index d5d5d4e20..6063a4d6d 100644 --- a/src/devtool/src/Generator/ProcessCommand.php +++ b/src/devtool/src/Generator/ProcessCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/RequestCommand.php b/src/devtool/src/Generator/RequestCommand.php index aca81e154..ef0911eeb 100644 --- a/src/devtool/src/Generator/RequestCommand.php +++ b/src/devtool/src/Generator/RequestCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Generator/ResourceCommand.php b/src/devtool/src/Generator/ResourceCommand.php index 3b4136332..603b65b0f 100644 --- a/src/devtool/src/Generator/ResourceCommand.php +++ b/src/devtool/src/Generator/ResourceCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool\Generator; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/Info.php b/src/devtool/src/Info.php index c0d4c14f8..62adc506c 100644 --- a/src/devtool/src/Info.php +++ b/src/devtool/src/Info.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool; use Hyperf\Devtool\Adapter\AbstractAdapter; diff --git a/src/devtool/src/InfoCommand.php b/src/devtool/src/InfoCommand.php index b2616a94e..85a10fd81 100644 --- a/src/devtool/src/InfoCommand.php +++ b/src/devtool/src/InfoCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool; use Hyperf\Command\Annotation\Command; diff --git a/src/devtool/src/VendorPublishCommand.php b/src/devtool/src/VendorPublishCommand.php index d1f43eaf1..1bd22e11c 100644 --- a/src/devtool/src/VendorPublishCommand.php +++ b/src/devtool/src/VendorPublishCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Devtool; use Hyperf\Collection\Arr; diff --git a/src/devtool/tests/Describe/RoutesCommandTest.php b/src/devtool/tests/Describe/RoutesCommandTest.php index 06430a022..0db293191 100644 --- a/src/devtool/tests/Describe/RoutesCommandTest.php +++ b/src/devtool/tests/Describe/RoutesCommandTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Devtool\Describe; use Hyperf\Contract\ConfigInterface; diff --git a/src/devtool/tests/Stub/ContainerStub.php b/src/devtool/tests/Stub/ContainerStub.php index 410452c5a..d6288078f 100644 --- a/src/devtool/tests/Stub/ContainerStub.php +++ b/src/devtool/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Devtool\Stub; use Hyperf\Config\Config; diff --git a/src/devtool/tests/Stub/IndexController.php b/src/devtool/tests/Stub/IndexController.php index aca495624..753e60019 100644 --- a/src/devtool/tests/Stub/IndexController.php +++ b/src/devtool/tests/Stub/IndexController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Devtool\Stub; class IndexController diff --git a/src/di/src/AbstractCallableDefinitionCollector.php b/src/di/src/AbstractCallableDefinitionCollector.php index 9552c9f1b..1e7acbd28 100644 --- a/src/di/src/AbstractCallableDefinitionCollector.php +++ b/src/di/src/AbstractCallableDefinitionCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use ReflectionNamedType; diff --git a/src/di/src/Annotation/AbstractAnnotation.php b/src/di/src/Annotation/AbstractAnnotation.php index be60cfcaf..43af943d3 100644 --- a/src/di/src/Annotation/AbstractAnnotation.php +++ b/src/di/src/Annotation/AbstractAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Contract\Arrayable; diff --git a/src/di/src/Annotation/AbstractMultipleAnnotation.php b/src/di/src/Annotation/AbstractMultipleAnnotation.php index ad298093c..dc05aed67 100644 --- a/src/di/src/Annotation/AbstractMultipleAnnotation.php +++ b/src/di/src/Annotation/AbstractMultipleAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; abstract class AbstractMultipleAnnotation extends AbstractAnnotation diff --git a/src/di/src/Annotation/AnnotationCollector.php b/src/di/src/Annotation/AnnotationCollector.php index 052a41f2d..1257c0c61 100644 --- a/src/di/src/Annotation/AnnotationCollector.php +++ b/src/di/src/Annotation/AnnotationCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\MetadataCollector; diff --git a/src/di/src/Annotation/AnnotationInterface.php b/src/di/src/Annotation/AnnotationInterface.php index 593ffffdb..88a5f00b0 100644 --- a/src/di/src/Annotation/AnnotationInterface.php +++ b/src/di/src/Annotation/AnnotationInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; interface AnnotationInterface diff --git a/src/di/src/Annotation/AnnotationReader.php b/src/di/src/Annotation/AnnotationReader.php index 81712231d..06dddbdd3 100644 --- a/src/di/src/Annotation/AnnotationReader.php +++ b/src/di/src/Annotation/AnnotationReader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\Exception\NotFoundException; diff --git a/src/di/src/Annotation/Aspect.php b/src/di/src/Annotation/Aspect.php index 7abdb1c84..2fb265c48 100644 --- a/src/di/src/Annotation/Aspect.php +++ b/src/di/src/Annotation/Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Attribute; diff --git a/src/di/src/Annotation/AspectCollector.php b/src/di/src/Annotation/AspectCollector.php index 203e4d1d6..ca0b9c036 100644 --- a/src/di/src/Annotation/AspectCollector.php +++ b/src/di/src/Annotation/AspectCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\MetadataCollector; diff --git a/src/di/src/Annotation/AspectLoader.php b/src/di/src/Annotation/AspectLoader.php index 8a1817f66..e24fdd7fb 100644 --- a/src/di/src/Annotation/AspectLoader.php +++ b/src/di/src/Annotation/AspectLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\ReflectionManager; diff --git a/src/di/src/Annotation/Debug.php b/src/di/src/Annotation/Debug.php index e02ac0e42..be29562ef 100644 --- a/src/di/src/Annotation/Debug.php +++ b/src/di/src/Annotation/Debug.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Attribute; diff --git a/src/di/src/Annotation/Inject.php b/src/di/src/Annotation/Inject.php index 755e13025..fb8ca9f43 100644 --- a/src/di/src/Annotation/Inject.php +++ b/src/di/src/Annotation/Inject.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Attribute; diff --git a/src/di/src/Annotation/InjectAspect.php b/src/di/src/Annotation/InjectAspect.php index a563934c8..4c497b3a1 100644 --- a/src/di/src/Annotation/InjectAspect.php +++ b/src/di/src/Annotation/InjectAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/src/Annotation/MultipleAnnotation.php b/src/di/src/Annotation/MultipleAnnotation.php index 01cdd464e..823cbfe5b 100644 --- a/src/di/src/Annotation/MultipleAnnotation.php +++ b/src/di/src/Annotation/MultipleAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\Exception\AnnotationException; diff --git a/src/di/src/Annotation/MultipleAnnotationInterface.php b/src/di/src/Annotation/MultipleAnnotationInterface.php index 9707bbf32..3e2c5caf4 100644 --- a/src/di/src/Annotation/MultipleAnnotationInterface.php +++ b/src/di/src/Annotation/MultipleAnnotationInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Di\Exception\AnnotationException; diff --git a/src/di/src/Annotation/RelationCollector.php b/src/di/src/Annotation/RelationCollector.php index 55426749b..9a3a1f9c0 100644 --- a/src/di/src/Annotation/RelationCollector.php +++ b/src/di/src/Annotation/RelationCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; /** diff --git a/src/di/src/Annotation/ScanConfig.php b/src/di/src/Annotation/ScanConfig.php index 55b90110e..81173e052 100644 --- a/src/di/src/Annotation/ScanConfig.php +++ b/src/di/src/Annotation/ScanConfig.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Config\ProviderConfig; diff --git a/src/di/src/Annotation/Scanner.php b/src/di/src/Annotation/Scanner.php index a63d4656c..bcf99da20 100644 --- a/src/di/src/Annotation/Scanner.php +++ b/src/di/src/Annotation/Scanner.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Hyperf\Config\ProviderConfig; diff --git a/src/di/src/Aop/AbstractAspect.php b/src/di/src/Aop/AbstractAspect.php index c9d782453..4bac7bb51 100644 --- a/src/di/src/Aop/AbstractAspect.php +++ b/src/di/src/Aop/AbstractAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; abstract class AbstractAspect implements AroundInterface diff --git a/src/di/src/Aop/AnnotationMetadata.php b/src/di/src/Aop/AnnotationMetadata.php index 088f1e803..78dea3e4f 100644 --- a/src/di/src/Aop/AnnotationMetadata.php +++ b/src/di/src/Aop/AnnotationMetadata.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; class AnnotationMetadata diff --git a/src/di/src/Aop/AroundInterface.php b/src/di/src/Aop/AroundInterface.php index 1fd9b2617..23fff2bb7 100644 --- a/src/di/src/Aop/AroundInterface.php +++ b/src/di/src/Aop/AroundInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; interface AroundInterface diff --git a/src/di/src/Aop/Aspect.php b/src/di/src/Aop/Aspect.php index 1ca1d772f..fc04cad00 100644 --- a/src/di/src/Aop/Aspect.php +++ b/src/di/src/Aop/Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/di/src/Aop/AspectManager.php b/src/di/src/Aop/AspectManager.php index 190d12ef0..f7ec8df65 100644 --- a/src/di/src/Aop/AspectManager.php +++ b/src/di/src/Aop/AspectManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; class AspectManager diff --git a/src/di/src/Aop/Ast.php b/src/di/src/Aop/Ast.php index 9627fe279..7351492ff 100644 --- a/src/di/src/Aop/Ast.php +++ b/src/di/src/Aop/Ast.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Support\Composer; diff --git a/src/di/src/Aop/AstVisitorRegistry.php b/src/di/src/Aop/AstVisitorRegistry.php index a9b446f90..91dd05de6 100644 --- a/src/di/src/Aop/AstVisitorRegistry.php +++ b/src/di/src/Aop/AstVisitorRegistry.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Stdlib\SplPriorityQueue; diff --git a/src/di/src/Aop/Pipeline.php b/src/di/src/Aop/Pipeline.php index efde6fd2e..468df0a92 100644 --- a/src/di/src/Aop/Pipeline.php +++ b/src/di/src/Aop/Pipeline.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Closure; diff --git a/src/di/src/Aop/ProceedingJoinPoint.php b/src/di/src/Aop/ProceedingJoinPoint.php index a5e86c4b2..ac28488f7 100644 --- a/src/di/src/Aop/ProceedingJoinPoint.php +++ b/src/di/src/Aop/ProceedingJoinPoint.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Closure; diff --git a/src/di/src/Aop/PropertyHandlerTrait.php b/src/di/src/Aop/PropertyHandlerTrait.php index 4704ab165..b73e247a3 100644 --- a/src/di/src/Aop/PropertyHandlerTrait.php +++ b/src/di/src/Aop/PropertyHandlerTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/di/src/Aop/PropertyHandlerVisitor.php b/src/di/src/Aop/PropertyHandlerVisitor.php index 40e944095..4bcfb46f6 100644 --- a/src/di/src/Aop/PropertyHandlerVisitor.php +++ b/src/di/src/Aop/PropertyHandlerVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\CodeParser\PhpParser; @@ -17,6 +18,7 @@ use PhpParser\Node; use PhpParser\Node\Name; use PhpParser\Node\Stmt\TraitUse; use PhpParser\NodeVisitorAbstract; +use ReflectionException; class PropertyHandlerVisitor extends NodeVisitorAbstract { @@ -83,7 +85,7 @@ class PropertyHandlerVisitor extends NodeVisitorAbstract foreach ($parameters as $parameter) { $constructor->params[] = PhpParser::getInstance()->getNodeFromReflectionParameter($parameter); } - } catch (\ReflectionException) { + } catch (ReflectionException) { // Cannot found __construct method in parent class or traits, do nothing. } } diff --git a/src/di/src/Aop/ProxyCallVisitor.php b/src/di/src/Aop/ProxyCallVisitor.php index 5f377f59c..fddc67fa2 100644 --- a/src/di/src/Aop/ProxyCallVisitor.php +++ b/src/di/src/Aop/ProxyCallVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Support\Composer; @@ -94,7 +95,7 @@ class ProxyCallVisitor extends NodeVisitorAbstract } // Rewrite the method to proxy call method. return $this->rewriteMethod($node); - case $node instanceof Node\Stmt\Trait_: + case $node instanceof Trait_: // If the node is trait and php version >= 7.3, it can `use ProxyTrait` like class. case $node instanceof Class_ && ! $node->isAnonymous(): // Add use proxy traits. diff --git a/src/di/src/Aop/ProxyManager.php b/src/di/src/Aop/ProxyManager.php index cc0712b11..8325a293d 100644 --- a/src/di/src/Aop/ProxyManager.php +++ b/src/di/src/Aop/ProxyManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/di/src/Aop/ProxyTrait.php b/src/di/src/Aop/ProxyTrait.php index bc5fcffbe..b61e287af 100644 --- a/src/di/src/Aop/ProxyTrait.php +++ b/src/di/src/Aop/ProxyTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Closure; diff --git a/src/di/src/Aop/RegisterInjectPropertyHandler.php b/src/di/src/Aop/RegisterInjectPropertyHandler.php index 373f9168a..85afcd954 100644 --- a/src/di/src/Aop/RegisterInjectPropertyHandler.php +++ b/src/di/src/Aop/RegisterInjectPropertyHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use Hyperf\Context\ApplicationContext; diff --git a/src/di/src/Aop/RewriteCollection.php b/src/di/src/Aop/RewriteCollection.php index 78213ebf9..8cf6dafb4 100644 --- a/src/di/src/Aop/RewriteCollection.php +++ b/src/di/src/Aop/RewriteCollection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; class RewriteCollection diff --git a/src/di/src/Aop/VisitorMetadata.php b/src/di/src/Aop/VisitorMetadata.php index 9b4fca0ce..acedc5438 100644 --- a/src/di/src/Aop/VisitorMetadata.php +++ b/src/di/src/Aop/VisitorMetadata.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Aop; use PhpParser\Node; diff --git a/src/di/src/ClassLoader.php b/src/di/src/ClassLoader.php index c632a5984..87245026c 100644 --- a/src/di/src/ClassLoader.php +++ b/src/di/src/ClassLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Dotenv\Dotenv; diff --git a/src/di/src/ClosureDefinitionCollector.php b/src/di/src/ClosureDefinitionCollector.php index 7eae848e7..61ea0fc79 100644 --- a/src/di/src/ClosureDefinitionCollector.php +++ b/src/di/src/ClosureDefinitionCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Closure; diff --git a/src/di/src/ClosureDefinitionCollectorInterface.php b/src/di/src/ClosureDefinitionCollectorInterface.php index 511323bff..475abfb5e 100644 --- a/src/di/src/ClosureDefinitionCollectorInterface.php +++ b/src/di/src/ClosureDefinitionCollectorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Closure; diff --git a/src/di/src/ConfigProvider.php b/src/di/src/ConfigProvider.php index 3c90fcd8f..deaf4f07b 100644 --- a/src/di/src/ConfigProvider.php +++ b/src/di/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/di/src/Container.php b/src/di/src/Container.php index ca5fa5e01..b45d5da64 100644 --- a/src/di/src/Container.php +++ b/src/di/src/Container.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Hyperf\Contract\ContainerInterface as HyperfContainerInterface; diff --git a/src/di/src/Definition/DefinitionInterface.php b/src/di/src/Definition/DefinitionInterface.php index aa4468a1e..d6690f75a 100644 --- a/src/di/src/Definition/DefinitionInterface.php +++ b/src/di/src/Definition/DefinitionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Stringable; diff --git a/src/di/src/Definition/DefinitionSource.php b/src/di/src/Definition/DefinitionSource.php index 871ef819d..471e47b73 100644 --- a/src/di/src/Definition/DefinitionSource.php +++ b/src/di/src/Definition/DefinitionSource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Hyperf\Di\ReflectionManager; diff --git a/src/di/src/Definition/DefinitionSourceFactory.php b/src/di/src/Definition/DefinitionSourceFactory.php index 2ad93566c..5bce35faf 100644 --- a/src/di/src/Definition/DefinitionSourceFactory.php +++ b/src/di/src/Definition/DefinitionSourceFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Hyperf\Config\ProviderConfig; diff --git a/src/di/src/Definition/DefinitionSourceInterface.php b/src/di/src/Definition/DefinitionSourceInterface.php index 65f0e66e0..9fd53757b 100644 --- a/src/di/src/Definition/DefinitionSourceInterface.php +++ b/src/di/src/Definition/DefinitionSourceInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Hyperf\Di\Exception\InvalidDefinitionException; diff --git a/src/di/src/Definition/FactoryDefinition.php b/src/di/src/Definition/FactoryDefinition.php index f56d26518..78a4cc0d0 100644 --- a/src/di/src/Definition/FactoryDefinition.php +++ b/src/di/src/Definition/FactoryDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; class FactoryDefinition implements DefinitionInterface diff --git a/src/di/src/Definition/MethodInjection.php b/src/di/src/Definition/MethodInjection.php index 725a195f2..8268fb510 100644 --- a/src/di/src/Definition/MethodInjection.php +++ b/src/di/src/Definition/MethodInjection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; class MethodInjection implements DefinitionInterface diff --git a/src/di/src/Definition/ObjectDefinition.php b/src/di/src/Definition/ObjectDefinition.php index b4c2e3e27..364ae9722 100644 --- a/src/di/src/Definition/ObjectDefinition.php +++ b/src/di/src/Definition/ObjectDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Hyperf\Di\ReflectionManager; @@ -67,7 +68,7 @@ class ObjectDefinition implements DefinitionInterface } /** - * @return null|\Hyperf\Di\Definition\MethodInjection + * @return null|MethodInjection */ public function getConstructorInjection() { diff --git a/src/di/src/Definition/PriorityDefinition.php b/src/di/src/Definition/PriorityDefinition.php index 514c65e33..f4f7e9b45 100644 --- a/src/di/src/Definition/PriorityDefinition.php +++ b/src/di/src/Definition/PriorityDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; class PriorityDefinition diff --git a/src/di/src/Definition/PropertyDefinition.php b/src/di/src/Definition/PropertyDefinition.php index c8d00ae1e..bf3b44b0e 100644 --- a/src/di/src/Definition/PropertyDefinition.php +++ b/src/di/src/Definition/PropertyDefinition.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; class PropertyDefinition implements DefinitionInterface diff --git a/src/di/src/Definition/PropertyHandlerManager.php b/src/di/src/Definition/PropertyHandlerManager.php index 87aba3b35..9da747cff 100644 --- a/src/di/src/Definition/PropertyHandlerManager.php +++ b/src/di/src/Definition/PropertyHandlerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; class PropertyHandlerManager diff --git a/src/di/src/Definition/Reference.php b/src/di/src/Definition/Reference.php index 6ee8fc272..04ee2f849 100644 --- a/src/di/src/Definition/Reference.php +++ b/src/di/src/Definition/Reference.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Psr\Container\ContainerInterface; diff --git a/src/di/src/Definition/SelfResolvingDefinitionInterface.php b/src/di/src/Definition/SelfResolvingDefinitionInterface.php index 86e4f490a..fb5749cb8 100644 --- a/src/di/src/Definition/SelfResolvingDefinitionInterface.php +++ b/src/di/src/Definition/SelfResolvingDefinitionInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Definition; use Psr\Container\ContainerInterface; diff --git a/src/di/src/Exception/AnnotationException.php b/src/di/src/Exception/AnnotationException.php index 020717bed..77fa14c29 100644 --- a/src/di/src/Exception/AnnotationException.php +++ b/src/di/src/Exception/AnnotationException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class AnnotationException extends Exception diff --git a/src/di/src/Exception/CircularDependencyException.php b/src/di/src/Exception/CircularDependencyException.php index 31d6692d6..0ce7618e9 100644 --- a/src/di/src/Exception/CircularDependencyException.php +++ b/src/di/src/Exception/CircularDependencyException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; use RuntimeException; diff --git a/src/di/src/Exception/ConflictAnnotationException.php b/src/di/src/Exception/ConflictAnnotationException.php index 047bc0e52..5aacfd542 100644 --- a/src/di/src/Exception/ConflictAnnotationException.php +++ b/src/di/src/Exception/ConflictAnnotationException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class ConflictAnnotationException extends AnnotationException diff --git a/src/di/src/Exception/DependencyException.php b/src/di/src/Exception/DependencyException.php index 84e7a6184..2cc8e9660 100644 --- a/src/di/src/Exception/DependencyException.php +++ b/src/di/src/Exception/DependencyException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class DependencyException extends Exception diff --git a/src/di/src/Exception/DirectoryNotExistException.php b/src/di/src/Exception/DirectoryNotExistException.php index 92cb6fc4e..d9be2ab63 100644 --- a/src/di/src/Exception/DirectoryNotExistException.php +++ b/src/di/src/Exception/DirectoryNotExistException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class DirectoryNotExistException extends Exception diff --git a/src/di/src/Exception/Exception.php b/src/di/src/Exception/Exception.php index 75be5ab12..98314153b 100644 --- a/src/di/src/Exception/Exception.php +++ b/src/di/src/Exception/Exception.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class Exception extends \Exception diff --git a/src/di/src/Exception/InvalidArgumentException.php b/src/di/src/Exception/InvalidArgumentException.php index 41b8e4e00..b61abb7e3 100644 --- a/src/di/src/Exception/InvalidArgumentException.php +++ b/src/di/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/di/src/Exception/InvalidDefinitionException.php b/src/di/src/Exception/InvalidDefinitionException.php index 832b194c6..8066ca061 100644 --- a/src/di/src/Exception/InvalidDefinitionException.php +++ b/src/di/src/Exception/InvalidDefinitionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; use Hyperf\Di\Definition\DefinitionInterface; diff --git a/src/di/src/Exception/NotCallableException.php b/src/di/src/Exception/NotCallableException.php index cfc07d99e..3d0f159d2 100644 --- a/src/di/src/Exception/NotCallableException.php +++ b/src/di/src/Exception/NotCallableException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; class NotCallableException extends Exception diff --git a/src/di/src/Exception/NotFoundException.php b/src/di/src/Exception/NotFoundException.php index 5354f8a8b..affcd423f 100644 --- a/src/di/src/Exception/NotFoundException.php +++ b/src/di/src/Exception/NotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Exception; use Psr\Container\NotFoundExceptionInterface; diff --git a/src/di/src/LazyLoader/AbstractLazyProxyBuilder.php b/src/di/src/LazyLoader/AbstractLazyProxyBuilder.php index 5fd59a2eb..041c1e1b6 100644 --- a/src/di/src/LazyLoader/AbstractLazyProxyBuilder.php +++ b/src/di/src/LazyLoader/AbstractLazyProxyBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; use PhpParser\BuilderFactory; diff --git a/src/di/src/LazyLoader/ClassLazyProxyBuilder.php b/src/di/src/LazyLoader/ClassLazyProxyBuilder.php index f8b68cb70..67fa81bc8 100644 --- a/src/di/src/LazyLoader/ClassLazyProxyBuilder.php +++ b/src/di/src/LazyLoader/ClassLazyProxyBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; class ClassLazyProxyBuilder extends AbstractLazyProxyBuilder diff --git a/src/di/src/LazyLoader/FallbackLazyProxyBuilder.php b/src/di/src/LazyLoader/FallbackLazyProxyBuilder.php index 556f3b300..78e2d2445 100644 --- a/src/di/src/LazyLoader/FallbackLazyProxyBuilder.php +++ b/src/di/src/LazyLoader/FallbackLazyProxyBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; class FallbackLazyProxyBuilder extends AbstractLazyProxyBuilder diff --git a/src/di/src/LazyLoader/InterfaceLazyProxyBuilder.php b/src/di/src/LazyLoader/InterfaceLazyProxyBuilder.php index 82d1e8431..5efee81ff 100644 --- a/src/di/src/LazyLoader/InterfaceLazyProxyBuilder.php +++ b/src/di/src/LazyLoader/InterfaceLazyProxyBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; class InterfaceLazyProxyBuilder extends AbstractLazyProxyBuilder diff --git a/src/di/src/LazyLoader/LazyLoader.php b/src/di/src/LazyLoader/LazyLoader.php index e2797d437..45825bfc5 100644 --- a/src/di/src/LazyLoader/LazyLoader.php +++ b/src/di/src/LazyLoader/LazyLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; use Hyperf\CodeParser\PhpParser; diff --git a/src/di/src/LazyLoader/LazyProxyTrait.php b/src/di/src/LazyLoader/LazyProxyTrait.php index f7c7931ad..3624c853e 100644 --- a/src/di/src/LazyLoader/LazyProxyTrait.php +++ b/src/di/src/LazyLoader/LazyProxyTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; use Hyperf\Context\ApplicationContext; diff --git a/src/di/src/LazyLoader/PublicMethodVisitor.php b/src/di/src/LazyLoader/PublicMethodVisitor.php index d1fd6aebd..a3062c28d 100644 --- a/src/di/src/LazyLoader/PublicMethodVisitor.php +++ b/src/di/src/LazyLoader/PublicMethodVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\LazyLoader; use PhpParser\Node; diff --git a/src/di/src/MetadataCacheCollector.php b/src/di/src/MetadataCacheCollector.php index a878bf17c..0f7921e0b 100644 --- a/src/di/src/MetadataCacheCollector.php +++ b/src/di/src/MetadataCacheCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; class MetadataCacheCollector diff --git a/src/di/src/MetadataCollector.php b/src/di/src/MetadataCollector.php index f074628ca..a6aa412d8 100644 --- a/src/di/src/MetadataCollector.php +++ b/src/di/src/MetadataCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Hyperf\Collection\Arr; diff --git a/src/di/src/MetadataCollectorInterface.php b/src/di/src/MetadataCollectorInterface.php index c830f6d6f..087c26cb6 100644 --- a/src/di/src/MetadataCollectorInterface.php +++ b/src/di/src/MetadataCollectorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; interface MetadataCollectorInterface diff --git a/src/di/src/MethodDefinitionCollector.php b/src/di/src/MethodDefinitionCollector.php index 1558272e0..9b8db67cf 100644 --- a/src/di/src/MethodDefinitionCollector.php +++ b/src/di/src/MethodDefinitionCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; class MethodDefinitionCollector extends AbstractCallableDefinitionCollector implements MethodDefinitionCollectorInterface diff --git a/src/di/src/MethodDefinitionCollectorInterface.php b/src/di/src/MethodDefinitionCollectorInterface.php index 01943b5b9..55f8e170d 100644 --- a/src/di/src/MethodDefinitionCollectorInterface.php +++ b/src/di/src/MethodDefinitionCollectorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; interface MethodDefinitionCollectorInterface diff --git a/src/di/src/ReflectionManager.php b/src/di/src/ReflectionManager.php index 997de94a5..9baf2be50 100644 --- a/src/di/src/ReflectionManager.php +++ b/src/di/src/ReflectionManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; use Hyperf\Di\Aop\Ast; diff --git a/src/di/src/ReflectionType.php b/src/di/src/ReflectionType.php index 0a300c16e..f61f63447 100644 --- a/src/di/src/ReflectionType.php +++ b/src/di/src/ReflectionType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di; class ReflectionType diff --git a/src/di/src/Resolver/DepthGuard.php b/src/di/src/Resolver/DepthGuard.php index 6fc0b18e2..bf819d66b 100644 --- a/src/di/src/Resolver/DepthGuard.php +++ b/src/di/src/Resolver/DepthGuard.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Resolver; use Hyperf\Context\Context; diff --git a/src/di/src/Resolver/FactoryResolver.php b/src/di/src/Resolver/FactoryResolver.php index 17d67f30f..f88bd32cb 100644 --- a/src/di/src/Resolver/FactoryResolver.php +++ b/src/di/src/Resolver/FactoryResolver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Resolver; use Hyperf\Di\Definition\DefinitionInterface; diff --git a/src/di/src/Resolver/ObjectResolver.php b/src/di/src/Resolver/ObjectResolver.php index cb904c699..4534941ae 100644 --- a/src/di/src/Resolver/ObjectResolver.php +++ b/src/di/src/Resolver/ObjectResolver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Resolver; use Hyperf\Di\Definition\DefinitionInterface; diff --git a/src/di/src/Resolver/ParameterResolver.php b/src/di/src/Resolver/ParameterResolver.php index b9300ca9d..6fc983271 100644 --- a/src/di/src/Resolver/ParameterResolver.php +++ b/src/di/src/Resolver/ParameterResolver.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Resolver; use Hyperf\Di\Definition\DefinitionInterface; use Hyperf\Di\Definition\MethodInjection; use Hyperf\Di\Exception\InvalidDefinitionException; +use ReflectionException; use ReflectionMethod; use ReflectionParameter; @@ -73,7 +75,7 @@ class ParameterResolver { try { return $parameter->getDefaultValue(); - } catch (\ReflectionException) { + } catch (ReflectionException) { throw new InvalidDefinitionException(sprintf( 'The parameter "%s" of %s has no type defined or guessable. It has a default value, ' . 'but the default value can\'t be read through Reflection because it is a PHP internal class.', diff --git a/src/di/src/Resolver/ResolverDispatcher.php b/src/di/src/Resolver/ResolverDispatcher.php index fbc2b449a..74e710aca 100644 --- a/src/di/src/Resolver/ResolverDispatcher.php +++ b/src/di/src/Resolver/ResolverDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Resolver; use Hyperf\Di\Definition\DefinitionInterface; diff --git a/src/di/src/Resolver/ResolverInterface.php b/src/di/src/Resolver/ResolverInterface.php index c188a70be..4a58152ad 100644 --- a/src/di/src/Resolver/ResolverInterface.php +++ b/src/di/src/Resolver/ResolverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Resolver; use Hyperf\Di\Definition\DefinitionInterface; diff --git a/src/di/src/ScanHandler/NullScanHandler.php b/src/di/src/ScanHandler/NullScanHandler.php index dd7f354c8..1f16105c7 100644 --- a/src/di/src/ScanHandler/NullScanHandler.php +++ b/src/di/src/ScanHandler/NullScanHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\ScanHandler; class NullScanHandler implements ScanHandlerInterface diff --git a/src/di/src/ScanHandler/PcntlScanHandler.php b/src/di/src/ScanHandler/PcntlScanHandler.php index 23b700425..7f17cdfed 100644 --- a/src/di/src/ScanHandler/PcntlScanHandler.php +++ b/src/di/src/ScanHandler/PcntlScanHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\ScanHandler; use Hyperf\Di\Exception\Exception; diff --git a/src/di/src/ScanHandler/ProcScanHandler.php b/src/di/src/ScanHandler/ProcScanHandler.php index 3c880e220..e771f9a77 100644 --- a/src/di/src/ScanHandler/ProcScanHandler.php +++ b/src/di/src/ScanHandler/ProcScanHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\ScanHandler; use function Hyperf\Support\env; diff --git a/src/di/src/ScanHandler/ScanHandlerInterface.php b/src/di/src/ScanHandler/ScanHandlerInterface.php index a354040ac..6e3fdf2a7 100644 --- a/src/di/src/ScanHandler/ScanHandlerInterface.php +++ b/src/di/src/ScanHandler/ScanHandlerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\ScanHandler; interface ScanHandlerInterface diff --git a/src/di/src/ScanHandler/Scanned.php b/src/di/src/ScanHandler/Scanned.php index a2cdab7b5..89fec8ac1 100644 --- a/src/di/src/ScanHandler/Scanned.php +++ b/src/di/src/ScanHandler/Scanned.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\ScanHandler; class Scanned diff --git a/src/di/tests/Annotation/AspectLoaderTest.php b/src/di/tests/Annotation/AspectLoaderTest.php index e2bfd9cc8..88d963190 100644 --- a/src/di/tests/Annotation/AspectLoaderTest.php +++ b/src/di/tests/Annotation/AspectLoaderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Annotation; use Hyperf\Di\Annotation\AspectLoader; diff --git a/src/di/tests/Annotation/ScannerTest.php b/src/di/tests/Annotation/ScannerTest.php index d01e5202e..ca3edbb7f 100644 --- a/src/di/tests/Annotation/ScannerTest.php +++ b/src/di/tests/Annotation/ScannerTest.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Annotation; +use Composer\Autoload\ClassLoader; use Hyperf\Context\ApplicationContext; use Hyperf\Contract\ContainerInterface; use Hyperf\Di\Annotation\AnnotationReader; @@ -56,7 +58,7 @@ class ScannerTest extends TestCase { $this->getContainer(); - $loader = Mockery::mock(\Composer\Autoload\ClassLoader::class); + $loader = Mockery::mock(ClassLoader::class); $loader->shouldReceive('findFile')->andReturnUsing(function ($class) { return $class; }); diff --git a/src/di/tests/AnnotationReaderTest.php b/src/di/tests/AnnotationReaderTest.php index d42d097e3..61a582bd1 100644 --- a/src/di/tests/AnnotationReaderTest.php +++ b/src/di/tests/AnnotationReaderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Annotation\AnnotationReader; diff --git a/src/di/tests/AnnotationTest.php b/src/di/tests/AnnotationTest.php index 4440629f1..a6d2f2eb0 100644 --- a/src/di/tests/AnnotationTest.php +++ b/src/di/tests/AnnotationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Annotation\ScanConfig; diff --git a/src/di/tests/Aop/PipelineTest.php b/src/di/tests/Aop/PipelineTest.php index 37b41dba0..3459a5b00 100644 --- a/src/di/tests/Aop/PipelineTest.php +++ b/src/di/tests/Aop/PipelineTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Aop; use Hyperf\Di\Aop\Pipeline; diff --git a/src/di/tests/Aop/ProxyCallVisitorTest.php b/src/di/tests/Aop/ProxyCallVisitorTest.php index 0a81afa66..26c9f9a4a 100644 --- a/src/di/tests/Aop/ProxyCallVisitorTest.php +++ b/src/di/tests/Aop/ProxyCallVisitorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Aop; use Hyperf\Di\Aop\Ast; diff --git a/src/di/tests/AopAspectTest.php b/src/di/tests/AopAspectTest.php index c12dfa3b7..b9b4623c8 100644 --- a/src/di/tests/AopAspectTest.php +++ b/src/di/tests/AopAspectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Annotation\Aspect as AspectAnnotation; diff --git a/src/di/tests/AstTest.php b/src/di/tests/AstTest.php index 45ed8f19c..1cbd1111c 100644 --- a/src/di/tests/AstTest.php +++ b/src/di/tests/AstTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Aop\Ast; diff --git a/src/di/tests/ClassLazyProxyBuilderTest.php b/src/di/tests/ClassLazyProxyBuilderTest.php index 5d1a99338..16af2ac7f 100644 --- a/src/di/tests/ClassLazyProxyBuilderTest.php +++ b/src/di/tests/ClassLazyProxyBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\CodeParser\PhpParser; diff --git a/src/di/tests/ClassLoaderTest.php b/src/di/tests/ClassLoaderTest.php index b762a2617..9b23fcedd 100644 --- a/src/di/tests/ClassLoaderTest.php +++ b/src/di/tests/ClassLoaderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\ClassLoader; diff --git a/src/di/tests/ClosureDefinitionTest.php b/src/di/tests/ClosureDefinitionTest.php index 6a96a350a..068e92b25 100644 --- a/src/di/tests/ClosureDefinitionTest.php +++ b/src/di/tests/ClosureDefinitionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Closure; diff --git a/src/di/tests/ContainerTest.php b/src/di/tests/ContainerTest.php index eafbb803b..58acd115b 100644 --- a/src/di/tests/ContainerTest.php +++ b/src/di/tests/ContainerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Container; diff --git a/src/di/tests/Definition/DefinitionSourceTest.php b/src/di/tests/Definition/DefinitionSourceTest.php index d8d3d6fe0..63485d021 100644 --- a/src/di/tests/Definition/DefinitionSourceTest.php +++ b/src/di/tests/Definition/DefinitionSourceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Definition; use Hyperf\Di\Definition\DefinitionSource; diff --git a/src/di/tests/Definition/PriorityDefinitionTest.php b/src/di/tests/Definition/PriorityDefinitionTest.php index e02ddf3b1..610f4a1bd 100644 --- a/src/di/tests/Definition/PriorityDefinitionTest.php +++ b/src/di/tests/Definition/PriorityDefinitionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Definition; use Hyperf\Di\Definition\PriorityDefinition; diff --git a/src/di/tests/DefinitionSourceTest.php b/src/di/tests/DefinitionSourceTest.php index 861c19287..5dfaf1829 100644 --- a/src/di/tests/DefinitionSourceTest.php +++ b/src/di/tests/DefinitionSourceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Container; diff --git a/src/di/tests/ExceptionStub/DemoInjectException.php b/src/di/tests/ExceptionStub/DemoInjectException.php index 31ad0d818..ef983afb0 100644 --- a/src/di/tests/ExceptionStub/DemoInjectException.php +++ b/src/di/tests/ExceptionStub/DemoInjectException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\ExceptionStub; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/InjectTest.php b/src/di/tests/InjectTest.php index 61c7802a7..4a22b8bb7 100644 --- a/src/di/tests/InjectTest.php +++ b/src/di/tests/InjectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Exception; @@ -47,6 +48,7 @@ use HyperfTest\Di\Stub\Inject\ParentClass; use HyperfTest\Di\Stub\Inject\Tar; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; /** @@ -64,7 +66,7 @@ class InjectTest extends TestCase ReflectionManager::clear(); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInject() { $this->getContainer(); @@ -75,7 +77,7 @@ class InjectTest extends TestCase $this->assertSame(null, $demoInject->getDemo1()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectWithTraitAndParent() { $this->getContainer(); @@ -93,7 +95,7 @@ class InjectTest extends TestCase $this->assertInstanceOf(Tar::class, $origin->getFoo()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectTraitAndParent() { $this->markTestSkipped('@var does not works as expect.'); @@ -112,7 +114,7 @@ class InjectTest extends TestCase $this->assertInstanceOf(Bar::class, $origin->getFoo()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectParent() { $this->getContainer(); @@ -130,7 +132,7 @@ class InjectTest extends TestCase $this->assertInstanceOf(Foo::class, $origin->getFoo()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInject2Trait() { $this->markTestSkipped('@var does not works as expect.'); @@ -150,7 +152,7 @@ class InjectTest extends TestCase $this->assertInstanceOf(Tar::class, $origin->getFoo()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectTraitNesting() { $this->getContainer(); @@ -170,7 +172,7 @@ class InjectTest extends TestCase $this->assertSame('foo3', $origin->getValue()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectParentParent() { $this->getContainer(); @@ -187,7 +189,7 @@ class InjectTest extends TestCase $this->assertInstanceOf(Foo::class, $origin->getFoo()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectParentNoRunParent() { $this->getContainer(); @@ -204,7 +206,7 @@ class InjectTest extends TestCase $this->assertInstanceOf(Foo::class, $origin->getFoo()); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testInjectParentPrivateProperty() { $this->getContainer(); diff --git a/src/di/tests/InterfaceLazyProxyBuilderTest.php b/src/di/tests/InterfaceLazyProxyBuilderTest.php index af4f6bc8b..cdb9ffe83 100644 --- a/src/di/tests/InterfaceLazyProxyBuilderTest.php +++ b/src/di/tests/InterfaceLazyProxyBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\CodeParser\PhpParser; diff --git a/src/di/tests/LazyProxyTraitTest.php b/src/di/tests/LazyProxyTraitTest.php index 84726d15f..d786eb0e7 100644 --- a/src/di/tests/LazyProxyTraitTest.php +++ b/src/di/tests/LazyProxyTraitTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Context\ApplicationContext; diff --git a/src/di/tests/MakeTest.php b/src/di/tests/MakeTest.php index 5e899f2df..716008817 100644 --- a/src/di/tests/MakeTest.php +++ b/src/di/tests/MakeTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Context\ApplicationContext; @@ -17,6 +18,7 @@ use Hyperf\Di\Definition\DefinitionSource; use HyperfTest\Di\Stub\Bar; use HyperfTest\Di\Stub\Demo; use HyperfTest\Di\Stub\Foo; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use function Hyperf\Support\make; @@ -25,7 +27,7 @@ use function Hyperf\Support\make; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Di\Container::class)] +#[CoversClass(Container::class)] /** * @internal * @coversNothing diff --git a/src/di/tests/MetadataCollectorTest.php b/src/di/tests/MetadataCollectorTest.php index 92d7216eb..f2740a0e8 100644 --- a/src/di/tests/MetadataCollectorTest.php +++ b/src/di/tests/MetadataCollectorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Config\Config; diff --git a/src/di/tests/MethodDefinitionTest.php b/src/di/tests/MethodDefinitionTest.php index 47b659d2f..a04682ce8 100644 --- a/src/di/tests/MethodDefinitionTest.php +++ b/src/di/tests/MethodDefinitionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\MethodDefinitionCollector; diff --git a/src/di/tests/ProceedingJoinPointTest.php b/src/di/tests/ProceedingJoinPointTest.php index d0dcab5c7..b22d6e9fe 100644 --- a/src/di/tests/ProceedingJoinPointTest.php +++ b/src/di/tests/ProceedingJoinPointTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Aop\ProceedingJoinPoint; diff --git a/src/di/tests/ProxyTraitTest.php b/src/di/tests/ProxyTraitTest.php index e6944abc9..854a224cc 100644 --- a/src/di/tests/ProxyTraitTest.php +++ b/src/di/tests/ProxyTraitTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Context\ApplicationContext; diff --git a/src/di/tests/PublicMethodVisitorTest.php b/src/di/tests/PublicMethodVisitorTest.php index 46f7c241f..ea24b71e3 100644 --- a/src/di/tests/PublicMethodVisitorTest.php +++ b/src/di/tests/PublicMethodVisitorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\CodeParser\PhpParser; diff --git a/src/di/tests/ReflectionTest.php b/src/di/tests/ReflectionTest.php index 507d46fbc..5ced6744c 100644 --- a/src/di/tests/ReflectionTest.php +++ b/src/di/tests/ReflectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\ReflectionManager; diff --git a/src/di/tests/ResolverDispatcherTest.php b/src/di/tests/ResolverDispatcherTest.php index 61cddb6f0..83328cefd 100644 --- a/src/di/tests/ResolverDispatcherTest.php +++ b/src/di/tests/ResolverDispatcherTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di; use Hyperf\Di\Definition\FactoryDefinition; diff --git a/src/di/tests/Stub/AnnotationCollector.php b/src/di/tests/Stub/AnnotationCollector.php index 71499cf4b..dcaf8ab48 100644 --- a/src/di/tests/Stub/AnnotationCollector.php +++ b/src/di/tests/Stub/AnnotationCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class AnnotationCollector extends \Hyperf\Di\Annotation\AnnotationCollector diff --git a/src/di/tests/Stub/Aspect/Debug1Aspect.php b/src/di/tests/Stub/Aspect/Debug1Aspect.php index 776cadf12..b2c21df2f 100644 --- a/src/di/tests/Stub/Aspect/Debug1Aspect.php +++ b/src/di/tests/Stub/Aspect/Debug1Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Aspect/Debug2Aspect.php b/src/di/tests/Stub/Aspect/Debug2Aspect.php index 0e606c2a8..83b2b711e 100644 --- a/src/di/tests/Stub/Aspect/Debug2Aspect.php +++ b/src/di/tests/Stub/Aspect/Debug2Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Annotation\Aspect; diff --git a/src/di/tests/Stub/Aspect/Debug3Aspect.php b/src/di/tests/Stub/Aspect/Debug3Aspect.php index d39c046dd..a6160ca4c 100644 --- a/src/di/tests/Stub/Aspect/Debug3Aspect.php +++ b/src/di/tests/Stub/Aspect/Debug3Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Aspect/DebugLoaderAspect.php b/src/di/tests/Stub/Aspect/DebugLoaderAspect.php index e1340315f..4896ba033 100644 --- a/src/di/tests/Stub/Aspect/DebugLoaderAspect.php +++ b/src/di/tests/Stub/Aspect/DebugLoaderAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Aspect/GetNameAspect.php b/src/di/tests/Stub/Aspect/GetNameAspect.php index 2e57bdc74..25116c7a0 100644 --- a/src/di/tests/Stub/Aspect/GetNameAspect.php +++ b/src/di/tests/Stub/Aspect/GetNameAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Aspect/GetParamsAspect.php b/src/di/tests/Stub/Aspect/GetParamsAspect.php index 46470c46b..5b2fe9bf6 100644 --- a/src/di/tests/Stub/Aspect/GetParamsAspect.php +++ b/src/di/tests/Stub/Aspect/GetParamsAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Aspect/IncrAspect.php b/src/di/tests/Stub/Aspect/IncrAspect.php index dea2b46b0..d4a4d1818 100644 --- a/src/di/tests/Stub/Aspect/IncrAspect.php +++ b/src/di/tests/Stub/Aspect/IncrAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Aspect/IncrAspectAnnotation.php b/src/di/tests/Stub/Aspect/IncrAspectAnnotation.php index ea92f2dd9..aaad793bd 100644 --- a/src/di/tests/Stub/Aspect/IncrAspectAnnotation.php +++ b/src/di/tests/Stub/Aspect/IncrAspectAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\ProceedingJoinPoint; diff --git a/src/di/tests/Stub/Aspect/NoProcessAspect.php b/src/di/tests/Stub/Aspect/NoProcessAspect.php index be6976466..c01f3f4d7 100644 --- a/src/di/tests/Stub/Aspect/NoProcessAspect.php +++ b/src/di/tests/Stub/Aspect/NoProcessAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Aspect; use Hyperf\Di\Aop\ProceedingJoinPoint; diff --git a/src/di/tests/Stub/AspectCollector.php b/src/di/tests/Stub/AspectCollector.php index 3cd9b212c..1584e21f5 100644 --- a/src/di/tests/Stub/AspectCollector.php +++ b/src/di/tests/Stub/AspectCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class AspectCollector extends \Hyperf\Di\Annotation\AspectCollector diff --git a/src/di/tests/Stub/Ast/Abs.php b/src/di/tests/Stub/Ast/Abs.php index 5d0575a4d..8349397af 100644 --- a/src/di/tests/Stub/Ast/Abs.php +++ b/src/di/tests/Stub/Ast/Abs.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; abstract class Abs diff --git a/src/di/tests/Stub/Ast/AbsAspect.php b/src/di/tests/Stub/Ast/AbsAspect.php index 84ffbaf48..b4053ac0f 100644 --- a/src/di/tests/Stub/Ast/AbsAspect.php +++ b/src/di/tests/Stub/Ast/AbsAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Ast/Bar.php b/src/di/tests/Stub/Ast/Bar.php index c9f57e2cc..a8bff0b90 100644 --- a/src/di/tests/Stub/Ast/Bar.php +++ b/src/di/tests/Stub/Ast/Bar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Bar diff --git a/src/di/tests/Stub/Ast/Bar2.php b/src/di/tests/Stub/Ast/Bar2.php index 71062a59c..da1570ad4 100644 --- a/src/di/tests/Stub/Ast/Bar2.php +++ b/src/di/tests/Stub/Ast/Bar2.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Bar2 extends Bar diff --git a/src/di/tests/Stub/Ast/Bar3.php b/src/di/tests/Stub/Ast/Bar3.php index 69b630519..4b25ce719 100644 --- a/src/di/tests/Stub/Ast/Bar3.php +++ b/src/di/tests/Stub/Ast/Bar3.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Bar3 extends Bar diff --git a/src/di/tests/Stub/Ast/Bar4.php b/src/di/tests/Stub/Ast/Bar4.php index 20840d597..23d0b8be0 100644 --- a/src/di/tests/Stub/Ast/Bar4.php +++ b/src/di/tests/Stub/Ast/Bar4.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Bar4 diff --git a/src/di/tests/Stub/Ast/Bar5.php b/src/di/tests/Stub/Ast/Bar5.php index 786df49ca..852c1bdf9 100644 --- a/src/di/tests/Stub/Ast/Bar5.php +++ b/src/di/tests/Stub/Ast/Bar5.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Bar5 diff --git a/src/di/tests/Stub/Ast/BarAspect.php b/src/di/tests/Stub/Ast/BarAspect.php index 19f343a8c..50cefce45 100644 --- a/src/di/tests/Stub/Ast/BarAspect.php +++ b/src/di/tests/Stub/Ast/BarAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/di/tests/Stub/Ast/BarInterface.php b/src/di/tests/Stub/Ast/BarInterface.php index 7c5550f6f..28f498f8c 100644 --- a/src/di/tests/Stub/Ast/BarInterface.php +++ b/src/di/tests/Stub/Ast/BarInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; interface BarInterface diff --git a/src/di/tests/Stub/Ast/Chi.php b/src/di/tests/Stub/Ast/Chi.php index 7c2ffef04..8758aa3f4 100644 --- a/src/di/tests/Stub/Ast/Chi.php +++ b/src/di/tests/Stub/Ast/Chi.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Chi extends Abs diff --git a/src/di/tests/Stub/Ast/Foo.php b/src/di/tests/Stub/Ast/Foo.php index 33be86689..6aa64b010 100644 --- a/src/di/tests/Stub/Ast/Foo.php +++ b/src/di/tests/Stub/Ast/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; class Foo diff --git a/src/di/tests/Stub/Ast/FooTrait.php b/src/di/tests/Stub/Ast/FooTrait.php index 1f5f58e28..919bdf733 100644 --- a/src/di/tests/Stub/Ast/FooTrait.php +++ b/src/di/tests/Stub/Ast/FooTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Ast; trait FooTrait diff --git a/src/di/tests/Stub/Bar.php b/src/di/tests/Stub/Bar.php index 2acda55fd..129c89e28 100644 --- a/src/di/tests/Stub/Bar.php +++ b/src/di/tests/Stub/Bar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class Bar diff --git a/src/di/tests/Stub/Container/Container1HasInterface.php b/src/di/tests/Stub/Container/Container1HasInterface.php index 29bc9e8ce..712cc51d2 100644 --- a/src/di/tests/Stub/Container/Container1HasInterface.php +++ b/src/di/tests/Stub/Container/Container1HasInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Container; interface Container1HasInterface diff --git a/src/di/tests/Stub/Container/Container2HasInterface.php b/src/di/tests/Stub/Container/Container2HasInterface.php index c31dfed33..cbea38fda 100644 --- a/src/di/tests/Stub/Container/Container2HasInterface.php +++ b/src/di/tests/Stub/Container/Container2HasInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Container; interface Container2HasInterface diff --git a/src/di/tests/Stub/Container/ContainerProxy.php b/src/di/tests/Stub/Container/ContainerProxy.php index a839f1bc5..2fd197652 100644 --- a/src/di/tests/Stub/Container/ContainerProxy.php +++ b/src/di/tests/Stub/Container/ContainerProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Container; use Hyperf\Di\Container; diff --git a/src/di/tests/Stub/Demo.php b/src/di/tests/Stub/Demo.php index b8b56a03c..c7897678a 100644 --- a/src/di/tests/Stub/Demo.php +++ b/src/di/tests/Stub/Demo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class Demo diff --git a/src/di/tests/Stub/DemoAnnotation.php b/src/di/tests/Stub/DemoAnnotation.php index 23af5434f..737a2c0fc 100644 --- a/src/di/tests/Stub/DemoAnnotation.php +++ b/src/di/tests/Stub/DemoAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Annotation\AbstractAnnotation; diff --git a/src/di/tests/Stub/DemoInject.php b/src/di/tests/Stub/DemoInject.php index 31b4dcba9..163a4cc88 100644 --- a/src/di/tests/Stub/DemoInject.php +++ b/src/di/tests/Stub/DemoInject.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/EmptyVarValue.php b/src/di/tests/Stub/EmptyVarValue.php index 40aaa7fc9..2d2edfada 100644 --- a/src/di/tests/Stub/EmptyVarValue.php +++ b/src/di/tests/Stub/EmptyVarValue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Foo.php b/src/di/tests/Stub/Foo.php index 90c817b08..315dbdc03 100644 --- a/src/di/tests/Stub/Foo.php +++ b/src/di/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class Foo diff --git a/src/di/tests/Stub/Foo2Aspect.php b/src/di/tests/Stub/Foo2Aspect.php index 70d41564d..179086106 100644 --- a/src/di/tests/Stub/Foo2Aspect.php +++ b/src/di/tests/Stub/Foo2Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Annotation\Aspect; diff --git a/src/di/tests/Stub/FooAspect.php b/src/di/tests/Stub/FooAspect.php index a2e6133ae..94ec7f25a 100644 --- a/src/di/tests/Stub/FooAspect.php +++ b/src/di/tests/Stub/FooAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Annotation\Aspect; diff --git a/src/di/tests/Stub/FooEnum.php b/src/di/tests/Stub/FooEnum.php index 8b83d0abe..6d989079f 100644 --- a/src/di/tests/Stub/FooEnum.php +++ b/src/di/tests/Stub/FooEnum.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; enum FooEnum: int diff --git a/src/di/tests/Stub/FooEnumStruct.php b/src/di/tests/Stub/FooEnumStruct.php index c6f6d7eec..6e7c0aef3 100644 --- a/src/di/tests/Stub/FooEnumStruct.php +++ b/src/di/tests/Stub/FooEnumStruct.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class FooEnumStruct diff --git a/src/di/tests/Stub/FooFactory.php b/src/di/tests/Stub/FooFactory.php index 9744a32a0..9e1ef0d01 100644 --- a/src/di/tests/Stub/FooFactory.php +++ b/src/di/tests/Stub/FooFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class FooFactory diff --git a/src/di/tests/Stub/FooInterface.php b/src/di/tests/Stub/FooInterface.php index 4e02558ed..6d1174998 100644 --- a/src/di/tests/Stub/FooInterface.php +++ b/src/di/tests/Stub/FooInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; interface FooInterface diff --git a/src/di/tests/Stub/FooWithNotExistAnnotation.php b/src/di/tests/Stub/FooWithNotExistAnnotation.php index af4e16745..4e939cca4 100644 --- a/src/di/tests/Stub/FooWithNotExistAnnotation.php +++ b/src/di/tests/Stub/FooWithNotExistAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use NotExistAnnotation; diff --git a/src/di/tests/Stub/Ignore.php b/src/di/tests/Stub/Ignore.php index 55782741b..5caa0f23b 100644 --- a/src/di/tests/Stub/Ignore.php +++ b/src/di/tests/Stub/Ignore.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; /** diff --git a/src/di/tests/Stub/IgnoreDemoAnnotation.php b/src/di/tests/Stub/IgnoreDemoAnnotation.php index c955040f7..3c33b3b2a 100644 --- a/src/di/tests/Stub/IgnoreDemoAnnotation.php +++ b/src/di/tests/Stub/IgnoreDemoAnnotation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Attribute; diff --git a/src/di/tests/Stub/Inject/Bar.php b/src/di/tests/Stub/Inject/Bar.php index 195eab748..46d939637 100644 --- a/src/di/tests/Stub/Inject/Bar.php +++ b/src/di/tests/Stub/Inject/Bar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Bar diff --git a/src/di/tests/Stub/Inject/Foo.php b/src/di/tests/Stub/Inject/Foo.php index 09fbfc046..c2251f869 100644 --- a/src/di/tests/Stub/Inject/Foo.php +++ b/src/di/tests/Stub/Inject/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Foo diff --git a/src/di/tests/Stub/Inject/Foo2Trait.php b/src/di/tests/Stub/Inject/Foo2Trait.php index a6b57d7b8..0084dd745 100644 --- a/src/di/tests/Stub/Inject/Foo2Trait.php +++ b/src/di/tests/Stub/Inject/Foo2Trait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/Foo3Trait.php b/src/di/tests/Stub/Inject/Foo3Trait.php index 234980371..4a34382e4 100644 --- a/src/di/tests/Stub/Inject/Foo3Trait.php +++ b/src/di/tests/Stub/Inject/Foo3Trait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/FooTrait.php b/src/di/tests/Stub/Inject/FooTrait.php index 09f0d3940..c527fb290 100644 --- a/src/di/tests/Stub/Inject/FooTrait.php +++ b/src/di/tests/Stub/Inject/FooTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/Origin2Class.php b/src/di/tests/Stub/Inject/Origin2Class.php index d6f7c0abd..87efd3139 100644 --- a/src/di/tests/Stub/Inject/Origin2Class.php +++ b/src/di/tests/Stub/Inject/Origin2Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Origin2Class extends ParentClass diff --git a/src/di/tests/Stub/Inject/Origin3Class.php b/src/di/tests/Stub/Inject/Origin3Class.php index f9015af09..cc9d03d76 100644 --- a/src/di/tests/Stub/Inject/Origin3Class.php +++ b/src/di/tests/Stub/Inject/Origin3Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Origin3Class extends ParentClass diff --git a/src/di/tests/Stub/Inject/Origin4Class.php b/src/di/tests/Stub/Inject/Origin4Class.php index a6d1dc266..9901eb4df 100644 --- a/src/di/tests/Stub/Inject/Origin4Class.php +++ b/src/di/tests/Stub/Inject/Origin4Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Origin4Class extends ParentClass diff --git a/src/di/tests/Stub/Inject/Origin5Class.php b/src/di/tests/Stub/Inject/Origin5Class.php index 6e91ce85f..78ddd1857 100644 --- a/src/di/tests/Stub/Inject/Origin5Class.php +++ b/src/di/tests/Stub/Inject/Origin5Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Origin5Class extends Parent2Class diff --git a/src/di/tests/Stub/Inject/Origin6Class.php b/src/di/tests/Stub/Inject/Origin6Class.php index 8f655730f..5a3de4d72 100644 --- a/src/di/tests/Stub/Inject/Origin6Class.php +++ b/src/di/tests/Stub/Inject/Origin6Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/Origin7Class.php b/src/di/tests/Stub/Inject/Origin7Class.php index 8a5b7066c..ec8c7c627 100644 --- a/src/di/tests/Stub/Inject/Origin7Class.php +++ b/src/di/tests/Stub/Inject/Origin7Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Origin7Class diff --git a/src/di/tests/Stub/Inject/OriginClass.php b/src/di/tests/Stub/Inject/OriginClass.php index c48039589..a4f24a9ea 100644 --- a/src/di/tests/Stub/Inject/OriginClass.php +++ b/src/di/tests/Stub/Inject/OriginClass.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/Parent2Class.php b/src/di/tests/Stub/Inject/Parent2Class.php index d6e397724..4b50c5a66 100644 --- a/src/di/tests/Stub/Inject/Parent2Class.php +++ b/src/di/tests/Stub/Inject/Parent2Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/Parent3Class.php b/src/di/tests/Stub/Inject/Parent3Class.php index 28d18de6f..304ab7ce5 100644 --- a/src/di/tests/Stub/Inject/Parent3Class.php +++ b/src/di/tests/Stub/Inject/Parent3Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Parent3Class extends ParentClass diff --git a/src/di/tests/Stub/Inject/Parent4Class.php b/src/di/tests/Stub/Inject/Parent4Class.php index 566d9ef36..9b04117d5 100644 --- a/src/di/tests/Stub/Inject/Parent4Class.php +++ b/src/di/tests/Stub/Inject/Parent4Class.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/ParentClass.php b/src/di/tests/Stub/Inject/ParentClass.php index 7b9a5ca35..c6d749ac1 100644 --- a/src/di/tests/Stub/Inject/ParentClass.php +++ b/src/di/tests/Stub/Inject/ParentClass.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; use Hyperf\Di\Annotation\Inject; diff --git a/src/di/tests/Stub/Inject/Tar.php b/src/di/tests/Stub/Inject/Tar.php index 89c1a4f1b..3bf5e4d5d 100644 --- a/src/di/tests/Stub/Inject/Tar.php +++ b/src/di/tests/Stub/Inject/Tar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\Inject; class Tar diff --git a/src/di/tests/Stub/LazyLoad/BarLazyLoad.php b/src/di/tests/Stub/LazyLoad/BarLazyLoad.php index 2c4b6f60a..9ba9cb80c 100644 --- a/src/di/tests/Stub/LazyLoad/BarLazyLoad.php +++ b/src/di/tests/Stub/LazyLoad/BarLazyLoad.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\LazyLoad; class BarLazyLoad diff --git a/src/di/tests/Stub/LazyLoad/FooLazyLoad.php b/src/di/tests/Stub/LazyLoad/FooLazyLoad.php index a0455643d..b6236f667 100644 --- a/src/di/tests/Stub/LazyLoad/FooLazyLoad.php +++ b/src/di/tests/Stub/LazyLoad/FooLazyLoad.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub\LazyLoad; class FooLazyLoad diff --git a/src/di/tests/Stub/LazyProxy.php b/src/di/tests/Stub/LazyProxy.php index 2273f0c3b..05bf7c447 100644 --- a/src/di/tests/Stub/LazyProxy.php +++ b/src/di/tests/Stub/LazyProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\LazyLoader\LazyProxyTrait; diff --git a/src/di/tests/Stub/NotFoundAttributeTarget.php b/src/di/tests/Stub/NotFoundAttributeTarget.php index fea7227fa..24f2d6cd6 100644 --- a/src/di/tests/Stub/NotFoundAttributeTarget.php +++ b/src/di/tests/Stub/NotFoundAttributeTarget.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; #[NotExistAttribute] diff --git a/src/di/tests/Stub/Par.php b/src/di/tests/Stub/Par.php index 9e4b98e64..c702f297b 100644 --- a/src/di/tests/Stub/Par.php +++ b/src/di/tests/Stub/Par.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class Par diff --git a/src/di/tests/Stub/Par2.php b/src/di/tests/Stub/Par2.php index be6ab36ac..6c60aa4b4 100644 --- a/src/di/tests/Stub/Par2.php +++ b/src/di/tests/Stub/Par2.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class Par2 extends Par diff --git a/src/di/tests/Stub/PathStub.php b/src/di/tests/Stub/PathStub.php index 229fe97aa..13e01f416 100644 --- a/src/di/tests/Stub/PathStub.php +++ b/src/di/tests/Stub/PathStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class PathStub diff --git a/src/di/tests/Stub/Proxied.php b/src/di/tests/Stub/Proxied.php index a231efc7e..c037f43e2 100644 --- a/src/di/tests/Stub/Proxied.php +++ b/src/di/tests/Stub/Proxied.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; class Proxied diff --git a/src/di/tests/Stub/ProxyTraitObject.php b/src/di/tests/Stub/ProxyTraitObject.php index a847fe979..89fc686d5 100644 --- a/src/di/tests/Stub/ProxyTraitObject.php +++ b/src/di/tests/Stub/ProxyTraitObject.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Aop\ProxyTrait; diff --git a/src/di/tests/Stub/ProxyTraitOnTrait.php b/src/di/tests/Stub/ProxyTraitOnTrait.php index 9a0ee0467..21b407192 100644 --- a/src/di/tests/Stub/ProxyTraitOnTrait.php +++ b/src/di/tests/Stub/ProxyTraitOnTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Di\Stub; use Hyperf\Di\Aop\ProxyTrait; diff --git a/src/dispatcher/src/AbstractDispatcher.php b/src/dispatcher/src/AbstractDispatcher.php index 9a86b85aa..fd7dfebd0 100644 --- a/src/dispatcher/src/AbstractDispatcher.php +++ b/src/dispatcher/src/AbstractDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dispatcher; use Hyperf\Contract\DispatcherInterface; diff --git a/src/dispatcher/src/AbstractRequestHandler.php b/src/dispatcher/src/AbstractRequestHandler.php index 28aafbcb1..a9f412cc0 100644 --- a/src/dispatcher/src/AbstractRequestHandler.php +++ b/src/dispatcher/src/AbstractRequestHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dispatcher; use Hyperf\Dispatcher\Exceptions\InvalidArgumentException; diff --git a/src/dispatcher/src/ConfigProvider.php b/src/dispatcher/src/ConfigProvider.php index 1e553a4bc..016dea051 100644 --- a/src/dispatcher/src/ConfigProvider.php +++ b/src/dispatcher/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dispatcher; class ConfigProvider diff --git a/src/dispatcher/src/Exceptions/InvalidArgumentException.php b/src/dispatcher/src/Exceptions/InvalidArgumentException.php index 291e11af8..49ec299f2 100644 --- a/src/dispatcher/src/Exceptions/InvalidArgumentException.php +++ b/src/dispatcher/src/Exceptions/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dispatcher\Exceptions; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/dispatcher/src/HttpDispatcher.php b/src/dispatcher/src/HttpDispatcher.php index ceafb9628..fc40f6b9f 100644 --- a/src/dispatcher/src/HttpDispatcher.php +++ b/src/dispatcher/src/HttpDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dispatcher; use Psr\Container\ContainerInterface; diff --git a/src/dispatcher/src/HttpRequestHandler.php b/src/dispatcher/src/HttpRequestHandler.php index 64bc2c806..cd496bb4e 100644 --- a/src/dispatcher/src/HttpRequestHandler.php +++ b/src/dispatcher/src/HttpRequestHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Dispatcher; use Psr\Http\Message\ResponseInterface; diff --git a/src/dispatcher/tests/HttpDispatcherTest.php b/src/dispatcher/tests/HttpDispatcherTest.php index 9b5153aa3..09b9b1be9 100644 --- a/src/dispatcher/tests/HttpDispatcherTest.php +++ b/src/dispatcher/tests/HttpDispatcherTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Dispatcher; use Hyperf\Context\ApplicationContext; diff --git a/src/dispatcher/tests/Middlewares/CoreMiddleware.php b/src/dispatcher/tests/Middlewares/CoreMiddleware.php index 5489de1e1..12995986c 100644 --- a/src/dispatcher/tests/Middlewares/CoreMiddleware.php +++ b/src/dispatcher/tests/Middlewares/CoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Dispatcher\Middlewares; use Hyperf\Context\Context; diff --git a/src/dispatcher/tests/Middlewares/Test2Middleware.php b/src/dispatcher/tests/Middlewares/Test2Middleware.php index 42f46f6d2..17bde221c 100644 --- a/src/dispatcher/tests/Middlewares/Test2Middleware.php +++ b/src/dispatcher/tests/Middlewares/Test2Middleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Dispatcher\Middlewares; use Hyperf\Context\Context; diff --git a/src/dispatcher/tests/Middlewares/TestMiddleware.php b/src/dispatcher/tests/Middlewares/TestMiddleware.php index e06ac84be..52c0145bd 100644 --- a/src/dispatcher/tests/Middlewares/TestMiddleware.php +++ b/src/dispatcher/tests/Middlewares/TestMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Dispatcher\Middlewares; use Hyperf\Context\Context; diff --git a/src/elasticsearch/src/ClientBuilderFactory.php b/src/elasticsearch/src/ClientBuilderFactory.php index 25987515c..15c4f2598 100644 --- a/src/elasticsearch/src/ClientBuilderFactory.php +++ b/src/elasticsearch/src/ClientBuilderFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Elasticsearch; use Elasticsearch\ClientBuilder; diff --git a/src/elasticsearch/tests/ClientFactoryTest.php b/src/elasticsearch/tests/ClientFactoryTest.php index 16d0d7060..94f25c204 100644 --- a/src/elasticsearch/tests/ClientFactoryTest.php +++ b/src/elasticsearch/tests/ClientFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Elasticsearch; use Elasticsearch\ClientBuilder; diff --git a/src/etcd/composer.json b/src/etcd/composer.json index 3558cd502..3d010f157 100644 --- a/src/etcd/composer.json +++ b/src/etcd/composer.json @@ -12,7 +12,8 @@ "php": ">=8.1", "hyperf/guzzle": "~3.1.0", "hyperf/support": "~3.1.0", - "hyperf/utils": "~3.1.0" + "hyperf/utils": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0" }, "autoload": { "psr-4": { diff --git a/src/etcd/src/Client.php b/src/etcd/src/Client.php index 4eeef2482..13378cb70 100644 --- a/src/etcd/src/Client.php +++ b/src/etcd/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd; use GuzzleHttp\HandlerStack; diff --git a/src/etcd/src/ConfigProvider.php b/src/etcd/src/ConfigProvider.php index e9bfaa035..5023db0f0 100644 --- a/src/etcd/src/ConfigProvider.php +++ b/src/etcd/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd; class ConfigProvider diff --git a/src/etcd/src/Exception/ClientNotFindException.php b/src/etcd/src/Exception/ClientNotFindException.php index 207e9456d..84df6962a 100644 --- a/src/etcd/src/Exception/ClientNotFindException.php +++ b/src/etcd/src/Exception/ClientNotFindException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd\Exception; use RuntimeException; diff --git a/src/etcd/src/KVFactory.php b/src/etcd/src/KVFactory.php index 9f22c875c..6d1e1119d 100644 --- a/src/etcd/src/KVFactory.php +++ b/src/etcd/src/KVFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd; use Hyperf\Contract\ConfigInterface; diff --git a/src/etcd/src/KVInterface.php b/src/etcd/src/KVInterface.php index 190e5049c..cc3b66154 100644 --- a/src/etcd/src/KVInterface.php +++ b/src/etcd/src/KVInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd; interface KVInterface diff --git a/src/etcd/src/V3/EtcdClient.php b/src/etcd/src/V3/EtcdClient.php index 7672880c5..645708fa0 100644 --- a/src/etcd/src/V3/EtcdClient.php +++ b/src/etcd/src/V3/EtcdClient.php @@ -9,9 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd\V3; use GuzzleHttp\Client as HttpClient; +use GuzzleHttp\Exception\BadResponseException; +use JetBrains\PhpStorm\ArrayShape; /** * @license https://github.com/ouqiang/etcd-php/blob/master/LICENSE @@ -124,16 +127,19 @@ class EtcdClient * @param string $key * @param string $value * @param array $options 可选参数 - * @param $options = [ - * 'lease' => 1, - * 'prev_kv' => true, - * 'ignore_value' => true, - * 'ignore_lease' => true, - * ] * @return array */ - public function put($key, $value, array $options = []) - { + public function put( + $key, + $value, + #[ArrayShape([ + 'lease' => 'int', + 'prev_kv' => 'bool', + 'ignore_value' => 'bool', + 'ignore_lease' => 'bool', + ])] + array $options = [] + ) { $params = [ 'key' => $key, 'value' => $value, @@ -159,24 +165,26 @@ class EtcdClient * Gets the key or a range of keys. * * @param string $key - * @param $options = [ - * 'range_end' => '', - * 'limit' => 10, - * 'revision' => 10, - * 'sort_order' => 1, - * 'sort_target' => 1, - * 'serializable' => false, - * 'keys_only' => false, - * 'count_only' => false, - * 'min_mod_revision' => 1, - * 'max_mod_revision' => 1, - * 'min_create_revision' => 1, - * 'max_create_revision' => 1, - * ] * @return array */ - public function get($key, array $options = []) - { + public function get( + $key, + #[ArrayShape([ + 'range_end' => 'string', + 'limit' => 'int', + 'revision' => 'int', + 'sort_order' => 'int', + 'sort_target' => 'int', + 'serializable' => 'bool', + 'keys_only' => 'bool', + 'count_only' => 'bool', + 'min_mod_revision' => 'int', + 'max_mod_revision' => 'int', + 'min_create_revision' => 'int', + 'max_create_revision' => 'int', + ])] + array $options = [] + ) { $params = [ 'key' => $key, ]; @@ -231,13 +239,16 @@ class EtcdClient * Removes the specified key or range of keys. * * @param string $key - * @param array $options - * string range_end - * bool prev_kv * @return array */ - public function del($key, array $options = []) - { + public function del( + $key, + #[ArrayShape([ + 'range_end' => 'string', + 'prev_kv' => 'bool', + ])] + array $options = [] + ) { $params = [ 'key' => $key, ]; @@ -663,7 +674,7 @@ class EtcdClient * @param array $params 请求参数 * @param array $options 可选参数 * @return array - * @throws \GuzzleHttp\Exception\BadResponseException + * @throws BadResponseException */ protected function request($uri, array $params = [], array $options = []) { diff --git a/src/etcd/src/V3/KV.php b/src/etcd/src/V3/KV.php index d16f57eaa..6de60a4e0 100644 --- a/src/etcd/src/V3/KV.php +++ b/src/etcd/src/V3/KV.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Etcd\V3; use GuzzleHttp; diff --git a/src/etcd/tests/KVTest.php b/src/etcd/tests/KVTest.php index 6245dc85e..10caefa7a 100644 --- a/src/etcd/tests/KVTest.php +++ b/src/etcd/tests/KVTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Etcd; use GuzzleHttp\Client; diff --git a/src/etcd/tests/Stub/GuzzleClientStub.php b/src/etcd/tests/Stub/GuzzleClientStub.php index 8534e3ef6..b9a1fcbb8 100644 --- a/src/etcd/tests/Stub/GuzzleClientStub.php +++ b/src/etcd/tests/Stub/GuzzleClientStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Etcd\Stub; use GuzzleHttp\Client; diff --git a/src/event/src/Annotation/Listener.php b/src/event/src/Annotation/Listener.php index 052d60b64..17a95fda1 100644 --- a/src/event/src/Annotation/Listener.php +++ b/src/event/src/Annotation/Listener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event\Annotation; use Attribute; diff --git a/src/event/src/ConfigProvider.php b/src/event/src/ConfigProvider.php index d70785b00..23cb816f3 100644 --- a/src/event/src/ConfigProvider.php +++ b/src/event/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; use Psr\EventDispatcher\EventDispatcherInterface; diff --git a/src/event/src/Contract/ListenerInterface.php b/src/event/src/Contract/ListenerInterface.php index 52071206e..2de816600 100644 --- a/src/event/src/Contract/ListenerInterface.php +++ b/src/event/src/Contract/ListenerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event\Contract; interface ListenerInterface diff --git a/src/event/src/EventDispatcher.php b/src/event/src/EventDispatcher.php index 561acdf21..c57b21be5 100644 --- a/src/event/src/EventDispatcher.php +++ b/src/event/src/EventDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; use Psr\EventDispatcher\EventDispatcherInterface; diff --git a/src/event/src/EventDispatcherFactory.php b/src/event/src/EventDispatcherFactory.php index 1ba8c9d46..e0bc1ab7c 100644 --- a/src/event/src/EventDispatcherFactory.php +++ b/src/event/src/EventDispatcherFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/event/src/ListenerData.php b/src/event/src/ListenerData.php index 3926585fc..6e7765fee 100644 --- a/src/event/src/ListenerData.php +++ b/src/event/src/ListenerData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; class ListenerData diff --git a/src/event/src/ListenerProvider.php b/src/event/src/ListenerProvider.php index 64a394f3f..8931f19ca 100644 --- a/src/event/src/ListenerProvider.php +++ b/src/event/src/ListenerProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; use Hyperf\Stdlib\SplPriorityQueue; diff --git a/src/event/src/ListenerProviderFactory.php b/src/event/src/ListenerProviderFactory.php index bbad01277..d2fc776de 100644 --- a/src/event/src/ListenerProviderFactory.php +++ b/src/event/src/ListenerProviderFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; use Hyperf\Contract\ConfigInterface; diff --git a/src/event/src/Stoppable.php b/src/event/src/Stoppable.php index 4ba22a54e..f9ea857ea 100644 --- a/src/event/src/Stoppable.php +++ b/src/event/src/Stoppable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event; trait Stoppable diff --git a/src/event/tests/ConfigProviderTest.php b/src/event/tests/ConfigProviderTest.php index a77c5c80f..1624dbc6a 100644 --- a/src/event/tests/ConfigProviderTest.php +++ b/src/event/tests/ConfigProviderTest.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event; use Hyperf\Event\ConfigProvider; use Hyperf\Event\EventDispatcherFactory; use Hyperf\Event\ListenerProviderFactory; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\EventDispatcher\ListenerProviderInterface; @@ -22,7 +24,7 @@ use Psr\EventDispatcher\ListenerProviderInterface; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Event\ConfigProvider::class)] +#[CoversClass(ConfigProvider::class)] class ConfigProviderTest extends TestCase { public function testInvoke() diff --git a/src/event/tests/Event/Alpha.php b/src/event/tests/Event/Alpha.php index d159a1376..005ce1ada 100644 --- a/src/event/tests/Event/Alpha.php +++ b/src/event/tests/Event/Alpha.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event\Event; use Hyperf\Event\Stoppable; diff --git a/src/event/tests/Event/Beta.php b/src/event/tests/Event/Beta.php index bc6a0141b..83db0d838 100644 --- a/src/event/tests/Event/Beta.php +++ b/src/event/tests/Event/Beta.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event\Event; class Beta diff --git a/src/event/tests/Event/PriorityEvent.php b/src/event/tests/Event/PriorityEvent.php index 16a4bc352..dacfbbf92 100644 --- a/src/event/tests/Event/PriorityEvent.php +++ b/src/event/tests/Event/PriorityEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event\Event; class PriorityEvent diff --git a/src/event/tests/EventDispatcherTest.php b/src/event/tests/EventDispatcherTest.php index b19ceaebb..5c32d6f36 100644 --- a/src/event/tests/EventDispatcherTest.php +++ b/src/event/tests/EventDispatcherTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event; use Hyperf\Config\Config; @@ -25,6 +26,7 @@ use HyperfTest\Event\Listener\BetaListener; use HyperfTest\Event\Listener\PriorityListener; use Mockery; use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; @@ -35,11 +37,7 @@ use ReflectionClass; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Event\EventDispatcher::class)] -/** - * @internal - * @coversNothing - */ +#[CoversClass(EventDispatcher::class)] class EventDispatcherTest extends TestCase { use MockeryPHPUnitIntegration; diff --git a/src/event/tests/Listener/AlphaListener.php b/src/event/tests/Listener/AlphaListener.php index 2a9dfa45a..d20be3f66 100644 --- a/src/event/tests/Listener/AlphaListener.php +++ b/src/event/tests/Listener/AlphaListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/event/tests/Listener/BetaListener.php b/src/event/tests/Listener/BetaListener.php index f5e64997f..6243ef5f8 100644 --- a/src/event/tests/Listener/BetaListener.php +++ b/src/event/tests/Listener/BetaListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/event/tests/Listener/PriorityListener.php b/src/event/tests/Listener/PriorityListener.php index b0f0e562a..8e04ca839 100644 --- a/src/event/tests/Listener/PriorityListener.php +++ b/src/event/tests/Listener/PriorityListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/event/tests/ListenerProviderTest.php b/src/event/tests/ListenerProviderTest.php index c05335440..36f7945e4 100644 --- a/src/event/tests/ListenerProviderTest.php +++ b/src/event/tests/ListenerProviderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event; use Hyperf\Event\ListenerProvider; diff --git a/src/event/tests/ListenerTest.php b/src/event/tests/ListenerTest.php index 3a98f1001..d840cff60 100644 --- a/src/event/tests/ListenerTest.php +++ b/src/event/tests/ListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Event; use Hyperf\Config\Config; diff --git a/src/exception-handler/src/Annotation/ExceptionHandler.php b/src/exception-handler/src/Annotation/ExceptionHandler.php index a4c9afac8..2f88b2677 100644 --- a/src/exception-handler/src/Annotation/ExceptionHandler.php +++ b/src/exception-handler/src/Annotation/ExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Annotation; use Attribute; diff --git a/src/exception-handler/src/ConfigProvider.php b/src/exception-handler/src/ConfigProvider.php index e9f7cbf82..8cf4f6f61 100644 --- a/src/exception-handler/src/ConfigProvider.php +++ b/src/exception-handler/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler; use Hyperf\ExceptionHandler\Formatter\DefaultFormatter; diff --git a/src/exception-handler/src/ExceptionHandler.php b/src/exception-handler/src/ExceptionHandler.php index 2ea8e276f..274c483b5 100644 --- a/src/exception-handler/src/ExceptionHandler.php +++ b/src/exception-handler/src/ExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler; use Swow\Psr7\Message\ResponsePlusInterface; diff --git a/src/exception-handler/src/ExceptionHandlerDispatcher.php b/src/exception-handler/src/ExceptionHandlerDispatcher.php index 5ad6cfe43..cf623f36e 100644 --- a/src/exception-handler/src/ExceptionHandlerDispatcher.php +++ b/src/exception-handler/src/ExceptionHandlerDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler; use Hyperf\Context\ResponseContext; diff --git a/src/exception-handler/src/Formatter/DefaultFormatter.php b/src/exception-handler/src/Formatter/DefaultFormatter.php index a544ce03c..d8f339b16 100644 --- a/src/exception-handler/src/Formatter/DefaultFormatter.php +++ b/src/exception-handler/src/Formatter/DefaultFormatter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Formatter; use Throwable; diff --git a/src/exception-handler/src/Formatter/FormatterInterface.php b/src/exception-handler/src/Formatter/FormatterInterface.php index bc824c528..33d35e2f9 100644 --- a/src/exception-handler/src/Formatter/FormatterInterface.php +++ b/src/exception-handler/src/Formatter/FormatterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Formatter; use Throwable; diff --git a/src/exception-handler/src/Handler/WhoopsExceptionHandler.php b/src/exception-handler/src/Handler/WhoopsExceptionHandler.php index 8432e85b8..40fb4e983 100644 --- a/src/exception-handler/src/Handler/WhoopsExceptionHandler.php +++ b/src/exception-handler/src/Handler/WhoopsExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Handler; use Hyperf\Context\Context; diff --git a/src/exception-handler/src/Listener/ErrorExceptionHandler.php b/src/exception-handler/src/Listener/ErrorExceptionHandler.php index f28e36147..dcc3d5054 100644 --- a/src/exception-handler/src/Listener/ErrorExceptionHandler.php +++ b/src/exception-handler/src/Listener/ErrorExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Listener; use ErrorException; diff --git a/src/exception-handler/src/Listener/ExceptionHandlerListener.php b/src/exception-handler/src/Listener/ExceptionHandlerListener.php index b262f9a0a..253c44506 100644 --- a/src/exception-handler/src/Listener/ExceptionHandlerListener.php +++ b/src/exception-handler/src/Listener/ExceptionHandlerListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/exception-handler/src/Propagation.php b/src/exception-handler/src/Propagation.php index 7b2256cde..5cf5545cb 100644 --- a/src/exception-handler/src/Propagation.php +++ b/src/exception-handler/src/Propagation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler; use Hyperf\Support\Traits\StaticInstance; diff --git a/src/exception-handler/tests/ErrorExceptionHandlerTest.php b/src/exception-handler/tests/ErrorExceptionHandlerTest.php index d3a3f177f..df0be8a4b 100644 --- a/src/exception-handler/tests/ErrorExceptionHandlerTest.php +++ b/src/exception-handler/tests/ErrorExceptionHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler; use ErrorException; diff --git a/src/exception-handler/tests/ExceptionHandlerListenerTest.php b/src/exception-handler/tests/ExceptionHandlerListenerTest.php index 86f031df1..4aba1c256 100644 --- a/src/exception-handler/tests/ExceptionHandlerListenerTest.php +++ b/src/exception-handler/tests/ExceptionHandlerListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler; use Hyperf\Config\Config; diff --git a/src/exception-handler/tests/ExceptionHandlerTest.php b/src/exception-handler/tests/ExceptionHandlerTest.php index 2431add33..ddf7efb70 100644 --- a/src/exception-handler/tests/ExceptionHandlerTest.php +++ b/src/exception-handler/tests/ExceptionHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler; use Exception; diff --git a/src/exception-handler/tests/FormatterTest.php b/src/exception-handler/tests/FormatterTest.php index 033aa78a4..cdd375053 100644 --- a/src/exception-handler/tests/FormatterTest.php +++ b/src/exception-handler/tests/FormatterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler; use Hyperf\ExceptionHandler\Formatter\DefaultFormatter; diff --git a/src/exception-handler/tests/Stub/BarExceptionHandler.php b/src/exception-handler/tests/Stub/BarExceptionHandler.php index a84410063..fe447cbb1 100644 --- a/src/exception-handler/tests/Stub/BarExceptionHandler.php +++ b/src/exception-handler/tests/Stub/BarExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler\Stub; use Hyperf\Context\Context; diff --git a/src/exception-handler/tests/Stub/FooExceptionHandler.php b/src/exception-handler/tests/Stub/FooExceptionHandler.php index aace6402b..ac6094b61 100644 --- a/src/exception-handler/tests/Stub/FooExceptionHandler.php +++ b/src/exception-handler/tests/Stub/FooExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler\Stub; use Hyperf\Context\Context; diff --git a/src/exception-handler/tests/WhoopsExceptionHandlerTest.php b/src/exception-handler/tests/WhoopsExceptionHandlerTest.php index c9412d85a..8cffd6d44 100644 --- a/src/exception-handler/tests/WhoopsExceptionHandlerTest.php +++ b/src/exception-handler/tests/WhoopsExceptionHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ExceptionHandler; use Hyperf\Context\Context; diff --git a/src/filesystem/publish/file.php b/src/filesystem/publish/file.php index 5e1fdf71c..0f23cb468 100644 --- a/src/filesystem/publish/file.php +++ b/src/filesystem/publish/file.php @@ -9,17 +9,25 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Filesystem\Adapter\AliyunOssAdapterFactory; +use Hyperf\Filesystem\Adapter\CosAdapterFactory; +use Hyperf\Filesystem\Adapter\FtpAdapterFactory; +use Hyperf\Filesystem\Adapter\LocalAdapterFactory; +use Hyperf\Filesystem\Adapter\MemoryAdapterFactory; +use Hyperf\Filesystem\Adapter\QiniuAdapterFactory; +use Hyperf\Filesystem\Adapter\S3AdapterFactory; + use function Hyperf\Support\env; return [ 'default' => 'local', 'storage' => [ 'local' => [ - 'driver' => \Hyperf\Filesystem\Adapter\LocalAdapterFactory::class, + 'driver' => LocalAdapterFactory::class, 'root' => __DIR__ . '/../../runtime', ], 'ftp' => [ - 'driver' => \Hyperf\Filesystem\Adapter\FtpAdapterFactory::class, + 'driver' => FtpAdapterFactory::class, 'host' => 'ftp.example.com', 'username' => 'username', 'password' => 'password', @@ -32,10 +40,10 @@ return [ // 'timestampsOnUnixListingsEnabled' => true, ], 'memory' => [ - 'driver' => \Hyperf\Filesystem\Adapter\MemoryAdapterFactory::class, + 'driver' => MemoryAdapterFactory::class, ], 's3' => [ - 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class, + 'driver' => S3AdapterFactory::class, 'credentials' => [ 'key' => env('S3_KEY'), 'secret' => env('S3_SECRET'), @@ -48,7 +56,7 @@ return [ 'bucket_name' => env('S3_BUCKET'), ], 'minio' => [ - 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class, + 'driver' => S3AdapterFactory::class, 'credentials' => [ 'key' => env('S3_KEY'), 'secret' => env('S3_SECRET'), @@ -61,7 +69,7 @@ return [ 'bucket_name' => env('S3_BUCKET'), ], 'oss' => [ - 'driver' => \Hyperf\Filesystem\Adapter\AliyunOssAdapterFactory::class, + 'driver' => AliyunOssAdapterFactory::class, 'accessId' => env('OSS_ACCESS_ID'), 'accessSecret' => env('OSS_ACCESS_SECRET'), 'bucket' => env('OSS_BUCKET'), @@ -73,14 +81,14 @@ return [ // 'proxy' => null, ], 'qiniu' => [ - 'driver' => \Hyperf\Filesystem\Adapter\QiniuAdapterFactory::class, + 'driver' => QiniuAdapterFactory::class, 'accessKey' => env('QINIU_ACCESS_KEY'), 'secretKey' => env('QINIU_SECRET_KEY'), 'bucket' => env('QINIU_BUCKET'), 'domain' => env('QINIU_DOMAIN'), ], 'cos' => [ - 'driver' => \Hyperf\Filesystem\Adapter\CosAdapterFactory::class, + 'driver' => CosAdapterFactory::class, 'region' => env('COS_REGION'), 'app_id' => env('COS_APPID'), 'secret_id' => env('COS_SECRET_ID'), diff --git a/src/filesystem/src/Adapter/AliyunOssAdapterFactory.php b/src/filesystem/src/Adapter/AliyunOssAdapterFactory.php index e9a4b39ba..c2edcbb33 100644 --- a/src/filesystem/src/Adapter/AliyunOssAdapterFactory.php +++ b/src/filesystem/src/Adapter/AliyunOssAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/CosAdapterFactory.php b/src/filesystem/src/Adapter/CosAdapterFactory.php index 84583248a..263987b1a 100644 --- a/src/filesystem/src/Adapter/CosAdapterFactory.php +++ b/src/filesystem/src/Adapter/CosAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/FtpAdapterFactory.php b/src/filesystem/src/Adapter/FtpAdapterFactory.php index e324b0af0..b5c6f38e8 100644 --- a/src/filesystem/src/Adapter/FtpAdapterFactory.php +++ b/src/filesystem/src/Adapter/FtpAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/LocalAdapterFactory.php b/src/filesystem/src/Adapter/LocalAdapterFactory.php index 3e09e8e71..20d95aa6c 100644 --- a/src/filesystem/src/Adapter/LocalAdapterFactory.php +++ b/src/filesystem/src/Adapter/LocalAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/MemoryAdapterFactory.php b/src/filesystem/src/Adapter/MemoryAdapterFactory.php index 4f7217b44..e83a83b18 100644 --- a/src/filesystem/src/Adapter/MemoryAdapterFactory.php +++ b/src/filesystem/src/Adapter/MemoryAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/NullAdapterFactory.php b/src/filesystem/src/Adapter/NullAdapterFactory.php index e0ef7bd91..039e5ea49 100644 --- a/src/filesystem/src/Adapter/NullAdapterFactory.php +++ b/src/filesystem/src/Adapter/NullAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/QiniuAdapterFactory.php b/src/filesystem/src/Adapter/QiniuAdapterFactory.php index f26889510..9f65e98ba 100644 --- a/src/filesystem/src/Adapter/QiniuAdapterFactory.php +++ b/src/filesystem/src/Adapter/QiniuAdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Hyperf\Filesystem\Contract\AdapterFactoryInterface; diff --git a/src/filesystem/src/Adapter/S3AdapterFactory.php b/src/filesystem/src/Adapter/S3AdapterFactory.php index 699e19e94..c92c62691 100644 --- a/src/filesystem/src/Adapter/S3AdapterFactory.php +++ b/src/filesystem/src/Adapter/S3AdapterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Adapter; use Aws\Handler\GuzzleV6\GuzzleHandler; diff --git a/src/filesystem/src/ConfigProvider.php b/src/filesystem/src/ConfigProvider.php index f7140b5a3..1cb9a6fe5 100644 --- a/src/filesystem/src/ConfigProvider.php +++ b/src/filesystem/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem; use League\Flysystem\Filesystem; diff --git a/src/filesystem/src/Contract/AdapterFactoryInterface.php b/src/filesystem/src/Contract/AdapterFactoryInterface.php index 0f611f820..e7ae0c50f 100644 --- a/src/filesystem/src/Contract/AdapterFactoryInterface.php +++ b/src/filesystem/src/Contract/AdapterFactoryInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Contract; use League\Flysystem\AdapterInterface; diff --git a/src/filesystem/src/Exception/InvalidArgumentException.php b/src/filesystem/src/Exception/InvalidArgumentException.php index fe4b8ac30..e7d25b6c2 100644 --- a/src/filesystem/src/Exception/InvalidArgumentException.php +++ b/src/filesystem/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/filesystem/src/FilesystemFactory.php b/src/filesystem/src/FilesystemFactory.php index 039d6c016..7e3964bea 100644 --- a/src/filesystem/src/FilesystemFactory.php +++ b/src/filesystem/src/FilesystemFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem; use Hyperf\Contract\ConfigInterface; diff --git a/src/filesystem/src/FilesystemInvoker.php b/src/filesystem/src/FilesystemInvoker.php index 22a0c51f4..2e076850e 100644 --- a/src/filesystem/src/FilesystemInvoker.php +++ b/src/filesystem/src/FilesystemInvoker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem; use Hyperf\Contract\ConfigInterface; diff --git a/src/filesystem/src/Version.php b/src/filesystem/src/Version.php index ccf9587fc..993d278b6 100644 --- a/src/filesystem/src/Version.php +++ b/src/filesystem/src/Version.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Filesystem; use League\Flysystem\FilesystemAdapter; diff --git a/src/filesystem/tests/Cases/AbstractTestCase.php b/src/filesystem/tests/Cases/AbstractTestCase.php index d6c81fbd8..1b9222ef3 100644 --- a/src/filesystem/tests/Cases/AbstractTestCase.php +++ b/src/filesystem/tests/Cases/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Filesystem\Cases; use PHPUnit\Framework\TestCase; diff --git a/src/filesystem/tests/Cases/FilesystemFactoryTest.php b/src/filesystem/tests/Cases/FilesystemFactoryTest.php index e04f1f4c7..176e9a5b4 100644 --- a/src/filesystem/tests/Cases/FilesystemFactoryTest.php +++ b/src/filesystem/tests/Cases/FilesystemFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Filesystem\Cases; use Hyperf\Config\Config; @@ -39,6 +40,10 @@ use PHPUnit\Framework\Attributes\CoversNothing; ! defined('BASE_PATH') && define('BASE_PATH', '.'); +use Hyperf\Filesystem\Adapter\CosAdapterFactory; +use Hyperf\Filesystem\Adapter\FtpAdapterFactory; +use Hyperf\Filesystem\Adapter\QiniuAdapterFactory; +use Hyperf\Filesystem\Adapter\S3AdapterFactory; use Xxtime\Flysystem\Aliyun\OssAdapter as XxtimeOSSAdapter; /** @@ -72,7 +77,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container = ApplicationContext::getContainer(); $container->set(ConfigInterface::class, $config); $factory = new FilesystemFactory($container, $container->get(ConfigInterface::class)); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem = $factory->get('test')); + $this->assertInstanceOf(Filesystem::class, $fileSystem = $factory->get('test')); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(InMemoryFilesystemAdapter::class, $invoker->adapter); @@ -101,7 +106,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(LocalFilesystemAdapter::class, $invoker->adapter); @@ -117,7 +122,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(LocalFilesystemAdapter::class, $invoker->adapter); @@ -136,7 +141,7 @@ class FilesystemFactoryTest extends AbstractTestCase 'default' => 'ftp', 'storage' => [ 'ftp' => [ - 'driver' => \Hyperf\Filesystem\Adapter\FtpAdapterFactory::class, + 'driver' => FtpAdapterFactory::class, 'host' => 'ftp.example.com', 'username' => 'username', 'password' => 'password', @@ -148,7 +153,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(FtpAdapter::class, $invoker->adapter); @@ -180,7 +185,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(OSSAdapter::class, $invoker->adapter); @@ -199,7 +204,7 @@ class FilesystemFactoryTest extends AbstractTestCase 'default' => 's3', 'storage' => [ 's3' => [ - 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class, + 'driver' => S3AdapterFactory::class, 'credentials' => [ 'key' => 'xxx', 'secret' => 'xxx', @@ -218,7 +223,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(AwsS3V3Adapter::class, $invoker->adapter); @@ -237,7 +242,7 @@ class FilesystemFactoryTest extends AbstractTestCase 'default' => 'cos', 'storage' => [ 'cos' => [ - 'driver' => \Hyperf\Filesystem\Adapter\CosAdapterFactory::class, + 'driver' => CosAdapterFactory::class, 'region' => 'xxx', 'app_id' => 'xxx', 'secret_id' => 'xxx', @@ -252,7 +257,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(CosAdapter::class, $invoker->adapter); @@ -271,7 +276,7 @@ class FilesystemFactoryTest extends AbstractTestCase 'default' => 'qiniu', 'storage' => [ 'qiniu' => [ - 'driver' => \Hyperf\Filesystem\Adapter\QiniuAdapterFactory::class, + 'driver' => QiniuAdapterFactory::class, 'accessKey' => 'xxx', 'secretKey' => 'xxx', 'bucket' => 'xxx', @@ -284,7 +289,7 @@ class FilesystemFactoryTest extends AbstractTestCase $container->set(ConfigInterface::class, $config); $container->define(Filesystem::class, FilesystemInvoker::class); $fileSystem = $container->get(Filesystem::class); - $this->assertInstanceOf(\League\Flysystem\Filesystem::class, $fileSystem); + $this->assertInstanceOf(Filesystem::class, $fileSystem); if (Version::isV2()) { $invoker = new ClassInvoker($fileSystem); $this->assertInstanceOf(QiniuAdapter::class, $invoker->adapter); diff --git a/src/framework/src/ApplicationFactory.php b/src/framework/src/ApplicationFactory.php index 909ce246e..3c8c1c1fe 100644 --- a/src/framework/src/ApplicationFactory.php +++ b/src/framework/src/ApplicationFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework; use Hyperf\Command\Annotation\Command; diff --git a/src/framework/src/Bootstrap/CloseCallback.php b/src/framework/src/Bootstrap/CloseCallback.php index 4c0c88774..749f123aa 100644 --- a/src/framework/src/Bootstrap/CloseCallback.php +++ b/src/framework/src/Bootstrap/CloseCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnClose; diff --git a/src/framework/src/Bootstrap/ConnectCallback.php b/src/framework/src/Bootstrap/ConnectCallback.php index 766113395..dfedd3acb 100644 --- a/src/framework/src/Bootstrap/ConnectCallback.php +++ b/src/framework/src/Bootstrap/ConnectCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnConnect; diff --git a/src/framework/src/Bootstrap/FinishCallback.php b/src/framework/src/Bootstrap/FinishCallback.php index 24355640c..f68c34243 100644 --- a/src/framework/src/Bootstrap/FinishCallback.php +++ b/src/framework/src/Bootstrap/FinishCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnFinish; diff --git a/src/framework/src/Bootstrap/ManagerStartCallback.php b/src/framework/src/Bootstrap/ManagerStartCallback.php index f586d5338..ee349e37a 100644 --- a/src/framework/src/Bootstrap/ManagerStartCallback.php +++ b/src/framework/src/Bootstrap/ManagerStartCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnManagerStart; diff --git a/src/framework/src/Bootstrap/ManagerStopCallback.php b/src/framework/src/Bootstrap/ManagerStopCallback.php index 5ed33e8e4..fd35ffe6d 100644 --- a/src/framework/src/Bootstrap/ManagerStopCallback.php +++ b/src/framework/src/Bootstrap/ManagerStopCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnManagerStop; diff --git a/src/framework/src/Bootstrap/PacketCallback.php b/src/framework/src/Bootstrap/PacketCallback.php index cdd4af13e..09e5661bd 100644 --- a/src/framework/src/Bootstrap/PacketCallback.php +++ b/src/framework/src/Bootstrap/PacketCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnPacket; diff --git a/src/framework/src/Bootstrap/PipeMessageCallback.php b/src/framework/src/Bootstrap/PipeMessageCallback.php index 974de218c..fc6e358f2 100644 --- a/src/framework/src/Bootstrap/PipeMessageCallback.php +++ b/src/framework/src/Bootstrap/PipeMessageCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnPipeMessage; diff --git a/src/framework/src/Bootstrap/ReceiveCallback.php b/src/framework/src/Bootstrap/ReceiveCallback.php index a94a055ad..a51bc2104 100644 --- a/src/framework/src/Bootstrap/ReceiveCallback.php +++ b/src/framework/src/Bootstrap/ReceiveCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnReceive; diff --git a/src/framework/src/Bootstrap/ServerStartCallback.php b/src/framework/src/Bootstrap/ServerStartCallback.php index 166e59bde..fe6ce2fb3 100644 --- a/src/framework/src/Bootstrap/ServerStartCallback.php +++ b/src/framework/src/Bootstrap/ServerStartCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; class ServerStartCallback diff --git a/src/framework/src/Bootstrap/ShutdownCallback.php b/src/framework/src/Bootstrap/ShutdownCallback.php index e9507ad1f..6610e1833 100644 --- a/src/framework/src/Bootstrap/ShutdownCallback.php +++ b/src/framework/src/Bootstrap/ShutdownCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnShutdown; diff --git a/src/framework/src/Bootstrap/StartCallback.php b/src/framework/src/Bootstrap/StartCallback.php index 26d542517..adeede159 100644 --- a/src/framework/src/Bootstrap/StartCallback.php +++ b/src/framework/src/Bootstrap/StartCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnStart; diff --git a/src/framework/src/Bootstrap/TaskCallback.php b/src/framework/src/Bootstrap/TaskCallback.php index ca81a0915..19ba493b6 100644 --- a/src/framework/src/Bootstrap/TaskCallback.php +++ b/src/framework/src/Bootstrap/TaskCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Contract\ConfigInterface; diff --git a/src/framework/src/Bootstrap/WorkerErrorCallback.php b/src/framework/src/Bootstrap/WorkerErrorCallback.php index 7023f81ac..5bd326fd0 100644 --- a/src/framework/src/Bootstrap/WorkerErrorCallback.php +++ b/src/framework/src/Bootstrap/WorkerErrorCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnWorkerError; diff --git a/src/framework/src/Bootstrap/WorkerExitCallback.php b/src/framework/src/Bootstrap/WorkerExitCallback.php index 7d8ebcb30..4bec61fb5 100644 --- a/src/framework/src/Bootstrap/WorkerExitCallback.php +++ b/src/framework/src/Bootstrap/WorkerExitCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Coordinator\Constants; diff --git a/src/framework/src/Bootstrap/WorkerStartCallback.php b/src/framework/src/Bootstrap/WorkerStartCallback.php index 4a133c096..773274cf5 100644 --- a/src/framework/src/Bootstrap/WorkerStartCallback.php +++ b/src/framework/src/Bootstrap/WorkerStartCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/framework/src/Bootstrap/WorkerStopCallback.php b/src/framework/src/Bootstrap/WorkerStopCallback.php index add3751dc..3da3ecfe2 100644 --- a/src/framework/src/Bootstrap/WorkerStopCallback.php +++ b/src/framework/src/Bootstrap/WorkerStopCallback.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Bootstrap; use Hyperf\Framework\Event\OnWorkerStop; diff --git a/src/framework/src/ConfigProvider.php b/src/framework/src/ConfigProvider.php index d80afff5a..fc616d00a 100644 --- a/src/framework/src/ConfigProvider.php +++ b/src/framework/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework; use Hyperf\Contract\ApplicationInterface; diff --git a/src/framework/src/Event/AfterWorkerStart.php b/src/framework/src/Event/AfterWorkerStart.php index 3660a1168..c37832c2c 100644 --- a/src/framework/src/Event/AfterWorkerStart.php +++ b/src/framework/src/Event/AfterWorkerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/BeforeMainServerStart.php b/src/framework/src/Event/BeforeMainServerStart.php index 8a874f0de..a35653821 100644 --- a/src/framework/src/Event/BeforeMainServerStart.php +++ b/src/framework/src/Event/BeforeMainServerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/BeforeServerStart.php b/src/framework/src/Event/BeforeServerStart.php index b6ecfb619..377fe809f 100644 --- a/src/framework/src/Event/BeforeServerStart.php +++ b/src/framework/src/Event/BeforeServerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; class BeforeServerStart diff --git a/src/framework/src/Event/BeforeWorkerStart.php b/src/framework/src/Event/BeforeWorkerStart.php index 2c46a0faf..36ffef3b1 100644 --- a/src/framework/src/Event/BeforeWorkerStart.php +++ b/src/framework/src/Event/BeforeWorkerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/BootApplication.php b/src/framework/src/Event/BootApplication.php index 4464a6bb8..bd7bd2fce 100644 --- a/src/framework/src/Event/BootApplication.php +++ b/src/framework/src/Event/BootApplication.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; class BootApplication diff --git a/src/framework/src/Event/MainWorkerStart.php b/src/framework/src/Event/MainWorkerStart.php index 5c4ecbcdb..a3b144a42 100644 --- a/src/framework/src/Event/MainWorkerStart.php +++ b/src/framework/src/Event/MainWorkerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnClose.php b/src/framework/src/Event/OnClose.php index 18894c8c9..183aabdca 100644 --- a/src/framework/src/Event/OnClose.php +++ b/src/framework/src/Event/OnClose.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnConnect.php b/src/framework/src/Event/OnConnect.php index e17ad6578..7e080405c 100644 --- a/src/framework/src/Event/OnConnect.php +++ b/src/framework/src/Event/OnConnect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnFinish.php b/src/framework/src/Event/OnFinish.php index 968efea98..5ded04730 100644 --- a/src/framework/src/Event/OnFinish.php +++ b/src/framework/src/Event/OnFinish.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnManagerStart.php b/src/framework/src/Event/OnManagerStart.php index 9c00d48d0..55305ecaf 100644 --- a/src/framework/src/Event/OnManagerStart.php +++ b/src/framework/src/Event/OnManagerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnManagerStop.php b/src/framework/src/Event/OnManagerStop.php index 804fb10a7..080b3b084 100644 --- a/src/framework/src/Event/OnManagerStop.php +++ b/src/framework/src/Event/OnManagerStop.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnPacket.php b/src/framework/src/Event/OnPacket.php index 8701000fb..7739af88b 100644 --- a/src/framework/src/Event/OnPacket.php +++ b/src/framework/src/Event/OnPacket.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnPipeMessage.php b/src/framework/src/Event/OnPipeMessage.php index 0227020d8..baae4b6cd 100644 --- a/src/framework/src/Event/OnPipeMessage.php +++ b/src/framework/src/Event/OnPipeMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnReceive.php b/src/framework/src/Event/OnReceive.php index 14a106c26..55ad669cf 100644 --- a/src/framework/src/Event/OnReceive.php +++ b/src/framework/src/Event/OnReceive.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnShutdown.php b/src/framework/src/Event/OnShutdown.php index 02ff0c41a..718809d93 100644 --- a/src/framework/src/Event/OnShutdown.php +++ b/src/framework/src/Event/OnShutdown.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnStart.php b/src/framework/src/Event/OnStart.php index 57450a867..5467d9f98 100644 --- a/src/framework/src/Event/OnStart.php +++ b/src/framework/src/Event/OnStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnTask.php b/src/framework/src/Event/OnTask.php index 84347b9e4..6a26e902d 100644 --- a/src/framework/src/Event/OnTask.php +++ b/src/framework/src/Event/OnTask.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Psr\EventDispatcher\StoppableEventInterface; diff --git a/src/framework/src/Event/OnWorkerError.php b/src/framework/src/Event/OnWorkerError.php index 5b2ece9ce..8746b9556 100644 --- a/src/framework/src/Event/OnWorkerError.php +++ b/src/framework/src/Event/OnWorkerError.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnWorkerExit.php b/src/framework/src/Event/OnWorkerExit.php index 8afb520fd..4156686a6 100644 --- a/src/framework/src/Event/OnWorkerExit.php +++ b/src/framework/src/Event/OnWorkerExit.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OnWorkerStop.php b/src/framework/src/Event/OnWorkerStop.php index 9bb43359a..264bae7fc 100644 --- a/src/framework/src/Event/OnWorkerStop.php +++ b/src/framework/src/Event/OnWorkerStop.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Event/OtherWorkerStart.php b/src/framework/src/Event/OtherWorkerStart.php index c6a123613..005e18418 100644 --- a/src/framework/src/Event/OtherWorkerStart.php +++ b/src/framework/src/Event/OtherWorkerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Event; use Swoole\Server; diff --git a/src/framework/src/Exception/NotImplementedException.php b/src/framework/src/Exception/NotImplementedException.php index b7f16cfff..5d8adbc9f 100644 --- a/src/framework/src/Exception/NotImplementedException.php +++ b/src/framework/src/Exception/NotImplementedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Exception; use RuntimeException; diff --git a/src/framework/src/Logger/StdoutLogger.php b/src/framework/src/Logger/StdoutLogger.php index 79d2f66e0..d15c6dd68 100644 --- a/src/framework/src/Logger/StdoutLogger.php +++ b/src/framework/src/Logger/StdoutLogger.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework\Logger; use Hyperf\Contract\ConfigInterface; diff --git a/src/framework/src/SymfonyEventDispatcher.php b/src/framework/src/SymfonyEventDispatcher.php index fdde9207b..7dd651c93 100644 --- a/src/framework/src/SymfonyEventDispatcher.php +++ b/src/framework/src/SymfonyEventDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Framework; use Psr\EventDispatcher\EventDispatcherInterface as PsrDispatcherInterface; diff --git a/src/framework/tests/ApplicationFactoryTest.php b/src/framework/tests/ApplicationFactoryTest.php index a559d3525..9c4927423 100644 --- a/src/framework/tests/ApplicationFactoryTest.php +++ b/src/framework/tests/ApplicationFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Framework; use Hyperf\Config\Config; diff --git a/src/framework/tests/StdoutLoggerTest.php b/src/framework/tests/StdoutLoggerTest.php index 17782deba..d2a43d651 100644 --- a/src/framework/tests/StdoutLoggerTest.php +++ b/src/framework/tests/StdoutLoggerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Framework; use Hyperf\Config\Config; diff --git a/src/framework/tests/Stub/TestObject.php b/src/framework/tests/Stub/TestObject.php index c4912a8ac..db49181cc 100644 --- a/src/framework/tests/Stub/TestObject.php +++ b/src/framework/tests/Stub/TestObject.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Framework\Stub; class TestObject diff --git a/src/graphql/src/Annotation/AnnotationTrait.php b/src/graphql/src/Annotation/AnnotationTrait.php index c5c30a8a2..dd92ece5a 100644 --- a/src/graphql/src/Annotation/AnnotationTrait.php +++ b/src/graphql/src/Annotation/AnnotationTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/graphql/src/Annotation/ExtendType.php b/src/graphql/src/Annotation/ExtendType.php index 6d30ddabf..325cf1948 100644 --- a/src/graphql/src/Annotation/ExtendType.php +++ b/src/graphql/src/Annotation/ExtendType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Factory.php b/src/graphql/src/Annotation/Factory.php index 16d1ce879..cc754c5b8 100644 --- a/src/graphql/src/Annotation/Factory.php +++ b/src/graphql/src/Annotation/Factory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/FailWith.php b/src/graphql/src/Annotation/FailWith.php index 95522b17e..fb46bd469 100644 --- a/src/graphql/src/Annotation/FailWith.php +++ b/src/graphql/src/Annotation/FailWith.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Field.php b/src/graphql/src/Annotation/Field.php index 9d639a3b7..f03cc5482 100644 --- a/src/graphql/src/Annotation/Field.php +++ b/src/graphql/src/Annotation/Field.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Logged.php b/src/graphql/src/Annotation/Logged.php index b2115a018..12a728182 100644 --- a/src/graphql/src/Annotation/Logged.php +++ b/src/graphql/src/Annotation/Logged.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Mutation.php b/src/graphql/src/Annotation/Mutation.php index 680f266ab..929cf843c 100644 --- a/src/graphql/src/Annotation/Mutation.php +++ b/src/graphql/src/Annotation/Mutation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Query.php b/src/graphql/src/Annotation/Query.php index d7fb570af..a12fba777 100644 --- a/src/graphql/src/Annotation/Query.php +++ b/src/graphql/src/Annotation/Query.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Right.php b/src/graphql/src/Annotation/Right.php index a2416d715..8676995c5 100644 --- a/src/graphql/src/Annotation/Right.php +++ b/src/graphql/src/Annotation/Right.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/SourceField.php b/src/graphql/src/Annotation/SourceField.php index e60dcf3f9..2c2de32cb 100644 --- a/src/graphql/src/Annotation/SourceField.php +++ b/src/graphql/src/Annotation/SourceField.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/Annotation/Type.php b/src/graphql/src/Annotation/Type.php index 982cc2ec1..d60657f55 100644 --- a/src/graphql/src/Annotation/Type.php +++ b/src/graphql/src/Annotation/Type.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL\Annotation; use Attribute; diff --git a/src/graphql/src/AnnotationReader.php b/src/graphql/src/AnnotationReader.php index b96ddda3a..bba002fec 100644 --- a/src/graphql/src/AnnotationReader.php +++ b/src/graphql/src/AnnotationReader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Doctrine\Common\Annotations\AnnotationException; diff --git a/src/graphql/src/ClassCollector.php b/src/graphql/src/ClassCollector.php index 958e1765e..bee44682b 100644 --- a/src/graphql/src/ClassCollector.php +++ b/src/graphql/src/ClassCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Hyperf\Di\MetadataCollector; diff --git a/src/graphql/src/ConfigProvider.php b/src/graphql/src/ConfigProvider.php index 3fb6803b3..40dc83fe6 100644 --- a/src/graphql/src/ConfigProvider.php +++ b/src/graphql/src/ConfigProvider.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Doctrine\Common\Annotations\Reader; +use GraphQL\Type\Schema; use TheCodingMachine\GraphQLite\Hydrators\FactoryHydrator; use TheCodingMachine\GraphQLite\Hydrators\HydratorInterface; use TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapperInterface; @@ -29,7 +31,7 @@ class ConfigProvider { return [ 'dependencies' => [ - \GraphQL\Type\Schema::class => \TheCodingMachine\GraphQLite\Schema::class, + Schema::class => \TheCodingMachine\GraphQLite\Schema::class, QueryProviderInterface::class => QueryProvider::class, RecursiveTypeMapperInterface::class => RecursiveTypeMapperFactory::class, Reader::class => ReaderFactory::class, diff --git a/src/graphql/src/FieldsBuilder.php b/src/graphql/src/FieldsBuilder.php index 0559881f3..cb9abac85 100644 --- a/src/graphql/src/FieldsBuilder.php +++ b/src/graphql/src/FieldsBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use GraphQL\Type\Definition\NonNull; @@ -554,7 +555,7 @@ class FieldsBuilder if (! $isNullable) { $graphQlType = GraphQLType::nonNull($graphQlType); } - } catch (TypeMappingException|CannotMapTypeExceptionInterface $e) { + } catch (CannotMapTypeExceptionInterface|TypeMappingException $e) { // Is the type iterable? If yes, let's analyze the docblock // TODO: it would be better not to go through an exception for this. if ($type instanceof Object_) { @@ -595,7 +596,7 @@ class FieldsBuilder foreach ($filteredDocBlockTypes as $singleDocBlockType) { try { $unionTypes[] = $this->toGraphQlType($this->dropNullableType($singleDocBlockType), null, $mapToInputType); - } catch (TypeMappingException|CannotMapTypeExceptionInterface $e) { + } catch (CannotMapTypeExceptionInterface|TypeMappingException $e) { // We have several types. It is ok not to be able to match one. $lastException = $e; } @@ -659,7 +660,7 @@ class FieldsBuilder // TODO: add here a scan of the $type variable and do stuff if it is iterable. // TODO: remove the iterator type if specified in the docblock (@return Iterator|User[]) // TODO: check there is at least one array (User[]) - } catch (TypeMappingException|CannotMapTypeExceptionInterface $e) { + } catch (CannotMapTypeExceptionInterface|TypeMappingException $e) { // We have several types. It is ok not to be able to match one. $lastException = $e; } @@ -686,7 +687,7 @@ class FieldsBuilder * Casts a Type to a GraphQL type. * Does not deal with nullable. * - * @return GraphQLType (InputType&GraphQLType)|(OutputType&GraphQLType) + * @return GraphQLType (GraphQLType&InputType)|(GraphQLType&OutputType) * @throws CannotMapTypeExceptionInterface */ private function toGraphQlType(Type $type, ?GraphQLType $subType, bool $mapToInputType): GraphQLType diff --git a/src/graphql/src/FieldsBuilderFactory.php b/src/graphql/src/FieldsBuilderFactory.php index 4ade4a253..4003feff8 100644 --- a/src/graphql/src/FieldsBuilderFactory.php +++ b/src/graphql/src/FieldsBuilderFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use TheCodingMachine\GraphQLite\Hydrators\HydratorInterface; diff --git a/src/graphql/src/GraphQLMiddleware.php b/src/graphql/src/GraphQLMiddleware.php index 31dc731f5..79e6d21f4 100644 --- a/src/graphql/src/GraphQLMiddleware.php +++ b/src/graphql/src/GraphQLMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use GraphQL\GraphQL; diff --git a/src/graphql/src/InputTypeGenerator.php b/src/graphql/src/InputTypeGenerator.php index dee347c6c..2f91a128c 100644 --- a/src/graphql/src/InputTypeGenerator.php +++ b/src/graphql/src/InputTypeGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use GraphQL\Type\Definition\InputObjectType; diff --git a/src/graphql/src/InputTypeUtils.php b/src/graphql/src/InputTypeUtils.php index acb7e9457..eb60a6a0c 100644 --- a/src/graphql/src/InputTypeUtils.php +++ b/src/graphql/src/InputTypeUtils.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; use phpDocumentor\Reflection\Types\Object_; use phpDocumentor\Reflection\Types\Self_; use ReflectionClass; @@ -69,7 +71,7 @@ class InputTypeUtils $type = (string) $returnType; - $typeResolver = new \phpDocumentor\Reflection\TypeResolver(); + $typeResolver = new TypeResolver(); $phpdocType = $typeResolver->resolve($type); $phpdocType = $this->resolveSelf($phpdocType, $refMethod->getDeclaringClass()); diff --git a/src/graphql/src/QueryProvider.php b/src/graphql/src/QueryProvider.php index e873f7555..b779c4525 100644 --- a/src/graphql/src/QueryProvider.php +++ b/src/graphql/src/QueryProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/graphql/src/ReaderFactory.php b/src/graphql/src/ReaderFactory.php index 27c03e408..e4a227257 100644 --- a/src/graphql/src/ReaderFactory.php +++ b/src/graphql/src/ReaderFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Doctrine\Common\Annotations\AnnotationReader; diff --git a/src/graphql/src/RecursiveTypeMapperFactory.php b/src/graphql/src/RecursiveTypeMapperFactory.php index 8e9351d7a..3b8582081 100644 --- a/src/graphql/src/RecursiveTypeMapperFactory.php +++ b/src/graphql/src/RecursiveTypeMapperFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Doctrine\Common\Annotations\Reader; diff --git a/src/graphql/src/ResolvableInputObjectType.php b/src/graphql/src/ResolvableInputObjectType.php index 73cfe1f5d..835618f4f 100644 --- a/src/graphql/src/ResolvableInputObjectType.php +++ b/src/graphql/src/ResolvableInputObjectType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use GraphQL\Type\Definition\InputObjectType; diff --git a/src/graphql/src/TypeAnnotatedObjectType.php b/src/graphql/src/TypeAnnotatedObjectType.php index f63aca898..1319a1b6b 100644 --- a/src/graphql/src/TypeAnnotatedObjectType.php +++ b/src/graphql/src/TypeAnnotatedObjectType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapperInterface; diff --git a/src/graphql/src/TypeGenerator.php b/src/graphql/src/TypeGenerator.php index 434cf2d13..aa3b5956c 100644 --- a/src/graphql/src/TypeGenerator.php +++ b/src/graphql/src/TypeGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use Psr\Container\ContainerInterface; diff --git a/src/graphql/src/TypeMapper.php b/src/graphql/src/TypeMapper.php index 4590f7254..cd646e138 100644 --- a/src/graphql/src/TypeMapper.php +++ b/src/graphql/src/TypeMapper.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GraphQL; use GraphQL\Type\Definition\InputObjectType; diff --git a/src/grpc-client/src/BaseClient.php b/src/grpc-client/src/BaseClient.php index cd413ed22..28ddc2bcd 100644 --- a/src/grpc-client/src/BaseClient.php +++ b/src/grpc-client/src/BaseClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Google\Protobuf\Internal\Message; diff --git a/src/grpc-client/src/BidiStreamingCall.php b/src/grpc-client/src/BidiStreamingCall.php index 68f9bf086..08cc2899f 100644 --- a/src/grpc-client/src/BidiStreamingCall.php +++ b/src/grpc-client/src/BidiStreamingCall.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; class BidiStreamingCall extends StreamingCall diff --git a/src/grpc-client/src/ClientStreamingCall.php b/src/grpc-client/src/ClientStreamingCall.php index b91e95fe3..e6d0a5876 100644 --- a/src/grpc-client/src/ClientStreamingCall.php +++ b/src/grpc-client/src/ClientStreamingCall.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Grpc\StatusCode; diff --git a/src/grpc-client/src/ConfigProvider.php b/src/grpc-client/src/ConfigProvider.php index 94f92d079..673f867f9 100644 --- a/src/grpc-client/src/ConfigProvider.php +++ b/src/grpc-client/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\GrpcClient\Listener\RegisterProtocolListener; diff --git a/src/grpc-client/src/DataFormatter.php b/src/grpc-client/src/DataFormatter.php index 46b134b92..aaaf67205 100644 --- a/src/grpc-client/src/DataFormatter.php +++ b/src/grpc-client/src/DataFormatter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Rpc\Context; diff --git a/src/grpc-client/src/Exception/GrpcClientException.php b/src/grpc-client/src/Exception/GrpcClientException.php index ed19b6275..44ddd2b10 100644 --- a/src/grpc-client/src/Exception/GrpcClientException.php +++ b/src/grpc-client/src/Exception/GrpcClientException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient\Exception; use RuntimeException; diff --git a/src/grpc-client/src/GrpcClient.php b/src/grpc-client/src/GrpcClient.php index 1158416d9..0dfd0c850 100644 --- a/src/grpc-client/src/GrpcClient.php +++ b/src/grpc-client/src/GrpcClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Coroutine\Channel\Pool as ChannelPool; diff --git a/src/grpc-client/src/GrpcNormalizer.php b/src/grpc-client/src/GrpcNormalizer.php index 93cb8633e..dea8b4c31 100644 --- a/src/grpc-client/src/GrpcNormalizer.php +++ b/src/grpc-client/src/GrpcNormalizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Contract\NormalizerInterface; diff --git a/src/grpc-client/src/GrpcPacker.php b/src/grpc-client/src/GrpcPacker.php index 3cf2aa8a4..5b6e163d1 100644 --- a/src/grpc-client/src/GrpcPacker.php +++ b/src/grpc-client/src/GrpcPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Contract\PackerInterface; diff --git a/src/grpc-client/src/GrpcTransporter.php b/src/grpc-client/src/GrpcTransporter.php index de692bc7b..27beba6a3 100644 --- a/src/grpc-client/src/GrpcTransporter.php +++ b/src/grpc-client/src/GrpcTransporter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Grpc\StatusCode; diff --git a/src/grpc-client/src/Listener/RegisterProtocolListener.php b/src/grpc-client/src/Listener/RegisterProtocolListener.php index d2afde518..35c6affaf 100644 --- a/src/grpc-client/src/Listener/RegisterProtocolListener.php +++ b/src/grpc-client/src/Listener/RegisterProtocolListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/grpc-client/src/Request.php b/src/grpc-client/src/Request.php index bcd726d28..67648d69b 100644 --- a/src/grpc-client/src/Request.php +++ b/src/grpc-client/src/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Google\Protobuf\Internal\Message; diff --git a/src/grpc-client/src/ServerStreamingCall.php b/src/grpc-client/src/ServerStreamingCall.php index 034fb5bb1..f7dc27aaa 100644 --- a/src/grpc-client/src/ServerStreamingCall.php +++ b/src/grpc-client/src/ServerStreamingCall.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Grpc\StatusCode; diff --git a/src/grpc-client/src/Status.php b/src/grpc-client/src/Status.php index 0e4ff54ed..685abcf12 100644 --- a/src/grpc-client/src/Status.php +++ b/src/grpc-client/src/Status.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; final class Status diff --git a/src/grpc-client/src/StreamingCall.php b/src/grpc-client/src/StreamingCall.php index 4e66630ce..b17b300bf 100644 --- a/src/grpc-client/src/StreamingCall.php +++ b/src/grpc-client/src/StreamingCall.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcClient; use Hyperf\Grpc\Parser; diff --git a/src/grpc-client/tests/BaseClientTest.php b/src/grpc-client/tests/BaseClientTest.php index 07b1dc2ec..28b7a4c3c 100644 --- a/src/grpc-client/tests/BaseClientTest.php +++ b/src/grpc-client/tests/BaseClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcClient; use Grpc\UserReply; diff --git a/src/grpc-client/tests/GPBMetadata/Grpc.php b/src/grpc-client/tests/GPBMetadata/Grpc.php index caf69994d..bd8ae6fa8 100644 --- a/src/grpc-client/tests/GPBMetadata/Grpc.php +++ b/src/grpc-client/tests/GPBMetadata/Grpc.php @@ -13,13 +13,15 @@ declare(strict_types=1); namespace GPBMetadata; +use Google\Protobuf\Internal\DescriptorPool; + class Grpc { public static $is_initialized = false; public static function initOnce() { - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $pool = DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; diff --git a/src/grpc-client/tests/GPBMetadata/RouteGuide.php b/src/grpc-client/tests/GPBMetadata/RouteGuide.php index 619b1ea1e..a9bf0e160 100644 --- a/src/grpc-client/tests/GPBMetadata/RouteGuide.php +++ b/src/grpc-client/tests/GPBMetadata/RouteGuide.php @@ -13,13 +13,15 @@ declare(strict_types=1); namespace GPBMetadata; +use Google\Protobuf\Internal\DescriptorPool; + class RouteGuide { public static $is_initialized = false; public static function initOnce() { - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $pool = DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; diff --git a/src/grpc-client/tests/GPBMetadata/User.php b/src/grpc-client/tests/GPBMetadata/User.php index e314115e73e3ecba297a792b438d274d8e2a9213..f9525e93cb93a5e73a8202a0834aa09fa62aaa69 100644 GIT binary patch delta 25 hcmaFN_ML5m3?oZvajL@PNsQ`~B^fI=uV&oA2mp0$2(JJD delta 22 ecmey)_Lyyh4C7=k#!|+Z$qJ0>o6jgrpc.Info. */ -class Info extends \Google\Protobuf\Internal\Message +class Info extends Message { /** * Generated from protobuf field int32 id = 1;. @@ -36,13 +38,13 @@ class Info extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var int $id - * @var string $name - * } + * @var int $id + * @var string $name + * } */ public function __construct($data = null) { - \GPBMetadata\Grpc::initOnce(); + Grpc::initOnce(); parent::__construct($data); } diff --git a/src/grpc-client/tests/Grpc/UserReply.php b/src/grpc-client/tests/Grpc/UserReply.php index e7bbfdc5d..b933848ed 100644 --- a/src/grpc-client/tests/Grpc/UserReply.php +++ b/src/grpc-client/tests/Grpc/UserReply.php @@ -14,11 +14,13 @@ declare(strict_types=1); namespace Grpc; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\Grpc; /** * Generated from protobuf message grpc.UserReply. */ -class UserReply extends \Google\Protobuf\Internal\Message +class UserReply extends Message { /** * Generated from protobuf field string message = 1;. @@ -36,13 +38,13 @@ class UserReply extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var string $message - * @var \Grpc\Info $info - * } + * @var string $message + * @var Info $info + * } */ public function __construct($data = null) { - \GPBMetadata\Grpc::initOnce(); + Grpc::initOnce(); parent::__construct($data); } @@ -70,7 +72,7 @@ class UserReply extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .grpc.Info info = 2;. - * @return \Grpc\Info + * @return Info */ public function getInfo() { @@ -79,12 +81,12 @@ class UserReply extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .grpc.Info info = 2;. - * @param \Grpc\Info $var + * @param Info $var * @return $this */ public function setInfo($var) { - GPBUtil::checkMessage($var, \Grpc\Info::class); + GPBUtil::checkMessage($var, Info::class); $this->info = $var; return $this; diff --git a/src/grpc-client/tests/RequestTest.php b/src/grpc-client/tests/RequestTest.php index 0e45ddfe3..444b62313 100644 --- a/src/grpc-client/tests/RequestTest.php +++ b/src/grpc-client/tests/RequestTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcClient; use Grpc\Info; diff --git a/src/grpc-client/tests/RouteGuideClientTest.php b/src/grpc-client/tests/RouteGuideClientTest.php index 40ed08b73..ae134b481 100644 --- a/src/grpc-client/tests/RouteGuideClientTest.php +++ b/src/grpc-client/tests/RouteGuideClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcClient; use Hyperf\Context\ApplicationContext; diff --git a/src/grpc-client/tests/Routeguide/Feature.php b/src/grpc-client/tests/Routeguide/Feature.php index 488349e37..b210c6f33 100644 --- a/src/grpc-client/tests/Routeguide/Feature.php +++ b/src/grpc-client/tests/Routeguide/Feature.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Routeguide; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\RouteGuide; /** * A feature names something at a given point. @@ -21,7 +23,7 @@ use Google\Protobuf\Internal\GPBUtil; * * Generated from protobuf message routeguide.Feature */ -class Feature extends \Google\Protobuf\Internal\Message +class Feature extends Message { /** * The name of the feature. @@ -43,15 +45,15 @@ class Feature extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var string $name - * The name of the feature - * @var \Routeguide\Point $location - * The point where the feature is detected. - * } + * @var string $name + * The name of the feature + * @var Point $location + * The point where the feature is detected. + * } */ public function __construct($data = null) { - \GPBMetadata\RouteGuide::initOnce(); + RouteGuide::initOnce(); parent::__construct($data); } @@ -85,7 +87,7 @@ class Feature extends \Google\Protobuf\Internal\Message * The point where the feature is detected. * * Generated from protobuf field .routeguide.Point location = 2; - * @return \Routeguide\Point + * @return Point */ public function getLocation() { @@ -96,12 +98,12 @@ class Feature extends \Google\Protobuf\Internal\Message * The point where the feature is detected. * * Generated from protobuf field .routeguide.Point location = 2; - * @param \Routeguide\Point $var + * @param Point $var * @return $this */ public function setLocation($var) { - GPBUtil::checkMessage($var, \Routeguide\Point::class); + GPBUtil::checkMessage($var, Point::class); $this->location = $var; return $this; diff --git a/src/grpc-client/tests/Routeguide/Point.php b/src/grpc-client/tests/Routeguide/Point.php index 8fcc8d876..e65e94cd4 100644 --- a/src/grpc-client/tests/Routeguide/Point.php +++ b/src/grpc-client/tests/Routeguide/Point.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Routeguide; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\RouteGuide; /** * Points are represented as latitude-longitude pairs in the E7 representation @@ -23,7 +25,7 @@ use Google\Protobuf\Internal\GPBUtil; * * Generated from protobuf message routeguide.Point */ -class Point extends \Google\Protobuf\Internal\Message +class Point extends Message { /** * Generated from protobuf field int32 latitude = 1;. @@ -41,13 +43,13 @@ class Point extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var int $latitude - * @var int $longitude - * } + * @var int $latitude + * @var int $longitude + * } */ public function __construct($data = null) { - \GPBMetadata\RouteGuide::initOnce(); + RouteGuide::initOnce(); parent::__construct($data); } diff --git a/src/grpc-client/tests/Routeguide/Rectangle.php b/src/grpc-client/tests/Routeguide/Rectangle.php index a29fd377a..38bff9e15 100644 --- a/src/grpc-client/tests/Routeguide/Rectangle.php +++ b/src/grpc-client/tests/Routeguide/Rectangle.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Routeguide; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\RouteGuide; /** * A latitude-longitude rectangle, represented as two diagonally opposite @@ -21,7 +23,7 @@ use Google\Protobuf\Internal\GPBUtil; * * Generated from protobuf message routeguide.Rectangle */ -class Rectangle extends \Google\Protobuf\Internal\Message +class Rectangle extends Message { /** * One corner of the rectangle. @@ -43,15 +45,15 @@ class Rectangle extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var \Routeguide\Point $lo - * One corner of the rectangle - * @var \Routeguide\Point $hi - * The other corner of the rectangle. - * } + * @var Point $lo + * One corner of the rectangle + * @var Point $hi + * The other corner of the rectangle. + * } */ public function __construct($data = null) { - \GPBMetadata\RouteGuide::initOnce(); + RouteGuide::initOnce(); parent::__construct($data); } @@ -59,7 +61,7 @@ class Rectangle extends \Google\Protobuf\Internal\Message * One corner of the rectangle. * * Generated from protobuf field .routeguide.Point lo = 1; - * @return \Routeguide\Point + * @return Point */ public function getLo() { @@ -70,12 +72,12 @@ class Rectangle extends \Google\Protobuf\Internal\Message * One corner of the rectangle. * * Generated from protobuf field .routeguide.Point lo = 1; - * @param \Routeguide\Point $var + * @param Point $var * @return $this */ public function setLo($var) { - GPBUtil::checkMessage($var, \Routeguide\Point::class); + GPBUtil::checkMessage($var, Point::class); $this->lo = $var; return $this; @@ -85,7 +87,7 @@ class Rectangle extends \Google\Protobuf\Internal\Message * The other corner of the rectangle. * * Generated from protobuf field .routeguide.Point hi = 2; - * @return \Routeguide\Point + * @return Point */ public function getHi() { @@ -96,12 +98,12 @@ class Rectangle extends \Google\Protobuf\Internal\Message * The other corner of the rectangle. * * Generated from protobuf field .routeguide.Point hi = 2; - * @param \Routeguide\Point $var + * @param Point $var * @return $this */ public function setHi($var) { - GPBUtil::checkMessage($var, \Routeguide\Point::class); + GPBUtil::checkMessage($var, Point::class); $this->hi = $var; return $this; diff --git a/src/grpc-client/tests/Routeguide/RouteNote.php b/src/grpc-client/tests/Routeguide/RouteNote.php index a48748ae4..6c21e9087 100644 --- a/src/grpc-client/tests/Routeguide/RouteNote.php +++ b/src/grpc-client/tests/Routeguide/RouteNote.php @@ -14,13 +14,15 @@ declare(strict_types=1); namespace Routeguide; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\RouteGuide; /** * A RouteNote is a message sent while at a given point. * * Generated from protobuf message routeguide.RouteNote */ -class RouteNote extends \Google\Protobuf\Internal\Message +class RouteNote extends Message { /** * The location from which the message is sent. @@ -42,15 +44,15 @@ class RouteNote extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var \Routeguide\Point $location - * The location from which the message is sent - * @var string $message - * The message to be sent. - * } + * @var Point $location + * The location from which the message is sent + * @var string $message + * The message to be sent. + * } */ public function __construct($data = null) { - \GPBMetadata\RouteGuide::initOnce(); + RouteGuide::initOnce(); parent::__construct($data); } @@ -58,7 +60,7 @@ class RouteNote extends \Google\Protobuf\Internal\Message * The location from which the message is sent. * * Generated from protobuf field .routeguide.Point location = 1; - * @return \Routeguide\Point + * @return Point */ public function getLocation() { @@ -69,12 +71,12 @@ class RouteNote extends \Google\Protobuf\Internal\Message * The location from which the message is sent. * * Generated from protobuf field .routeguide.Point location = 1; - * @param \Routeguide\Point $var + * @param Point $var * @return $this */ public function setLocation($var) { - GPBUtil::checkMessage($var, \Routeguide\Point::class); + GPBUtil::checkMessage($var, Point::class); $this->location = $var; return $this; diff --git a/src/grpc-client/tests/Routeguide/RouteSummary.php b/src/grpc-client/tests/Routeguide/RouteSummary.php index c6e1b13e4..c652ec49e 100644 --- a/src/grpc-client/tests/Routeguide/RouteSummary.php +++ b/src/grpc-client/tests/Routeguide/RouteSummary.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Routeguide; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\RouteGuide; /** * A RouteSummary is received in response to a RecordRoute rpc. @@ -23,7 +25,7 @@ use Google\Protobuf\Internal\GPBUtil; * * Generated from protobuf message routeguide.RouteSummary */ -class RouteSummary extends \Google\Protobuf\Internal\Message +class RouteSummary extends Message { /** * The number of points received. @@ -59,19 +61,19 @@ class RouteSummary extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var int $point_count - * The number of points received - * @var int $feature_count - * The number of known features passed while traversing the route - * @var int $distance - * The distance covered in metres - * @var int $elapsed_time - * The duration of the traversal in seconds. - * } + * @var int $point_count + * The number of points received + * @var int $feature_count + * The number of known features passed while traversing the route + * @var int $distance + * The distance covered in metres + * @var int $elapsed_time + * The duration of the traversal in seconds. + * } */ public function __construct($data = null) { - \GPBMetadata\RouteGuide::initOnce(); + RouteGuide::initOnce(); parent::__construct($data); } diff --git a/src/grpc-client/tests/Stub/HiClient.php b/src/grpc-client/tests/Stub/HiClient.php index 3afaf114a..29571fc65 100644 --- a/src/grpc-client/tests/Stub/HiClient.php +++ b/src/grpc-client/tests/Stub/HiClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcClient\Stub; use Grpc\Info; diff --git a/src/grpc-client/tests/Stub/RouteGuideClient.php b/src/grpc-client/tests/Stub/RouteGuideClient.php index 7f66db8cb..479d272df 100644 --- a/src/grpc-client/tests/Stub/RouteGuideClient.php +++ b/src/grpc-client/tests/Stub/RouteGuideClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcClient\Stub; use Hyperf\GrpcClient\BaseClient; diff --git a/src/grpc-client/tests/Stub/UserServiceClient.php b/src/grpc-client/tests/Stub/UserServiceClient.php index ab1a15be9..c499ab750 100644 --- a/src/grpc-client/tests/Stub/UserServiceClient.php +++ b/src/grpc-client/tests/Stub/UserServiceClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcClient\Stub; use Hyperf\GrpcClient\BaseClient; diff --git a/src/grpc-client/tests/UserService/UserId.php b/src/grpc-client/tests/UserService/UserId.php index c217eb948..7bb5280f3 100644 --- a/src/grpc-client/tests/UserService/UserId.php +++ b/src/grpc-client/tests/UserService/UserId.php @@ -14,11 +14,13 @@ declare(strict_types=1); namespace UserService; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\User; /** * Generated from protobuf message UserService.UserId. */ -class UserId extends \Google\Protobuf\Internal\Message +class UserId extends Message { /** * Generated from protobuf field uint64 id = 1;. @@ -31,12 +33,12 @@ class UserId extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var int|string $id - * } + * @var int|string $id + * } */ public function __construct($data = null) { - \GPBMetadata\User::initOnce(); + User::initOnce(); parent::__construct($data); } diff --git a/src/grpc-client/tests/UserService/UserInfo.php b/src/grpc-client/tests/UserService/UserInfo.php index 534db69f3..c293201f0 100644 --- a/src/grpc-client/tests/UserService/UserInfo.php +++ b/src/grpc-client/tests/UserService/UserInfo.php @@ -14,11 +14,13 @@ declare(strict_types=1); namespace UserService; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use GPBMetadata\User; /** * Generated from protobuf message UserService.UserInfo. */ -class UserInfo extends \Google\Protobuf\Internal\Message +class UserInfo extends Message { /** * Generated from protobuf field uint64 id = 1;. @@ -41,14 +43,14 @@ class UserInfo extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var int|string $id - * @var string $name - * @var int $gender - * } + * @var int|string $id + * @var string $name + * @var int $gender + * } */ public function __construct($data = null) { - \GPBMetadata\User::initOnce(); + User::initOnce(); parent::__construct($data); } diff --git a/src/grpc-server/src/ConfigProvider.php b/src/grpc-server/src/ConfigProvider.php index 404dbe2c9..5e5f144e3 100644 --- a/src/grpc-server/src/ConfigProvider.php +++ b/src/grpc-server/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer; use Hyperf\GrpcServer\Listener\RegisterProtocolListener; diff --git a/src/grpc-server/src/CoreMiddleware.php b/src/grpc-server/src/CoreMiddleware.php index 96163a87d..0b9909b70 100644 --- a/src/grpc-server/src/CoreMiddleware.php +++ b/src/grpc-server/src/CoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer; use Closure; diff --git a/src/grpc-server/src/Exception/GrpcException.php b/src/grpc-server/src/Exception/GrpcException.php index acd7c13dd..1950ffb95 100644 --- a/src/grpc-server/src/Exception/GrpcException.php +++ b/src/grpc-server/src/Exception/GrpcException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer\Exception; use Hyperf\Server\Exception\ServerException; diff --git a/src/grpc-server/src/Exception/GrpcStatusException.php b/src/grpc-server/src/Exception/GrpcStatusException.php index 142eedbea..ca69f34d8 100644 --- a/src/grpc-server/src/Exception/GrpcStatusException.php +++ b/src/grpc-server/src/Exception/GrpcStatusException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer\Exception; use Google\Protobuf\Any; diff --git a/src/grpc-server/src/Exception/Handler/GrpcExceptionHandler.php b/src/grpc-server/src/Exception/Handler/GrpcExceptionHandler.php index 02903ee87..6ad40bf39 100644 --- a/src/grpc-server/src/Exception/Handler/GrpcExceptionHandler.php +++ b/src/grpc-server/src/Exception/Handler/GrpcExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer\Exception\Handler; use Google\Rpc\Status; diff --git a/src/grpc-server/src/Listener/RegisterProtocolListener.php b/src/grpc-server/src/Listener/RegisterProtocolListener.php index 5ce7f4ad8..b0da14b36 100644 --- a/src/grpc-server/src/Listener/RegisterProtocolListener.php +++ b/src/grpc-server/src/Listener/RegisterProtocolListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/grpc-server/src/Listener/RegisterServiceListener.php b/src/grpc-server/src/Listener/RegisterServiceListener.php index 323fe88a5..056b47f36 100644 --- a/src/grpc-server/src/Listener/RegisterServiceListener.php +++ b/src/grpc-server/src/Listener/RegisterServiceListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/grpc-server/src/ResponseEmitter.php b/src/grpc-server/src/ResponseEmitter.php index 769718f6a..f362df138 100644 --- a/src/grpc-server/src/ResponseEmitter.php +++ b/src/grpc-server/src/ResponseEmitter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer; use Psr\Http\Message\ResponseInterface; diff --git a/src/grpc-server/src/Server.php b/src/grpc-server/src/Server.php index 6e8909d1a..dffd4ee90 100644 --- a/src/grpc-server/src/Server.php +++ b/src/grpc-server/src/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\GrpcServer; use Hyperf\Contract\ConfigInterface; diff --git a/src/grpc-server/tests/CoreMiddlewareTest.php b/src/grpc-server/tests/CoreMiddlewareTest.php index f28630946..6e7e6f147 100644 --- a/src/grpc-server/tests/CoreMiddlewareTest.php +++ b/src/grpc-server/tests/CoreMiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcServer; use Closure; diff --git a/src/grpc-server/tests/GrpcExceptionHandlerTest.php b/src/grpc-server/tests/GrpcExceptionHandlerTest.php index 1ed0cac17..eac9bfe45 100644 --- a/src/grpc-server/tests/GrpcExceptionHandlerTest.php +++ b/src/grpc-server/tests/GrpcExceptionHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcServer; use Google\Protobuf\Any; diff --git a/src/grpc-server/tests/Stub/GrpcExceptionHandlerStub.php b/src/grpc-server/tests/Stub/GrpcExceptionHandlerStub.php index c2261144d..e893c2e2a 100644 --- a/src/grpc-server/tests/Stub/GrpcExceptionHandlerStub.php +++ b/src/grpc-server/tests/Stub/GrpcExceptionHandlerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcServer\Stub; use Hyperf\GrpcServer\Exception\Handler\GrpcExceptionHandler; diff --git a/src/grpc-server/tests/Stub/GrpcStatusExceptionHandlerStub.php b/src/grpc-server/tests/Stub/GrpcStatusExceptionHandlerStub.php index 4bfa85428..556c31d86 100644 --- a/src/grpc-server/tests/Stub/GrpcStatusExceptionHandlerStub.php +++ b/src/grpc-server/tests/Stub/GrpcStatusExceptionHandlerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\GrpcServer\Stub; use Google\Rpc\Status; diff --git a/src/grpc/src/Parser.php b/src/grpc/src/Parser.php index 6ec88e9ad..d0a87da84 100644 --- a/src/grpc/src/Parser.php +++ b/src/grpc/src/Parser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Grpc; use Google\Protobuf\GPBEmpty; @@ -96,7 +97,7 @@ class Parser { if (is_array($deserialize)) { [$className, $deserializeFunc] = $deserialize; - /** @var \Google\Protobuf\Internal\Message $object */ + /** @var Message $object */ $object = new $className(); if ($deserializeFunc && method_exists($object, $deserializeFunc)) { $object->{$deserializeFunc}($unpacked); diff --git a/src/grpc/src/PathGenerator.php b/src/grpc/src/PathGenerator.php index b580f88e1..7b33e35ae 100644 --- a/src/grpc/src/PathGenerator.php +++ b/src/grpc/src/PathGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Grpc; use Hyperf\Rpc\Contract\PathGeneratorInterface; diff --git a/src/grpc/src/StatusCode.php b/src/grpc/src/StatusCode.php index 6f3b4ae15..2120f4e14 100644 --- a/src/grpc/src/StatusCode.php +++ b/src/grpc/src/StatusCode.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Grpc; /** diff --git a/src/guzzle/src/ClientFactory.php b/src/guzzle/src/ClientFactory.php index 1e1db2907..b8aad4dda 100644 --- a/src/guzzle/src/ClientFactory.php +++ b/src/guzzle/src/ClientFactory.php @@ -9,15 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; use GuzzleHttp\Client; use GuzzleHttp\HandlerStack; use Hyperf\Coroutine\Coroutine; +use Hyperf\Di\Container; use Psr\Container\ContainerInterface; +use Swoole\Runtime; /** - * @property \Hyperf\Di\Container $container + * @property Container $container */ class ClientFactory { @@ -40,7 +43,7 @@ class ClientFactory if ( $this->runInSwoole && Coroutine::inCoroutine() - && (\Swoole\Runtime::getHookFlags() & $this->nativeCurlHook) == 0 + && (Runtime::getHookFlags() & $this->nativeCurlHook) == 0 ) { $stack = HandlerStack::create(new CoroutineHandler()); } diff --git a/src/guzzle/src/ConfigProvider.php b/src/guzzle/src/ConfigProvider.php index 252e66147..85436fef0 100644 --- a/src/guzzle/src/ConfigProvider.php +++ b/src/guzzle/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; class ConfigProvider diff --git a/src/guzzle/src/CoroutineHandler.php b/src/guzzle/src/CoroutineHandler.php index 75867ea82..7be77e63e 100644 --- a/src/guzzle/src/CoroutineHandler.php +++ b/src/guzzle/src/CoroutineHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; use Exception; @@ -16,6 +17,7 @@ use GuzzleHttp; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Promise\Create; use GuzzleHttp\Promise\FulfilledPromise; +use GuzzleHttp\Promise\PromiseInterface; use GuzzleHttp\Psr7; use GuzzleHttp\Psr7\Uri; use GuzzleHttp\Psr7\Utils; @@ -42,7 +44,7 @@ class CoroutineHandler ]; /** - * @return \GuzzleHttp\Promise\PromiseInterface + * @return PromiseInterface */ public function __invoke(RequestInterface $request, array $options) { diff --git a/src/guzzle/src/HandlerStackFactory.php b/src/guzzle/src/HandlerStackFactory.php index 04e530693..df9b058ea 100644 --- a/src/guzzle/src/HandlerStackFactory.php +++ b/src/guzzle/src/HandlerStackFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; use GuzzleHttp\HandlerStack; diff --git a/src/guzzle/src/MiddlewareInterface.php b/src/guzzle/src/MiddlewareInterface.php index 69bb35c95..ccea45df3 100644 --- a/src/guzzle/src/MiddlewareInterface.php +++ b/src/guzzle/src/MiddlewareInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; interface MiddlewareInterface diff --git a/src/guzzle/src/PoolHandler.php b/src/guzzle/src/PoolHandler.php index f9f840dc6..ad0542196 100644 --- a/src/guzzle/src/PoolHandler.php +++ b/src/guzzle/src/PoolHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; use Exception; diff --git a/src/guzzle/src/RetryMiddleware.php b/src/guzzle/src/RetryMiddleware.php index db24ae357..b45423451 100644 --- a/src/guzzle/src/RetryMiddleware.php +++ b/src/guzzle/src/RetryMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle; use GuzzleHttp\Middleware; diff --git a/src/guzzle/src/RingPHP/CoroutineHandler.php b/src/guzzle/src/RingPHP/CoroutineHandler.php index f14c52083..f31e9efcd 100644 --- a/src/guzzle/src/RingPHP/CoroutineHandler.php +++ b/src/guzzle/src/RingPHP/CoroutineHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle\RingPHP; use Exception; diff --git a/src/guzzle/src/RingPHP/PoolHandler.php b/src/guzzle/src/RingPHP/PoolHandler.php index 27e1a0557..120494ab9 100644 --- a/src/guzzle/src/RingPHP/PoolHandler.php +++ b/src/guzzle/src/RingPHP/PoolHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle\RingPHP; use Exception; diff --git a/src/guzzle/src/RingPHP/ResourceGenerator.php b/src/guzzle/src/RingPHP/ResourceGenerator.php index f2e0fa953..00c969cda 100644 --- a/src/guzzle/src/RingPHP/ResourceGenerator.php +++ b/src/guzzle/src/RingPHP/ResourceGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Guzzle\RingPHP; class ResourceGenerator diff --git a/src/guzzle/tests/Cases/CoroutineHandlerTest.php b/src/guzzle/tests/Cases/CoroutineHandlerTest.php index 6d503b966..763f11eac 100644 --- a/src/guzzle/tests/Cases/CoroutineHandlerTest.php +++ b/src/guzzle/tests/Cases/CoroutineHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Cases; use Exception; diff --git a/src/guzzle/tests/Cases/HandlerStackFactoryTest.php b/src/guzzle/tests/Cases/HandlerStackFactoryTest.php index 22b17ada9..6b54fdd23 100644 --- a/src/guzzle/tests/Cases/HandlerStackFactoryTest.php +++ b/src/guzzle/tests/Cases/HandlerStackFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Cases; use GuzzleHttp\Client; diff --git a/src/guzzle/tests/Cases/PoolHandlerTest.php b/src/guzzle/tests/Cases/PoolHandlerTest.php index 19b6f8261..eb1f4c025 100644 --- a/src/guzzle/tests/Cases/PoolHandlerTest.php +++ b/src/guzzle/tests/Cases/PoolHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Cases; use GuzzleHttp\Client; diff --git a/src/guzzle/tests/Cases/RingPHPCoroutineHandlerTest.php b/src/guzzle/tests/Cases/RingPHPCoroutineHandlerTest.php index a5d8efb83..a2f59c939 100644 --- a/src/guzzle/tests/Cases/RingPHPCoroutineHandlerTest.php +++ b/src/guzzle/tests/Cases/RingPHPCoroutineHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyerfTest\Guzzle\Cases; use Hyperf\Guzzle\RingPHP\CoroutineHandler; diff --git a/src/guzzle/tests/Stub/CoroutineHandlerStub.php b/src/guzzle/tests/Stub/CoroutineHandlerStub.php index 2d9484b84..7efa748f2 100644 --- a/src/guzzle/tests/Stub/CoroutineHandlerStub.php +++ b/src/guzzle/tests/Stub/CoroutineHandlerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Stub; use Hyperf\Engine\Http\Client; diff --git a/src/guzzle/tests/Stub/HandlerStackFactoryStub.php b/src/guzzle/tests/Stub/HandlerStackFactoryStub.php index d8a8000fc..b1a3d07a0 100644 --- a/src/guzzle/tests/Stub/HandlerStackFactoryStub.php +++ b/src/guzzle/tests/Stub/HandlerStackFactoryStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Stub; use Hyperf\Guzzle\HandlerStackFactory; diff --git a/src/guzzle/tests/Stub/PoolHandlerStub.php b/src/guzzle/tests/Stub/PoolHandlerStub.php index 7e9c69589..c414981f3 100644 --- a/src/guzzle/tests/Stub/PoolHandlerStub.php +++ b/src/guzzle/tests/Stub/PoolHandlerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Stub; use Hyperf\Engine\Http\Client; diff --git a/src/guzzle/tests/Stub/RingPHPCoroutineHanderStub.php b/src/guzzle/tests/Stub/RingPHPCoroutineHanderStub.php index 239026409..356cd707c 100644 --- a/src/guzzle/tests/Stub/RingPHPCoroutineHanderStub.php +++ b/src/guzzle/tests/Stub/RingPHPCoroutineHanderStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Guzzle\Stub; use Hyperf\Engine\Http\Client; diff --git a/src/helper/src/Functions.php b/src/helper/src/Functions.php index 2a853adce..bf17d10d1 100644 --- a/src/helper/src/Functions.php +++ b/src/helper/src/Functions.php @@ -38,7 +38,7 @@ if (! function_exists('retry')) { * * @param float|int $times * @param int $sleep millisecond - * @throws \Throwable + * @throws Throwable */ function retry($times, callable $callback, int $sleep = 0) { diff --git a/src/http-message/src/Base/MessageTrait.php b/src/http-message/src/Base/MessageTrait.php index de931bbed..cd0a881aa 100755 --- a/src/http-message/src/Base/MessageTrait.php +++ b/src/http-message/src/Base/MessageTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Base; use Hyperf\HttpMessage\Stream\SwooleStream; diff --git a/src/http-message/src/Base/Request.php b/src/http-message/src/Base/Request.php index e429838d0..0491a6c51 100755 --- a/src/http-message/src/Base/Request.php +++ b/src/http-message/src/Base/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Base; use Hyperf\HttpMessage\Stream\SwooleStream; @@ -221,7 +222,7 @@ class Request implements RequestInterface, RequestPlusInterface, Stringable return $this; } - public function setUri(UriInterface|string $uri, ?bool $preserveHost = null): static + public function setUri(string|UriInterface $uri, ?bool $preserveHost = null): static { $this->uri = $uri; diff --git a/src/http-message/src/Base/Response.php b/src/http-message/src/Base/Response.php index 870b3e410..7b7b79dac 100755 --- a/src/http-message/src/Base/Response.php +++ b/src/http-message/src/Base/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Base; use InvalidArgumentException; diff --git a/src/http-message/src/ConfigProvider.php b/src/http-message/src/ConfigProvider.php index faef76482..2e98497ec 100644 --- a/src/http-message/src/ConfigProvider.php +++ b/src/http-message/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage; use Hyperf\HttpMessage\Server\Request\Parser; diff --git a/src/http-message/src/Cookie/Cookie.php b/src/http-message/src/Cookie/Cookie.php index bab5db5c1..49f9082ad 100755 --- a/src/http-message/src/Cookie/Cookie.php +++ b/src/http-message/src/Cookie/Cookie.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Cookie; use DateTimeInterface; diff --git a/src/http-message/src/Cookie/CookieJar.php b/src/http-message/src/Cookie/CookieJar.php index 80b46d7f4..0ed64c630 100755 --- a/src/http-message/src/Cookie/CookieJar.php +++ b/src/http-message/src/Cookie/CookieJar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Cookie; use ArrayIterator; diff --git a/src/http-message/src/Cookie/CookieJarInterface.php b/src/http-message/src/Cookie/CookieJarInterface.php index ab3c31af0..b8d79f5bf 100755 --- a/src/http-message/src/Cookie/CookieJarInterface.php +++ b/src/http-message/src/Cookie/CookieJarInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Cookie; use Countable; diff --git a/src/http-message/src/Cookie/FileCookieJar.php b/src/http-message/src/Cookie/FileCookieJar.php index eddfe2420..a34dbefb9 100755 --- a/src/http-message/src/Cookie/FileCookieJar.php +++ b/src/http-message/src/Cookie/FileCookieJar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Cookie; use Hyperf\Codec\Json; diff --git a/src/http-message/src/Cookie/SessionCookieJar.php b/src/http-message/src/Cookie/SessionCookieJar.php index 977345190..e25d4fc6c 100755 --- a/src/http-message/src/Cookie/SessionCookieJar.php +++ b/src/http-message/src/Cookie/SessionCookieJar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Cookie; use RuntimeException; diff --git a/src/http-message/src/Cookie/SetCookie.php b/src/http-message/src/Cookie/SetCookie.php index 7b89e0c8b..c19c0276a 100755 --- a/src/http-message/src/Cookie/SetCookie.php +++ b/src/http-message/src/Cookie/SetCookie.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Cookie; use Hyperf\Contract\Arrayable; @@ -160,8 +161,6 @@ class SetCookie implements Stringable, Arrayable /** * Set the domain of the cookie. - * - * @param string $domain */ public function setDomain(?string $domain) { diff --git a/src/http-message/src/Exception/BadRequestHttpException.php b/src/http-message/src/Exception/BadRequestHttpException.php index bd2c7e35a..e6fea88aa 100644 --- a/src/http-message/src/Exception/BadRequestHttpException.php +++ b/src/http-message/src/Exception/BadRequestHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/http-message/src/Exception/ForbiddenHttpException.php b/src/http-message/src/Exception/ForbiddenHttpException.php index a72f31d03..cf86dcf8c 100644 --- a/src/http-message/src/Exception/ForbiddenHttpException.php +++ b/src/http-message/src/Exception/ForbiddenHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/HttpException.php b/src/http-message/src/Exception/HttpException.php index d50736d79..bad8c3188 100644 --- a/src/http-message/src/Exception/HttpException.php +++ b/src/http-message/src/Exception/HttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Hyperf\HttpMessage\Server\Response; diff --git a/src/http-message/src/Exception/MethodNotAllowedHttpException.php b/src/http-message/src/Exception/MethodNotAllowedHttpException.php index 98dd7f311..5d58f79d0 100644 --- a/src/http-message/src/Exception/MethodNotAllowedHttpException.php +++ b/src/http-message/src/Exception/MethodNotAllowedHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/NotAcceptableHttpException.php b/src/http-message/src/Exception/NotAcceptableHttpException.php index 8d558e33e..77211231d 100644 --- a/src/http-message/src/Exception/NotAcceptableHttpException.php +++ b/src/http-message/src/Exception/NotAcceptableHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/NotFoundHttpException.php b/src/http-message/src/Exception/NotFoundHttpException.php index 878fc3a57..b90ea5d05 100644 --- a/src/http-message/src/Exception/NotFoundHttpException.php +++ b/src/http-message/src/Exception/NotFoundHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/RangeNotSatisfiableHttpException.php b/src/http-message/src/Exception/RangeNotSatisfiableHttpException.php index f2d8dca44..ef69a9878 100644 --- a/src/http-message/src/Exception/RangeNotSatisfiableHttpException.php +++ b/src/http-message/src/Exception/RangeNotSatisfiableHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/ServerErrorHttpException.php b/src/http-message/src/Exception/ServerErrorHttpException.php index c064bf9c2..ac3be0878 100644 --- a/src/http-message/src/Exception/ServerErrorHttpException.php +++ b/src/http-message/src/Exception/ServerErrorHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/UnauthorizedHttpException.php b/src/http-message/src/Exception/UnauthorizedHttpException.php index d8f214a43..5bfd9d6d7 100644 --- a/src/http-message/src/Exception/UnauthorizedHttpException.php +++ b/src/http-message/src/Exception/UnauthorizedHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/UnprocessableEntityHttpException.php b/src/http-message/src/Exception/UnprocessableEntityHttpException.php index 24d23a2c3..f12510758 100644 --- a/src/http-message/src/Exception/UnprocessableEntityHttpException.php +++ b/src/http-message/src/Exception/UnprocessableEntityHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Exception/UnsupportedMediaTypeHttpException.php b/src/http-message/src/Exception/UnsupportedMediaTypeHttpException.php index 28335042c..0faeaff6d 100644 --- a/src/http-message/src/Exception/UnsupportedMediaTypeHttpException.php +++ b/src/http-message/src/Exception/UnsupportedMediaTypeHttpException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Exception; use Throwable; diff --git a/src/http-message/src/Server/Chunk/Chunkable.php b/src/http-message/src/Server/Chunk/Chunkable.php index 51333b9eb..74f953cfe 100644 --- a/src/http-message/src/Server/Chunk/Chunkable.php +++ b/src/http-message/src/Server/Chunk/Chunkable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server\Chunk; interface Chunkable diff --git a/src/http-message/src/Server/Chunk/HasChunk.php b/src/http-message/src/Server/Chunk/HasChunk.php index fe46910bf..e4a721f27 100644 --- a/src/http-message/src/Server/Chunk/HasChunk.php +++ b/src/http-message/src/Server/Chunk/HasChunk.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server\Chunk; use Hyperf\Engine\Contract\Http\Writable; diff --git a/src/http-message/src/Server/Request.php b/src/http-message/src/Server/Request.php index 7da6ca2c3..2b5b91892 100644 --- a/src/http-message/src/Server/Request.php +++ b/src/http-message/src/Server/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server; use Hyperf\Context\ApplicationContext; @@ -53,7 +54,7 @@ class Request extends \Hyperf\HttpMessage\Base\Request implements ServerRequestI /** * Load a swoole request, and transfer to a psr-7 request object. * - * @return \Hyperf\HttpMessage\Server\Request + * @return Request */ public static function loadFromSwooleRequest(Swoole\Http\Request $swooleRequest) { @@ -221,7 +222,7 @@ class Request extends \Hyperf\HttpMessage\Base\Request implements ServerRequestI * @return null|array|object The deserialized body parameters, if any. * These will typically be an array or object. */ - public function getParsedBody(): array|object|null + public function getParsedBody(): null|array|object { return $this->parsedBody; } @@ -434,7 +435,7 @@ class Request extends \Hyperf\HttpMessage\Base\Request implements ServerRequestI return $this; } - public function setParsedBody(object|array|null $data): static + public function setParsedBody(null|array|object $data): static { $this->parsedBody = $data; return $this; diff --git a/src/http-message/src/Server/Request/JsonParser.php b/src/http-message/src/Server/Request/JsonParser.php index 569e2bc4b..2aedbea29 100644 --- a/src/http-message/src/Server/Request/JsonParser.php +++ b/src/http-message/src/Server/Request/JsonParser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server\Request; use Hyperf\Codec\Json; diff --git a/src/http-message/src/Server/Request/Parser.php b/src/http-message/src/Server/Request/Parser.php index efb8c3af4..1bdb91324 100644 --- a/src/http-message/src/Server/Request/Parser.php +++ b/src/http-message/src/Server/Request/Parser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server\Request; use Hyperf\HttpMessage\Server\RequestParserInterface; diff --git a/src/http-message/src/Server/Request/XmlParser.php b/src/http-message/src/Server/Request/XmlParser.php index c0d3992ef..8a1b60bd9 100644 --- a/src/http-message/src/Server/Request/XmlParser.php +++ b/src/http-message/src/Server/Request/XmlParser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server\Request; use Hyperf\Codec\Xml; diff --git a/src/http-message/src/Server/RequestParserInterface.php b/src/http-message/src/Server/RequestParserInterface.php index 9ec43df39..3d0faf4ff 100644 --- a/src/http-message/src/Server/RequestParserInterface.php +++ b/src/http-message/src/Server/RequestParserInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server; interface RequestParserInterface diff --git a/src/http-message/src/Server/Response.php b/src/http-message/src/Server/Response.php index 6324ba29b..e198527e3 100755 --- a/src/http-message/src/Server/Response.php +++ b/src/http-message/src/Server/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server; use Hyperf\Engine\Contract\Http\Writable; diff --git a/src/http-message/src/Server/ResponsePlusProxy.php b/src/http-message/src/Server/ResponsePlusProxy.php index 9c41f6f6b..7dbccd30d 100644 --- a/src/http-message/src/Server/ResponsePlusProxy.php +++ b/src/http-message/src/Server/ResponsePlusProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server; use Hyperf\Coroutine\Exception\InvalidArgumentException; diff --git a/src/http-message/src/Server/ResponseProxyTrait.php b/src/http-message/src/Server/ResponseProxyTrait.php index 55be0ac56..d4a594f8d 100644 --- a/src/http-message/src/Server/ResponseProxyTrait.php +++ b/src/http-message/src/Server/ResponseProxyTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Server; use Hyperf\HttpMessage\Cookie\Cookie; diff --git a/src/http-message/src/Stream/FileInterface.php b/src/http-message/src/Stream/FileInterface.php index cf738c211..777a4c9c8 100644 --- a/src/http-message/src/Stream/FileInterface.php +++ b/src/http-message/src/Stream/FileInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Stream; interface FileInterface diff --git a/src/http-message/src/Stream/StandardStream.php b/src/http-message/src/Stream/StandardStream.php index 5c0894e92..16226e4ad 100644 --- a/src/http-message/src/Stream/StandardStream.php +++ b/src/http-message/src/Stream/StandardStream.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Stream; use Exception; diff --git a/src/http-message/src/Stream/SwooleFileStream.php b/src/http-message/src/Stream/SwooleFileStream.php index 02cc0eea5..1f51a6693 100644 --- a/src/http-message/src/Stream/SwooleFileStream.php +++ b/src/http-message/src/Stream/SwooleFileStream.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Stream; use BadMethodCallException; @@ -17,6 +18,7 @@ use Psr\Http\Message\StreamInterface; use RuntimeException; use SplFileInfo; use Stringable; +use Throwable; class SwooleFileStream implements StreamInterface, FileInterface, Stringable { @@ -55,7 +57,7 @@ class SwooleFileStream implements StreamInterface, FileInterface, Stringable { try { return $this->getContents(); - } catch (\Throwable) { + } catch (Throwable) { return ''; } } diff --git a/src/http-message/src/Stream/SwooleStream.php b/src/http-message/src/Stream/SwooleStream.php index 09064557e..059dffb84 100755 --- a/src/http-message/src/Stream/SwooleStream.php +++ b/src/http-message/src/Stream/SwooleStream.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Stream; use BadMethodCallException; use Psr\Http\Message\StreamInterface; use RuntimeException; use Stringable; +use Throwable; class SwooleStream implements StreamInterface, Stringable { @@ -45,7 +47,7 @@ class SwooleStream implements StreamInterface, Stringable { try { return $this->getContents(); - } catch (\Throwable) { + } catch (Throwable) { return ''; } } diff --git a/src/http-message/src/Upload/UploadedFile.php b/src/http-message/src/Upload/UploadedFile.php index 2be7e6f3b..e7743e144 100755 --- a/src/http-message/src/Upload/UploadedFile.php +++ b/src/http-message/src/Upload/UploadedFile.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Upload; use Hyperf\HttpMessage\Stream\StandardStream; diff --git a/src/http-message/src/Uri/Uri.php b/src/http-message/src/Uri/Uri.php index a7485c6d8..528dfe69a 100755 --- a/src/http-message/src/Uri/Uri.php +++ b/src/http-message/src/Uri/Uri.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpMessage\Uri; use InvalidArgumentException; diff --git a/src/http-message/tests/MessageTraitTest.php b/src/http-message/tests/MessageTraitTest.php index 6f4eadd4a..b048168b5 100644 --- a/src/http-message/tests/MessageTraitTest.php +++ b/src/http-message/tests/MessageTraitTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage; use Hyperf\HttpMessage\Base\Request; diff --git a/src/http-message/tests/RequestParserTest.php b/src/http-message/tests/RequestParserTest.php index c8c3a62a0..89e8767bc 100644 --- a/src/http-message/tests/RequestParserTest.php +++ b/src/http-message/tests/RequestParserTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage; use Hyperf\HttpMessage\Exception\BadRequestHttpException; diff --git a/src/http-message/tests/ResponseProxyTest.php b/src/http-message/tests/ResponseProxyTest.php index 3551dad9f..60c5c8cae 100644 --- a/src/http-message/tests/ResponseProxyTest.php +++ b/src/http-message/tests/ResponseProxyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage; use Hyperf\HttpMessage\Server\Response; diff --git a/src/http-message/tests/ResponseTest.php b/src/http-message/tests/ResponseTest.php index 7dee7ebc4..57ff3b578 100644 --- a/src/http-message/tests/ResponseTest.php +++ b/src/http-message/tests/ResponseTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage; use Hyperf\Engine\Http\WritableConnection; diff --git a/src/http-message/tests/ServerRequestTest.php b/src/http-message/tests/ServerRequestTest.php index e55a276ae..000284efd 100644 --- a/src/http-message/tests/ServerRequestTest.php +++ b/src/http-message/tests/ServerRequestTest.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage; use Hyperf\Codec\Json; use Hyperf\Codec\Xml; use Hyperf\Context\ApplicationContext; +use Hyperf\HttpMessage\Exception\BadRequestHttpException; use Hyperf\HttpMessage\Server\Request; use Hyperf\HttpMessage\Server\Request\JsonParser; use Hyperf\HttpMessage\Server\Request\Parser; @@ -25,6 +27,8 @@ use HyperfTest\HttpMessage\Stub\Server\RequestStub; use InvalidArgumentException; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; @@ -75,7 +79,7 @@ class ServerRequestTest extends TestCase public function testNormalizeParsedBodyException() { - $this->expectException(\Hyperf\HttpMessage\Exception\BadRequestHttpException::class); + $this->expectException(BadRequestHttpException::class); $this->getContainer(); @@ -88,7 +92,7 @@ class ServerRequestTest extends TestCase public function testXmlNormalizeParsedBodyException() { - $this->expectException(\Hyperf\HttpMessage\Exception\BadRequestHttpException::class); + $this->expectException(BadRequestHttpException::class); $this->getContainer(); @@ -163,7 +167,7 @@ class ServerRequestTest extends TestCase $this->assertSame(null, $uri->getPort()); } - #[\PHPUnit\Framework\Attributes\Group('ParseHost')] + #[Group('ParseHost')] public function testParseHost() { $hostStrIPv4 = '192.168.119.100:9501'; @@ -189,7 +193,7 @@ class ServerRequestTest extends TestCase * @param mixed $host * @param mixed $port */ - #[\PHPUnit\Framework\Attributes\DataProvider('getIPv6Examples')] + #[DataProvider('getIPv6Examples')] public function testGetUriFromGlobalsForIPv6Host($originHost, $host, $port) { $swooleRequest = Mockery::mock(SwooleRequest::class); diff --git a/src/http-message/tests/Stub/ParserStub.php b/src/http-message/tests/Stub/ParserStub.php index 37d7f9d34..528368718 100644 --- a/src/http-message/tests/Stub/ParserStub.php +++ b/src/http-message/tests/Stub/ParserStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage\Stub; use Hyperf\HttpMessage\Server\RequestParserInterface; diff --git a/src/http-message/tests/Stub/Server/RequestStub.php b/src/http-message/tests/Stub/Server/RequestStub.php index 2d3f350ed..7ea1a7d1d 100644 --- a/src/http-message/tests/Stub/Server/RequestStub.php +++ b/src/http-message/tests/Stub/Server/RequestStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage\Stub\Server; use Hyperf\HttpMessage\Server\Request; diff --git a/src/http-message/tests/Stub/Server/ResponseStub.php b/src/http-message/tests/Stub/Server/ResponseStub.php index e6de1584f..6e80bf38a 100644 --- a/src/http-message/tests/Stub/Server/ResponseStub.php +++ b/src/http-message/tests/Stub/Server/ResponseStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage\Stub\Server; use Hyperf\HttpMessage\Server\ResponseProxyTrait; diff --git a/src/http-message/tests/SwooleStreamTest.php b/src/http-message/tests/SwooleStreamTest.php index 2002c173b..0b0cca368 100644 --- a/src/http-message/tests/SwooleStreamTest.php +++ b/src/http-message/tests/SwooleStreamTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage; use Hyperf\HttpMessage\Server\Response; diff --git a/src/http-message/tests/Upload/UploadedFileTest.php b/src/http-message/tests/Upload/UploadedFileTest.php index 3730902e0..c7da97a10 100644 --- a/src/http-message/tests/Upload/UploadedFileTest.php +++ b/src/http-message/tests/Upload/UploadedFileTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpMessage\Upload; use Hyperf\HttpMessage\Upload\UploadedFile; diff --git a/src/http-server/src/Annotation/AutoController.php b/src/http-server/src/Annotation/AutoController.php index 29392c589..c5c998717 100644 --- a/src/http-server/src/Annotation/AutoController.php +++ b/src/http-server/src/Annotation/AutoController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/Controller.php b/src/http-server/src/Annotation/Controller.php index d9dfc797c..3e50a165f 100644 --- a/src/http-server/src/Annotation/Controller.php +++ b/src/http-server/src/Annotation/Controller.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/DeleteMapping.php b/src/http-server/src/Annotation/DeleteMapping.php index 11626a62e..49dcd2791 100644 --- a/src/http-server/src/Annotation/DeleteMapping.php +++ b/src/http-server/src/Annotation/DeleteMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/GetMapping.php b/src/http-server/src/Annotation/GetMapping.php index 9d478a17f..35a4f4b3a 100644 --- a/src/http-server/src/Annotation/GetMapping.php +++ b/src/http-server/src/Annotation/GetMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/Mapping.php b/src/http-server/src/Annotation/Mapping.php index a5c01c65a..0aa693fce 100644 --- a/src/http-server/src/Annotation/Mapping.php +++ b/src/http-server/src/Annotation/Mapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Hyperf\Di\Annotation\AbstractAnnotation; diff --git a/src/http-server/src/Annotation/Middleware.php b/src/http-server/src/Annotation/Middleware.php index eb6358268..d9675e30a 100644 --- a/src/http-server/src/Annotation/Middleware.php +++ b/src/http-server/src/Annotation/Middleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/Middlewares.php b/src/http-server/src/Annotation/Middlewares.php index e28574d82..95dd22967 100644 --- a/src/http-server/src/Annotation/Middlewares.php +++ b/src/http-server/src/Annotation/Middlewares.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/PatchMapping.php b/src/http-server/src/Annotation/PatchMapping.php index f986e0d72..6a175e7de 100644 --- a/src/http-server/src/Annotation/PatchMapping.php +++ b/src/http-server/src/Annotation/PatchMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/PostMapping.php b/src/http-server/src/Annotation/PostMapping.php index a9a9fa53d..34677edba 100644 --- a/src/http-server/src/Annotation/PostMapping.php +++ b/src/http-server/src/Annotation/PostMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/PutMapping.php b/src/http-server/src/Annotation/PutMapping.php index 6b8c44127..3237d3bb1 100644 --- a/src/http-server/src/Annotation/PutMapping.php +++ b/src/http-server/src/Annotation/PutMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/Annotation/RequestMapping.php b/src/http-server/src/Annotation/RequestMapping.php index 64d6a9d3b..f0622a742 100644 --- a/src/http-server/src/Annotation/RequestMapping.php +++ b/src/http-server/src/Annotation/RequestMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/http-server/src/ConfigProvider.php b/src/http-server/src/ConfigProvider.php index 622692440..bb9ca5639 100644 --- a/src/http-server/src/ConfigProvider.php +++ b/src/http-server/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use Hyperf\HttpServer\Contract\RequestInterface; diff --git a/src/http-server/src/Contract/CoreMiddlewareInterface.php b/src/http-server/src/Contract/CoreMiddlewareInterface.php index 65a8c286e..04ae98695 100644 --- a/src/http-server/src/Contract/CoreMiddlewareInterface.php +++ b/src/http-server/src/Contract/CoreMiddlewareInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Contract; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/http-server/src/Contract/RequestInterface.php b/src/http-server/src/Contract/RequestInterface.php index 5d14c33fd..9c955d832 100644 --- a/src/http-server/src/Contract/RequestInterface.php +++ b/src/http-server/src/Contract/RequestInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Contract; use Hyperf\HttpMessage\Upload\UploadedFile; diff --git a/src/http-server/src/Contract/ResponseInterface.php b/src/http-server/src/Contract/ResponseInterface.php index 8be2c5644..0bb15228c 100644 --- a/src/http-server/src/Contract/ResponseInterface.php +++ b/src/http-server/src/Contract/ResponseInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Contract; use Hyperf\Contract\Arrayable; diff --git a/src/http-server/src/CoreMiddleware.php b/src/http-server/src/CoreMiddleware.php index 1a01832bc..e8fccd271 100644 --- a/src/http-server/src/CoreMiddleware.php +++ b/src/http-server/src/CoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use Closure; @@ -165,7 +166,7 @@ class CoreMiddleware implements CoreMiddlewareInterface throw new MethodNotAllowedHttpException('Allow: ' . implode(', ', $methods)); } - protected function prepareHandler(string|array $handler): array + protected function prepareHandler(array|string $handler): array { if (is_string($handler)) { if (str_contains($handler, '@')) { diff --git a/src/http-server/src/Event/Event.php b/src/http-server/src/Event/Event.php index 0750ba260..39aabe4b0 100644 --- a/src/http-server/src/Event/Event.php +++ b/src/http-server/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Event; use Psr\Http\Message\ResponseInterface; diff --git a/src/http-server/src/Event/RequestHandled.php b/src/http-server/src/Event/RequestHandled.php index 2aaa973fa..04b1efdc0 100644 --- a/src/http-server/src/Event/RequestHandled.php +++ b/src/http-server/src/Event/RequestHandled.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Event; class RequestHandled extends Event diff --git a/src/http-server/src/Event/RequestReceived.php b/src/http-server/src/Event/RequestReceived.php index 8a43ad5bd..bbbf1acd4 100644 --- a/src/http-server/src/Event/RequestReceived.php +++ b/src/http-server/src/Event/RequestReceived.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Event; class RequestReceived extends Event diff --git a/src/http-server/src/Event/RequestTerminated.php b/src/http-server/src/Event/RequestTerminated.php index afbe1b508..bdfef4aab 100644 --- a/src/http-server/src/Event/RequestTerminated.php +++ b/src/http-server/src/Event/RequestTerminated.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Event; class RequestTerminated extends Event diff --git a/src/http-server/src/Exception/Handler/HttpExceptionHandler.php b/src/http-server/src/Exception/Handler/HttpExceptionHandler.php index 8f18c424c..f174e6912 100644 --- a/src/http-server/src/Exception/Handler/HttpExceptionHandler.php +++ b/src/http-server/src/Exception/Handler/HttpExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Exception\Handler; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/http-server/src/Exception/Http/EncodingException.php b/src/http-server/src/Exception/Http/EncodingException.php index bc9067fb7..4074722a0 100644 --- a/src/http-server/src/Exception/Http/EncodingException.php +++ b/src/http-server/src/Exception/Http/EncodingException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Exception\Http; use Hyperf\Server\Exception\ServerException; diff --git a/src/http-server/src/Exception/Http/FileException.php b/src/http-server/src/Exception/Http/FileException.php index 1c9280ddb..c5bc46f2a 100644 --- a/src/http-server/src/Exception/Http/FileException.php +++ b/src/http-server/src/Exception/Http/FileException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Exception\Http; use Hyperf\Server\Exception\ServerException; diff --git a/src/http-server/src/Exception/Http/InvalidResponseException.php b/src/http-server/src/Exception/Http/InvalidResponseException.php index a268f66ce..d190b0f46 100644 --- a/src/http-server/src/Exception/Http/InvalidResponseException.php +++ b/src/http-server/src/Exception/Http/InvalidResponseException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Exception\Http; use Hyperf\Server\Exception\ServerException; diff --git a/src/http-server/src/MiddlewareManager.php b/src/http-server/src/MiddlewareManager.php index 190ef4548..e014a1ee1 100644 --- a/src/http-server/src/MiddlewareManager.php +++ b/src/http-server/src/MiddlewareManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use Hyperf\Stdlib\SplPriorityQueue; diff --git a/src/http-server/src/PriorityMiddleware.php b/src/http-server/src/PriorityMiddleware.php index f280dc564..7e23ee410 100644 --- a/src/http-server/src/PriorityMiddleware.php +++ b/src/http-server/src/PriorityMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; class PriorityMiddleware diff --git a/src/http-server/src/Request.php b/src/http-server/src/Request.php index 534aa4a6e..18916931e 100644 --- a/src/http-server/src/Request.php +++ b/src/http-server/src/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use Hyperf\Collection\Arr; diff --git a/src/http-server/src/Response.php b/src/http-server/src/Response.php index f9b727e45..74b2c5f16 100644 --- a/src/http-server/src/Response.php +++ b/src/http-server/src/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use BadMethodCallException; diff --git a/src/http-server/src/ResponseEmitter.php b/src/http-server/src/ResponseEmitter.php index f8b3dfcb4..54353f776 100644 --- a/src/http-server/src/ResponseEmitter.php +++ b/src/http-server/src/ResponseEmitter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use Hyperf\Contract\ResponseEmitterInterface; diff --git a/src/http-server/src/Router/Dispatched.php b/src/http-server/src/Router/Dispatched.php index 9faf854c2..18456c030 100644 --- a/src/http-server/src/Router/Dispatched.php +++ b/src/http-server/src/Router/Dispatched.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Router; use FastRoute\Dispatcher; diff --git a/src/http-server/src/Router/DispatcherFactory.php b/src/http-server/src/Router/DispatcherFactory.php index 5f7e67d71..fcea07674 100644 --- a/src/http-server/src/Router/DispatcherFactory.php +++ b/src/http-server/src/Router/DispatcherFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Router; use FastRoute\DataGenerator\GroupCountBased as DataGenerator; diff --git a/src/http-server/src/Router/Handler.php b/src/http-server/src/Router/Handler.php index 0b97ecf36..a2d906693 100644 --- a/src/http-server/src/Router/Handler.php +++ b/src/http-server/src/Router/Handler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Router; class Handler diff --git a/src/http-server/src/Router/RouteCollector.php b/src/http-server/src/Router/RouteCollector.php index bf687331f..f35041fae 100644 --- a/src/http-server/src/Router/RouteCollector.php +++ b/src/http-server/src/Router/RouteCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Router; use FastRoute\DataGenerator; diff --git a/src/http-server/src/Router/Router.php b/src/http-server/src/Router/Router.php index c4d974695..18ad70dfd 100644 --- a/src/http-server/src/Router/Router.php +++ b/src/http-server/src/Router/Router.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Router; /** diff --git a/src/http-server/src/Server.php b/src/http-server/src/Server.php index 8725f2d7c..748fa1805 100644 --- a/src/http-server/src/Server.php +++ b/src/http-server/src/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer; use FastRoute\Dispatcher; diff --git a/src/http-server/tests/CoreMiddlewareTest.php b/src/http-server/tests/CoreMiddlewareTest.php index 6408786b2..9cea9286b 100644 --- a/src/http-server/tests/CoreMiddlewareTest.php +++ b/src/http-server/tests/CoreMiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer; use FastRoute\Dispatcher; diff --git a/src/http-server/tests/MappingAnnotationTest.php b/src/http-server/tests/MappingAnnotationTest.php index 2ce076f08..4921af258 100644 --- a/src/http-server/tests/MappingAnnotationTest.php +++ b/src/http-server/tests/MappingAnnotationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer; use Hyperf\HttpServer\Annotation\RequestMapping; diff --git a/src/http-server/tests/RequestTest.php b/src/http-server/tests/RequestTest.php index 44ddd573a..350f1018d 100644 --- a/src/http-server/tests/RequestTest.php +++ b/src/http-server/tests/RequestTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer; use Hyperf\Context\Context; diff --git a/src/http-server/tests/ResponseTest.php b/src/http-server/tests/ResponseTest.php index 982c7d65c..23fe0e998 100644 --- a/src/http-server/tests/ResponseTest.php +++ b/src/http-server/tests/ResponseTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer; use Hyperf\Context\ApplicationContext; diff --git a/src/http-server/tests/Router/DispatcherFactoryTest.php b/src/http-server/tests/Router/DispatcherFactoryTest.php index 0b17708f4..eb9bd8e82 100644 --- a/src/http-server/tests/Router/DispatcherFactoryTest.php +++ b/src/http-server/tests/Router/DispatcherFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Router; use FastRoute\Dispatcher; diff --git a/src/http-server/tests/Router/MiddlewareTest.php b/src/http-server/tests/Router/MiddlewareTest.php index e2220e997..a46612e80 100644 --- a/src/http-server/tests/Router/MiddlewareTest.php +++ b/src/http-server/tests/Router/MiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Router; use Hyperf\Di\Annotation\MultipleAnnotation; diff --git a/src/http-server/tests/Router/RouteCollectorTest.php b/src/http-server/tests/Router/RouteCollectorTest.php index 2499cd4ad..5001dc65b 100644 --- a/src/http-server/tests/Router/RouteCollectorTest.php +++ b/src/http-server/tests/Router/RouteCollectorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Router; use FastRoute\DataGenerator\GroupCountBased as DataGenerator; diff --git a/src/http-server/tests/ServerTest.php b/src/http-server/tests/ServerTest.php index ed4504a89..52fc7cae7 100644 --- a/src/http-server/tests/ServerTest.php +++ b/src/http-server/tests/ServerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer; use Hyperf\Context\ApplicationContext; diff --git a/src/http-server/tests/Stub/BarMiddleware.php b/src/http-server/tests/Stub/BarMiddleware.php index 3f6ee25cb..8415045d3 100644 --- a/src/http-server/tests/Stub/BarMiddleware.php +++ b/src/http-server/tests/Stub/BarMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Psr\Http\Message\ResponseInterface; diff --git a/src/http-server/tests/Stub/CoreMiddlewareStub.php b/src/http-server/tests/Stub/CoreMiddlewareStub.php index 1c7777138..b7362ccbd 100644 --- a/src/http-server/tests/Stub/CoreMiddlewareStub.php +++ b/src/http-server/tests/Stub/CoreMiddlewareStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Hyperf\HttpMessage\Server\Response; diff --git a/src/http-server/tests/Stub/DemoController.php b/src/http-server/tests/Stub/DemoController.php index 731830b67..5099d17c2 100644 --- a/src/http-server/tests/Stub/DemoController.php +++ b/src/http-server/tests/Stub/DemoController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; class DemoController diff --git a/src/http-server/tests/Stub/DispatcherFactory.php b/src/http-server/tests/Stub/DispatcherFactory.php index 9bdf3d6d9..9b29ef753 100644 --- a/src/http-server/tests/Stub/DispatcherFactory.php +++ b/src/http-server/tests/Stub/DispatcherFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Hyperf\HttpServer\Annotation\AutoController; diff --git a/src/http-server/tests/Stub/FooController.php b/src/http-server/tests/Stub/FooController.php index 8eb1328d3..fd1a8cc72 100644 --- a/src/http-server/tests/Stub/FooController.php +++ b/src/http-server/tests/Stub/FooController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; class FooController diff --git a/src/http-server/tests/Stub/FooMiddleware.php b/src/http-server/tests/Stub/FooMiddleware.php index 9cbe3712d..45b6e2582 100644 --- a/src/http-server/tests/Stub/FooMiddleware.php +++ b/src/http-server/tests/Stub/FooMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Psr\Http\Message\ResponseInterface; diff --git a/src/http-server/tests/Stub/RouteCollectorStub.php b/src/http-server/tests/Stub/RouteCollectorStub.php index cee918477..a5a3d7163 100644 --- a/src/http-server/tests/Stub/RouteCollectorStub.php +++ b/src/http-server/tests/Stub/RouteCollectorStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Hyperf\HttpServer\Router\RouteCollector; diff --git a/src/http-server/tests/Stub/ServerStub.php b/src/http-server/tests/Stub/ServerStub.php index b4f037b9f..ff42647d7 100644 --- a/src/http-server/tests/Stub/ServerStub.php +++ b/src/http-server/tests/Stub/ServerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Hyperf\HttpServer\Server; diff --git a/src/http-server/tests/Stub/SetHeaderMiddleware.php b/src/http-server/tests/Stub/SetHeaderMiddleware.php index 4b2921ff6..c37fac8c2 100644 --- a/src/http-server/tests/Stub/SetHeaderMiddleware.php +++ b/src/http-server/tests/Stub/SetHeaderMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\HttpServer\Stub; use Psr\Http\Message\ResponseInterface; diff --git a/src/http2-client/src/Client.php b/src/http2-client/src/Client.php index 5507e85d3..260f814c6 100644 --- a/src/http2-client/src/Client.php +++ b/src/http2-client/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Http2Client; use Hyperf\Coordinator\Constants; diff --git a/src/http2-client/src/ConfigProvider.php b/src/http2-client/src/ConfigProvider.php index 27744b94b..d3df83a24 100644 --- a/src/http2-client/src/ConfigProvider.php +++ b/src/http2-client/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Http2Client; class ConfigProvider diff --git a/src/http2-client/src/Exception/ClientClosedException.php b/src/http2-client/src/Exception/ClientClosedException.php index 689d771f3..c7e094913 100644 --- a/src/http2-client/src/Exception/ClientClosedException.php +++ b/src/http2-client/src/Exception/ClientClosedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Http2Client\Exception; use Exception; diff --git a/src/http2-client/src/Exception/LoopBrokenException.php b/src/http2-client/src/Exception/LoopBrokenException.php index 5e1b9a0b2..6b8715204 100644 --- a/src/http2-client/src/Exception/LoopBrokenException.php +++ b/src/http2-client/src/Exception/LoopBrokenException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Http2Client\Exception; use Exception; diff --git a/src/http2-client/src/Exception/StreamLostException.php b/src/http2-client/src/Exception/StreamLostException.php index d0d64e5cc..f2d6e8206 100644 --- a/src/http2-client/src/Exception/StreamLostException.php +++ b/src/http2-client/src/Exception/StreamLostException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Http2Client\Exception; use RuntimeException; diff --git a/src/http2-client/src/Exception/TimeoutException.php b/src/http2-client/src/Exception/TimeoutException.php index f894d5cce..e4a666587 100644 --- a/src/http2-client/src/Exception/TimeoutException.php +++ b/src/http2-client/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Http2Client\Exception; use RuntimeException; diff --git a/src/http2-client/tests/ClientTest.php b/src/http2-client/tests/ClientTest.php index 97cd66970..24c556ec9 100644 --- a/src/http2-client/tests/ClientTest.php +++ b/src/http2-client/tests/ClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Http2Client; use Hyperf\Context\ApplicationContext; diff --git a/src/ide-helper/output/Hyperf/Amqp/Annotation/Consumer.php b/src/ide-helper/output/Hyperf/Amqp/Annotation/Consumer.php index 8f4f90502..9e14e557f 100644 --- a/src/ide-helper/output/Hyperf/Amqp/Annotation/Consumer.php +++ b/src/ide-helper/output/Hyperf/Amqp/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Amqp/Annotation/Producer.php b/src/ide-helper/output/Hyperf/Amqp/Annotation/Producer.php index 92ae42187..d558690f1 100644 --- a/src/ide-helper/output/Hyperf/Amqp/Annotation/Producer.php +++ b/src/ide-helper/output/Hyperf/Amqp/Annotation/Producer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Amqp\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/AsyncQueue/Annotation/AsyncQueueMessage.php b/src/ide-helper/output/Hyperf/AsyncQueue/Annotation/AsyncQueueMessage.php index 342e5e197..a1246cad4 100644 --- a/src/ide-helper/output/Hyperf/AsyncQueue/Annotation/AsyncQueueMessage.php +++ b/src/ide-helper/output/Hyperf/AsyncQueue/Annotation/AsyncQueueMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\AsyncQueue\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php b/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php index a8df53e10..e3396feb1 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/CacheEvict.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php b/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php index 30be1d9ee..fd5c4684b 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/CachePut.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php b/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php index 82afb1ef9..5c240caee 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/Cacheable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php b/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php index f52979e65..5e8a66cc2 100644 --- a/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php +++ b/src/ide-helper/output/Hyperf/Cache/Annotation/FailCache.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Cache\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php b/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php index 3aee417be..f0265ad72 100644 --- a/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php +++ b/src/ide-helper/output/Hyperf/CircuitBreaker/Annotation/CircuitBreaker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\CircuitBreaker\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Command/Annotation/Command.php b/src/ide-helper/output/Hyperf/Command/Annotation/Command.php index 428254576..e04edaff6 100644 --- a/src/ide-helper/output/Hyperf/Command/Annotation/Command.php +++ b/src/ide-helper/output/Hyperf/Command/Annotation/Command.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Command\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Config/Annotation/Value.php b/src/ide-helper/output/Hyperf/Config/Annotation/Value.php index 234e30103..957480bda 100644 --- a/src/ide-helper/output/Hyperf/Config/Annotation/Value.php +++ b/src/ide-helper/output/Hyperf/Config/Annotation/Value.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Config\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Constants/Annotation/Constants.php b/src/ide-helper/output/Hyperf/Constants/Annotation/Constants.php index 7d067593c..fabcc2376 100644 --- a/src/ide-helper/output/Hyperf/Constants/Annotation/Constants.php +++ b/src/ide-helper/output/Hyperf/Constants/Annotation/Constants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Constants\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Crontab/Annotation/Crontab.php b/src/ide-helper/output/Hyperf/Crontab/Annotation/Crontab.php index 8260006c9..918af4c0a 100644 --- a/src/ide-helper/output/Hyperf/Crontab/Annotation/Crontab.php +++ b/src/ide-helper/output/Hyperf/Crontab/Annotation/Crontab.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Crontab\Annotation; use Attribute; @@ -17,7 +18,7 @@ use Hyperf\Di\Annotation\AbstractAnnotation; #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)] class Crontab extends AbstractAnnotation { - public function __construct(?string $name = null, string $type = 'callback', ?string $rule = null, ?bool $singleton = null, ?string $mutexPool = null, ?int $mutexExpires = null, ?bool $onOneServer = null, array|string|null $callback = null, ?string $memo = null, array|string|bool $enable = true) + public function __construct(?string $name = null, string $type = 'callback', ?string $rule = null, ?bool $singleton = null, ?string $mutexPool = null, ?int $mutexExpires = null, ?bool $onOneServer = null, null|array|string $callback = null, ?string $memo = null, array|bool|string $enable = true) { } } diff --git a/src/ide-helper/output/Hyperf/DbConnection/Annotation/Transactional.php b/src/ide-helper/output/Hyperf/DbConnection/Annotation/Transactional.php index 33f7c5d0f..eb43c5508 100644 --- a/src/ide-helper/output/Hyperf/DbConnection/Annotation/Transactional.php +++ b/src/ide-helper/output/Hyperf/DbConnection/Annotation/Transactional.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\DbConnection\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Di/Annotation/Aspect.php b/src/ide-helper/output/Hyperf/Di/Annotation/Aspect.php index 55c472909..064067403 100644 --- a/src/ide-helper/output/Hyperf/Di/Annotation/Aspect.php +++ b/src/ide-helper/output/Hyperf/Di/Annotation/Aspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Di/Annotation/Debug.php b/src/ide-helper/output/Hyperf/Di/Annotation/Debug.php index aeedabace..8d81cc728 100644 --- a/src/ide-helper/output/Hyperf/Di/Annotation/Debug.php +++ b/src/ide-helper/output/Hyperf/Di/Annotation/Debug.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Di/Annotation/Inject.php b/src/ide-helper/output/Hyperf/Di/Annotation/Inject.php index 86c59a027..c44b0fa7a 100644 --- a/src/ide-helper/output/Hyperf/Di/Annotation/Inject.php +++ b/src/ide-helper/output/Hyperf/Di/Annotation/Inject.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Di\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Event/Annotation/Listener.php b/src/ide-helper/output/Hyperf/Event/Annotation/Listener.php index 628e00116..d7107c240 100644 --- a/src/ide-helper/output/Hyperf/Event/Annotation/Listener.php +++ b/src/ide-helper/output/Hyperf/Event/Annotation/Listener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Event\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/ExceptionHandler/Annotation/ExceptionHandler.php b/src/ide-helper/output/Hyperf/ExceptionHandler/Annotation/ExceptionHandler.php index 3f42750ed..cb567d232 100644 --- a/src/ide-helper/output/Hyperf/ExceptionHandler/Annotation/ExceptionHandler.php +++ b/src/ide-helper/output/Hyperf/ExceptionHandler/Annotation/ExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ExceptionHandler\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/AutoController.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/AutoController.php index 386843d53..ea9d2801e 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/AutoController.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/AutoController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/Controller.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/Controller.php index 301903f57..d0e153a46 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/Controller.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/Controller.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/DeleteMapping.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/DeleteMapping.php index 59f9806d5..0e30a6f3e 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/DeleteMapping.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/DeleteMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/GetMapping.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/GetMapping.php index 265e19eb6..a9128d99f 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/GetMapping.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/GetMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middleware.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middleware.php index 273f2693e..81543c64d 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middleware.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middlewares.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middlewares.php index ab52c4652..5c920dfe3 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middlewares.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/Middlewares.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/PatchMapping.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/PatchMapping.php index d37c524d9..8342cc3ed 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/PatchMapping.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/PatchMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/PostMapping.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/PostMapping.php index c8e9bdf17..0dd0ebe74 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/PostMapping.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/PostMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/PutMapping.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/PutMapping.php index aff3b6977..7f4ef14ee 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/PutMapping.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/PutMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/HttpServer/Annotation/RequestMapping.php b/src/ide-helper/output/Hyperf/HttpServer/Annotation/RequestMapping.php index 6462dad6e..8dba2963a 100644 --- a/src/ide-helper/output/Hyperf/HttpServer/Annotation/RequestMapping.php +++ b/src/ide-helper/output/Hyperf/HttpServer/Annotation/RequestMapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\HttpServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Kafka/Annotation/Consumer.php b/src/ide-helper/output/Hyperf/Kafka/Annotation/Consumer.php index 55960ad07..751664f4b 100644 --- a/src/ide-helper/output/Hyperf/Kafka/Annotation/Consumer.php +++ b/src/ide-helper/output/Hyperf/Kafka/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Metric/Annotation/Counter.php b/src/ide-helper/output/Hyperf/Metric/Annotation/Counter.php index bef28bff7..d1d075da6 100644 --- a/src/ide-helper/output/Hyperf/Metric/Annotation/Counter.php +++ b/src/ide-helper/output/Hyperf/Metric/Annotation/Counter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Metric/Annotation/Histogram.php b/src/ide-helper/output/Hyperf/Metric/Annotation/Histogram.php index bd41aa8f0..ec1c70663 100644 --- a/src/ide-helper/output/Hyperf/Metric/Annotation/Histogram.php +++ b/src/ide-helper/output/Hyperf/Metric/Annotation/Histogram.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/ModelListener/Annotation/ModelListener.php b/src/ide-helper/output/Hyperf/ModelListener/Annotation/ModelListener.php index cbeeefe61..58dcc0c72 100644 --- a/src/ide-helper/output/Hyperf/ModelListener/Annotation/ModelListener.php +++ b/src/ide-helper/output/Hyperf/ModelListener/Annotation/ModelListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Nats/Annotation/Consumer.php b/src/ide-helper/output/Hyperf/Nats/Annotation/Consumer.php index 2f79cf99e..e86fafd29 100644 --- a/src/ide-helper/output/Hyperf/Nats/Annotation/Consumer.php +++ b/src/ide-helper/output/Hyperf/Nats/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Nsq/Annotation/Consumer.php b/src/ide-helper/output/Hyperf/Nsq/Annotation/Consumer.php index fa6a5b831..41b2c92c8 100644 --- a/src/ide-helper/output/Hyperf/Nsq/Annotation/Consumer.php +++ b/src/ide-helper/output/Hyperf/Nsq/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Process/Annotation/Process.php b/src/ide-helper/output/Hyperf/Process/Annotation/Process.php index 975b21d4f..35bd9633f 100644 --- a/src/ide-helper/output/Hyperf/Process/Annotation/Process.php +++ b/src/ide-helper/output/Hyperf/Process/Annotation/Process.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/RateLimit/Annotation/RateLimit.php b/src/ide-helper/output/Hyperf/RateLimit/Annotation/RateLimit.php index 13874ab3b..004deae10 100644 --- a/src/ide-helper/output/Hyperf/RateLimit/Annotation/RateLimit.php +++ b/src/ide-helper/output/Hyperf/RateLimit/Annotation/RateLimit.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryFalsy.php b/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryFalsy.php index 289bb79e5..6371312d5 100644 --- a/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryFalsy.php +++ b/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryFalsy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryThrowable.php b/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryThrowable.php index 204572fae..dfd76beca 100644 --- a/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryThrowable.php +++ b/src/ide-helper/output/Hyperf/Retry/Annotation/BackoffRetryThrowable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Retry/Annotation/CircuitBreaker.php b/src/ide-helper/output/Hyperf/Retry/Annotation/CircuitBreaker.php index da0118d1d..b43fe0e26 100644 --- a/src/ide-helper/output/Hyperf/Retry/Annotation/CircuitBreaker.php +++ b/src/ide-helper/output/Hyperf/Retry/Annotation/CircuitBreaker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; @@ -17,7 +18,7 @@ use Hyperf\Retry\CircuitBreakerState; #[Attribute(Attribute::TARGET_METHOD)] class CircuitBreaker extends AbstractRetry { - public function __construct(array $policies = ['Hyperf\\Retry\\Policy\\FallbackRetryPolicy', 'Hyperf\\Retry\\Policy\\ClassifierRetryPolicy', 'Hyperf\\Retry\\Policy\\CircuitBreakerRetryPolicy', 'Hyperf\\Retry\\Policy\\MaxAttemptsRetryPolicy', 'Hyperf\\Retry\\Policy\\SleepRetryPolicy'], string $sleepStrategyClass = 'Hyperf\\Retry\\SleepStrategyInterface', int $maxAttempts = 10, CircuitBreakerState|array $circuitBreakerState = [10], int $base = 0, mixed $retryOnThrowablePredicate = '', mixed $retryOnResultPredicate = '', array $retryThrowables = ['Throwable'], array $ignoreThrowables = [], mixed $fallback = '') + public function __construct(array $policies = ['Hyperf\\Retry\\Policy\\FallbackRetryPolicy', 'Hyperf\\Retry\\Policy\\ClassifierRetryPolicy', 'Hyperf\\Retry\\Policy\\CircuitBreakerRetryPolicy', 'Hyperf\\Retry\\Policy\\MaxAttemptsRetryPolicy', 'Hyperf\\Retry\\Policy\\SleepRetryPolicy'], string $sleepStrategyClass = 'Hyperf\\Retry\\SleepStrategyInterface', int $maxAttempts = 10, array|CircuitBreakerState $circuitBreakerState = [10], int $base = 0, mixed $retryOnThrowablePredicate = '', mixed $retryOnResultPredicate = '', array $retryThrowables = ['Throwable'], array $ignoreThrowables = [], mixed $fallback = '') { } } diff --git a/src/ide-helper/output/Hyperf/Retry/Annotation/Retry.php b/src/ide-helper/output/Hyperf/Retry/Annotation/Retry.php index e9afd7057..d96d36296 100644 --- a/src/ide-helper/output/Hyperf/Retry/Annotation/Retry.php +++ b/src/ide-helper/output/Hyperf/Retry/Annotation/Retry.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; @@ -17,7 +18,7 @@ use Hyperf\Retry\RetryBudgetInterface; #[Attribute(Attribute::TARGET_METHOD)] class Retry extends AbstractRetry { - public function __construct(array $policies = ['Hyperf\\Retry\\Policy\\FallbackRetryPolicy', 'Hyperf\\Retry\\Policy\\ClassifierRetryPolicy', 'Hyperf\\Retry\\Policy\\BudgetRetryPolicy', 'Hyperf\\Retry\\Policy\\MaxAttemptsRetryPolicy', 'Hyperf\\Retry\\Policy\\SleepRetryPolicy'], string $sleepStrategyClass = 'Hyperf\\Retry\\SleepStrategyInterface', int $maxAttempts = 10, RetryBudgetInterface|array $retryBudget = [10, 1, 0.2], int $base = 0, mixed $retryOnThrowablePredicate = '', mixed $retryOnResultPredicate = '', array $retryThrowables = ['Throwable'], array $ignoreThrowables = [], mixed $fallback = '') + public function __construct(array $policies = ['Hyperf\\Retry\\Policy\\FallbackRetryPolicy', 'Hyperf\\Retry\\Policy\\ClassifierRetryPolicy', 'Hyperf\\Retry\\Policy\\BudgetRetryPolicy', 'Hyperf\\Retry\\Policy\\MaxAttemptsRetryPolicy', 'Hyperf\\Retry\\Policy\\SleepRetryPolicy'], string $sleepStrategyClass = 'Hyperf\\Retry\\SleepStrategyInterface', int $maxAttempts = 10, array|RetryBudgetInterface $retryBudget = [10, 1, 0.2], int $base = 0, mixed $retryOnThrowablePredicate = '', mixed $retryOnResultPredicate = '', array $retryThrowables = ['Throwable'], array $ignoreThrowables = [], mixed $fallback = '') { } } diff --git a/src/ide-helper/output/Hyperf/Retry/Annotation/RetryFalsy.php b/src/ide-helper/output/Hyperf/Retry/Annotation/RetryFalsy.php index 424aafd3f..379446ec1 100644 --- a/src/ide-helper/output/Hyperf/Retry/Annotation/RetryFalsy.php +++ b/src/ide-helper/output/Hyperf/Retry/Annotation/RetryFalsy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Retry/Annotation/RetryThrowable.php b/src/ide-helper/output/Hyperf/Retry/Annotation/RetryThrowable.php index 3fc05f503..50dcfbb84 100644 --- a/src/ide-helper/output/Hyperf/Retry/Annotation/RetryThrowable.php +++ b/src/ide-helper/output/Hyperf/Retry/Annotation/RetryThrowable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/RpcServer/Annotation/RpcService.php b/src/ide-helper/output/Hyperf/RpcServer/Annotation/RpcService.php index b5b3e5d68..08f96f2f6 100644 --- a/src/ide-helper/output/Hyperf/RpcServer/Annotation/RpcService.php +++ b/src/ide-helper/output/Hyperf/RpcServer/Annotation/RpcService.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Signal/Annotation/Signal.php b/src/ide-helper/output/Hyperf/Signal/Annotation/Signal.php index 1b97713ee..a23e42efc 100644 --- a/src/ide-helper/output/Hyperf/Signal/Annotation/Signal.php +++ b/src/ide-helper/output/Hyperf/Signal/Annotation/Signal.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/Event.php b/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/Event.php index 2147a4171..bd8d881d0 100644 --- a/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/Event.php +++ b/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/SocketIONamespace.php b/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/SocketIONamespace.php index de1906e40..25a922f7a 100644 --- a/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/SocketIONamespace.php +++ b/src/ide-helper/output/Hyperf/SocketIOServer/Annotation/SocketIONamespace.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Task/Annotation/Task.php b/src/ide-helper/output/Hyperf/Task/Annotation/Task.php index 5785f7174..50be11b1b 100644 --- a/src/ide-helper/output/Hyperf/Task/Annotation/Task.php +++ b/src/ide-helper/output/Hyperf/Task/Annotation/Task.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Annotation; use Attribute; diff --git a/src/ide-helper/output/Hyperf/Tracer/Annotation/Trace.php b/src/ide-helper/output/Hyperf/Tracer/Annotation/Trace.php index 253c9005d..f3eab3a56 100644 --- a/src/ide-helper/output/Hyperf/Tracer/Annotation/Trace.php +++ b/src/ide-helper/output/Hyperf/Tracer/Annotation/Trace.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Annotation; use Attribute; diff --git a/src/ide-helper/src/AnnotationGenerator.php b/src/ide-helper/src/AnnotationGenerator.php index 39ca0b4ac..7ecc76b20 100644 --- a/src/ide-helper/src/AnnotationGenerator.php +++ b/src/ide-helper/src/AnnotationGenerator.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\IDEHelper; use Hyperf\IDEHelper\Visitor\AnnotationIDEVisitor; use Hyperf\Support\Composer; use ReflectionClass; +use Throwable; class AnnotationGenerator { @@ -55,7 +57,7 @@ class AnnotationGenerator file_put_contents($target . '.php', $code); } } - } catch (\Throwable) { + } catch (Throwable) { } } } diff --git a/src/ide-helper/src/Ast.php b/src/ide-helper/src/Ast.php index f9a843ffc..8bc652930 100644 --- a/src/ide-helper/src/Ast.php +++ b/src/ide-helper/src/Ast.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\IDEHelper; use Doctrine\Common\Annotations\AnnotationReader; diff --git a/src/ide-helper/src/Metadata.php b/src/ide-helper/src/Metadata.php index 2dd03a554..8d22e03f0 100644 --- a/src/ide-helper/src/Metadata.php +++ b/src/ide-helper/src/Metadata.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\IDEHelper; use Doctrine\Common\Annotations\Reader; diff --git a/src/ide-helper/src/Visitor/AnnotationIDEVisitor.php b/src/ide-helper/src/Visitor/AnnotationIDEVisitor.php index ab8d47e83..ce74d20bc 100644 --- a/src/ide-helper/src/Visitor/AnnotationIDEVisitor.php +++ b/src/ide-helper/src/Visitor/AnnotationIDEVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\IDEHelper\Visitor; use Hyperf\CodeParser\PhpParser; diff --git a/src/json-rpc/src/ConfigProvider.php b/src/json-rpc/src/ConfigProvider.php index f7ca8d5b1..b09b6fcec 100644 --- a/src/json-rpc/src/ConfigProvider.php +++ b/src/json-rpc/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\JsonRpc\Listener\RegisterProtocolListener; diff --git a/src/json-rpc/src/CoreMiddleware.php b/src/json-rpc/src/CoreMiddleware.php index 22d4b911c..1f6a63681 100644 --- a/src/json-rpc/src/CoreMiddleware.php +++ b/src/json-rpc/src/CoreMiddleware.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Closure; use Hyperf\HttpServer\Router\Dispatched; use Hyperf\Rpc\Protocol; +use InvalidArgumentException; use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Swow\Psr7\Message\ResponsePlusInterface; @@ -44,7 +46,7 @@ class CoreMiddleware extends \Hyperf\RpcServer\CoreMiddleware try { $parameters = $this->parseMethodParameters($controller, $action, $request->getParsedBody()); - } catch (\InvalidArgumentException) { + } catch (InvalidArgumentException) { return $this->responseBuilder->buildErrorResponse($request, ResponseBuilder::INVALID_PARAMS); } diff --git a/src/json-rpc/src/DataFormatter.php b/src/json-rpc/src/DataFormatter.php index 513d6470b..99d421c22 100644 --- a/src/json-rpc/src/DataFormatter.php +++ b/src/json-rpc/src/DataFormatter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Rpc\Context; diff --git a/src/json-rpc/src/DataFormatterFactory.php b/src/json-rpc/src/DataFormatterFactory.php index 95bbf5254..0e208fe86 100644 --- a/src/json-rpc/src/DataFormatterFactory.php +++ b/src/json-rpc/src/DataFormatterFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Contract\NormalizerInterface; diff --git a/src/json-rpc/src/Exception/BadRequestException.php b/src/json-rpc/src/Exception/BadRequestException.php index d35d4b7c4..dda9e566f 100644 --- a/src/json-rpc/src/Exception/BadRequestException.php +++ b/src/json-rpc/src/Exception/BadRequestException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Exception; use Hyperf\HttpMessage\Exception\BadRequestHttpException; diff --git a/src/json-rpc/src/Exception/ClientException.php b/src/json-rpc/src/Exception/ClientException.php index d0331e47a..eeaebf1c7 100644 --- a/src/json-rpc/src/Exception/ClientException.php +++ b/src/json-rpc/src/Exception/ClientException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Exception; use RuntimeException; diff --git a/src/json-rpc/src/Exception/Handler/HttpExceptionHandler.php b/src/json-rpc/src/Exception/Handler/HttpExceptionHandler.php index bc4eae643..52ace4896 100644 --- a/src/json-rpc/src/Exception/Handler/HttpExceptionHandler.php +++ b/src/json-rpc/src/Exception/Handler/HttpExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Exception\Handler; class HttpExceptionHandler extends TcpExceptionHandler diff --git a/src/json-rpc/src/Exception/Handler/TcpExceptionHandler.php b/src/json-rpc/src/Exception/Handler/TcpExceptionHandler.php index 7f26eba20..2cc9a007a 100644 --- a/src/json-rpc/src/Exception/Handler/TcpExceptionHandler.php +++ b/src/json-rpc/src/Exception/Handler/TcpExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Exception\Handler; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/json-rpc/src/HttpCoreMiddleware.php b/src/json-rpc/src/HttpCoreMiddleware.php index abedf4d5a..90f14ea2a 100644 --- a/src/json-rpc/src/HttpCoreMiddleware.php +++ b/src/json-rpc/src/HttpCoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/json-rpc/src/HttpServer.php b/src/json-rpc/src/HttpServer.php index 6265cc789..791f470b0 100644 --- a/src/json-rpc/src/HttpServer.php +++ b/src/json-rpc/src/HttpServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Context\RequestContext; diff --git a/src/json-rpc/src/JsonRpcHttpTransporter.php b/src/json-rpc/src/JsonRpcHttpTransporter.php index 26e541f4a..44f49981e 100644 --- a/src/json-rpc/src/JsonRpcHttpTransporter.php +++ b/src/json-rpc/src/JsonRpcHttpTransporter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use GuzzleHttp\Client; diff --git a/src/json-rpc/src/JsonRpcNormalizer.php b/src/json-rpc/src/JsonRpcNormalizer.php index 52cce52d8..eca7e4662 100644 --- a/src/json-rpc/src/JsonRpcNormalizer.php +++ b/src/json-rpc/src/JsonRpcNormalizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Contract\NormalizerInterface; diff --git a/src/json-rpc/src/JsonRpcPoolTransporter.php b/src/json-rpc/src/JsonRpcPoolTransporter.php index 3c9f6b399..5ef99dc74 100644 --- a/src/json-rpc/src/JsonRpcPoolTransporter.php +++ b/src/json-rpc/src/JsonRpcPoolTransporter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Context\ApplicationContext; diff --git a/src/json-rpc/src/JsonRpcTransporter.php b/src/json-rpc/src/JsonRpcTransporter.php index 5683df999..1dd9c4aa8 100644 --- a/src/json-rpc/src/JsonRpcTransporter.php +++ b/src/json-rpc/src/JsonRpcTransporter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Context\ApplicationContext; diff --git a/src/json-rpc/src/Listener/RegisterProtocolListener.php b/src/json-rpc/src/Listener/RegisterProtocolListener.php index 6322e93b2..29340e7cc 100644 --- a/src/json-rpc/src/Listener/RegisterProtocolListener.php +++ b/src/json-rpc/src/Listener/RegisterProtocolListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Listener; use Hyperf\Codec\Packer\JsonPacker; diff --git a/src/json-rpc/src/Listener/RegisterServiceListener.php b/src/json-rpc/src/Listener/RegisterServiceListener.php index f1a51871c..33b701ded 100644 --- a/src/json-rpc/src/Listener/RegisterServiceListener.php +++ b/src/json-rpc/src/Listener/RegisterServiceListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/json-rpc/src/NormalizeDataFormatter.php b/src/json-rpc/src/NormalizeDataFormatter.php index 459553fc2..61838c373 100644 --- a/src/json-rpc/src/NormalizeDataFormatter.php +++ b/src/json-rpc/src/NormalizeDataFormatter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Contract\NormalizerInterface; diff --git a/src/json-rpc/src/Packer/JsonEofPacker.php b/src/json-rpc/src/Packer/JsonEofPacker.php index f0fd3397f..d47dc4a49 100644 --- a/src/json-rpc/src/Packer/JsonEofPacker.php +++ b/src/json-rpc/src/Packer/JsonEofPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Packer; use Hyperf\Contract\PackerInterface; diff --git a/src/json-rpc/src/Packer/JsonLengthPacker.php b/src/json-rpc/src/Packer/JsonLengthPacker.php index 9a23c5413..f9a3b3f23 100644 --- a/src/json-rpc/src/Packer/JsonLengthPacker.php +++ b/src/json-rpc/src/Packer/JsonLengthPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Packer; use Hyperf\Contract\PackerInterface; diff --git a/src/json-rpc/src/PathGenerator.php b/src/json-rpc/src/PathGenerator.php index c3cf8c49e..1698e4a94 100644 --- a/src/json-rpc/src/PathGenerator.php +++ b/src/json-rpc/src/PathGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; class PathGenerator extends \Hyperf\Rpc\PathGenerator\PathGenerator diff --git a/src/json-rpc/src/Pool/Frequency.php b/src/json-rpc/src/Pool/Frequency.php index a35e29c29..535aff8d1 100644 --- a/src/json-rpc/src/Pool/Frequency.php +++ b/src/json-rpc/src/Pool/Frequency.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Pool; use Hyperf\Pool\Frequency as BaseFrequency; diff --git a/src/json-rpc/src/Pool/PoolFactory.php b/src/json-rpc/src/Pool/PoolFactory.php index 5da3fcd21..bf0971094 100644 --- a/src/json-rpc/src/Pool/PoolFactory.php +++ b/src/json-rpc/src/Pool/PoolFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Pool; use Hyperf\Di\Container; diff --git a/src/json-rpc/src/Pool/RpcConnection.php b/src/json-rpc/src/Pool/RpcConnection.php index fa48bc6d5..9fbe491cc 100644 --- a/src/json-rpc/src/Pool/RpcConnection.php +++ b/src/json-rpc/src/Pool/RpcConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Pool; use Closure; @@ -54,17 +55,17 @@ class RpcConnection extends BaseConnection implements ConnectionInterface return $this->connection->{$name}; } - public function send(string $data): int|false + public function send(string $data): false|int { return $this->connection->sendAll($data); } - public function recv(float $timeout = 0): string|false + public function recv(float $timeout = 0): false|string { return $this->recvPacket($timeout); } - public function recvPacket(float $timeout = 0): string|false + public function recvPacket(float $timeout = 0): false|string { return $this->connection->recvPacket($timeout); } diff --git a/src/json-rpc/src/Pool/RpcPool.php b/src/json-rpc/src/Pool/RpcPool.php index 926297962..bffcc90bb 100644 --- a/src/json-rpc/src/Pool/RpcPool.php +++ b/src/json-rpc/src/Pool/RpcPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc\Pool; use Hyperf\Contract\ConnectionInterface; diff --git a/src/json-rpc/src/RecvTrait.php b/src/json-rpc/src/RecvTrait.php index 923a8d59e..539e44659 100644 --- a/src/json-rpc/src/RecvTrait.php +++ b/src/json-rpc/src/RecvTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Engine\Contract\SocketInterface; diff --git a/src/json-rpc/src/ResponseBuilder.php b/src/json-rpc/src/ResponseBuilder.php index 1a36e98aa..2c5815b22 100644 --- a/src/json-rpc/src/ResponseBuilder.php +++ b/src/json-rpc/src/ResponseBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Context\Context; diff --git a/src/json-rpc/src/TcpServer.php b/src/json-rpc/src/TcpServer.php index 52d4557db..25701a0b3 100644 --- a/src/json-rpc/src/TcpServer.php +++ b/src/json-rpc/src/TcpServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\JsonRpc; use Hyperf\Context\ResponseContext; @@ -29,6 +30,7 @@ use Hyperf\RpcServer\Server; use Hyperf\Server\Exception\InvalidArgumentException; use Hyperf\Server\ServerManager; use Psr\Container\ContainerInterface; +use Swoole\Server\Port; use Swow\Psr7\Message\ResponsePlusInterface; use Swow\Psr7\Message\ServerRequestPlusInterface; @@ -120,7 +122,7 @@ class TcpServer extends Server if (! isset($data['params'])) { $data['params'] = []; } - /** @var \Swoole\Server\Port $port */ + /** @var Port $port */ [, $port] = ServerManager::get($this->serverName); $uri = (new Uri())->setPath($data['method'])->setHost($port->host)->setPort($port->port); diff --git a/src/json-rpc/tests/AnyParamCoreMiddlewareTest.php b/src/json-rpc/tests/AnyParamCoreMiddlewareTest.php index 72e44966c..4620c7474 100644 --- a/src/json-rpc/tests/AnyParamCoreMiddlewareTest.php +++ b/src/json-rpc/tests/AnyParamCoreMiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Error; diff --git a/src/json-rpc/tests/CoreMiddlewareTest.php b/src/json-rpc/tests/CoreMiddlewareTest.php index 70977b610..f18093ee6 100644 --- a/src/json-rpc/tests/CoreMiddlewareTest.php +++ b/src/json-rpc/tests/CoreMiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Hyperf\Codec\Packer\JsonPacker; diff --git a/src/json-rpc/tests/DataFormatterTest.php b/src/json-rpc/tests/DataFormatterTest.php index 1f02e81cf..4cc3bf2bd 100644 --- a/src/json-rpc/tests/DataFormatterTest.php +++ b/src/json-rpc/tests/DataFormatterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Hyperf\JsonRpc\DataFormatter; diff --git a/src/json-rpc/tests/JsonPackerTest.php b/src/json-rpc/tests/JsonPackerTest.php index c3cba9bb5..a4d962c49 100644 --- a/src/json-rpc/tests/JsonPackerTest.php +++ b/src/json-rpc/tests/JsonPackerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Hyperf\JsonRpc\Packer\JsonEofPacker; diff --git a/src/json-rpc/tests/JsonRpcHttpTransporterTest.php b/src/json-rpc/tests/JsonRpcHttpTransporterTest.php index 52fdd0a2d..952febcb4 100644 --- a/src/json-rpc/tests/JsonRpcHttpTransporterTest.php +++ b/src/json-rpc/tests/JsonRpcHttpTransporterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use GuzzleHttp\Client; diff --git a/src/json-rpc/tests/JsonRpcPoolTransporterTest.php b/src/json-rpc/tests/JsonRpcPoolTransporterTest.php index 86f0342cc..b437fdf86 100644 --- a/src/json-rpc/tests/JsonRpcPoolTransporterTest.php +++ b/src/json-rpc/tests/JsonRpcPoolTransporterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Hyperf\Context\ApplicationContext; diff --git a/src/json-rpc/tests/RpcServiceClientTest.php b/src/json-rpc/tests/RpcServiceClientTest.php index f7ced4afa..f26a06dc7 100644 --- a/src/json-rpc/tests/RpcServiceClientTest.php +++ b/src/json-rpc/tests/RpcServiceClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Hyperf\Codec\Packer\JsonPacker; diff --git a/src/json-rpc/tests/Stub/CalculatorProxyServiceClient.php b/src/json-rpc/tests/Stub/CalculatorProxyServiceClient.php index 3eeee9efa..ed0bff8c5 100644 --- a/src/json-rpc/tests/Stub/CalculatorProxyServiceClient.php +++ b/src/json-rpc/tests/Stub/CalculatorProxyServiceClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc\Stub; use Hyperf\RpcClient\Proxy\AbstractProxyService; diff --git a/src/json-rpc/tests/Stub/CalculatorService.php b/src/json-rpc/tests/Stub/CalculatorService.php index 2096426d9..37b29678d 100644 --- a/src/json-rpc/tests/Stub/CalculatorService.php +++ b/src/json-rpc/tests/Stub/CalculatorService.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc\Stub; use Error; diff --git a/src/json-rpc/tests/Stub/CalculatorServiceInterface.php b/src/json-rpc/tests/Stub/CalculatorServiceInterface.php index b1d9c2bd1..ff188c360 100644 --- a/src/json-rpc/tests/Stub/CalculatorServiceInterface.php +++ b/src/json-rpc/tests/Stub/CalculatorServiceInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc\Stub; interface CalculatorServiceInterface diff --git a/src/json-rpc/tests/Stub/IntegerValue.php b/src/json-rpc/tests/Stub/IntegerValue.php index b43a382ae..3e773c185 100644 --- a/src/json-rpc/tests/Stub/IntegerValue.php +++ b/src/json-rpc/tests/Stub/IntegerValue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc\Stub; class IntegerValue diff --git a/src/json-rpc/tests/Stub/RpcConnectionStub.php b/src/json-rpc/tests/Stub/RpcConnectionStub.php index 0805cfba0..f64047c19 100644 --- a/src/json-rpc/tests/Stub/RpcConnectionStub.php +++ b/src/json-rpc/tests/Stub/RpcConnectionStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc\Stub; use Closure; @@ -29,13 +30,13 @@ class RpcConnectionStub extends RpcConnection // return $this->connection->{$name}; } - public function send(string $data): int|false + public function send(string $data): false|int { $this->lastData = $data; return strlen($data); } - public function recvPacket(float $timeout = 0): string|false + public function recvPacket(float $timeout = 0): false|string { return $this->lastData; } diff --git a/src/json-rpc/tests/Stub/RpcPoolStub.php b/src/json-rpc/tests/Stub/RpcPoolStub.php index 74fcf0a57..62a48eff0 100644 --- a/src/json-rpc/tests/Stub/RpcPoolStub.php +++ b/src/json-rpc/tests/Stub/RpcPoolStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc\Stub; use Hyperf\Contract\ConnectionInterface; diff --git a/src/json-rpc/tests/TcpServerTest.php b/src/json-rpc/tests/TcpServerTest.php index 631de788c..acba5b346 100644 --- a/src/json-rpc/tests/TcpServerTest.php +++ b/src/json-rpc/tests/TcpServerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\JsonRpc; use Hyperf\Codec\Json; @@ -135,7 +136,7 @@ class TcpServerTest extends TestCase 'port' => 9504, 'sock_type' => SWOOLE_SOCK_TCP, 'callbacks' => [ - Event::ON_RECEIVE => [\Hyperf\JsonRpc\TcpServer::class, 'onReceive'], + Event::ON_RECEIVE => [TcpServer::class, 'onReceive'], ], 'settings' => [ 'open_eof_split' => true, diff --git a/src/kafka/publish/kafka.php b/src/kafka/publish/kafka.php index 0e6d75aec..a79b5b661 100644 --- a/src/kafka/publish/kafka.php +++ b/src/kafka/publish/kafka.php @@ -10,6 +10,9 @@ declare(strict_types=1); * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ use Hyperf\Kafka\Constants\KafkaStrategy; +use longlang\phpkafka\Client\SwooleClient; +use longlang\phpkafka\Socket\SwooleSocket; +use longlang\phpkafka\Timer\SwooleTimer; return [ 'default' => [ @@ -39,9 +42,9 @@ return [ 'partition_assignment_strategy' => KafkaStrategy::RANGE_ASSIGNOR, 'sasl' => [], 'ssl' => [], - 'client' => \longlang\phpkafka\Client\SwooleClient::class, - 'socket' => \longlang\phpkafka\Socket\SwooleSocket::class, - 'timer' => \longlang\phpkafka\Timer\SwooleTimer::class, + 'client' => SwooleClient::class, + 'socket' => SwooleSocket::class, + 'timer' => SwooleTimer::class, 'consume_timeout' => 600, 'exception_callback' => null, ], diff --git a/src/kafka/src/AbstractConsumer.php b/src/kafka/src/AbstractConsumer.php index df71010c4..cadaae7e1 100644 --- a/src/kafka/src/AbstractConsumer.php +++ b/src/kafka/src/AbstractConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use longlang\phpkafka\Consumer\ConsumeMessage; @@ -22,7 +23,7 @@ abstract class AbstractConsumer /** * @var string|string[] */ - public string|array $topic = []; + public array|string $topic = []; public ?string $groupId = null; diff --git a/src/kafka/src/Annotation/Consumer.php b/src/kafka/src/Annotation/Consumer.php index 4431ca3a7..ca4968120 100644 --- a/src/kafka/src/Annotation/Consumer.php +++ b/src/kafka/src/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Annotation; use Attribute; diff --git a/src/kafka/src/ConfigProvider.php b/src/kafka/src/ConfigProvider.php index f0ebdf383..e3d668dc9 100644 --- a/src/kafka/src/ConfigProvider.php +++ b/src/kafka/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use Hyperf\Kafka\Listener\AfterWorkerExitListener; diff --git a/src/kafka/src/Constants/KafkaStrategy.php b/src/kafka/src/Constants/KafkaStrategy.php index c8fdc9181..3e722f741 100644 --- a/src/kafka/src/Constants/KafkaStrategy.php +++ b/src/kafka/src/Constants/KafkaStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Constants; use longlang\phpkafka\Consumer\Assignor\RangeAssignor; diff --git a/src/kafka/src/ConsumerManager.php b/src/kafka/src/ConsumerManager.php index db74d27b3..339831a01 100644 --- a/src/kafka/src/ConsumerManager.php +++ b/src/kafka/src/ConsumerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use Hyperf\Contract\ConfigInterface; diff --git a/src/kafka/src/Context.php b/src/kafka/src/Context.php index 20eaef1d0..10436c021 100644 --- a/src/kafka/src/Context.php +++ b/src/kafka/src/Context.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use Hyperf\Context\Context as RequestContext; diff --git a/src/kafka/src/Event/AfterConsume.php b/src/kafka/src/Event/AfterConsume.php index b5218dd86..639405cf9 100644 --- a/src/kafka/src/Event/AfterConsume.php +++ b/src/kafka/src/Event/AfterConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Event; use Hyperf\Kafka\AbstractConsumer; diff --git a/src/kafka/src/Event/BeforeConsume.php b/src/kafka/src/Event/BeforeConsume.php index 17fa10ebc..a9a36cdfe 100644 --- a/src/kafka/src/Event/BeforeConsume.php +++ b/src/kafka/src/Event/BeforeConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Event; class BeforeConsume extends Consume diff --git a/src/kafka/src/Event/Consume.php b/src/kafka/src/Event/Consume.php index c573ab29d..146762ce5 100644 --- a/src/kafka/src/Event/Consume.php +++ b/src/kafka/src/Event/Consume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Event; use Hyperf\Kafka\AbstractConsumer; diff --git a/src/kafka/src/Event/Event.php b/src/kafka/src/Event/Event.php index eebdf61d1..37bfeaa0c 100644 --- a/src/kafka/src/Event/Event.php +++ b/src/kafka/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Event; use Hyperf\Kafka\AbstractConsumer; diff --git a/src/kafka/src/Event/FailToConsume.php b/src/kafka/src/Event/FailToConsume.php index 5134a2832..20a27ce13 100644 --- a/src/kafka/src/Event/FailToConsume.php +++ b/src/kafka/src/Event/FailToConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Event; use Hyperf\Kafka\AbstractConsumer; diff --git a/src/kafka/src/Exception/ConnectionClosedException.php b/src/kafka/src/Exception/ConnectionClosedException.php index 4e0481b7e..3e445270b 100644 --- a/src/kafka/src/Exception/ConnectionClosedException.php +++ b/src/kafka/src/Exception/ConnectionClosedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Exception; class ConnectionClosedException extends KafkaException diff --git a/src/kafka/src/Exception/InvalidConsumeResultException.php b/src/kafka/src/Exception/InvalidConsumeResultException.php index bbc0a87f0..e130b668a 100644 --- a/src/kafka/src/Exception/InvalidConsumeResultException.php +++ b/src/kafka/src/Exception/InvalidConsumeResultException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Exception; class InvalidConsumeResultException extends KafkaException diff --git a/src/kafka/src/Exception/KafkaException.php b/src/kafka/src/Exception/KafkaException.php index 66ac2ed06..a9d49463f 100644 --- a/src/kafka/src/Exception/KafkaException.php +++ b/src/kafka/src/Exception/KafkaException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Exception; use RuntimeException; diff --git a/src/kafka/src/Exception/TimeoutException.php b/src/kafka/src/Exception/TimeoutException.php index 9c0be6089..e807a4348 100644 --- a/src/kafka/src/Exception/TimeoutException.php +++ b/src/kafka/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Exception; class TimeoutException extends KafkaException diff --git a/src/kafka/src/Listener/AfterWorkerExitListener.php b/src/kafka/src/Listener/AfterWorkerExitListener.php index e9d6db990..2a1dc71bc 100644 --- a/src/kafka/src/Listener/AfterWorkerExitListener.php +++ b/src/kafka/src/Listener/AfterWorkerExitListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/kafka/src/Listener/BeforeMainServerStartListener.php b/src/kafka/src/Listener/BeforeMainServerStartListener.php index 1d8a274ff..2e8b4ef3a 100644 --- a/src/kafka/src/Listener/BeforeMainServerStartListener.php +++ b/src/kafka/src/Listener/BeforeMainServerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/kafka/src/Producer.php b/src/kafka/src/Producer.php index 33c290845..ef9d3c8ba 100644 --- a/src/kafka/src/Producer.php +++ b/src/kafka/src/Producer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use Hyperf\Contract\ConfigInterface; diff --git a/src/kafka/src/ProducerManager.php b/src/kafka/src/ProducerManager.php index d089e67ab..f5f3deec7 100644 --- a/src/kafka/src/ProducerManager.php +++ b/src/kafka/src/ProducerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use Psr\Container\ContainerInterface; diff --git a/src/kafka/src/Promise.php b/src/kafka/src/Promise.php index 28adc44d7..5931a2bd7 100644 --- a/src/kafka/src/Promise.php +++ b/src/kafka/src/Promise.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; use Hyperf\Engine\Channel; diff --git a/src/kafka/src/Result.php b/src/kafka/src/Result.php index 6fb9f1dd6..4d487e389 100644 --- a/src/kafka/src/Result.php +++ b/src/kafka/src/Result.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Kafka; class Result diff --git a/src/kafka/tests/ConsumerManagerTest.php b/src/kafka/tests/ConsumerManagerTest.php index fa75a8795..8687e0560 100644 --- a/src/kafka/tests/ConsumerManagerTest.php +++ b/src/kafka/tests/ConsumerManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Kafka; use Hyperf\Collection\Arr; diff --git a/src/kafka/tests/Stub/ContainerStub.php b/src/kafka/tests/Stub/ContainerStub.php index 6f6ee75f5..e5462e061 100644 --- a/src/kafka/tests/Stub/ContainerStub.php +++ b/src/kafka/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Kafka\Stub; use Hyperf\Config\Config; diff --git a/src/kafka/tests/Stub/DemoConsumer.php b/src/kafka/tests/Stub/DemoConsumer.php index 8045f7f11..2d81a7e55 100644 --- a/src/kafka/tests/Stub/DemoConsumer.php +++ b/src/kafka/tests/Stub/DemoConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Kafka\Stub; use Hyperf\Kafka\AbstractConsumer; diff --git a/src/kafka/tests/TestCase.php b/src/kafka/tests/TestCase.php index 8aeee3c78..8826a5c4d 100644 --- a/src/kafka/tests/TestCase.php +++ b/src/kafka/tests/TestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Kafka; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/load-balancer/src/AbstractLoadBalancer.php b/src/load-balancer/src/AbstractLoadBalancer.php index f84c878a8..37a96bca0 100644 --- a/src/load-balancer/src/AbstractLoadBalancer.php +++ b/src/load-balancer/src/AbstractLoadBalancer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use Closure; diff --git a/src/load-balancer/src/ConfigProvider.php b/src/load-balancer/src/ConfigProvider.php index 95db61d63..f4d023968 100644 --- a/src/load-balancer/src/ConfigProvider.php +++ b/src/load-balancer/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; class ConfigProvider diff --git a/src/load-balancer/src/Exception/NoNodesAvailableException.php b/src/load-balancer/src/Exception/NoNodesAvailableException.php index 392a156ca..762d24a7c 100644 --- a/src/load-balancer/src/Exception/NoNodesAvailableException.php +++ b/src/load-balancer/src/Exception/NoNodesAvailableException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer\Exception; class NoNodesAvailableException extends RuntimeException diff --git a/src/load-balancer/src/Exception/RuntimeException.php b/src/load-balancer/src/Exception/RuntimeException.php index 721c79aad..88d3fd147 100644 --- a/src/load-balancer/src/Exception/RuntimeException.php +++ b/src/load-balancer/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer\Exception; class RuntimeException extends \RuntimeException diff --git a/src/load-balancer/src/LoadBalancerInterface.php b/src/load-balancer/src/LoadBalancerInterface.php index b9113fea1..e7191d532 100644 --- a/src/load-balancer/src/LoadBalancerInterface.php +++ b/src/load-balancer/src/LoadBalancerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use Closure; diff --git a/src/load-balancer/src/LoadBalancerManager.php b/src/load-balancer/src/LoadBalancerManager.php index 7abf8a2bb..9fde57506 100644 --- a/src/load-balancer/src/LoadBalancerManager.php +++ b/src/load-balancer/src/LoadBalancerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use InvalidArgumentException; diff --git a/src/load-balancer/src/Node.php b/src/load-balancer/src/Node.php index 19093407d..939171e8e 100644 --- a/src/load-balancer/src/Node.php +++ b/src/load-balancer/src/Node.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; class Node diff --git a/src/load-balancer/src/Random.php b/src/load-balancer/src/Random.php index 1df88ecda..2d17fa9d0 100644 --- a/src/load-balancer/src/Random.php +++ b/src/load-balancer/src/Random.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use Hyperf\LoadBalancer\Exception\NoNodesAvailableException; diff --git a/src/load-balancer/src/RoundRobin.php b/src/load-balancer/src/RoundRobin.php index a791a017e..36ae5a83f 100644 --- a/src/load-balancer/src/RoundRobin.php +++ b/src/load-balancer/src/RoundRobin.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use Hyperf\LoadBalancer\Exception\NoNodesAvailableException; diff --git a/src/load-balancer/src/WeightedRandom.php b/src/load-balancer/src/WeightedRandom.php index 1d146481f..418704535 100644 --- a/src/load-balancer/src/WeightedRandom.php +++ b/src/load-balancer/src/WeightedRandom.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use Hyperf\LoadBalancer\Exception\NoNodesAvailableException; diff --git a/src/load-balancer/src/WeightedRoundRobin.php b/src/load-balancer/src/WeightedRoundRobin.php index f5a889257..d819a0f97 100644 --- a/src/load-balancer/src/WeightedRoundRobin.php +++ b/src/load-balancer/src/WeightedRoundRobin.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\LoadBalancer; use Hyperf\LoadBalancer\Exception\NoNodesAvailableException; diff --git a/src/load-balancer/tests/RandomTest.php b/src/load-balancer/tests/RandomTest.php index 207610458..3f19e0fb0 100644 --- a/src/load-balancer/tests/RandomTest.php +++ b/src/load-balancer/tests/RandomTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\LoadBalancer; use Hyperf\Coordinator\Constants; diff --git a/src/load-balancer/tests/RoundRobinTest.php b/src/load-balancer/tests/RoundRobinTest.php index d4f22d51a..38723045e 100644 --- a/src/load-balancer/tests/RoundRobinTest.php +++ b/src/load-balancer/tests/RoundRobinTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\LoadBalancer; use Hyperf\LoadBalancer\Node; diff --git a/src/load-balancer/tests/WeightedRandomTest.php b/src/load-balancer/tests/WeightedRandomTest.php index 7cc09cd66..2501a8d2d 100644 --- a/src/load-balancer/tests/WeightedRandomTest.php +++ b/src/load-balancer/tests/WeightedRandomTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\LoadBalancer; use Hyperf\LoadBalancer\Node; diff --git a/src/load-balancer/tests/WeightedRoundRobinTest.php b/src/load-balancer/tests/WeightedRoundRobinTest.php index e4cbc1d63..c5c4c2859 100644 --- a/src/load-balancer/tests/WeightedRoundRobinTest.php +++ b/src/load-balancer/tests/WeightedRoundRobinTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\LoadBalancer; use Hyperf\LoadBalancer\Node; diff --git a/src/logger/publish/logger.php b/src/logger/publish/logger.php index d370f8b2a..734a3e5b3 100644 --- a/src/logger/publish/logger.php +++ b/src/logger/publish/logger.php @@ -9,17 +9,21 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Monolog\Formatter\LineFormatter; +use Monolog\Handler\StreamHandler; +use Monolog\Logger; + return [ 'default' => [ 'handlers' => [ [ - 'class' => Monolog\Handler\StreamHandler::class, + 'class' => StreamHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], 'formatter' => [ - 'class' => Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, 'constructor' => [], ], ], diff --git a/src/logger/src/Aspect/UdpSocketAspect.php b/src/logger/src/Aspect/UdpSocketAspect.php index b932b09b1..c65ee2562 100644 --- a/src/logger/src/Aspect/UdpSocketAspect.php +++ b/src/logger/src/Aspect/UdpSocketAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Logger\Aspect; use Hyperf\Coroutine\Coroutine; diff --git a/src/logger/src/ConfigProvider.php b/src/logger/src/ConfigProvider.php index 87f505558..b5e55fb30 100644 --- a/src/logger/src/ConfigProvider.php +++ b/src/logger/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Logger; use Psr\Log\LoggerInterface; diff --git a/src/logger/src/Exception/InvalidConfigException.php b/src/logger/src/Exception/InvalidConfigException.php index 9d2bb00eb..e5bf021a4 100644 --- a/src/logger/src/Exception/InvalidConfigException.php +++ b/src/logger/src/Exception/InvalidConfigException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Logger\Exception; use RuntimeException; diff --git a/src/logger/src/Logger.php b/src/logger/src/Logger.php index 4cb4023f2..54dbfd29b 100644 --- a/src/logger/src/Logger.php +++ b/src/logger/src/Logger.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Logger; use DateTimeZone; diff --git a/src/logger/src/LoggerFactory.php b/src/logger/src/LoggerFactory.php index 80fc1a0e1..ee1a9f592 100644 --- a/src/logger/src/LoggerFactory.php +++ b/src/logger/src/LoggerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Logger; use Hyperf\Collection\Arr; diff --git a/src/logger/tests/LoggerFactoryTest.php b/src/logger/tests/LoggerFactoryTest.php index 62428d310..ade68eeb2 100644 --- a/src/logger/tests/LoggerFactoryTest.php +++ b/src/logger/tests/LoggerFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Logger; use Hyperf\Config\Config; @@ -20,9 +21,12 @@ use HyperfTest\Logger\Stub\BarProcessor; use HyperfTest\Logger\Stub\FooHandler; use HyperfTest\Logger\Stub\FooProcessor; use Mockery; +use Monolog\Formatter\LineFormatter; use Monolog\Handler\StreamHandler; use Monolog\Handler\TestHandler; +use Monolog\Logger; use Monolog\LogRecord; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use ReflectionClass; @@ -31,7 +35,7 @@ use ReflectionClass; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(LoggerFactory::class)] +#[CoversClass(LoggerFactory::class)] class LoggerFactoryTest extends TestCase { protected function tearDown(): void @@ -173,14 +177,14 @@ class LoggerFactoryTest extends TestCase 'logger' => [ 'default' => [ 'handler' => [ - 'class' => \Monolog\Handler\StreamHandler::class, + 'class' => StreamHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => \Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], ], 'formatter' => [ - 'class' => \Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, 'constructor' => [], ], ], @@ -188,27 +192,27 @@ class LoggerFactoryTest extends TestCase 'default-handlers' => [ 'handlers' => [ [ - 'class' => \Monolog\Handler\StreamHandler::class, + 'class' => StreamHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => \Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], 'formatter' => [ - 'class' => \Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, ], ], [ - 'class' => \Monolog\Handler\TestHandler::class, + 'class' => TestHandler::class, 'constructor' => [ - 'level' => \Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], 'formatter' => [ - 'class' => \Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, ], ], ], 'formatter' => [ - 'class' => \Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, 'constructor' => [], ], ], @@ -218,10 +222,10 @@ class LoggerFactoryTest extends TestCase 'class' => FooHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => \Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], 'formatter' => [ - 'class' => \Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, ], ], ], @@ -247,10 +251,10 @@ class LoggerFactoryTest extends TestCase 'class' => FooHandler::class, 'constructor' => [ 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', - 'level' => \Monolog\Logger::DEBUG, + 'level' => Logger::DEBUG, ], 'formatter' => [ - 'class' => \Monolog\Formatter\LineFormatter::class, + 'class' => LineFormatter::class, ], ], ], diff --git a/src/logger/tests/LoggerTest.php b/src/logger/tests/LoggerTest.php index b216014e4..798390e30 100644 --- a/src/logger/tests/LoggerTest.php +++ b/src/logger/tests/LoggerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Logger; use Hyperf\Contract\StdoutLoggerInterface; @@ -16,6 +17,7 @@ use Hyperf\Logger\Logger; use Mockery; use Monolog\Handler\TestHandler; use Monolog\LogRecord; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use RuntimeException; @@ -26,7 +28,7 @@ use function Hyperf\Coroutine\parallel; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Logger\Logger::class)] +#[CoversClass(Logger::class)] class LoggerTest extends TestCase { public function testInstanceOfMonoLogger() diff --git a/src/logger/tests/Stub/BarProcessor.php b/src/logger/tests/Stub/BarProcessor.php index b11ac6efa..9c7302970 100644 --- a/src/logger/tests/Stub/BarProcessor.php +++ b/src/logger/tests/Stub/BarProcessor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Logger\Stub; use Monolog\LogRecord; diff --git a/src/logger/tests/Stub/FooHandler.php b/src/logger/tests/Stub/FooHandler.php index fd316d431..7c23794a0 100644 --- a/src/logger/tests/Stub/FooHandler.php +++ b/src/logger/tests/Stub/FooHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Logger\Stub; use Hyperf\Context\Context; diff --git a/src/logger/tests/Stub/FooProcessor.php b/src/logger/tests/Stub/FooProcessor.php index b59d27831..226a4ba5b 100644 --- a/src/logger/tests/Stub/FooProcessor.php +++ b/src/logger/tests/Stub/FooProcessor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Logger\Stub; use Monolog\LogRecord; diff --git a/src/macroable/src/Macroable.php b/src/macroable/src/Macroable.php index 709c972e7..df79b3df4 100644 --- a/src/macroable/src/Macroable.php +++ b/src/macroable/src/Macroable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Macroable; use BadMethodCallException; diff --git a/src/macroable/tests/MacroableTest.php b/src/macroable/tests/MacroableTest.php index 9301b344f..29c2bbc6a 100644 --- a/src/macroable/tests/MacroableTest.php +++ b/src/macroable/tests/MacroableTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Macroable; use Hyperf\Macroable\Macroable; diff --git a/src/memory/src/AtomicManager.php b/src/memory/src/AtomicManager.php index fbb643335..c1656cfdd 100644 --- a/src/memory/src/AtomicManager.php +++ b/src/memory/src/AtomicManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Memory; use RuntimeException; diff --git a/src/memory/src/ConfigProvider.php b/src/memory/src/ConfigProvider.php index 869534104..c685d3106 100644 --- a/src/memory/src/ConfigProvider.php +++ b/src/memory/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Memory; class ConfigProvider diff --git a/src/memory/src/LockManager.php b/src/memory/src/LockManager.php index 419789cf5..333c8590d 100644 --- a/src/memory/src/LockManager.php +++ b/src/memory/src/LockManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Memory; use RuntimeException; diff --git a/src/memory/src/TableManager.php b/src/memory/src/TableManager.php index b7ace10ea..67a793fda 100644 --- a/src/memory/src/TableManager.php +++ b/src/memory/src/TableManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Memory; use RuntimeException; diff --git a/src/metric/publish/metric.php b/src/metric/publish/metric.php index a5ad15150..964e58056 100644 --- a/src/metric/publish/metric.php +++ b/src/metric/publish/metric.php @@ -10,6 +10,7 @@ declare(strict_types=1); * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ use Hyperf\Metric\Adapter\Prometheus\Constants; +use Hyperf\Metric\Adapter\Prometheus\MetricFactory; use function Hyperf\Support\env; @@ -25,7 +26,7 @@ return [ 'buffer_size' => env('METRIC_BUFFER_SIZE', 200), 'metric' => [ 'prometheus' => [ - 'driver' => Hyperf\Metric\Adapter\Prometheus\MetricFactory::class, + 'driver' => MetricFactory::class, 'mode' => Constants::SCRAPE_MODE, 'namespace' => env('APP_NAME', 'skeleton'), 'redis_config' => env('PROMETHEUS_REDIS_CONFIG', 'default'), diff --git a/src/metric/src/Adapter/InfluxDB/MetricFactory.php b/src/metric/src/Adapter/InfluxDB/MetricFactory.php index e0ff084f9..5e5e9de84 100644 --- a/src/metric/src/Adapter/InfluxDB/MetricFactory.php +++ b/src/metric/src/Adapter/InfluxDB/MetricFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\InfluxDB; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Adapter/NoOp/Counter.php b/src/metric/src/Adapter/NoOp/Counter.php index 1d4b718b0..3a1165cbc 100644 --- a/src/metric/src/Adapter/NoOp/Counter.php +++ b/src/metric/src/Adapter/NoOp/Counter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\NoOp; use Hyperf\Metric\Contract\CounterInterface; diff --git a/src/metric/src/Adapter/NoOp/Gauge.php b/src/metric/src/Adapter/NoOp/Gauge.php index 2eae0be00..af4ab13e0 100644 --- a/src/metric/src/Adapter/NoOp/Gauge.php +++ b/src/metric/src/Adapter/NoOp/Gauge.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\NoOp; use Hyperf\Metric\Contract\GaugeInterface; diff --git a/src/metric/src/Adapter/NoOp/Histogram.php b/src/metric/src/Adapter/NoOp/Histogram.php index ac0c3cb6b..8b790a1f4 100644 --- a/src/metric/src/Adapter/NoOp/Histogram.php +++ b/src/metric/src/Adapter/NoOp/Histogram.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\NoOp; use Hyperf\Metric\Contract\HistogramInterface; diff --git a/src/metric/src/Adapter/NoOp/MetricFactory.php b/src/metric/src/Adapter/NoOp/MetricFactory.php index eec76fe10..6dd82f1e7 100644 --- a/src/metric/src/Adapter/NoOp/MetricFactory.php +++ b/src/metric/src/Adapter/NoOp/MetricFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\NoOp; use Hyperf\Coordinator\Constants; diff --git a/src/metric/src/Adapter/Prometheus/Constants.php b/src/metric/src/Adapter/Prometheus/Constants.php index 72eb4c464..d6a0ee487 100644 --- a/src/metric/src/Adapter/Prometheus/Constants.php +++ b/src/metric/src/Adapter/Prometheus/Constants.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; class Constants diff --git a/src/metric/src/Adapter/Prometheus/Counter.php b/src/metric/src/Adapter/Prometheus/Counter.php index ebe539d41..d8cbb9568 100644 --- a/src/metric/src/Adapter/Prometheus/Counter.php +++ b/src/metric/src/Adapter/Prometheus/Counter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; use Hyperf\Metric\Contract\CounterInterface; diff --git a/src/metric/src/Adapter/Prometheus/Gauge.php b/src/metric/src/Adapter/Prometheus/Gauge.php index 60846aeaf..4d2e73bc1 100644 --- a/src/metric/src/Adapter/Prometheus/Gauge.php +++ b/src/metric/src/Adapter/Prometheus/Gauge.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; use Hyperf\Metric\Contract\GaugeInterface; diff --git a/src/metric/src/Adapter/Prometheus/Histogram.php b/src/metric/src/Adapter/Prometheus/Histogram.php index e38d1e124..793a64bda 100644 --- a/src/metric/src/Adapter/Prometheus/Histogram.php +++ b/src/metric/src/Adapter/Prometheus/Histogram.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; use Hyperf\Metric\Contract\HistogramInterface; diff --git a/src/metric/src/Adapter/Prometheus/MetricFactory.php b/src/metric/src/Adapter/Prometheus/MetricFactory.php index 2c1686358..35cf45711 100644 --- a/src/metric/src/Adapter/Prometheus/MetricFactory.php +++ b/src/metric/src/Adapter/Prometheus/MetricFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; use GuzzleHttp\Exception\GuzzleException; diff --git a/src/metric/src/Adapter/Prometheus/Redis.php b/src/metric/src/Adapter/Prometheus/Redis.php index 0552e4853..0ea910474 100644 --- a/src/metric/src/Adapter/Prometheus/Redis.php +++ b/src/metric/src/Adapter/Prometheus/Redis.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; use Hyperf\Codec\Json; diff --git a/src/metric/src/Adapter/Prometheus/RedisStorageFactory.php b/src/metric/src/Adapter/Prometheus/RedisStorageFactory.php index c1bc640b6..53650c5f1 100644 --- a/src/metric/src/Adapter/Prometheus/RedisStorageFactory.php +++ b/src/metric/src/Adapter/Prometheus/RedisStorageFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\Prometheus; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Adapter/RemoteProxy/Counter.php b/src/metric/src/Adapter/RemoteProxy/Counter.php index c088282d8..77b534b5f 100644 --- a/src/metric/src/Adapter/RemoteProxy/Counter.php +++ b/src/metric/src/Adapter/RemoteProxy/Counter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\RemoteProxy; use Hyperf\Context\ApplicationContext; diff --git a/src/metric/src/Adapter/RemoteProxy/Gauge.php b/src/metric/src/Adapter/RemoteProxy/Gauge.php index e94306a8d..bb6f9a5d7 100644 --- a/src/metric/src/Adapter/RemoteProxy/Gauge.php +++ b/src/metric/src/Adapter/RemoteProxy/Gauge.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\RemoteProxy; use Hyperf\Context\ApplicationContext; diff --git a/src/metric/src/Adapter/RemoteProxy/Histogram.php b/src/metric/src/Adapter/RemoteProxy/Histogram.php index 36722ed6b..0be2d5920 100644 --- a/src/metric/src/Adapter/RemoteProxy/Histogram.php +++ b/src/metric/src/Adapter/RemoteProxy/Histogram.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\RemoteProxy; use Hyperf\Context\ApplicationContext; diff --git a/src/metric/src/Adapter/RemoteProxy/MetricCollector.php b/src/metric/src/Adapter/RemoteProxy/MetricCollector.php index 8d0bc149d..64a383455 100644 --- a/src/metric/src/Adapter/RemoteProxy/MetricCollector.php +++ b/src/metric/src/Adapter/RemoteProxy/MetricCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\RemoteProxy; use Hyperf\Metric\Contract\MetricCollectorInterface; diff --git a/src/metric/src/Adapter/RemoteProxy/MetricCollectorFactory.php b/src/metric/src/Adapter/RemoteProxy/MetricCollectorFactory.php index bdd33dea1..387004632 100644 --- a/src/metric/src/Adapter/RemoteProxy/MetricCollectorFactory.php +++ b/src/metric/src/Adapter/RemoteProxy/MetricCollectorFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\RemoteProxy; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Adapter/RemoteProxy/MetricFactory.php b/src/metric/src/Adapter/RemoteProxy/MetricFactory.php index 7a7e59445..93566fc61 100644 --- a/src/metric/src/Adapter/RemoteProxy/MetricFactory.php +++ b/src/metric/src/Adapter/RemoteProxy/MetricFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\RemoteProxy; use Hyperf\Metric\Contract\CounterInterface; diff --git a/src/metric/src/Adapter/StatsD/Counter.php b/src/metric/src/Adapter/StatsD/Counter.php index e92de713e..6a26ff6f8 100644 --- a/src/metric/src/Adapter/StatsD/Counter.php +++ b/src/metric/src/Adapter/StatsD/Counter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\StatsD; use Domnikl\Statsd\Client; diff --git a/src/metric/src/Adapter/StatsD/Gauge.php b/src/metric/src/Adapter/StatsD/Gauge.php index f277661c1..a577d7682 100644 --- a/src/metric/src/Adapter/StatsD/Gauge.php +++ b/src/metric/src/Adapter/StatsD/Gauge.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\StatsD; use Domnikl\Statsd\Client; diff --git a/src/metric/src/Adapter/StatsD/Histogram.php b/src/metric/src/Adapter/StatsD/Histogram.php index 8c2884f34..202e520fa 100644 --- a/src/metric/src/Adapter/StatsD/Histogram.php +++ b/src/metric/src/Adapter/StatsD/Histogram.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\StatsD; use Domnikl\Statsd\Client; diff --git a/src/metric/src/Adapter/StatsD/MetricFactory.php b/src/metric/src/Adapter/StatsD/MetricFactory.php index c6bd19a1d..e771edf0e 100644 --- a/src/metric/src/Adapter/StatsD/MetricFactory.php +++ b/src/metric/src/Adapter/StatsD/MetricFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Adapter\StatsD; use Domnikl\Statsd\Client; diff --git a/src/metric/src/Annotation/Counter.php b/src/metric/src/Annotation/Counter.php index 4ef0d8f9c..5ddb4f513 100644 --- a/src/metric/src/Annotation/Counter.php +++ b/src/metric/src/Annotation/Counter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Annotation; use Attribute; diff --git a/src/metric/src/Annotation/Histogram.php b/src/metric/src/Annotation/Histogram.php index e88ed9241..2303f9339 100644 --- a/src/metric/src/Annotation/Histogram.php +++ b/src/metric/src/Annotation/Histogram.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Annotation; use Attribute; diff --git a/src/metric/src/Aspect/CounterAnnotationAspect.php b/src/metric/src/Aspect/CounterAnnotationAspect.php index 1f12f3bb4..24997c145 100644 --- a/src/metric/src/Aspect/CounterAnnotationAspect.php +++ b/src/metric/src/Aspect/CounterAnnotationAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/metric/src/Aspect/HistogramAnnotationAspect.php b/src/metric/src/Aspect/HistogramAnnotationAspect.php index 9f41ba5fc..2da8cb059 100644 --- a/src/metric/src/Aspect/HistogramAnnotationAspect.php +++ b/src/metric/src/Aspect/HistogramAnnotationAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/metric/src/ConfigProvider.php b/src/metric/src/ConfigProvider.php index 5e436790b..d6ff0fbc4 100644 --- a/src/metric/src/ConfigProvider.php +++ b/src/metric/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric; use Domnikl\Statsd\Connection; diff --git a/src/metric/src/Contract/CounterInterface.php b/src/metric/src/Contract/CounterInterface.php index a625b70dc..2570132a3 100644 --- a/src/metric/src/Contract/CounterInterface.php +++ b/src/metric/src/Contract/CounterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Contract; /** diff --git a/src/metric/src/Contract/GaugeInterface.php b/src/metric/src/Contract/GaugeInterface.php index 204c121b6..98b76f7e6 100644 --- a/src/metric/src/Contract/GaugeInterface.php +++ b/src/metric/src/Contract/GaugeInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Contract; /** diff --git a/src/metric/src/Contract/HistogramInterface.php b/src/metric/src/Contract/HistogramInterface.php index 1f8bd5d58..239b4bba8 100644 --- a/src/metric/src/Contract/HistogramInterface.php +++ b/src/metric/src/Contract/HistogramInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Contract; /** diff --git a/src/metric/src/Contract/MetricCollectorInterface.php b/src/metric/src/Contract/MetricCollectorInterface.php index 54b95ac98..20b992cab 100644 --- a/src/metric/src/Contract/MetricCollectorInterface.php +++ b/src/metric/src/Contract/MetricCollectorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Contract; interface MetricCollectorInterface diff --git a/src/metric/src/Contract/MetricFactoryInterface.php b/src/metric/src/Contract/MetricFactoryInterface.php index 0e28970b9..f3b982df5 100644 --- a/src/metric/src/Contract/MetricFactoryInterface.php +++ b/src/metric/src/Contract/MetricFactoryInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Contract; interface MetricFactoryInterface diff --git a/src/metric/src/CoroutineServerStats.php b/src/metric/src/CoroutineServerStats.php index 171ef4c77..47d4945e0 100644 --- a/src/metric/src/CoroutineServerStats.php +++ b/src/metric/src/CoroutineServerStats.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric; use Hyperf\Contract\Arrayable; diff --git a/src/metric/src/Event/MetricFactoryReady.php b/src/metric/src/Event/MetricFactoryReady.php index 6ac4a0bf3..5acceddd7 100644 --- a/src/metric/src/Event/MetricFactoryReady.php +++ b/src/metric/src/Event/MetricFactoryReady.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Event; use Hyperf\Metric\Contract\MetricFactoryInterface; diff --git a/src/metric/src/Exception/InvalidArgumentException.php b/src/metric/src/Exception/InvalidArgumentException.php index e80c63a98..800d81b9d 100644 --- a/src/metric/src/Exception/InvalidArgumentException.php +++ b/src/metric/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/metric/src/Exception/RuntimeException.php b/src/metric/src/Exception/RuntimeException.php index ddc9d55af..30946aa86 100644 --- a/src/metric/src/Exception/RuntimeException.php +++ b/src/metric/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Exception; class RuntimeException extends \RuntimeException diff --git a/src/metric/src/Listener/DBPoolWatcher.php b/src/metric/src/Listener/DBPoolWatcher.php index 20dd5f5fd..0c3628639 100644 --- a/src/metric/src/Listener/DBPoolWatcher.php +++ b/src/metric/src/Listener/DBPoolWatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; @@ -27,9 +28,6 @@ class DBPoolWatcher extends PoolWatcher implements ListenerInterface return 'mysql'; } - /** - * {@inheritdoc} - */ public function process(object $event): void { $config = $this->container->get(ConfigInterface::class); diff --git a/src/metric/src/Listener/MetricBufferWatcher.php b/src/metric/src/Listener/MetricBufferWatcher.php index feeaa1560..957c7ab50 100644 --- a/src/metric/src/Listener/MetricBufferWatcher.php +++ b/src/metric/src/Listener/MetricBufferWatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Listener/OnBeforeHandle.php b/src/metric/src/Listener/OnBeforeHandle.php index 868c54009..918b25ac1 100644 --- a/src/metric/src/Listener/OnBeforeHandle.php +++ b/src/metric/src/Listener/OnBeforeHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Command\Event\AfterExecute; diff --git a/src/metric/src/Listener/OnCoroutineServerStart.php b/src/metric/src/Listener/OnCoroutineServerStart.php index 5294dd15b..a5d83c12f 100644 --- a/src/metric/src/Listener/OnCoroutineServerStart.php +++ b/src/metric/src/Listener/OnCoroutineServerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Listener/OnMetricFactoryReady.php b/src/metric/src/Listener/OnMetricFactoryReady.php index ffc81167e..bbf31a94a 100644 --- a/src/metric/src/Listener/OnMetricFactoryReady.php +++ b/src/metric/src/Listener/OnMetricFactoryReady.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Listener/OnPipeMessage.php b/src/metric/src/Listener/OnPipeMessage.php index 4049c52b4..61e88f55e 100644 --- a/src/metric/src/Listener/OnPipeMessage.php +++ b/src/metric/src/Listener/OnPipeMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Coroutine\Coroutine; diff --git a/src/metric/src/Listener/OnWorkerStart.php b/src/metric/src/Listener/OnWorkerStart.php index 0cdb4dc4d..f6777733e 100644 --- a/src/metric/src/Listener/OnWorkerStart.php +++ b/src/metric/src/Listener/OnWorkerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; @@ -23,6 +24,7 @@ use Hyperf\Metric\Event\MetricFactoryReady; use Hyperf\Metric\MetricSetter; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; +use Swoole\Server; use function gc_status; use function getrusage; @@ -124,7 +126,7 @@ class OnWorkerStart implements ListenerInterface $timerInterval = $this->config->get('metric.default_metric_interval', 5); $timerId = $this->timer->tick($timerInterval, function () use ($metrics) { - $server = $this->container->get(\Swoole\Server::class); + $server = $this->container->get(Server::class); $serverStats = $server->stats(); $this->trySet('gc_', $metrics, gc_status()); $this->trySet('', $metrics, getrusage()); diff --git a/src/metric/src/Listener/PoolWatcher.php b/src/metric/src/Listener/PoolWatcher.php index 936cc3aae..0eaa543ef 100644 --- a/src/metric/src/Listener/PoolWatcher.php +++ b/src/metric/src/Listener/PoolWatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Listener/QueueWatcher.php b/src/metric/src/Listener/QueueWatcher.php index 592d08dc2..38dd9a7a7 100644 --- a/src/metric/src/Listener/QueueWatcher.php +++ b/src/metric/src/Listener/QueueWatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\AsyncQueue\Driver\DriverFactory; diff --git a/src/metric/src/Listener/RedisPoolWatcher.php b/src/metric/src/Listener/RedisPoolWatcher.php index fc4817f3c..4b6e10c3a 100644 --- a/src/metric/src/Listener/RedisPoolWatcher.php +++ b/src/metric/src/Listener/RedisPoolWatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Listener; use Hyperf\Contract\ConfigInterface; @@ -27,9 +28,6 @@ class RedisPoolWatcher extends PoolWatcher implements ListenerInterface return 'redis'; } - /** - * {@inheritdoc} - */ public function process(object $event): void { $config = $this->container->get(ConfigInterface::class); diff --git a/src/metric/src/Metric.php b/src/metric/src/Metric.php index ddad54a90..4dbe5d5e8 100644 --- a/src/metric/src/Metric.php +++ b/src/metric/src/Metric.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric; use Hyperf\Metric\Contract\MetricFactoryInterface; diff --git a/src/metric/src/MetricFactoryPicker.php b/src/metric/src/MetricFactoryPicker.php index ff7fdae4d..46f2e71c8 100644 --- a/src/metric/src/MetricFactoryPicker.php +++ b/src/metric/src/MetricFactoryPicker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/MetricSetter.php b/src/metric/src/MetricSetter.php index f2d6db0d0..f7871622b 100644 --- a/src/metric/src/MetricSetter.php +++ b/src/metric/src/MetricSetter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric; use Hyperf\Coroutine\Coroutine; diff --git a/src/metric/src/Middleware/MetricMiddleware.php b/src/metric/src/Middleware/MetricMiddleware.php index 5dc6b3787..934d73514 100644 --- a/src/metric/src/Middleware/MetricMiddleware.php +++ b/src/metric/src/Middleware/MetricMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Middleware; use Hyperf\HttpMessage\Exception\HttpException; diff --git a/src/metric/src/Process/MetricProcess.php b/src/metric/src/Process/MetricProcess.php index 266987e08..d24a332cc 100644 --- a/src/metric/src/Process/MetricProcess.php +++ b/src/metric/src/Process/MetricProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric\Process; use Hyperf\Contract\ConfigInterface; diff --git a/src/metric/src/Timer.php b/src/metric/src/Timer.php index 4600b4a4d..64405c9a3 100644 --- a/src/metric/src/Timer.php +++ b/src/metric/src/Timer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Metric; use Hyperf\Metric\Contract\MetricFactoryInterface; diff --git a/src/metric/tests/Adapter/Prometheus/RedisStorageFactoryTest.php b/src/metric/tests/Adapter/Prometheus/RedisStorageFactoryTest.php index 6f4c1c6b6..b54491e22 100644 --- a/src/metric/tests/Adapter/Prometheus/RedisStorageFactoryTest.php +++ b/src/metric/tests/Adapter/Prometheus/RedisStorageFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Adapter\Prometheus; use Hyperf\Config\Config; diff --git a/src/metric/tests/Adapter/Prometheus/RedisTest.php b/src/metric/tests/Adapter/Prometheus/RedisTest.php index 8c59d75b5..659069a54 100644 --- a/src/metric/tests/Adapter/Prometheus/RedisTest.php +++ b/src/metric/tests/Adapter/Prometheus/RedisTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Adapter\Prometheus; use Hyperf\Metric\Adapter\Prometheus\Redis; diff --git a/src/metric/tests/Adapter/RemoteProxy/MetricCollectorTest.php b/src/metric/tests/Adapter/RemoteProxy/MetricCollectorTest.php index e445ae81a..e971f5c86 100644 --- a/src/metric/tests/Adapter/RemoteProxy/MetricCollectorTest.php +++ b/src/metric/tests/Adapter/RemoteProxy/MetricCollectorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Adapter\RemoteProxy; use Hyperf\Metric\Adapter\RemoteProxy\MetricCollector; diff --git a/src/metric/tests/Cases/MetricFactoryPickerTest.php b/src/metric/tests/Cases/MetricFactoryPickerTest.php index 373df5729..06a7dc662 100644 --- a/src/metric/tests/Cases/MetricFactoryPickerTest.php +++ b/src/metric/tests/Cases/MetricFactoryPickerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Cases; use Hyperf\Config\Config; @@ -23,6 +24,7 @@ use Hyperf\Process\ProcessCollector; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; +use Swoole\Process; /** * @internal @@ -98,7 +100,7 @@ class MetricFactoryPickerTest extends TestCase ], ], ]); - ProcessCollector::add('dummy', Mockery::mock(\Swoole\Process::class)); + ProcessCollector::add('dummy', Mockery::mock(Process::class)); $container = Mockery::mock(Container::class); $container->shouldReceive('get')->with(ConfigInterface::class)->andReturn($config); $container->shouldReceive('get')->with(RemoteFactory::class)->andReturn(Mockery::mock(RemoteFactory::class)); @@ -125,7 +127,7 @@ class MetricFactoryPickerTest extends TestCase ], ], ]); - ProcessCollector::add('dummy', Mockery::mock(\Swoole\Process::class)); + ProcessCollector::add('dummy', Mockery::mock(Process::class)); $container = Mockery::mock(Container::class); $container->shouldReceive('get')->with(ConfigInterface::class)->andReturn($config); $container->shouldReceive('get')->with(PrometheusFactory::class)->andReturn(Mockery::mock(PrometheusFactory::class)); diff --git a/src/metric/tests/Cases/MetricFactoryTest.php b/src/metric/tests/Cases/MetricFactoryTest.php index ad3b0b5e5..9e8214dc5 100644 --- a/src/metric/tests/Cases/MetricFactoryTest.php +++ b/src/metric/tests/Cases/MetricFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Cases; use Hyperf\Config\Config; diff --git a/src/metric/tests/Cases/OnWorkerStartTest.php b/src/metric/tests/Cases/OnWorkerStartTest.php index 0d4ad5608..47a6aff1f 100644 --- a/src/metric/tests/Cases/OnWorkerStartTest.php +++ b/src/metric/tests/Cases/OnWorkerStartTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Cases; use Hyperf\Config\Config; diff --git a/src/metric/tests/Cases/TimerTest.php b/src/metric/tests/Cases/TimerTest.php index c2fd3ce8a..09fb41fba 100644 --- a/src/metric/tests/Cases/TimerTest.php +++ b/src/metric/tests/Cases/TimerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Metric\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/migration-generator/src/Command/GenerateMigrationCommand.php b/src/migration-generator/src/Command/GenerateMigrationCommand.php index d4a45e1b2..0d15353a7 100644 --- a/src/migration-generator/src/Command/GenerateMigrationCommand.php +++ b/src/migration-generator/src/Command/GenerateMigrationCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\MigrationGenerator\Command; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/migration-generator/src/ConfigProvider.php b/src/migration-generator/src/ConfigProvider.php index 6573439c9..24146f474 100644 --- a/src/migration-generator/src/ConfigProvider.php +++ b/src/migration-generator/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\MigrationGenerator; use Hyperf\MigrationGenerator\Command\GenerateMigrationCommand; diff --git a/src/migration-generator/src/CreateMigrationVisitor.php b/src/migration-generator/src/CreateMigrationVisitor.php index ab99af01e..545c20c25 100644 --- a/src/migration-generator/src/CreateMigrationVisitor.php +++ b/src/migration-generator/src/CreateMigrationVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\MigrationGenerator; use Hyperf\CodeParser\PhpParser; diff --git a/src/migration-generator/src/MigrationGenerator.php b/src/migration-generator/src/MigrationGenerator.php index 7e2a17c61..826a2007d 100644 --- a/src/migration-generator/src/MigrationGenerator.php +++ b/src/migration-generator/src/MigrationGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\MigrationGenerator; use Hyperf\Collection\Collection; diff --git a/src/migration-generator/src/TableData.php b/src/migration-generator/src/TableData.php index c6c8268c0..943183887 100644 --- a/src/migration-generator/src/TableData.php +++ b/src/migration-generator/src/TableData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\MigrationGenerator; use JetBrains\PhpStorm\ArrayShape; diff --git a/src/migration-generator/tests/Cases/MigrationGeneratorTest.php b/src/migration-generator/tests/Cases/MigrationGeneratorTest.php index 79bc2a503..4191ec1b7 100644 --- a/src/migration-generator/tests/Cases/MigrationGeneratorTest.php +++ b/src/migration-generator/tests/Cases/MigrationGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\MigrationGenerator\Cases; use Hyperf\Contract\ConfigInterface; diff --git a/src/migration-generator/tests/ContainerStub.php b/src/migration-generator/tests/ContainerStub.php index 01abbcc45..f42854e53 100644 --- a/src/migration-generator/tests/ContainerStub.php +++ b/src/migration-generator/tests/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\MigrationGenerator; use Hyperf\Config\Config; diff --git a/src/model-cache/publish/databases.php b/src/model-cache/publish/databases.php index 673bffb17..247989dd9 100644 --- a/src/model-cache/publish/databases.php +++ b/src/model-cache/publish/databases.php @@ -9,6 +9,8 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\ModelCache\Handler\RedisHandler; + use function Hyperf\Support\env; return [ @@ -30,7 +32,7 @@ return [ 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60), ], 'cache' => [ - 'handler' => \Hyperf\ModelCache\Handler\RedisHandler::class, + 'handler' => RedisHandler::class, 'cache_key' => 'mc:%s:m:%s:%s:%s', 'prefix' => 'default', 'pool' => 'default', diff --git a/src/model-cache/src/Builder.php b/src/model-cache/src/Builder.php index 646e0abf0..eca5106de 100644 --- a/src/model-cache/src/Builder.php +++ b/src/model-cache/src/Builder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use Closure; diff --git a/src/model-cache/src/Cacheable.php b/src/model-cache/src/Cacheable.php index 96cd90048..74ff102e0 100644 --- a/src/model-cache/src/Cacheable.php +++ b/src/model-cache/src/Cacheable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use Hyperf\Context\ApplicationContext; diff --git a/src/model-cache/src/CacheableInterface.php b/src/model-cache/src/CacheableInterface.php index cdc616b49..0256049bc 100644 --- a/src/model-cache/src/CacheableInterface.php +++ b/src/model-cache/src/CacheableInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use Hyperf\Database\Model\Collection; diff --git a/src/model-cache/src/Config.php b/src/model-cache/src/Config.php index 8439affd9..31d30fc6d 100644 --- a/src/model-cache/src/Config.php +++ b/src/model-cache/src/Config.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use DateInterval; diff --git a/src/model-cache/src/ConfigProvider.php b/src/model-cache/src/ConfigProvider.php index 7153d203b..cf1c959d2 100644 --- a/src/model-cache/src/ConfigProvider.php +++ b/src/model-cache/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use Hyperf\ModelCache\Listener\DeleteCacheInTransactionListener; diff --git a/src/model-cache/src/EagerLoad/EagerLoader.php b/src/model-cache/src/EagerLoad/EagerLoader.php index f848b3911..d8d896939 100644 --- a/src/model-cache/src/EagerLoad/EagerLoader.php +++ b/src/model-cache/src/EagerLoad/EagerLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\EagerLoad; use Hyperf\Database\Connection; diff --git a/src/model-cache/src/EagerLoad/EagerLoaderBuilder.php b/src/model-cache/src/EagerLoad/EagerLoaderBuilder.php index f4db857b5..a6dff2ada 100644 --- a/src/model-cache/src/EagerLoad/EagerLoaderBuilder.php +++ b/src/model-cache/src/EagerLoad/EagerLoaderBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\EagerLoad; use Closure; diff --git a/src/model-cache/src/Exception/CacheException.php b/src/model-cache/src/Exception/CacheException.php index 9377eedd6..1d3900023 100644 --- a/src/model-cache/src/Exception/CacheException.php +++ b/src/model-cache/src/Exception/CacheException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Exception; use RuntimeException; diff --git a/src/model-cache/src/Exception/OperatorNotFoundException.php b/src/model-cache/src/Exception/OperatorNotFoundException.php index c120def03..5f78423b8 100644 --- a/src/model-cache/src/Exception/OperatorNotFoundException.php +++ b/src/model-cache/src/Exception/OperatorNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Exception; use RuntimeException; diff --git a/src/model-cache/src/Handler/DefaultValueInterface.php b/src/model-cache/src/Handler/DefaultValueInterface.php index 27682f3db..7e16eed31 100644 --- a/src/model-cache/src/Handler/DefaultValueInterface.php +++ b/src/model-cache/src/Handler/DefaultValueInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Handler; interface DefaultValueInterface diff --git a/src/model-cache/src/Handler/HandlerInterface.php b/src/model-cache/src/Handler/HandlerInterface.php index 69d6d758f..3db832439 100644 --- a/src/model-cache/src/Handler/HandlerInterface.php +++ b/src/model-cache/src/Handler/HandlerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Handler; use Hyperf\ModelCache\Config; diff --git a/src/model-cache/src/Handler/RedisHandler.php b/src/model-cache/src/Handler/RedisHandler.php index d4309bd02..1ff360f74 100644 --- a/src/model-cache/src/Handler/RedisHandler.php +++ b/src/model-cache/src/Handler/RedisHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Handler; use Hyperf\Contract\Arrayable; diff --git a/src/model-cache/src/Handler/RedisStringHandler.php b/src/model-cache/src/Handler/RedisStringHandler.php index 8f4fed560..e31386b6d 100644 --- a/src/model-cache/src/Handler/RedisStringHandler.php +++ b/src/model-cache/src/Handler/RedisStringHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Handler; use Hyperf\Codec\Packer\PhpSerializerPacker; diff --git a/src/model-cache/src/InvalidCacheManager.php b/src/model-cache/src/InvalidCacheManager.php index 3ee3c7287..4bb466d70 100644 --- a/src/model-cache/src/InvalidCacheManager.php +++ b/src/model-cache/src/InvalidCacheManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use Hyperf\Support\Traits\StaticInstance; diff --git a/src/model-cache/src/Listener/DeleteCacheInTransactionListener.php b/src/model-cache/src/Listener/DeleteCacheInTransactionListener.php index faefaa2eb..5cccf9b95 100644 --- a/src/model-cache/src/Listener/DeleteCacheInTransactionListener.php +++ b/src/model-cache/src/Listener/DeleteCacheInTransactionListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Listener; use Hyperf\Database\Events\TransactionCommitted; diff --git a/src/model-cache/src/Listener/DeleteCacheListener.php b/src/model-cache/src/Listener/DeleteCacheListener.php index 52a0d1dbb..51560839f 100644 --- a/src/model-cache/src/Listener/DeleteCacheListener.php +++ b/src/model-cache/src/Listener/DeleteCacheListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Listener; use Hyperf\Database\Model\Events\Deleted; diff --git a/src/model-cache/src/Listener/EagerLoadListener.php b/src/model-cache/src/Listener/EagerLoadListener.php index 9280ffffc..86bb52ecf 100644 --- a/src/model-cache/src/Listener/EagerLoadListener.php +++ b/src/model-cache/src/Listener/EagerLoadListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Listener; use Hyperf\Database\Model\Collection; diff --git a/src/model-cache/src/Manager.php b/src/model-cache/src/Manager.php index 9ab48eec5..66f481a3e 100644 --- a/src/model-cache/src/Manager.php +++ b/src/model-cache/src/Manager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache; use DateInterval; diff --git a/src/model-cache/src/Redis/HashGetMultiple.php b/src/model-cache/src/Redis/HashGetMultiple.php index 041adfda0..5a15db4b8 100644 --- a/src/model-cache/src/Redis/HashGetMultiple.php +++ b/src/model-cache/src/Redis/HashGetMultiple.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Redis; class HashGetMultiple implements OperatorInterface diff --git a/src/model-cache/src/Redis/HashIncr.php b/src/model-cache/src/Redis/HashIncr.php index e273d9b86..c9857c9de 100644 --- a/src/model-cache/src/Redis/HashIncr.php +++ b/src/model-cache/src/Redis/HashIncr.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Redis; class HashIncr implements OperatorInterface diff --git a/src/model-cache/src/Redis/LuaManager.php b/src/model-cache/src/Redis/LuaManager.php index 8946064af..6dc6252df 100644 --- a/src/model-cache/src/Redis/LuaManager.php +++ b/src/model-cache/src/Redis/LuaManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Redis; use Hyperf\ModelCache\Config; diff --git a/src/model-cache/src/Redis/OperatorInterface.php b/src/model-cache/src/Redis/OperatorInterface.php index dbcac8149..3b7b3f1bc 100644 --- a/src/model-cache/src/Redis/OperatorInterface.php +++ b/src/model-cache/src/Redis/OperatorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelCache\Redis; interface OperatorInterface diff --git a/src/model-cache/tests/Handler/RedisHandlerTest.php b/src/model-cache/tests/Handler/RedisHandlerTest.php index 7be584c61..b3ed64c88 100644 --- a/src/model-cache/tests/Handler/RedisHandlerTest.php +++ b/src/model-cache/tests/Handler/RedisHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Handler; use DateInterval; diff --git a/src/model-cache/tests/Handler/RedisStringHandlerTest.php b/src/model-cache/tests/Handler/RedisStringHandlerTest.php index 53e0ecaa6..a0fdc0428 100644 --- a/src/model-cache/tests/Handler/RedisStringHandlerTest.php +++ b/src/model-cache/tests/Handler/RedisStringHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Handler; use Hyperf\ModelCache\Handler\RedisStringHandler; diff --git a/src/model-cache/tests/ManagerTest.php b/src/model-cache/tests/ManagerTest.php index 9b62737d3..89518d161 100644 --- a/src/model-cache/tests/ManagerTest.php +++ b/src/model-cache/tests/ManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache; use Hyperf\Config\Config; diff --git a/src/model-cache/tests/ModelCacheTest.php b/src/model-cache/tests/ModelCacheTest.php index 9279ed3ce..bed6b9eac 100644 --- a/src/model-cache/tests/ModelCacheTest.php +++ b/src/model-cache/tests/ModelCacheTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache; use DateInterval; diff --git a/src/model-cache/tests/Stub/BookModel.php b/src/model-cache/tests/Stub/BookModel.php index 5d8a8914f..a694c6757 100644 --- a/src/model-cache/tests/Stub/BookModel.php +++ b/src/model-cache/tests/Stub/BookModel.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; +use Carbon\Carbon; use Hyperf\ModelCache\Cacheable; use Hyperf\ModelCache\CacheableInterface; use HyperfTest\Database\Stubs\Model\Model; @@ -19,8 +21,8 @@ use HyperfTest\Database\Stubs\Model\Model; * @property int $id * @property int $user_id * @property string $title - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class BookModel extends Model implements CacheableInterface { @@ -28,8 +30,6 @@ class BookModel extends Model implements CacheableInterface /** * The table associated with the model. - * - * @var string */ protected ?string $table = 'book'; diff --git a/src/model-cache/tests/Stub/ContainerStub.php b/src/model-cache/tests/Stub/ContainerStub.php index 35f8198f1..4aad2c4d3 100644 --- a/src/model-cache/tests/Stub/ContainerStub.php +++ b/src/model-cache/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; use Hyperf\Codec\Packer\PhpSerializerPacker; diff --git a/src/model-cache/tests/Stub/ImageModel.php b/src/model-cache/tests/Stub/ImageModel.php index a7b84dae5..a2e1142b4 100644 --- a/src/model-cache/tests/Stub/ImageModel.php +++ b/src/model-cache/tests/Stub/ImageModel.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; +use Carbon\Carbon; use Hyperf\ModelCache\Cacheable; use Hyperf\ModelCache\CacheableInterface; use HyperfTest\Database\Stubs\Model\Model; @@ -20,8 +22,8 @@ use HyperfTest\Database\Stubs\Model\Model; * @property string $url * @property int $imageable_id * @property string $imageable_type - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class ImageModel extends Model implements CacheableInterface { diff --git a/src/model-cache/tests/Stub/ManagerStub.php b/src/model-cache/tests/Stub/ManagerStub.php index e0f24fc47..475d7b698 100644 --- a/src/model-cache/tests/Stub/ManagerStub.php +++ b/src/model-cache/tests/Stub/ManagerStub.php @@ -9,13 +9,15 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; use DateInterval; use Hyperf\Database\Model\Model; use Hyperf\ModelCache\Handler\HandlerInterface; +use Hyperf\ModelCache\Manager; -class ManagerStub extends \Hyperf\ModelCache\Manager +class ManagerStub extends Manager { public function getCacheTTL(Model $instance, HandlerInterface $handler): DateInterval|int { diff --git a/src/model-cache/tests/Stub/ModelStub.php b/src/model-cache/tests/Stub/ModelStub.php index f119d296a..4b78a0d9d 100644 --- a/src/model-cache/tests/Stub/ModelStub.php +++ b/src/model-cache/tests/Stub/ModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; use Hyperf\DbConnection\Model\Model; diff --git a/src/model-cache/tests/Stub/NonHandler.php b/src/model-cache/tests/Stub/NonHandler.php index 4f0168f6d..e26903136 100644 --- a/src/model-cache/tests/Stub/NonHandler.php +++ b/src/model-cache/tests/Stub/NonHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; use Hyperf\ModelCache\Config; diff --git a/src/model-cache/tests/Stub/StdoutLogger.php b/src/model-cache/tests/Stub/StdoutLogger.php index f1f4555f7..6edbafce2 100644 --- a/src/model-cache/tests/Stub/StdoutLogger.php +++ b/src/model-cache/tests/Stub/StdoutLogger.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/model-cache/tests/Stub/UserExtModel.php b/src/model-cache/tests/Stub/UserExtModel.php index b24875947..cc2495384 100644 --- a/src/model-cache/tests/Stub/UserExtModel.php +++ b/src/model-cache/tests/Stub/UserExtModel.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; +use Carbon\Carbon; use Hyperf\DbConnection\Model\Model; use Hyperf\ModelCache\Cacheable; use Hyperf\ModelCache\CacheableInterface; @@ -21,8 +23,8 @@ use Hyperf\ModelCache\CacheableInterface; * @property float $float_num * @property string $str * @property string $json - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class UserExtModel extends Model implements CacheableInterface { diff --git a/src/model-cache/tests/Stub/UserHiddenModel.php b/src/model-cache/tests/Stub/UserHiddenModel.php index eece068d9..afea04b7e 100644 --- a/src/model-cache/tests/Stub/UserHiddenModel.php +++ b/src/model-cache/tests/Stub/UserHiddenModel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; class UserHiddenModel extends UserModel diff --git a/src/model-cache/tests/Stub/UserModel.php b/src/model-cache/tests/Stub/UserModel.php index 18c6b8fe4..a39c51f85 100644 --- a/src/model-cache/tests/Stub/UserModel.php +++ b/src/model-cache/tests/Stub/UserModel.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelCache\Stub; +use Carbon\Carbon; use Hyperf\DbConnection\Model\Model; use Hyperf\ModelCache\Cacheable; use Hyperf\ModelCache\CacheableInterface; @@ -19,8 +21,8 @@ use Hyperf\ModelCache\CacheableInterface; * @property int $id * @property string $name * @property int $gender - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at + * @property Carbon $created_at + * @property Carbon $updated_at */ class UserModel extends Model implements CacheableInterface { diff --git a/src/model-listener/src/AbstractListener.php b/src/model-listener/src/AbstractListener.php index 38e8dabce..f4857c868 100644 --- a/src/model-listener/src/AbstractListener.php +++ b/src/model-listener/src/AbstractListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener; use Hyperf\Database\Model\Events\Created; diff --git a/src/model-listener/src/Annotation/ModelListener.php b/src/model-listener/src/Annotation/ModelListener.php index 3034e404a..c730aa186 100644 --- a/src/model-listener/src/Annotation/ModelListener.php +++ b/src/model-listener/src/Annotation/ModelListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener\Annotation; use Attribute; diff --git a/src/model-listener/src/Collector/ListenerCollector.php b/src/model-listener/src/Collector/ListenerCollector.php index bc44ef485..036088a65 100644 --- a/src/model-listener/src/Collector/ListenerCollector.php +++ b/src/model-listener/src/Collector/ListenerCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener\Collector; use Hyperf\Di\MetadataCollector; diff --git a/src/model-listener/src/ConfigProvider.php b/src/model-listener/src/ConfigProvider.php index e27805572..8a5ea64ed 100644 --- a/src/model-listener/src/ConfigProvider.php +++ b/src/model-listener/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener; use Hyperf\ModelListener\Collector\ListenerCollector; diff --git a/src/model-listener/src/Listener/ModelEventListener.php b/src/model-listener/src/Listener/ModelEventListener.php index ff8cc32e4..a2ca9c173 100644 --- a/src/model-listener/src/Listener/ModelEventListener.php +++ b/src/model-listener/src/Listener/ModelEventListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener\Listener; use Hyperf\Database\Model\Events\Event; diff --git a/src/model-listener/src/Listener/ModelHookEventListener.php b/src/model-listener/src/Listener/ModelHookEventListener.php index 0bf3a0914..b41b1d6e7 100644 --- a/src/model-listener/src/Listener/ModelHookEventListener.php +++ b/src/model-listener/src/Listener/ModelHookEventListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ModelListener\Listener; use Hyperf\Database\Model\Events\Event; diff --git a/src/model-listener/tests/AnnotationTest.php b/src/model-listener/tests/AnnotationTest.php index 02879d6f5..28e8606fc 100644 --- a/src/model-listener/tests/AnnotationTest.php +++ b/src/model-listener/tests/AnnotationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelListener; use Hyperf\ModelListener\Annotation\ModelListener; diff --git a/src/model-listener/tests/ListenerCollectorTest.php b/src/model-listener/tests/ListenerCollectorTest.php index 3969590b2..d60eef43a 100644 --- a/src/model-listener/tests/ListenerCollectorTest.php +++ b/src/model-listener/tests/ListenerCollectorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelListener; use Hyperf\ModelListener\Collector\ListenerCollector; diff --git a/src/model-listener/tests/ModelListenerTest.php b/src/model-listener/tests/ModelListenerTest.php index 9ca258057..30e317b6e 100644 --- a/src/model-listener/tests/ModelListenerTest.php +++ b/src/model-listener/tests/ModelListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelListener; use Hyperf\Database\Model\Builder; diff --git a/src/model-listener/tests/Stub/ModelListenerStub.php b/src/model-listener/tests/Stub/ModelListenerStub.php index 308574449..956dac385 100644 --- a/src/model-listener/tests/Stub/ModelListenerStub.php +++ b/src/model-listener/tests/Stub/ModelListenerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelListener\Stub; use Hyperf\Database\Model\Events\Updating; diff --git a/src/model-listener/tests/Stub/ModelStub.php b/src/model-listener/tests/Stub/ModelStub.php index 31bb8be1b..b628f904d 100644 --- a/src/model-listener/tests/Stub/ModelStub.php +++ b/src/model-listener/tests/Stub/ModelStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ModelListener\Stub; use Hyperf\Database\Model\Model; diff --git a/src/nacos/composer.json b/src/nacos/composer.json index 46eaaa902..ed001959d 100644 --- a/src/nacos/composer.json +++ b/src/nacos/composer.json @@ -24,7 +24,8 @@ "hyperf/codec": "~3.1.0", "hyperf/contract": "~3.1.0", "hyperf/support": "~3.1.0", - "hyperf/utils": "~3.1.0" + "hyperf/utils": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0" }, "suggests": { "google/protobuf": "Required to use nacos v2 grpc apis.", diff --git a/src/nacos/src/AbstractProvider.php b/src/nacos/src/AbstractProvider.php index 6f1343aeb..f41b8b30d 100644 --- a/src/nacos/src/AbstractProvider.php +++ b/src/nacos/src/AbstractProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; use GuzzleHttp\Client; diff --git a/src/nacos/src/Application.php b/src/nacos/src/Application.php index ebfd9444b..9b31aae2f 100644 --- a/src/nacos/src/Application.php +++ b/src/nacos/src/Application.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; use Hyperf\Nacos\Exception\InvalidArgumentException; diff --git a/src/nacos/src/ApplicationFactory.php b/src/nacos/src/ApplicationFactory.php index c68f70bd8..d9fcc11a7 100644 --- a/src/nacos/src/ApplicationFactory.php +++ b/src/nacos/src/ApplicationFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; use Hyperf\Contract\ConfigInterface; diff --git a/src/nacos/src/Config.php b/src/nacos/src/Config.php index 5fada2abc..bb4603b72 100644 --- a/src/nacos/src/Config.php +++ b/src/nacos/src/Config.php @@ -9,8 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; +use JetBrains\PhpStorm\ArrayShape; + class Config { protected string $baseUri = 'http://127.0.0.1:8848/'; @@ -39,20 +42,19 @@ class Config 'http_errors' => false, ]; - /** - * @param $config = [ - * 'base_uri' => 'http://127.0.0.1:8848/', - * 'username' => null, - * 'password' => null, - * 'access_key' => null, - * 'access_secret' => null, - * 'guzzle_config' => [], - * 'host' => '127.0.0.1', - * 'port' => 8848, - * ] - */ - public function __construct(array $config = []) - { + public function __construct( + #[ArrayShape([ + 'base_uri' => 'string', + 'username' => 'string', + 'password' => 'string', + 'access_key' => 'string', + 'access_secret' => 'string', + 'guzzle_config' => 'array', + 'host' => 'string', + 'port' => 'int', + ])] + array $config = [] + ) { isset($config['base_uri']) && $this->baseUri = (string) $config['base_uri']; isset($config['username']) && $this->username = (string) $config['username']; isset($config['password']) && $this->password = (string) $config['password']; diff --git a/src/nacos/src/ConfigProvider.php b/src/nacos/src/ConfigProvider.php index 691906e69..ce38dd8ad 100644 --- a/src/nacos/src/ConfigProvider.php +++ b/src/nacos/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; class ConfigProvider diff --git a/src/nacos/src/Exception/ConnectToServerFailedException.php b/src/nacos/src/Exception/ConnectToServerFailedException.php index fe4b121f9..9dea46f77 100644 --- a/src/nacos/src/Exception/ConnectToServerFailedException.php +++ b/src/nacos/src/Exception/ConnectToServerFailedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Exception; class ConnectToServerFailedException extends RuntimeException diff --git a/src/nacos/src/Exception/InvalidArgumentException.php b/src/nacos/src/Exception/InvalidArgumentException.php index 8ab774706..c5661d804 100644 --- a/src/nacos/src/Exception/InvalidArgumentException.php +++ b/src/nacos/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Exception; class InvalidArgumentException extends \InvalidArgumentException implements NacosThrowable diff --git a/src/nacos/src/Exception/NacosThrowable.php b/src/nacos/src/Exception/NacosThrowable.php index 0e80c509c..b50cf8ed0 100644 --- a/src/nacos/src/Exception/NacosThrowable.php +++ b/src/nacos/src/Exception/NacosThrowable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Exception; use Throwable; diff --git a/src/nacos/src/Exception/RequestException.php b/src/nacos/src/Exception/RequestException.php index c90fbea1f..a10fc7d19 100644 --- a/src/nacos/src/Exception/RequestException.php +++ b/src/nacos/src/Exception/RequestException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Exception; class RequestException extends RuntimeException diff --git a/src/nacos/src/Exception/RuntimeException.php b/src/nacos/src/Exception/RuntimeException.php index 05dcbadc1..32d11339a 100644 --- a/src/nacos/src/Exception/RuntimeException.php +++ b/src/nacos/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Exception; class RuntimeException extends \RuntimeException implements NacosThrowable diff --git a/src/nacos/src/GrpcClient.php b/src/nacos/src/GrpcClient.php index d2e7db8e1..712dd7aae 100644 --- a/src/nacos/src/GrpcClient.php +++ b/src/nacos/src/GrpcClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; use Exception; diff --git a/src/nacos/src/GrpcFactory.php b/src/nacos/src/GrpcFactory.php index 6c9aed6d5..7d1056462 100644 --- a/src/nacos/src/GrpcFactory.php +++ b/src/nacos/src/GrpcFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; use Hyperf\Context\ApplicationContext; @@ -29,7 +30,7 @@ class GrpcFactory } } - public function get(string $namespaceId, string|Module $module = 'config'): GrpcClient + public function get(string $namespaceId, Module|string $module = 'config'): GrpcClient { $module instanceof Module && $module = $module->value; @@ -52,7 +53,7 @@ class GrpcFactory * @param string $module config or naming * @return array array */ - public function moduleClients(string|Module $module): array + public function moduleClients(Module|string $module): array { $module instanceof Module && $module = $module->value; diff --git a/src/nacos/src/Module.php b/src/nacos/src/Module.php index a43d1ba1b..c0bfacb22 100644 --- a/src/nacos/src/Module.php +++ b/src/nacos/src/Module.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos; enum Module: string diff --git a/src/nacos/src/Protobuf/Any.php b/src/nacos/src/Protobuf/Any.php index 4a30fb317..c467365b4 100644 --- a/src/nacos/src/Protobuf/Any.php +++ b/src/nacos/src/Protobuf/Any.php @@ -13,6 +13,7 @@ declare(strict_types=1); namespace Hyperf\Nacos\Protobuf; +use Google\Protobuf\Internal\AnyBase; use Google\Protobuf\Internal\GPBUtil; /** @@ -82,7 +83,7 @@ use Google\Protobuf\Internal\GPBUtil; * * Generated from protobuf message google.protobuf.Any */ -class Any extends \Google\Protobuf\Internal\AnyBase +class Any extends AnyBase { /** * A URL/resource name that uniquely identifies the type of the serialized @@ -126,33 +127,33 @@ class Any extends \Google\Protobuf\Internal\AnyBase * @param array $data { * Optional. Data for populating the Message object. * - * @var string $type_url - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * @var string $type_url + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the + * * Applications are allowed to cache lookup results based on the * URL, or have them precompiled into a binary to avoid any * lookup. Therefore, binary compatibility needs to be preserved * on changes to types. (Use versioned type names to manage * breaking changes.) - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - * @var string $value - * Must be a valid serialized protocol buffer of the above specified type. - * } + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + * @var string $value + * Must be a valid serialized protocol buffer of the above specified type. + * } */ public function __construct($data = null) { diff --git a/src/nacos/src/Protobuf/GPBMetadata/Any.php b/src/nacos/src/Protobuf/GPBMetadata/Any.php index 05f222441..95133e5d6 100644 --- a/src/nacos/src/Protobuf/GPBMetadata/Any.php +++ b/src/nacos/src/Protobuf/GPBMetadata/Any.php @@ -13,13 +13,15 @@ declare(strict_types=1); namespace Hyperf\Nacos\Protobuf\GPBMetadata; +use Google\Protobuf\Internal\DescriptorPool; + class Any { public static $is_initialized = false; public static function initOnce() { - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $pool = DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; diff --git a/src/nacos/src/Protobuf/GPBMetadata/Nacos.php b/src/nacos/src/Protobuf/GPBMetadata/Nacos.php index cc53a7180d75bef3ec15f88954615968cd0fc510..1284e9e6d19142578c0d1a6bc495f6687be87b39 100644 GIT binary patch delta 29 lcmaFQ`G9kSF(XT9ajL@PRgCJB4HzpYA7-rDoWRu21OTAS3Qzz5 delta 34 ocmaFB`JQuwG2`S!#xlm3$>xmelbMetadata. */ -class Metadata extends \Google\Protobuf\Internal\Message +class Metadata extends Message { /** * Generated from protobuf field string type = 3;. @@ -41,10 +44,10 @@ class Metadata extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var string $type - * @var string $clientIp - * @var array|\Google\Protobuf\Internal\MapField $headers - * } + * @var string $type + * @var string $clientIp + * @var array|MapField $headers + * } */ public function __construct($data = null) { @@ -98,7 +101,7 @@ class Metadata extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field map headers = 7;. - * @return \Google\Protobuf\Internal\MapField + * @return MapField */ public function getHeaders() { @@ -107,12 +110,12 @@ class Metadata extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field map headers = 7;. - * @param array|\Google\Protobuf\Internal\MapField $var + * @param array|MapField $var * @return $this */ public function setHeaders($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::STRING); $this->headers = $arr; return $this; diff --git a/src/nacos/src/Protobuf/Payload.php b/src/nacos/src/Protobuf/Payload.php index f96c62cda..fbd45cdc3 100644 --- a/src/nacos/src/Protobuf/Payload.php +++ b/src/nacos/src/Protobuf/Payload.php @@ -14,11 +14,12 @@ declare(strict_types=1); namespace Hyperf\Nacos\Protobuf; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; /** * Generated from protobuf message Payload. */ -class Payload extends \Google\Protobuf\Internal\Message +class Payload extends Message { /** * Generated from protobuf field .Metadata metadata = 2;. @@ -36,9 +37,9 @@ class Payload extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var \Hyperf\Nacos\Protobuf\Metadata $metadata - * @var \Hyperf\Nacos\Protobuf\Any $body - * } + * @var Metadata $metadata + * @var Any $body + * } */ public function __construct($data = null) { @@ -48,7 +49,7 @@ class Payload extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .Metadata metadata = 2;. - * @return null|\Hyperf\Nacos\Protobuf\Metadata + * @return null|Metadata */ public function getMetadata() { @@ -67,12 +68,12 @@ class Payload extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .Metadata metadata = 2;. - * @param \Hyperf\Nacos\Protobuf\Metadata $var + * @param Metadata $var * @return $this */ public function setMetadata($var) { - GPBUtil::checkMessage($var, \Hyperf\Nacos\Protobuf\Metadata::class); + GPBUtil::checkMessage($var, Metadata::class); $this->metadata = $var; return $this; @@ -80,7 +81,7 @@ class Payload extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .google.protobuf.Any body = 3;. - * @return null|\Hyperf\Nacos\Protobuf\Any + * @return null|Any */ public function getBody() { @@ -99,12 +100,12 @@ class Payload extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .google.protobuf.Any body = 3;. - * @param \Hyperf\Nacos\Protobuf\Any $var + * @param Any $var * @return $this */ public function setBody($var) { - GPBUtil::checkMessage($var, \Hyperf\Nacos\Protobuf\Any::class); + GPBUtil::checkMessage($var, Any::class); $this->body = $var; return $this; diff --git a/src/nacos/src/Protobuf/Request/ConfigBatchListenRequest.php b/src/nacos/src/Protobuf/Request/ConfigBatchListenRequest.php index 975eaa25a..0b5e4db9d 100644 --- a/src/nacos/src/Protobuf/Request/ConfigBatchListenRequest.php +++ b/src/nacos/src/Protobuf/Request/ConfigBatchListenRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; use Hyperf\Nacos\Protobuf\ListenContext; diff --git a/src/nacos/src/Protobuf/Request/ConfigQueryRequest.php b/src/nacos/src/Protobuf/Request/ConfigQueryRequest.php index a144bfaf0..926a6f640 100644 --- a/src/nacos/src/Protobuf/Request/ConfigQueryRequest.php +++ b/src/nacos/src/Protobuf/Request/ConfigQueryRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class ConfigQueryRequest extends Request diff --git a/src/nacos/src/Protobuf/Request/ConnectionSetupRequest.php b/src/nacos/src/Protobuf/Request/ConnectionSetupRequest.php index 677f50b95..f958a6dfd 100644 --- a/src/nacos/src/Protobuf/Request/ConnectionSetupRequest.php +++ b/src/nacos/src/Protobuf/Request/ConnectionSetupRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class ConnectionSetupRequest extends Request diff --git a/src/nacos/src/Protobuf/Request/HealthCheckRequest.php b/src/nacos/src/Protobuf/Request/HealthCheckRequest.php index bc6e2320c..500bfede9 100644 --- a/src/nacos/src/Protobuf/Request/HealthCheckRequest.php +++ b/src/nacos/src/Protobuf/Request/HealthCheckRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class HealthCheckRequest extends Request diff --git a/src/nacos/src/Protobuf/Request/InstanceRequest.php b/src/nacos/src/Protobuf/Request/InstanceRequest.php index 19c8004e1..bb6e277a2 100644 --- a/src/nacos/src/Protobuf/Request/InstanceRequest.php +++ b/src/nacos/src/Protobuf/Request/InstanceRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; use Hyperf\Nacos\Protobuf\Message\Instance; diff --git a/src/nacos/src/Protobuf/Request/NamingRequest.php b/src/nacos/src/Protobuf/Request/NamingRequest.php index fe0a451f7..9d0bd03ed 100644 --- a/src/nacos/src/Protobuf/Request/NamingRequest.php +++ b/src/nacos/src/Protobuf/Request/NamingRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; use Hyperf\Contract\Arrayable; diff --git a/src/nacos/src/Protobuf/Request/NotifySubscriberResponse.php b/src/nacos/src/Protobuf/Request/NotifySubscriberResponse.php index 49f3c10df..e145c39f8 100644 --- a/src/nacos/src/Protobuf/Request/NotifySubscriberResponse.php +++ b/src/nacos/src/Protobuf/Request/NotifySubscriberResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class NotifySubscriberResponse extends Request diff --git a/src/nacos/src/Protobuf/Request/Request.php b/src/nacos/src/Protobuf/Request/Request.php index 23aa43223..d8c23098e 100644 --- a/src/nacos/src/Protobuf/Request/Request.php +++ b/src/nacos/src/Protobuf/Request/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; abstract class Request implements RequestInterface diff --git a/src/nacos/src/Protobuf/Request/RequestInterface.php b/src/nacos/src/Protobuf/Request/RequestInterface.php index 260be0591..1758e7d60 100644 --- a/src/nacos/src/Protobuf/Request/RequestInterface.php +++ b/src/nacos/src/Protobuf/Request/RequestInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; interface RequestInterface diff --git a/src/nacos/src/Protobuf/Request/ServerCheckRequest.php b/src/nacos/src/Protobuf/Request/ServerCheckRequest.php index f45384580..c4f81a6dd 100644 --- a/src/nacos/src/Protobuf/Request/ServerCheckRequest.php +++ b/src/nacos/src/Protobuf/Request/ServerCheckRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class ServerCheckRequest extends Request diff --git a/src/nacos/src/Protobuf/Request/ServiceQueryRequest.php b/src/nacos/src/Protobuf/Request/ServiceQueryRequest.php index bb4314910..b5d4e79aa 100644 --- a/src/nacos/src/Protobuf/Request/ServiceQueryRequest.php +++ b/src/nacos/src/Protobuf/Request/ServiceQueryRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class ServiceQueryRequest implements RequestInterface diff --git a/src/nacos/src/Protobuf/Request/SubscribeServiceRequest.php b/src/nacos/src/Protobuf/Request/SubscribeServiceRequest.php index 002044002..cfd3046f2 100644 --- a/src/nacos/src/Protobuf/Request/SubscribeServiceRequest.php +++ b/src/nacos/src/Protobuf/Request/SubscribeServiceRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Request; class SubscribeServiceRequest implements RequestInterface diff --git a/src/nacos/src/Protobuf/Response/ConfigChangeBatchListenResponse.php b/src/nacos/src/Protobuf/Response/ConfigChangeBatchListenResponse.php index fafc33cfd..a28527f71 100644 --- a/src/nacos/src/Protobuf/Response/ConfigChangeBatchListenResponse.php +++ b/src/nacos/src/Protobuf/Response/ConfigChangeBatchListenResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; use Hyperf\Nacos\Protobuf\ListenContext; diff --git a/src/nacos/src/Protobuf/Response/ConfigChangeNotifyRequest.php b/src/nacos/src/Protobuf/Response/ConfigChangeNotifyRequest.php index cf2c54fdd..1d4039133 100644 --- a/src/nacos/src/Protobuf/Response/ConfigChangeNotifyRequest.php +++ b/src/nacos/src/Protobuf/Response/ConfigChangeNotifyRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; use Hyperf\Codec\Json; diff --git a/src/nacos/src/Protobuf/Response/ConfigQueryResponse.php b/src/nacos/src/Protobuf/Response/ConfigQueryResponse.php index b6c6cc573..0e8ed09e0 100644 --- a/src/nacos/src/Protobuf/Response/ConfigQueryResponse.php +++ b/src/nacos/src/Protobuf/Response/ConfigQueryResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; class ConfigQueryResponse extends Response diff --git a/src/nacos/src/Protobuf/Response/HealthCheckResponse.php b/src/nacos/src/Protobuf/Response/HealthCheckResponse.php index 11d6b885e..d92582a79 100644 --- a/src/nacos/src/Protobuf/Response/HealthCheckResponse.php +++ b/src/nacos/src/Protobuf/Response/HealthCheckResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; class HealthCheckResponse extends Response diff --git a/src/nacos/src/Protobuf/Response/Mapping.php b/src/nacos/src/Protobuf/Response/Mapping.php index e544dba07..df8b6e94e 100644 --- a/src/nacos/src/Protobuf/Response/Mapping.php +++ b/src/nacos/src/Protobuf/Response/Mapping.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; class Mapping diff --git a/src/nacos/src/Protobuf/Response/NotifySubscriberRequest.php b/src/nacos/src/Protobuf/Response/NotifySubscriberRequest.php index 9e3c415e5..8e6b8e07f 100644 --- a/src/nacos/src/Protobuf/Response/NotifySubscriberRequest.php +++ b/src/nacos/src/Protobuf/Response/NotifySubscriberRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; use Hyperf\Nacos\Protobuf\ServiceInfo; diff --git a/src/nacos/src/Protobuf/Response/Response.php b/src/nacos/src/Protobuf/Response/Response.php index 174fb33a5..9746de5f6 100644 --- a/src/nacos/src/Protobuf/Response/Response.php +++ b/src/nacos/src/Protobuf/Response/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; use Hyperf\Codec\Json; diff --git a/src/nacos/src/Protobuf/Response/ServerCheckResponse.php b/src/nacos/src/Protobuf/Response/ServerCheckResponse.php index 6f92260a6..c1ea0f628 100644 --- a/src/nacos/src/Protobuf/Response/ServerCheckResponse.php +++ b/src/nacos/src/Protobuf/Response/ServerCheckResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; class ServerCheckResponse extends Response diff --git a/src/nacos/src/Protobuf/Response/SubscribeServiceResponse.php b/src/nacos/src/Protobuf/Response/SubscribeServiceResponse.php index 12b8e29a5..92f31bb42 100644 --- a/src/nacos/src/Protobuf/Response/SubscribeServiceResponse.php +++ b/src/nacos/src/Protobuf/Response/SubscribeServiceResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf\Response; use Hyperf\Nacos\Protobuf\Message\Service; diff --git a/src/nacos/src/Protobuf/ServiceHost.php b/src/nacos/src/Protobuf/ServiceHost.php index 67c87132b..63698fc24 100644 --- a/src/nacos/src/Protobuf/ServiceHost.php +++ b/src/nacos/src/Protobuf/ServiceHost.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf; use Hyperf\Contract\JsonDeSerializable; diff --git a/src/nacos/src/Protobuf/ServiceInfo.php b/src/nacos/src/Protobuf/ServiceInfo.php index 116639ea5..dcf649fa1 100644 --- a/src/nacos/src/Protobuf/ServiceInfo.php +++ b/src/nacos/src/Protobuf/ServiceInfo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Protobuf; use Hyperf\Contract\JsonDeSerializable; diff --git a/src/nacos/src/Provider/AccessToken.php b/src/nacos/src/Provider/AccessToken.php index 484634e37..72beb5f64 100644 --- a/src/nacos/src/Provider/AccessToken.php +++ b/src/nacos/src/Provider/AccessToken.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Provider; trait AccessToken diff --git a/src/nacos/src/Provider/AuthProvider.php b/src/nacos/src/Provider/AuthProvider.php index 2c383cc14..87e88201e 100644 --- a/src/nacos/src/Provider/AuthProvider.php +++ b/src/nacos/src/Provider/AuthProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Provider; use GuzzleHttp\RequestOptions; diff --git a/src/nacos/src/Provider/ConfigProvider.php b/src/nacos/src/Provider/ConfigProvider.php index c311fffe3..307d201f3 100644 --- a/src/nacos/src/Provider/ConfigProvider.php +++ b/src/nacos/src/Provider/ConfigProvider.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Provider; use GuzzleHttp\RequestOptions; use Hyperf\Nacos\AbstractProvider; +use JetBrains\PhpStorm\ArrayShape; use Psr\Http\Message\ResponseInterface; class ConfigProvider extends AbstractProvider @@ -56,16 +58,15 @@ class ConfigProvider extends AbstractProvider ]); } - /** - * @param $options = [ - * 'dataId' => '', - * 'group' => '', - * 'contentMD5' => md5(file_get_contents($configPath)), - * 'tenant' => '', - * ] - */ - public function listener(array $options = []): ResponseInterface - { + public function listener( + #[ArrayShape([ + 'dataId' => 'string', + 'group' => 'string', + 'contentMD5' => 'string', // md5(file_get_contents($configPath)) + 'tenant' => 'string', + ])] + array $options = [] + ): ResponseInterface { $config = ($options['dataId'] ?? null) . self::WORD_SEPARATOR . ($options['group'] ?? null) . self::WORD_SEPARATOR . ($options['contentMD5'] ?? null) . self::WORD_SEPARATOR . diff --git a/src/nacos/src/Provider/InstanceProvider.php b/src/nacos/src/Provider/InstanceProvider.php index dfb78167d..4c3adef4d 100644 --- a/src/nacos/src/Provider/InstanceProvider.php +++ b/src/nacos/src/Provider/InstanceProvider.php @@ -9,28 +9,32 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Provider; use GuzzleHttp\RequestOptions; use Hyperf\Codec\Json; use Hyperf\Nacos\AbstractProvider; +use JetBrains\PhpStorm\ArrayShape; use Psr\Http\Message\ResponseInterface; class InstanceProvider extends AbstractProvider { - /** - * @param $optional = [ - * 'groupName' => '', - * 'clusterName' => '', - * 'namespaceId' => '', - * 'weight' => 99.0, - * 'metadata' => '', - * 'enabled' => true, - * 'ephemeral' => false, // 是否临时实例 - * ] - */ - public function register(string $ip, int $port, string $serviceName, array $optional = []): ResponseInterface - { + public function register( + string $ip, + int $port, + string $serviceName, + #[ArrayShape([ + 'groupName' => '', + 'clusterName' => '', + 'namespaceId' => '', + 'weight' => 99.0, + 'metadata' => '', + 'enabled' => true, + 'ephemeral' => false, // 是否临时实例 + ])] + array $optional = [] + ): ResponseInterface { return $this->request('POST', 'nacos/v1/ns/instance', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'serviceName' => $serviceName, @@ -40,15 +44,18 @@ class InstanceProvider extends AbstractProvider ]); } - /** - * @param $optional = [ - * 'clusterName' => '', - * 'namespaceId' => '', - * 'ephemeral' => false, - * ] - */ - public function delete(string $serviceName, string $groupName, string $ip, int $port, array $optional = []): ResponseInterface - { + public function delete( + string $serviceName, + string $groupName, + string $ip, + int $port, + #[ArrayShape([ + 'clusterName' => '', + 'namespaceId' => '', + 'ephemeral' => false, + ])] + array $optional = [] + ): ResponseInterface { return $this->request('DELETE', 'nacos/v1/ns/instance', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'serviceName' => $serviceName, @@ -59,19 +66,21 @@ class InstanceProvider extends AbstractProvider ]); } - /** - * @param $optional = [ - * 'groupName' => '', - * 'clusterName' => '', - * 'namespaceId' => '', - * 'weight' => 0.99, - * 'metadata' => '', // json - * 'enabled' => false, - * 'ephemeral' => false, - * ] - */ - public function update(string $ip, int $port, string $serviceName, array $optional = []): ResponseInterface - { + public function update( + string $ip, + int $port, + string $serviceName, + #[ArrayShape([ + 'groupName' => '', + 'clusterName' => '', + 'namespaceId' => '', + 'weight' => 0.99, + 'metadata' => '', // json + 'enabled' => false, + 'ephemeral' => false, + ])] + array $optional = [] + ): ResponseInterface { return $this->request('PUT', 'nacos/v1/ns/instance', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'serviceName' => $serviceName, @@ -81,16 +90,16 @@ class InstanceProvider extends AbstractProvider ]); } - /** - * @param $optional = [ - * 'groupName' => '', - * 'namespaceId' => '', - * 'clusters' => '', // 集群名称(字符串,多个集群用逗号分隔) - * 'healthyOnly' => false, - * ] - */ - public function list(string $serviceName, array $optional = []): ResponseInterface - { + public function list( + string $serviceName, + #[ArrayShape([ + 'groupName' => '', + 'namespaceId' => '', + 'clusters' => '', // 集群名称(字 + 'healthyOnly' => false, + ])] + array $optional = [] + ): ResponseInterface { return $this->request('GET', 'nacos/v1/ns/instance/list', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'serviceName' => $serviceName, @@ -98,17 +107,19 @@ class InstanceProvider extends AbstractProvider ]); } - /** - * @param $optional = [ - * 'groupName' => '', - * 'namespaceId' => '', - * 'cluster' => '', - * 'healthyOnly' => false, - * 'ephemeral' => false, - * ] - */ - public function detail(string $ip, int $port, string $serviceName, array $optional = []): ResponseInterface - { + public function detail( + string $ip, + int $port, + string $serviceName, + #[ArrayShape([ + 'groupName' => '', + 'namespaceId' => '', + 'cluster' => '', + 'healthyOnly' => false, + 'ephemeral' => false, + ])] + array $optional = [] + ): ResponseInterface { return $this->request('GET', 'nacos/v1/ns/instance', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'ip' => $ip, @@ -118,17 +129,21 @@ class InstanceProvider extends AbstractProvider ]); } - /** - * @param $beat = [ - * 'ip' => '', - * 'port' => 9501, - * 'serviceName' => '', - * 'cluster' => '', - * 'weight' => 1, - * ] - */ - public function beat(string $serviceName, array $beat = [], ?string $groupName = null, ?string $namespaceId = null, ?bool $ephemeral = null, bool $lightBeatEnabled = false): ResponseInterface - { + public function beat( + string $serviceName, + #[ArrayShape([ + 'ip' => '', + 'port' => 9501, + 'serviceName' => '', + 'cluster' => '', + 'weight' => 1, + ])] + array $beat = [], + ?string $groupName = null, + ?string $namespaceId = null, + ?bool $ephemeral = null, + bool $lightBeatEnabled = false + ): ResponseInterface { return $this->request('PUT', 'nacos/v1/ns/instance/beat', [ RequestOptions::QUERY => $this->filter([ 'serviceName' => $serviceName, @@ -142,15 +157,18 @@ class InstanceProvider extends AbstractProvider ]); } - /** - * @param $optional = [ - * 'namespaceId' => '', - * 'groupName' => '', - * 'clusterName' => '', - * ] - */ - public function updateHealth(string $ip, int $port, string $serviceName, bool $healthy, array $optional = []): ResponseInterface - { + public function updateHealth( + string $ip, + int $port, + string $serviceName, + bool $healthy, + #[ArrayShape([ + 'namespaceId' => '', + 'groupName' => '', + 'clusterName' => '', + ])] + array $optional = [] + ): ResponseInterface { return $this->request('PUT', 'nacos/v1/ns/health/instance', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'ip' => $ip, diff --git a/src/nacos/src/Provider/OperatorProvider.php b/src/nacos/src/Provider/OperatorProvider.php index 31962bab1..94c3fd4dd 100644 --- a/src/nacos/src/Provider/OperatorProvider.php +++ b/src/nacos/src/Provider/OperatorProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Provider; use GuzzleHttp\RequestOptions; diff --git a/src/nacos/src/Provider/ServiceProvider.php b/src/nacos/src/Provider/ServiceProvider.php index b6495c32e..208fc255b 100644 --- a/src/nacos/src/Provider/ServiceProvider.php +++ b/src/nacos/src/Provider/ServiceProvider.php @@ -9,25 +9,27 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nacos\Provider; use GuzzleHttp\RequestOptions; use Hyperf\Nacos\AbstractProvider; +use JetBrains\PhpStorm\ArrayShape; use Psr\Http\Message\ResponseInterface; class ServiceProvider extends AbstractProvider { - /** - * @param $optional = [ - * 'groupName' => '', - * 'namespaceId' => '', - * 'protectThreshold' => 0.99, - * 'metadata' => '', - * 'selector' => '', // json字符串 - * ] - */ - public function create(string $serviceName, array $optional = []): ResponseInterface - { + public function create( + string $serviceName, + #[ArrayShape([ + 'groupName' => '', + 'namespaceId' => '', + 'protectThreshold' => 0.99, + 'metadata' => '', + 'selector' => '', // json字符串 + ])] + array $optional = [] + ): ResponseInterface { return $this->request('POST', 'nacos/v1/ns/service', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'serviceName' => $serviceName, @@ -46,17 +48,17 @@ class ServiceProvider extends AbstractProvider ]); } - /** - * @param $optional = [ - * 'groupName' => '', - * 'namespaceId' => '', - * 'protectThreshold' => 0.99, - * 'metadata' => '', - * 'selector' => '', // json字符串 - * ] - */ - public function update(string $serviceName, array $optional = []): ResponseInterface - { + public function update( + string $serviceName, + #[ArrayShape([ + 'groupName' => '', + 'namespaceId' => '', + 'protectThreshold' => 0.99, + 'metadata' => '', + 'selector' => '', // json字符串 + ])] + array $optional = [] + ): ResponseInterface { return $this->request('PUT', 'nacos/v1/ns/service', [ RequestOptions::QUERY => $this->filter(array_merge($optional, [ 'serviceName' => $serviceName, diff --git a/src/nacos/tests/AbstractTestCase.php b/src/nacos/tests/AbstractTestCase.php index b8a6a55be..0990500dd 100644 --- a/src/nacos/tests/AbstractTestCase.php +++ b/src/nacos/tests/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos; use Mockery; diff --git a/src/nacos/tests/Cases/ApplicationTest.php b/src/nacos/tests/Cases/ApplicationTest.php index 0690870be..39f2d30a6 100644 --- a/src/nacos/tests/Cases/ApplicationTest.php +++ b/src/nacos/tests/Cases/ApplicationTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases; use Hyperf\Nacos\Application; diff --git a/src/nacos/tests/Cases/Provider/NacosAuthTest.php b/src/nacos/tests/Cases/Provider/NacosAuthTest.php index ebaa85356..428e6f40a 100644 --- a/src/nacos/tests/Cases/Provider/NacosAuthTest.php +++ b/src/nacos/tests/Cases/Provider/NacosAuthTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases\Provider; use Hyperf\Codec\Json; diff --git a/src/nacos/tests/Cases/Provider/NacosConfigTest.php b/src/nacos/tests/Cases/Provider/NacosConfigTest.php index f610183e3..cfbb348de 100644 --- a/src/nacos/tests/Cases/Provider/NacosConfigTest.php +++ b/src/nacos/tests/Cases/Provider/NacosConfigTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases\Provider; use Hyperf\Codec\Json; diff --git a/src/nacos/tests/Cases/Provider/NacosInstanceTest.php b/src/nacos/tests/Cases/Provider/NacosInstanceTest.php index fb56246d4..6d4b734b4 100644 --- a/src/nacos/tests/Cases/Provider/NacosInstanceTest.php +++ b/src/nacos/tests/Cases/Provider/NacosInstanceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases\Provider; use Hyperf\Codec\Json; diff --git a/src/nacos/tests/Cases/Provider/NacosOperatorTest.php b/src/nacos/tests/Cases/Provider/NacosOperatorTest.php index b8a48c1d9..fa184aef9 100644 --- a/src/nacos/tests/Cases/Provider/NacosOperatorTest.php +++ b/src/nacos/tests/Cases/Provider/NacosOperatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases\Provider; use Hyperf\Codec\Json; diff --git a/src/nacos/tests/Cases/Provider/NacosServiceTest.php b/src/nacos/tests/Cases/Provider/NacosServiceTest.php index 1933d82ca..3f087e960 100644 --- a/src/nacos/tests/Cases/Provider/NacosServiceTest.php +++ b/src/nacos/tests/Cases/Provider/NacosServiceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases\Provider; use Hyperf\Codec\Json; diff --git a/src/nacos/tests/Cases/Sign/NacosNamingSignTest.php b/src/nacos/tests/Cases/Sign/NacosNamingSignTest.php index b33d075c8..fe01bec4e 100644 --- a/src/nacos/tests/Cases/Sign/NacosNamingSignTest.php +++ b/src/nacos/tests/Cases/Sign/NacosNamingSignTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos\Cases\Sign; use GuzzleHttp\Psr7\Response; diff --git a/src/nacos/tests/HandlerMockery.php b/src/nacos/tests/HandlerMockery.php index 71b986cac..6a8348ddf 100644 --- a/src/nacos/tests/HandlerMockery.php +++ b/src/nacos/tests/HandlerMockery.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nacos; use GuzzleHttp\Promise\FulfilledPromise; diff --git a/src/nats/publish/nats.php b/src/nats/publish/nats.php index 01bd56f76..1d32e2a3b 100644 --- a/src/nats/publish/nats.php +++ b/src/nats/publish/nats.php @@ -9,10 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Nats\Driver\NatsDriver; +use Hyperf\Nats\Encoders\JSONEncoder; + return [ 'default' => [ - 'driver' => Hyperf\Nats\Driver\NatsDriver::class, - 'encoder' => Hyperf\Nats\Encoders\JSONEncoder::class, + 'driver' => NatsDriver::class, + 'encoder' => JSONEncoder::class, 'timeout' => 10.0, 'options' => [ 'host' => '127.0.0.1', diff --git a/src/nats/src/AbstractConsumer.php b/src/nats/src/AbstractConsumer.php index 411c8cc57..48afe661e 100644 --- a/src/nats/src/AbstractConsumer.php +++ b/src/nats/src/AbstractConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Psr\Container\ContainerInterface; diff --git a/src/nats/src/Annotation/Consumer.php b/src/nats/src/Annotation/Consumer.php index 1ac980cdc..ca9cd0b20 100644 --- a/src/nats/src/Annotation/Consumer.php +++ b/src/nats/src/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Annotation; use Attribute; diff --git a/src/nats/src/ConfigProvider.php b/src/nats/src/ConfigProvider.php index 57488997a..ca6638d40 100644 --- a/src/nats/src/ConfigProvider.php +++ b/src/nats/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Hyperf\Nats\Driver\DriverFactory; diff --git a/src/nats/src/Connection.php b/src/nats/src/Connection.php index 894a2fc7d..56ca1437b 100644 --- a/src/nats/src/Connection.php +++ b/src/nats/src/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Closure; diff --git a/src/nats/src/ConnectionOptions.php b/src/nats/src/ConnectionOptions.php index 1b7e8761d..dd9ea568f 100644 --- a/src/nats/src/ConnectionOptions.php +++ b/src/nats/src/ConnectionOptions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Stringable; @@ -103,7 +104,7 @@ class ConnectionOptions implements Stringable * * @param array|Traversable $options the connection options */ - public function __construct(null|Traversable|array $options = null) + public function __construct(null|array|Traversable $options = null) { if (! empty($options)) { $this->initialize($options); diff --git a/src/nats/src/ConsumerManager.php b/src/nats/src/ConsumerManager.php index 0a1ac1c1e..aec50e345 100644 --- a/src/nats/src/ConsumerManager.php +++ b/src/nats/src/ConsumerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/nats/src/Contract/PublishInterface.php b/src/nats/src/Contract/PublishInterface.php index 474df3370..9c916c98f 100644 --- a/src/nats/src/Contract/PublishInterface.php +++ b/src/nats/src/Contract/PublishInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Contract; interface PublishInterface diff --git a/src/nats/src/Contract/RequestInterface.php b/src/nats/src/Contract/RequestInterface.php index f5ac4b325..9b5ae7ce9 100644 --- a/src/nats/src/Contract/RequestInterface.php +++ b/src/nats/src/Contract/RequestInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Contract; use Closure; diff --git a/src/nats/src/Contract/SubscribeInterface.php b/src/nats/src/Contract/SubscribeInterface.php index bfa1a2227..9d628adb8 100644 --- a/src/nats/src/Contract/SubscribeInterface.php +++ b/src/nats/src/Contract/SubscribeInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Contract; use Closure; diff --git a/src/nats/src/Driver/AbstractDriver.php b/src/nats/src/Driver/AbstractDriver.php index aa6d1f134..832491474 100644 --- a/src/nats/src/Driver/AbstractDriver.php +++ b/src/nats/src/Driver/AbstractDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Driver; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/nats/src/Driver/DriverFactory.php b/src/nats/src/Driver/DriverFactory.php index 6fa1a308e..760c968cc 100644 --- a/src/nats/src/Driver/DriverFactory.php +++ b/src/nats/src/Driver/DriverFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Driver; use Hyperf\Contract\ConfigInterface; diff --git a/src/nats/src/Driver/DriverInterface.php b/src/nats/src/Driver/DriverInterface.php index 60d98f903..c749c24f6 100644 --- a/src/nats/src/Driver/DriverInterface.php +++ b/src/nats/src/Driver/DriverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Driver; use Hyperf\Nats\Contract\PublishInterface; diff --git a/src/nats/src/Driver/NatsDriver.php b/src/nats/src/Driver/NatsDriver.php index a7ad973b7..226aa4359 100644 --- a/src/nats/src/Driver/NatsDriver.php +++ b/src/nats/src/Driver/NatsDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Driver; use Closure; diff --git a/src/nats/src/EncodedConnection.php b/src/nats/src/EncodedConnection.php index c47c8a856..7ce6ffe85 100644 --- a/src/nats/src/EncodedConnection.php +++ b/src/nats/src/EncodedConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Closure; diff --git a/src/nats/src/Encoders/Encoder.php b/src/nats/src/Encoders/Encoder.php index f7773e0f7..7c8d0b115 100644 --- a/src/nats/src/Encoders/Encoder.php +++ b/src/nats/src/Encoders/Encoder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Encoders; /** diff --git a/src/nats/src/Encoders/JSONEncoder.php b/src/nats/src/Encoders/JSONEncoder.php index 162e17bc8..1be239a64 100644 --- a/src/nats/src/Encoders/JSONEncoder.php +++ b/src/nats/src/Encoders/JSONEncoder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Encoders; /** diff --git a/src/nats/src/Encoders/PHPEncoder.php b/src/nats/src/Encoders/PHPEncoder.php index a2a48b536..cb830dde2 100644 --- a/src/nats/src/Encoders/PHPEncoder.php +++ b/src/nats/src/Encoders/PHPEncoder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Encoders; /** diff --git a/src/nats/src/Encoders/YAMLEncoder.php b/src/nats/src/Encoders/YAMLEncoder.php index 810ef47e4..a5a0a9d7a 100644 --- a/src/nats/src/Encoders/YAMLEncoder.php +++ b/src/nats/src/Encoders/YAMLEncoder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Encoders; /** diff --git a/src/nats/src/Event/AfterConsume.php b/src/nats/src/Event/AfterConsume.php index 89611c558..452f7babe 100644 --- a/src/nats/src/Event/AfterConsume.php +++ b/src/nats/src/Event/AfterConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; class AfterConsume extends Consume diff --git a/src/nats/src/Event/AfterSubscribe.php b/src/nats/src/Event/AfterSubscribe.php index 62c3e0752..464e7c146 100644 --- a/src/nats/src/Event/AfterSubscribe.php +++ b/src/nats/src/Event/AfterSubscribe.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; class AfterSubscribe extends Event diff --git a/src/nats/src/Event/BeforeConsume.php b/src/nats/src/Event/BeforeConsume.php index fe414b59d..9bda8aca3 100644 --- a/src/nats/src/Event/BeforeConsume.php +++ b/src/nats/src/Event/BeforeConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; class BeforeConsume extends Consume diff --git a/src/nats/src/Event/BeforeSubscribe.php b/src/nats/src/Event/BeforeSubscribe.php index dbfccd3ef..3b2cd8054 100644 --- a/src/nats/src/Event/BeforeSubscribe.php +++ b/src/nats/src/Event/BeforeSubscribe.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; class BeforeSubscribe extends Event diff --git a/src/nats/src/Event/Consume.php b/src/nats/src/Event/Consume.php index 9a0b4506f..382e14483 100644 --- a/src/nats/src/Event/Consume.php +++ b/src/nats/src/Event/Consume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; use Hyperf\Nats\AbstractConsumer; diff --git a/src/nats/src/Event/Event.php b/src/nats/src/Event/Event.php index 823916127..13615b825 100644 --- a/src/nats/src/Event/Event.php +++ b/src/nats/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; use Hyperf\Nats\AbstractConsumer; diff --git a/src/nats/src/Event/FailToConsume.php b/src/nats/src/Event/FailToConsume.php index 41c01251c..daaec375b 100644 --- a/src/nats/src/Event/FailToConsume.php +++ b/src/nats/src/Event/FailToConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Event; use Hyperf\Nats\AbstractConsumer; diff --git a/src/nats/src/Exception.php b/src/nats/src/Exception.php index 2d2698ce9..b544800c4 100644 --- a/src/nats/src/Exception.php +++ b/src/nats/src/Exception.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; /** diff --git a/src/nats/src/Exception/ConfigNotFoundException.php b/src/nats/src/Exception/ConfigNotFoundException.php index 3ce400188..f0c84067b 100644 --- a/src/nats/src/Exception/ConfigNotFoundException.php +++ b/src/nats/src/Exception/ConfigNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Exception; use RuntimeException; diff --git a/src/nats/src/Exception/DriverException.php b/src/nats/src/Exception/DriverException.php index e7dce75a1..10d846ad1 100644 --- a/src/nats/src/Exception/DriverException.php +++ b/src/nats/src/Exception/DriverException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Exception; use RuntimeException; diff --git a/src/nats/src/Exception/TimeoutException.php b/src/nats/src/Exception/TimeoutException.php index 3487d5efe..846bdc025 100644 --- a/src/nats/src/Exception/TimeoutException.php +++ b/src/nats/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Exception; use RuntimeException; diff --git a/src/nats/src/Functions.php b/src/nats/src/Functions.php index 22b9cab2e..950b9748f 100644 --- a/src/nats/src/Functions.php +++ b/src/nats/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; function stream_set_timeout($fp, $seconds, $microseconds) diff --git a/src/nats/src/Listener/AfterSubscribeListener.php b/src/nats/src/Listener/AfterSubscribeListener.php index 2fc89725a..2dfe19aac 100644 --- a/src/nats/src/Listener/AfterSubscribeListener.php +++ b/src/nats/src/Listener/AfterSubscribeListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Listener; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/nats/src/Listener/BeforeMainServerStartListener.php b/src/nats/src/Listener/BeforeMainServerStartListener.php index 0c228af9d..219bf6b5e 100644 --- a/src/nats/src/Listener/BeforeMainServerStartListener.php +++ b/src/nats/src/Listener/BeforeMainServerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/nats/src/Message.php b/src/nats/src/Message.php index 41f66d177..7d6d00d81 100644 --- a/src/nats/src/Message.php +++ b/src/nats/src/Message.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; use Stringable; diff --git a/src/nats/src/RandomGenerator.php b/src/nats/src/RandomGenerator.php index 340412f37..8b12f70d2 100644 --- a/src/nats/src/RandomGenerator.php +++ b/src/nats/src/RandomGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; class RandomGenerator diff --git a/src/nats/src/ServerInfo.php b/src/nats/src/ServerInfo.php index 6fc741159..26778a85f 100644 --- a/src/nats/src/ServerInfo.php +++ b/src/nats/src/ServerInfo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nats; /** diff --git a/src/nats/tests/NatsDriverTest.php b/src/nats/tests/NatsDriverTest.php index a1429538e..d837763b2 100644 --- a/src/nats/tests/NatsDriverTest.php +++ b/src/nats/tests/NatsDriverTest.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nats; use Doctrine\Instantiator\Instantiator; use Hyperf\Nats\Driver\NatsDriver; +use Hyperf\Nats\Encoders\JSONEncoder; use Hyperf\Support\Reflection\ClassInvoker; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; @@ -29,8 +31,8 @@ class NatsDriverTest extends TestCase $instantiator = new Instantiator(); $driver = new ClassInvoker($instantiator->instantiate(NatsDriver::class)); $time = $driver->getMaxIdleTime([ - 'driver' => \Hyperf\Nats\Driver\NatsDriver::class, - 'encoder' => \Hyperf\Nats\Encoders\JSONEncoder::class, + 'driver' => NatsDriver::class, + 'encoder' => JSONEncoder::class, 'timeout' => 10.0, 'options' => [ 'host' => '127.0.0.1', diff --git a/src/nsq/src/AbstractConsumer.php b/src/nsq/src/AbstractConsumer.php index a077760e8..516c2bf5c 100644 --- a/src/nsq/src/AbstractConsumer.php +++ b/src/nsq/src/AbstractConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Psr\Container\ContainerInterface; diff --git a/src/nsq/src/Annotation/Consumer.php b/src/nsq/src/Annotation/Consumer.php index d02086d0b..f9af25651 100644 --- a/src/nsq/src/Annotation/Consumer.php +++ b/src/nsq/src/Annotation/Consumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Annotation; use Attribute; diff --git a/src/nsq/src/ClientInterface.php b/src/nsq/src/ClientInterface.php index 358c25eb8..06405a414 100644 --- a/src/nsq/src/ClientInterface.php +++ b/src/nsq/src/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Psr\Http\Message\ResponseInterface; diff --git a/src/nsq/src/ConfigProvider.php b/src/nsq/src/ConfigProvider.php index 687838834..e0c4e279a 100644 --- a/src/nsq/src/ConfigProvider.php +++ b/src/nsq/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Hyperf\Nsq\Listener\BeforeMainServerStartListener; diff --git a/src/nsq/src/ConsumerManager.php b/src/nsq/src/ConsumerManager.php index 0b1e554f8..43883dfbb 100644 --- a/src/nsq/src/ConsumerManager.php +++ b/src/nsq/src/ConsumerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Hyperf\Contract\ConfigInterface; diff --git a/src/nsq/src/Event/AfterConsume.php b/src/nsq/src/Event/AfterConsume.php index e4e7f5111..7149d370c 100644 --- a/src/nsq/src/Event/AfterConsume.php +++ b/src/nsq/src/Event/AfterConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; use Hyperf\Nsq\AbstractConsumer; diff --git a/src/nsq/src/Event/AfterSubscribe.php b/src/nsq/src/Event/AfterSubscribe.php index c7ebf9b41..aacf1d3f0 100644 --- a/src/nsq/src/Event/AfterSubscribe.php +++ b/src/nsq/src/Event/AfterSubscribe.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; class AfterSubscribe extends Event diff --git a/src/nsq/src/Event/BeforeConsume.php b/src/nsq/src/Event/BeforeConsume.php index e2dc7f899..699679061 100644 --- a/src/nsq/src/Event/BeforeConsume.php +++ b/src/nsq/src/Event/BeforeConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; class BeforeConsume extends Consume diff --git a/src/nsq/src/Event/BeforeSubscribe.php b/src/nsq/src/Event/BeforeSubscribe.php index 6caca318c..2875381f4 100644 --- a/src/nsq/src/Event/BeforeSubscribe.php +++ b/src/nsq/src/Event/BeforeSubscribe.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; class BeforeSubscribe extends Event diff --git a/src/nsq/src/Event/Consume.php b/src/nsq/src/Event/Consume.php index e8fb066e4..0c1e80038 100644 --- a/src/nsq/src/Event/Consume.php +++ b/src/nsq/src/Event/Consume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; use Hyperf\Nsq\AbstractConsumer; diff --git a/src/nsq/src/Event/Event.php b/src/nsq/src/Event/Event.php index 38206b24a..a0c7d8147 100644 --- a/src/nsq/src/Event/Event.php +++ b/src/nsq/src/Event/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; use Hyperf\Nsq\AbstractConsumer; diff --git a/src/nsq/src/Event/FailToConsume.php b/src/nsq/src/Event/FailToConsume.php index 519d1d899..ea853396d 100644 --- a/src/nsq/src/Event/FailToConsume.php +++ b/src/nsq/src/Event/FailToConsume.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Event; use Hyperf\Nsq\AbstractConsumer; diff --git a/src/nsq/src/Exception/SocketSendException.php b/src/nsq/src/Exception/SocketSendException.php index ede0dda48..830a0963a 100644 --- a/src/nsq/src/Exception/SocketSendException.php +++ b/src/nsq/src/Exception/SocketSendException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Exception; use RuntimeException; diff --git a/src/nsq/src/Listener/BeforeMainServerStartListener.php b/src/nsq/src/Listener/BeforeMainServerStartListener.php index 3f7db408d..5df7ad936 100644 --- a/src/nsq/src/Listener/BeforeMainServerStartListener.php +++ b/src/nsq/src/Listener/BeforeMainServerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/nsq/src/Message.php b/src/nsq/src/Message.php index 4227765a9..1193ec382 100644 --- a/src/nsq/src/Message.php +++ b/src/nsq/src/Message.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; class Message diff --git a/src/nsq/src/MessageBuilder.php b/src/nsq/src/MessageBuilder.php index 9b3c0f4e1..fa7692c80 100644 --- a/src/nsq/src/MessageBuilder.php +++ b/src/nsq/src/MessageBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Hyperf\CodeParser\Package; diff --git a/src/nsq/src/Nsq.php b/src/nsq/src/Nsq.php index 973150c01..c126a407f 100644 --- a/src/nsq/src/Nsq.php +++ b/src/nsq/src/Nsq.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Closure; @@ -49,7 +50,7 @@ class Nsq /** * @param string|string[] $message */ - public function publish(string $topic, string|array $message, float $deferTime = 0.0, bool $confirm = false): bool + public function publish(string $topic, array|string $message, float $deferTime = 0.0, bool $confirm = false): bool { if (is_array($message)) { if ($deferTime > 0) { diff --git a/src/nsq/src/Nsqd/AbstractEndpoint.php b/src/nsq/src/Nsqd/AbstractEndpoint.php index 2529766de..34d517915 100644 --- a/src/nsq/src/Nsqd/AbstractEndpoint.php +++ b/src/nsq/src/Nsqd/AbstractEndpoint.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Nsqd; abstract class AbstractEndpoint diff --git a/src/nsq/src/Nsqd/Api.php b/src/nsq/src/Nsqd/Api.php index d0d314446..eb7a6aab6 100644 --- a/src/nsq/src/Nsqd/Api.php +++ b/src/nsq/src/Nsqd/Api.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Nsqd; use GuzzleHttp\RequestOptions; diff --git a/src/nsq/src/Nsqd/Channel.php b/src/nsq/src/Nsqd/Channel.php index 8bc336cb2..b9e932497 100644 --- a/src/nsq/src/Nsqd/Channel.php +++ b/src/nsq/src/Nsqd/Channel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Nsqd; use GuzzleHttp\RequestOptions; diff --git a/src/nsq/src/Nsqd/Client.php b/src/nsq/src/Nsqd/Client.php index 7c0928901..542cdeca4 100644 --- a/src/nsq/src/Nsqd/Client.php +++ b/src/nsq/src/Nsqd/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Nsqd; use GuzzleHttp; diff --git a/src/nsq/src/Nsqd/ClientInterface.php b/src/nsq/src/Nsqd/ClientInterface.php index 5b4addf33..e2b30ccc7 100644 --- a/src/nsq/src/Nsqd/ClientInterface.php +++ b/src/nsq/src/Nsqd/ClientInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Nsqd; interface ClientInterface extends \Hyperf\Nsq\ClientInterface diff --git a/src/nsq/src/Nsqd/Topic.php b/src/nsq/src/Nsqd/Topic.php index de3904b17..e58b4ee1b 100644 --- a/src/nsq/src/Nsqd/Topic.php +++ b/src/nsq/src/Nsqd/Topic.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Nsqd; use GuzzleHttp\RequestOptions; diff --git a/src/nsq/src/Packer.php b/src/nsq/src/Packer.php index e3f3e1fff..b29b69925 100644 --- a/src/nsq/src/Packer.php +++ b/src/nsq/src/Packer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; class Packer diff --git a/src/nsq/src/Pool/NsqConnection.php b/src/nsq/src/Pool/NsqConnection.php index 1f64d8093..5adb44932 100644 --- a/src/nsq/src/Pool/NsqConnection.php +++ b/src/nsq/src/Pool/NsqConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Pool; use Hyperf\Collection\Arr; diff --git a/src/nsq/src/Pool/NsqPool.php b/src/nsq/src/Pool/NsqPool.php index c7ab673c6..3c069e870 100644 --- a/src/nsq/src/Pool/NsqPool.php +++ b/src/nsq/src/Pool/NsqPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Pool; use Hyperf\Collection\Arr; diff --git a/src/nsq/src/Pool/NsqPoolFactory.php b/src/nsq/src/Pool/NsqPoolFactory.php index 652760538..d89f056b1 100644 --- a/src/nsq/src/Pool/NsqPoolFactory.php +++ b/src/nsq/src/Pool/NsqPoolFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq\Pool; use Hyperf\Di\Container; diff --git a/src/nsq/src/Result.php b/src/nsq/src/Result.php index eada1db3c..260754959 100644 --- a/src/nsq/src/Result.php +++ b/src/nsq/src/Result.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; class Result diff --git a/src/nsq/src/Subscriber.php b/src/nsq/src/Subscriber.php index 8fcdb5ed4..51702de8e 100644 --- a/src/nsq/src/Subscriber.php +++ b/src/nsq/src/Subscriber.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Nsq; use Hyperf\Codec\Json; diff --git a/src/nsq/tests/ConsumerManagerTest.php b/src/nsq/tests/ConsumerManagerTest.php index e966c1059..82745988f 100644 --- a/src/nsq/tests/ConsumerManagerTest.php +++ b/src/nsq/tests/ConsumerManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq; use Hyperf\Config\Config; diff --git a/src/nsq/tests/HttpClientTest.php b/src/nsq/tests/HttpClientTest.php index ce11829c8..549df10ac 100644 --- a/src/nsq/tests/HttpClientTest.php +++ b/src/nsq/tests/HttpClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq; use Hyperf\Config\Config; diff --git a/src/nsq/tests/NsqTest.php b/src/nsq/tests/NsqTest.php index db47fac3f..b8b29979f 100644 --- a/src/nsq/tests/NsqTest.php +++ b/src/nsq/tests/NsqTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq; use Hyperf\Coroutine\Coroutine; diff --git a/src/nsq/tests/NsqdApiTest.php b/src/nsq/tests/NsqdApiTest.php index 11050f712..dc1863269 100644 --- a/src/nsq/tests/NsqdApiTest.php +++ b/src/nsq/tests/NsqdApiTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq; use Hyperf\Config\Config; diff --git a/src/nsq/tests/Stub/ContainerStub.php b/src/nsq/tests/Stub/ContainerStub.php index a1dcabee2..dfdca4a33 100644 --- a/src/nsq/tests/Stub/ContainerStub.php +++ b/src/nsq/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq\Stub; use Hyperf\Config\Config; diff --git a/src/nsq/tests/Stub/CoroutineHandlerStub.php b/src/nsq/tests/Stub/CoroutineHandlerStub.php index a789fcba8..d74bfff44 100644 --- a/src/nsq/tests/Stub/CoroutineHandlerStub.php +++ b/src/nsq/tests/Stub/CoroutineHandlerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq\Stub; use Hyperf\Guzzle\CoroutineHandler; diff --git a/src/nsq/tests/Stub/DemoConsumer.php b/src/nsq/tests/Stub/DemoConsumer.php index f1a5f24f8..ce1e099e8 100644 --- a/src/nsq/tests/Stub/DemoConsumer.php +++ b/src/nsq/tests/Stub/DemoConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq\Stub; use Hyperf\Nsq\AbstractConsumer; diff --git a/src/nsq/tests/Stub/DisabledDemoConsumer.php b/src/nsq/tests/Stub/DisabledDemoConsumer.php index 7af9bac52..7648e94ed 100644 --- a/src/nsq/tests/Stub/DisabledDemoConsumer.php +++ b/src/nsq/tests/Stub/DisabledDemoConsumer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq\Stub; use Hyperf\Nsq\AbstractConsumer; diff --git a/src/nsq/tests/SubscriberTest.php b/src/nsq/tests/SubscriberTest.php index f84bc0140..b083f8770 100644 --- a/src/nsq/tests/SubscriberTest.php +++ b/src/nsq/tests/SubscriberTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Nsq; use Hyperf\Codec\Json; diff --git a/src/paginator/src/AbstractPaginator.php b/src/paginator/src/AbstractPaginator.php index fb6930d26..15e61acf3 100644 --- a/src/paginator/src/AbstractPaginator.php +++ b/src/paginator/src/AbstractPaginator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Paginator; use ArrayAccess; diff --git a/src/paginator/src/ConfigProvider.php b/src/paginator/src/ConfigProvider.php index 2b17976c6..36fe3f77f 100644 --- a/src/paginator/src/ConfigProvider.php +++ b/src/paginator/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Paginator; use Hyperf\Contract\LengthAwarePaginatorInterface; diff --git a/src/paginator/src/LengthAwarePaginator.php b/src/paginator/src/LengthAwarePaginator.php index c543d5f58..872571e38 100644 --- a/src/paginator/src/LengthAwarePaginator.php +++ b/src/paginator/src/LengthAwarePaginator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Paginator; use Countable; diff --git a/src/paginator/src/Listener/PageResolverListener.php b/src/paginator/src/Listener/PageResolverListener.php index c6526f9d3..d39b49c8b 100644 --- a/src/paginator/src/Listener/PageResolverListener.php +++ b/src/paginator/src/Listener/PageResolverListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Paginator\Listener; use Hyperf\Context\ApplicationContext; diff --git a/src/paginator/src/Paginator.php b/src/paginator/src/Paginator.php index 644ca5563..f9a91faba 100644 --- a/src/paginator/src/Paginator.php +++ b/src/paginator/src/Paginator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Paginator; use Countable; diff --git a/src/paginator/src/UrlWindow.php b/src/paginator/src/UrlWindow.php index cdad83b91..e3bb1a675 100644 --- a/src/paginator/src/UrlWindow.php +++ b/src/paginator/src/UrlWindow.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Paginator; use Hyperf\Contract\LengthAwarePaginatorInterface; diff --git a/src/paginator/tests/LengthAwarePaginatorTest.php b/src/paginator/tests/LengthAwarePaginatorTest.php index 82647dd47..65da02110 100644 --- a/src/paginator/tests/LengthAwarePaginatorTest.php +++ b/src/paginator/tests/LengthAwarePaginatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Paginator; use Hyperf\Codec\Json; diff --git a/src/paginator/tests/PageResolverListenerTest.php b/src/paginator/tests/PageResolverListenerTest.php index b802cc25e..459940abb 100644 --- a/src/paginator/tests/PageResolverListenerTest.php +++ b/src/paginator/tests/PageResolverListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Paginator; use Hyperf\Context\ApplicationContext; diff --git a/src/phar/src/Ast/Ast.php b/src/phar/src/Ast/Ast.php index 13ab64f63..155edd7db 100644 --- a/src/phar/src/Ast/Ast.php +++ b/src/phar/src/Ast/Ast.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar\Ast; use PhpParser\NodeTraverser; diff --git a/src/phar/src/Ast/Visitor/RewriteConfigFactoryVisitor.php b/src/phar/src/Ast/Visitor/RewriteConfigFactoryVisitor.php index 698ca0eb2..dfb4bc042 100644 --- a/src/phar/src/Ast/Visitor/RewriteConfigFactoryVisitor.php +++ b/src/phar/src/Ast/Visitor/RewriteConfigFactoryVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar\Ast\Visitor; use PhpParser\Node; diff --git a/src/phar/src/Ast/Visitor/RewriteConfigVisitor.php b/src/phar/src/Ast/Visitor/RewriteConfigVisitor.php index 87ef722f7..54e2a7f20 100644 --- a/src/phar/src/Ast/Visitor/RewriteConfigVisitor.php +++ b/src/phar/src/Ast/Visitor/RewriteConfigVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar\Ast\Visitor; use PhpParser\Node; diff --git a/src/phar/src/BuildCommand.php b/src/phar/src/BuildCommand.php index bf8009819..5e2f5e4bc 100644 --- a/src/phar/src/BuildCommand.php +++ b/src/phar/src/BuildCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/phar/src/Bundle.php b/src/phar/src/Bundle.php index ac8574f87..5b21cfc9b 100644 --- a/src/phar/src/Bundle.php +++ b/src/phar/src/Bundle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use ArrayIterator; diff --git a/src/phar/src/ConfigProvider.php b/src/phar/src/ConfigProvider.php index d15be9d15..d1bf96834 100644 --- a/src/phar/src/ConfigProvider.php +++ b/src/phar/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use Hyperf\Framework\Logger\StdoutLogger; diff --git a/src/phar/src/LoggerInterface.php b/src/phar/src/LoggerInterface.php index 650caaa4f..f0f804097 100644 --- a/src/phar/src/LoggerInterface.php +++ b/src/phar/src/LoggerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use Psr\Log; diff --git a/src/phar/src/Package.php b/src/phar/src/Package.php index a899873f3..f4376ce78 100644 --- a/src/phar/src/Package.php +++ b/src/phar/src/Package.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use Symfony\Component\Finder\Finder; diff --git a/src/phar/src/PharBuilder.php b/src/phar/src/PharBuilder.php index 9a714285e..755b837c7 100644 --- a/src/phar/src/PharBuilder.php +++ b/src/phar/src/PharBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use FilesystemIterator; diff --git a/src/phar/src/TargetPhar.php b/src/phar/src/TargetPhar.php index b3f8cecea..b280bee2c 100644 --- a/src/phar/src/TargetPhar.php +++ b/src/phar/src/TargetPhar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Phar; use Phar; diff --git a/src/phar/tests/ConfigFactoryVisitorTest.php b/src/phar/tests/ConfigFactoryVisitorTest.php index 46b17f30e..57136154e 100644 --- a/src/phar/tests/ConfigFactoryVisitorTest.php +++ b/src/phar/tests/ConfigFactoryVisitorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Phar; use Hyperf\Phar\Ast\Ast; diff --git a/src/phar/tests/PackageTest.php b/src/phar/tests/PackageTest.php index 02d53710f..e0027d0a6 100644 --- a/src/phar/tests/PackageTest.php +++ b/src/phar/tests/PackageTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Phar; use Hyperf\Phar\Package; diff --git a/src/phar/tests/VisitorTest.php b/src/phar/tests/VisitorTest.php index 450bb2cef..5c9b52b2f 100644 --- a/src/phar/tests/VisitorTest.php +++ b/src/phar/tests/VisitorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Phar; use Hyperf\Phar\Ast\Ast; diff --git a/src/pipeline/src/Pipeline.php b/src/pipeline/src/Pipeline.php index f10ca6f03..78b05bc8d 100644 --- a/src/pipeline/src/Pipeline.php +++ b/src/pipeline/src/Pipeline.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pipeline; use Closure; diff --git a/src/pipeline/tests/PipelineTest.php b/src/pipeline/tests/PipelineTest.php index c81c302c3..9bcb42fd8 100644 --- a/src/pipeline/tests/PipelineTest.php +++ b/src/pipeline/tests/PipelineTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pipeline; use Hyperf\Context\ApplicationContext; diff --git a/src/pipeline/tests/Stub/FooPipeline.php b/src/pipeline/tests/Stub/FooPipeline.php index 865f38e76..8e31e776b 100644 --- a/src/pipeline/tests/Stub/FooPipeline.php +++ b/src/pipeline/tests/Stub/FooPipeline.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pipeline\Stub; use Hyperf\Pipeline\Pipeline; diff --git a/src/pool/src/Channel.php b/src/pool/src/Channel.php index 11703d2c6..f7414c932 100644 --- a/src/pool/src/Channel.php +++ b/src/pool/src/Channel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/src/ConfigProvider.php b/src/pool/src/ConfigProvider.php index 91e837845..09ec7354b 100644 --- a/src/pool/src/ConfigProvider.php +++ b/src/pool/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; class ConfigProvider diff --git a/src/pool/src/Connection.php b/src/pool/src/Connection.php index 35774b32f..8f4b07379 100644 --- a/src/pool/src/Connection.php +++ b/src/pool/src/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/src/ConstantFrequency.php b/src/pool/src/ConstantFrequency.php index 6c20e6668..5c867a61b 100644 --- a/src/pool/src/ConstantFrequency.php +++ b/src/pool/src/ConstantFrequency.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Coordinator\Timer; diff --git a/src/pool/src/Context.php b/src/pool/src/Context.php index d45093002..d8bee8a98 100644 --- a/src/pool/src/Context.php +++ b/src/pool/src/Context.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Context\Context as CoroutineContext; diff --git a/src/pool/src/Event/ReleaseConnection.php b/src/pool/src/Event/ReleaseConnection.php index fca051288..d96a348f8 100644 --- a/src/pool/src/Event/ReleaseConnection.php +++ b/src/pool/src/Event/ReleaseConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\Event; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/src/Exception/ConnectionException.php b/src/pool/src/Exception/ConnectionException.php index 825f86f2c..8e6c4c040 100644 --- a/src/pool/src/Exception/ConnectionException.php +++ b/src/pool/src/Exception/ConnectionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\Exception; use Exception; diff --git a/src/pool/src/Exception/InvalidArgumentException.php b/src/pool/src/Exception/InvalidArgumentException.php index 7db0aa560..b9a24f64b 100644 --- a/src/pool/src/Exception/InvalidArgumentException.php +++ b/src/pool/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/pool/src/Exception/SocketPopException.php b/src/pool/src/Exception/SocketPopException.php index f73127949..0595f15c9 100644 --- a/src/pool/src/Exception/SocketPopException.php +++ b/src/pool/src/Exception/SocketPopException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\Exception; use RuntimeException; diff --git a/src/pool/src/Frequency.php b/src/pool/src/Frequency.php index 18ca65080..c1abab4f8 100644 --- a/src/pool/src/Frequency.php +++ b/src/pool/src/Frequency.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Contract\FrequencyInterface; diff --git a/src/pool/src/KeepaliveConnection.php b/src/pool/src/KeepaliveConnection.php index 12080a6b2..31e22a07b 100644 --- a/src/pool/src/KeepaliveConnection.php +++ b/src/pool/src/KeepaliveConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Closure; diff --git a/src/pool/src/LowFrequencyInterface.php b/src/pool/src/LowFrequencyInterface.php index 8ebde4a73..811074340 100644 --- a/src/pool/src/LowFrequencyInterface.php +++ b/src/pool/src/LowFrequencyInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; interface LowFrequencyInterface diff --git a/src/pool/src/Pool.php b/src/pool/src/Pool.php index 44fc0d574..cc5e7adcc 100644 --- a/src/pool/src/Pool.php +++ b/src/pool/src/Pool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Contract\ConnectionInterface; @@ -30,7 +31,7 @@ abstract class Pool implements PoolInterface protected int $currentConnections = 0; - protected null|LowFrequencyInterface|FrequencyInterface $frequency = null; + protected null|FrequencyInterface|LowFrequencyInterface $frequency = null; public function __construct(protected ContainerInterface $container, array $config = []) { diff --git a/src/pool/src/PoolOption.php b/src/pool/src/PoolOption.php index 79d58f678..a13fcd6ce 100644 --- a/src/pool/src/PoolOption.php +++ b/src/pool/src/PoolOption.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool; use Hyperf\Contract\PoolOptionInterface; diff --git a/src/pool/src/SimplePool/Config.php b/src/pool/src/SimplePool/Config.php index 89c20ad04..d098bc0de 100644 --- a/src/pool/src/SimplePool/Config.php +++ b/src/pool/src/SimplePool/Config.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\SimplePool; class Config diff --git a/src/pool/src/SimplePool/Connection.php b/src/pool/src/SimplePool/Connection.php index 5c27df9a3..65736e099 100644 --- a/src/pool/src/SimplePool/Connection.php +++ b/src/pool/src/SimplePool/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\SimplePool; use Hyperf\Pool\Connection as AbstractConnection; diff --git a/src/pool/src/SimplePool/Pool.php b/src/pool/src/SimplePool/Pool.php index 104c4ccec..85fdf930d 100644 --- a/src/pool/src/SimplePool/Pool.php +++ b/src/pool/src/SimplePool/Pool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\SimplePool; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/src/SimplePool/PoolFactory.php b/src/pool/src/SimplePool/PoolFactory.php index 798763eed..96f85dbfe 100644 --- a/src/pool/src/SimplePool/PoolFactory.php +++ b/src/pool/src/SimplePool/PoolFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Pool\SimplePool; use Psr\Container\ContainerInterface; diff --git a/src/pool/tests/ConnectionTest.php b/src/pool/tests/ConnectionTest.php index c61650496..46813c605 100644 --- a/src/pool/tests/ConnectionTest.php +++ b/src/pool/tests/ConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/pool/tests/FrequencyTest.php b/src/pool/tests/FrequencyTest.php index 6b2c7c2fd..14bdf8c75 100644 --- a/src/pool/tests/FrequencyTest.php +++ b/src/pool/tests/FrequencyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/tests/HeartbeatConnectionTest.php b/src/pool/tests/HeartbeatConnectionTest.php index 2de9d84e5..993f36dc2 100644 --- a/src/pool/tests/HeartbeatConnectionTest.php +++ b/src/pool/tests/HeartbeatConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool; use Hyperf\Context\ApplicationContext; diff --git a/src/pool/tests/PoolTest.php b/src/pool/tests/PoolTest.php index ee67d386e..d11f8fc58 100644 --- a/src/pool/tests/PoolTest.php +++ b/src/pool/tests/PoolTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool; use Hyperf\Context\ApplicationContext; diff --git a/src/pool/tests/Stub/ActiveConnectionStub.php b/src/pool/tests/Stub/ActiveConnectionStub.php index 7b9769c49..563a70cfa 100644 --- a/src/pool/tests/Stub/ActiveConnectionStub.php +++ b/src/pool/tests/Stub/ActiveConnectionStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool\Stub; use Exception; diff --git a/src/pool/tests/Stub/ConstantFrequencyStub.php b/src/pool/tests/Stub/ConstantFrequencyStub.php index 4dcd5a587..ff4032eea 100644 --- a/src/pool/tests/Stub/ConstantFrequencyStub.php +++ b/src/pool/tests/Stub/ConstantFrequencyStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool\Stub; use Hyperf\Pool\ConstantFrequency; diff --git a/src/pool/tests/Stub/FooPool.php b/src/pool/tests/Stub/FooPool.php index 6827bd290..d44012be7 100644 --- a/src/pool/tests/Stub/FooPool.php +++ b/src/pool/tests/Stub/FooPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool\Stub; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/tests/Stub/FrequencyStub.php b/src/pool/tests/Stub/FrequencyStub.php index a8e9e2d69..632405523 100644 --- a/src/pool/tests/Stub/FrequencyStub.php +++ b/src/pool/tests/Stub/FrequencyStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool\Stub; use Hyperf\Pool\Frequency; diff --git a/src/pool/tests/Stub/HeartbeatPoolStub.php b/src/pool/tests/Stub/HeartbeatPoolStub.php index b278104c1..0e2b8fc68 100644 --- a/src/pool/tests/Stub/HeartbeatPoolStub.php +++ b/src/pool/tests/Stub/HeartbeatPoolStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool\Stub; use Hyperf\Contract\ConnectionInterface; diff --git a/src/pool/tests/Stub/KeepaliveConnectionStub.php b/src/pool/tests/Stub/KeepaliveConnectionStub.php index f41bfe092..f5d95c970 100644 --- a/src/pool/tests/Stub/KeepaliveConnectionStub.php +++ b/src/pool/tests/Stub/KeepaliveConnectionStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Pool\Stub; use Hyperf\Context\Context; diff --git a/src/process/src/AbstractProcess.php b/src/process/src/AbstractProcess.php index 8b3477726..866ce8aca 100644 --- a/src/process/src/AbstractProcess.php +++ b/src/process/src/AbstractProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process; use Hyperf\Contract\ProcessInterface; @@ -28,6 +29,7 @@ use Hyperf\Process\Exception\ServerInvalidException; use Hyperf\Process\Exception\SocketAcceptException; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; +use Swoole\Coroutine\Socket; use Swoole\Event; use Swoole\Process as SwooleProcess; use Swoole\Server; @@ -156,7 +158,7 @@ abstract class AbstractProcess implements ProcessInterface Coroutine::create(function () use ($quit) { while ($quit->pop(0.001) !== true) { try { - /** @var \Swoole\Coroutine\Socket $sock */ + /** @var Socket $sock */ $sock = $this->process->exportSocket(); $recv = $sock->recv($this->recvLength, $this->recvTimeout); if ($recv === '') { diff --git a/src/process/src/Annotation/Process.php b/src/process/src/Annotation/Process.php index 58571d940..36767fa08 100644 --- a/src/process/src/Annotation/Process.php +++ b/src/process/src/Annotation/Process.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Annotation; use Attribute; diff --git a/src/process/src/ConfigProvider.php b/src/process/src/ConfigProvider.php index f7b651f4b..6a96b57b4 100644 --- a/src/process/src/ConfigProvider.php +++ b/src/process/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process; use Hyperf\Process\Listener\BootProcessListener; diff --git a/src/process/src/Event/AfterCoroutineHandle.php b/src/process/src/Event/AfterCoroutineHandle.php index 6723015a4..9e86b4f1b 100644 --- a/src/process/src/Event/AfterCoroutineHandle.php +++ b/src/process/src/Event/AfterCoroutineHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Event; use Hyperf\Process\AbstractProcess; diff --git a/src/process/src/Event/AfterProcessHandle.php b/src/process/src/Event/AfterProcessHandle.php index 93f3b6da3..ff87c4a94 100644 --- a/src/process/src/Event/AfterProcessHandle.php +++ b/src/process/src/Event/AfterProcessHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Event; use Hyperf\Process\AbstractProcess; diff --git a/src/process/src/Event/BeforeCoroutineHandle.php b/src/process/src/Event/BeforeCoroutineHandle.php index 5912a096b..c9b6dd109 100644 --- a/src/process/src/Event/BeforeCoroutineHandle.php +++ b/src/process/src/Event/BeforeCoroutineHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Event; use Hyperf\Process\AbstractProcess; diff --git a/src/process/src/Event/BeforeProcessHandle.php b/src/process/src/Event/BeforeProcessHandle.php index 6cc4f2f41..145fa5a03 100644 --- a/src/process/src/Event/BeforeProcessHandle.php +++ b/src/process/src/Event/BeforeProcessHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Event; use Hyperf\Process\AbstractProcess; diff --git a/src/process/src/Event/PipeMessage.php b/src/process/src/Event/PipeMessage.php index 9be234153..85796a66a 100644 --- a/src/process/src/Event/PipeMessage.php +++ b/src/process/src/Event/PipeMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Event; class PipeMessage diff --git a/src/process/src/Exception/ServerInvalidException.php b/src/process/src/Exception/ServerInvalidException.php index d8071ff25..dc8b5270e 100644 --- a/src/process/src/Exception/ServerInvalidException.php +++ b/src/process/src/Exception/ServerInvalidException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Exception; use RuntimeException; diff --git a/src/process/src/Exception/SocketAcceptException.php b/src/process/src/Exception/SocketAcceptException.php index 3f888a504..63604e7ee 100644 --- a/src/process/src/Exception/SocketAcceptException.php +++ b/src/process/src/Exception/SocketAcceptException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Exception; use RuntimeException; diff --git a/src/process/src/Handler/ProcessStopHandler.php b/src/process/src/Handler/ProcessStopHandler.php index 66757dc95..f0459daae 100644 --- a/src/process/src/Handler/ProcessStopHandler.php +++ b/src/process/src/Handler/ProcessStopHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Handler; use Hyperf\Process\ProcessManager; diff --git a/src/process/src/Listener/BootProcessListener.php b/src/process/src/Listener/BootProcessListener.php index cf5694d9e..9bfdb5260 100644 --- a/src/process/src/Listener/BootProcessListener.php +++ b/src/process/src/Listener/BootProcessListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/process/src/Listener/LogAfterProcessStoppedListener.php b/src/process/src/Listener/LogAfterProcessStoppedListener.php index cf292994f..c892e9615 100644 --- a/src/process/src/Listener/LogAfterProcessStoppedListener.php +++ b/src/process/src/Listener/LogAfterProcessStoppedListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Listener; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/process/src/Listener/LogBeforeProcessStartListener.php b/src/process/src/Listener/LogBeforeProcessStartListener.php index 67c8c1802..9bf0708c6 100644 --- a/src/process/src/Listener/LogBeforeProcessStartListener.php +++ b/src/process/src/Listener/LogBeforeProcessStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process\Listener; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/process/src/ProcessCollector.php b/src/process/src/ProcessCollector.php index 5440c8cd3..10b0d8742 100644 --- a/src/process/src/ProcessCollector.php +++ b/src/process/src/ProcessCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process; use Swoole\Process; diff --git a/src/process/src/ProcessManager.php b/src/process/src/ProcessManager.php index 5bb6b7361..8a8681ff0 100644 --- a/src/process/src/ProcessManager.php +++ b/src/process/src/ProcessManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Process; use Hyperf\Contract\ProcessInterface; diff --git a/src/process/tests/BootProcessListenerTest.php b/src/process/tests/BootProcessListenerTest.php index da9289c2a..ae08413bf 100644 --- a/src/process/tests/BootProcessListenerTest.php +++ b/src/process/tests/BootProcessListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Process; use Hyperf\Contract\ConfigInterface; diff --git a/src/process/tests/ProcessTest.php b/src/process/tests/ProcessTest.php index 6e8269759..f5f69ff7e 100644 --- a/src/process/tests/ProcessTest.php +++ b/src/process/tests/ProcessTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Process; use Hyperf\Context\ApplicationContext; @@ -17,10 +18,12 @@ use Hyperf\Process\Event\BeforeProcessHandle; use HyperfTest\Process\Stub\FooProcess; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\EventDispatcher\EventDispatcherInterface; use ReflectionClass; +use Swoole\Server; /** * @internal @@ -41,7 +44,7 @@ class ProcessTest extends TestCase self::$dispatched = []; } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testEventWhenThrowExceptionInProcess() { $container = $this->getContainer(); @@ -71,7 +74,7 @@ class ProcessTest extends TestCase protected function getServer() { - $server = Mockery::mock(\Swoole\Server::class); + $server = Mockery::mock(Server::class); $server->shouldReceive('addProcess')->withAnyArgs()->andReturnUsing(function ($process) { $ref = new ReflectionClass($process); $property = $ref->getProperty('callback'); diff --git a/src/process/tests/Stub/FooProcess.php b/src/process/tests/Stub/FooProcess.php index a35c8e2ed..4183dffdf 100644 --- a/src/process/tests/Stub/FooProcess.php +++ b/src/process/tests/Stub/FooProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Process\Stub; use Hyperf\Process\AbstractProcess; diff --git a/src/protocol/src/ConfigProvider.php b/src/protocol/src/ConfigProvider.php index a59bde87f..811972c7e 100644 --- a/src/protocol/src/ConfigProvider.php +++ b/src/protocol/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Protocol; use Hyperf\Protocol\Packer\SerializePacker; diff --git a/src/protocol/src/Packer/SerializePacker.php b/src/protocol/src/Packer/SerializePacker.php index 445fbd276..1522ddcd9 100644 --- a/src/protocol/src/Packer/SerializePacker.php +++ b/src/protocol/src/Packer/SerializePacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Protocol\Packer; use Hyperf\Protocol\ProtocolPackerInterface; diff --git a/src/protocol/src/ProtocolPackerInterface.php b/src/protocol/src/ProtocolPackerInterface.php index b1441bb95..c0deb6cb0 100644 --- a/src/protocol/src/ProtocolPackerInterface.php +++ b/src/protocol/src/ProtocolPackerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Protocol; use Hyperf\Contract\PackerInterface; diff --git a/src/protocol/tests/SerializePackerTest.php b/src/protocol/tests/SerializePackerTest.php index cb141ca07..20e4d2ec0 100644 --- a/src/protocol/tests/SerializePackerTest.php +++ b/src/protocol/tests/SerializePackerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Protocol; use Hyperf\Protocol\Packer\SerializePacker; diff --git a/src/protocol/tests/Stub/DemoStub.php b/src/protocol/tests/Stub/DemoStub.php index 1c080ae71..3bbea20ac 100644 --- a/src/protocol/tests/Stub/DemoStub.php +++ b/src/protocol/tests/Stub/DemoStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Protocol\Stub; class DemoStub diff --git a/src/rate-limit/src/Annotation/RateLimit.php b/src/rate-limit/src/Annotation/RateLimit.php index 06ac565c3..f0dac3e0b 100644 --- a/src/rate-limit/src/Annotation/RateLimit.php +++ b/src/rate-limit/src/Annotation/RateLimit.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Annotation; use Attribute; diff --git a/src/rate-limit/src/Aspect/RateLimitAnnotationAspect.php b/src/rate-limit/src/Aspect/RateLimitAnnotationAspect.php index 2d4ae2a9b..ec1a7c24c 100644 --- a/src/rate-limit/src/Aspect/RateLimitAnnotationAspect.php +++ b/src/rate-limit/src/Aspect/RateLimitAnnotationAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Aspect; use bandwidthThrottle\tokenBucket\storage\StorageException; diff --git a/src/rate-limit/src/ConfigProvider.php b/src/rate-limit/src/ConfigProvider.php index 775c23203..407de2336 100644 --- a/src/rate-limit/src/ConfigProvider.php +++ b/src/rate-limit/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit; use Hyperf\RateLimit\Aspect\RateLimitAnnotationAspect; diff --git a/src/rate-limit/src/Exception/RateLimitException.php b/src/rate-limit/src/Exception/RateLimitException.php index 4a02b7031..2debd56c2 100644 --- a/src/rate-limit/src/Exception/RateLimitException.php +++ b/src/rate-limit/src/Exception/RateLimitException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Exception; use RuntimeException; diff --git a/src/rate-limit/src/Handler/RateLimitHandler.php b/src/rate-limit/src/Handler/RateLimitHandler.php index 5bbd7eb49..9dcb66f8f 100644 --- a/src/rate-limit/src/Handler/RateLimitHandler.php +++ b/src/rate-limit/src/Handler/RateLimitHandler.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Handler; use bandwidthThrottle\tokenBucket\Rate; +use bandwidthThrottle\tokenBucket\storage\StorageException; use bandwidthThrottle\tokenBucket\TokenBucket; use Hyperf\Contract\ConfigInterface; use Hyperf\RateLimit\Storage\RedisStorage; @@ -30,7 +32,7 @@ class RateLimitHandler } /** - * @throws \bandwidthThrottle\tokenBucket\storage\StorageException + * @throws StorageException */ public function build(string $key, int $limit, int $capacity, int $timeout): TokenBucket { diff --git a/src/rate-limit/src/Storage/RedisStorage.php b/src/rate-limit/src/Storage/RedisStorage.php index 2644d856f..38dff4083 100644 --- a/src/rate-limit/src/Storage/RedisStorage.php +++ b/src/rate-limit/src/Storage/RedisStorage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Storage; use bandwidthThrottle\tokenBucket\storage\scope\GlobalScope; diff --git a/src/rate-limit/src/Storage/StorageInterface.php b/src/rate-limit/src/Storage/StorageInterface.php index 80c0fb96a..4d049daee 100644 --- a/src/rate-limit/src/Storage/StorageInterface.php +++ b/src/rate-limit/src/Storage/StorageInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RateLimit\Storage; use Psr\Container\ContainerInterface; diff --git a/src/rate-limit/tests/RateLimitTest.php b/src/rate-limit/tests/RateLimitTest.php index d762457a4..a2f7c1384 100644 --- a/src/rate-limit/tests/RateLimitTest.php +++ b/src/rate-limit/tests/RateLimitTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RateLimit; use bandwidthThrottle\tokenBucket\Rate; diff --git a/src/rate-limit/tests/Stub/Storage/EmptyStorage.php b/src/rate-limit/tests/Stub/Storage/EmptyStorage.php index 021a26430..21c9314e9 100644 --- a/src/rate-limit/tests/Stub/Storage/EmptyStorage.php +++ b/src/rate-limit/tests/Stub/Storage/EmptyStorage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RateLimit\Stub\Storage; use bandwidthThrottle\tokenBucket\storage\scope\GlobalScope; diff --git a/src/rate-limit/tests/Stub/Storage/InvalidStorage.php b/src/rate-limit/tests/Stub/Storage/InvalidStorage.php index ee9626da0..b1703f6df 100644 --- a/src/rate-limit/tests/Stub/Storage/InvalidStorage.php +++ b/src/rate-limit/tests/Stub/Storage/InvalidStorage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RateLimit\Stub\Storage; class InvalidStorage diff --git a/src/reactive-x/src/AllProcessesBroadcaster.php b/src/reactive-x/src/AllProcessesBroadcaster.php index 35aa27bbb..1dda1eefc 100644 --- a/src/reactive-x/src/AllProcessesBroadcaster.php +++ b/src/reactive-x/src/AllProcessesBroadcaster.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\ReactiveX\Contract\BroadcasterInterface; diff --git a/src/reactive-x/src/ConfigProvider.php b/src/reactive-x/src/ConfigProvider.php index 9bff73eb3..b9a607a66 100644 --- a/src/reactive-x/src/ConfigProvider.php +++ b/src/reactive-x/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\ReactiveX\Contract\BroadcasterInterface; diff --git a/src/reactive-x/src/Contract/BroadcasterInterface.php b/src/reactive-x/src/Contract/BroadcasterInterface.php index b76211078..57b64e700 100644 --- a/src/reactive-x/src/Contract/BroadcasterInterface.php +++ b/src/reactive-x/src/Contract/BroadcasterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Contract; use Hyperf\ReactiveX\IpcMessageWrapper; diff --git a/src/reactive-x/src/Contract/MessageBusInterface.php b/src/reactive-x/src/Contract/MessageBusInterface.php index 10804fbb3..16b12a242 100644 --- a/src/reactive-x/src/Contract/MessageBusInterface.php +++ b/src/reactive-x/src/Contract/MessageBusInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Contract; use Rx\DisposableInterface; diff --git a/src/reactive-x/src/Example/BatchSaveRoute.php b/src/reactive-x/src/Example/BatchSaveRoute.php index 01ee750a4..bcadc1946 100644 --- a/src/reactive-x/src/Example/BatchSaveRoute.php +++ b/src/reactive-x/src/Example/BatchSaveRoute.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Example; use Exception; diff --git a/src/reactive-x/src/Example/SqlListener.php b/src/reactive-x/src/Example/SqlListener.php index 980d23e1d..af0d6150f 100644 --- a/src/reactive-x/src/Example/SqlListener.php +++ b/src/reactive-x/src/Example/SqlListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Example; use Hyperf\Collection\Arr; diff --git a/src/reactive-x/src/Example/WebSocketsController.php b/src/reactive-x/src/Example/WebSocketsController.php index 9c85c50c1..df1001411 100644 --- a/src/reactive-x/src/Example/WebSocketsController.php +++ b/src/reactive-x/src/Example/WebSocketsController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Example; use Hyperf\Contract\OnCloseInterface; diff --git a/src/reactive-x/src/IpcMessageWrapper.php b/src/reactive-x/src/IpcMessageWrapper.php index 5a341a1be..93db517d1 100644 --- a/src/reactive-x/src/IpcMessageWrapper.php +++ b/src/reactive-x/src/IpcMessageWrapper.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Rx\Notification; diff --git a/src/reactive-x/src/IpcSubject.php b/src/reactive-x/src/IpcSubject.php index 609fbe57c..88ddf40eb 100644 --- a/src/reactive-x/src/IpcSubject.php +++ b/src/reactive-x/src/IpcSubject.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\Framework\Event\OnPipeMessage; diff --git a/src/reactive-x/src/Listener/BootApplicationListener.php b/src/reactive-x/src/Listener/BootApplicationListener.php index edc38f880..4c6d9b8af 100644 --- a/src/reactive-x/src/Listener/BootApplicationListener.php +++ b/src/reactive-x/src/Listener/BootApplicationListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/reactive-x/src/MessageBusFactory.php b/src/reactive-x/src/MessageBusFactory.php index 7b0c2c99a..7d2ea1df2 100644 --- a/src/reactive-x/src/MessageBusFactory.php +++ b/src/reactive-x/src/MessageBusFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\ReactiveX\Contract\BroadcasterInterface; diff --git a/src/reactive-x/src/Observable.php b/src/reactive-x/src/Observable.php index 24cf86846..442a5c4ab 100644 --- a/src/reactive-x/src/Observable.php +++ b/src/reactive-x/src/Observable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Exception; diff --git a/src/reactive-x/src/Observable/ChannelObservable.php b/src/reactive-x/src/Observable/ChannelObservable.php index fedbfc491..c57c555e8 100644 --- a/src/reactive-x/src/Observable/ChannelObservable.php +++ b/src/reactive-x/src/Observable/ChannelObservable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Observable; use Hyperf\Engine\Channel; diff --git a/src/reactive-x/src/Observable/CoroutineObservable.php b/src/reactive-x/src/Observable/CoroutineObservable.php index ec78356e8..078909e78 100644 --- a/src/reactive-x/src/Observable/CoroutineObservable.php +++ b/src/reactive-x/src/Observable/CoroutineObservable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Observable; use Hyperf\Coroutine\WaitGroup; diff --git a/src/reactive-x/src/Observable/EventObservable.php b/src/reactive-x/src/Observable/EventObservable.php index e43228f68..114543003 100644 --- a/src/reactive-x/src/Observable/EventObservable.php +++ b/src/reactive-x/src/Observable/EventObservable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Observable; use Hyperf\Context\ApplicationContext; diff --git a/src/reactive-x/src/Observable/HttpRouteObservable.php b/src/reactive-x/src/Observable/HttpRouteObservable.php index 0e0b65e43..5ced95066 100644 --- a/src/reactive-x/src/Observable/HttpRouteObservable.php +++ b/src/reactive-x/src/Observable/HttpRouteObservable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Observable; use Hyperf\Context\ApplicationContext; @@ -33,7 +34,7 @@ class HttpRouteObservable extends Observable * @param null|callable|string $callback */ public function __construct( - private string|array $httpMethod, + private array|string $httpMethod, private string $uri, private mixed $callback = null, private ?SchedulerInterface $scheduler = null, diff --git a/src/reactive-x/src/RxSwoole.php b/src/reactive-x/src/RxSwoole.php index b6e9d8540..93fb15026 100644 --- a/src/reactive-x/src/RxSwoole.php +++ b/src/reactive-x/src/RxSwoole.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/reactive-x/src/Scheduler/ConcurrentEventLoopScheduler.php b/src/reactive-x/src/Scheduler/ConcurrentEventLoopScheduler.php index 58c04af13..fbe183da1 100644 --- a/src/reactive-x/src/Scheduler/ConcurrentEventLoopScheduler.php +++ b/src/reactive-x/src/Scheduler/ConcurrentEventLoopScheduler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX\Scheduler; use Hyperf\Coroutine\Coroutine; @@ -87,9 +88,6 @@ final class ConcurrentEventLoopScheduler extends VirtualTimeScheduler $this->insideInvoke = false; } - /** - * {@inheritdoc} - */ public function now(): int { return (int) floor(microtime(true) * 1000); diff --git a/src/reactive-x/src/ServerBroadcaster.php b/src/reactive-x/src/ServerBroadcaster.php index f4230b43c..e08142e79 100644 --- a/src/reactive-x/src/ServerBroadcaster.php +++ b/src/reactive-x/src/ServerBroadcaster.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\ReactiveX\Contract\BroadcasterInterface; diff --git a/src/reactive-x/src/UserProcessesBroadcaster.php b/src/reactive-x/src/UserProcessesBroadcaster.php index 8789cdb66..ffd07fd34 100644 --- a/src/reactive-x/src/UserProcessesBroadcaster.php +++ b/src/reactive-x/src/UserProcessesBroadcaster.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ReactiveX; use Hyperf\Process\ProcessCollector; diff --git a/src/reactive-x/tests/Cases/ConcurrentEventLoopSchedulerTest.php b/src/reactive-x/tests/Cases/ConcurrentEventLoopSchedulerTest.php index 642f1c664..756ff53bb 100644 --- a/src/reactive-x/tests/Cases/ConcurrentEventLoopSchedulerTest.php +++ b/src/reactive-x/tests/Cases/ConcurrentEventLoopSchedulerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cases; use Hyperf\Engine\Channel; diff --git a/src/reactive-x/tests/Cases/IpcSubjectTest.php b/src/reactive-x/tests/Cases/IpcSubjectTest.php index c63f7bc41..596ec345c 100644 --- a/src/reactive-x/tests/Cases/IpcSubjectTest.php +++ b/src/reactive-x/tests/Cases/IpcSubjectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/reactive-x/tests/Cases/ObservableTest.php b/src/reactive-x/tests/Cases/ObservableTest.php index 7465bcae0..a798ed2a3 100644 --- a/src/reactive-x/tests/Cases/ObservableTest.php +++ b/src/reactive-x/tests/Cases/ObservableTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/reactive-x/tests/Stub/TestEvent.php b/src/reactive-x/tests/Stub/TestEvent.php index 8ff3a8c0b..1341e3a62 100644 --- a/src/reactive-x/tests/Stub/TestEvent.php +++ b/src/reactive-x/tests/Stub/TestEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ReactiveX\Stub; class TestEvent diff --git a/src/redis/src/ConfigProvider.php b/src/redis/src/ConfigProvider.php index 5f3a23625..353a98029 100644 --- a/src/redis/src/ConfigProvider.php +++ b/src/redis/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; class ConfigProvider diff --git a/src/redis/src/Exception/InvalidRedisConnectionException.php b/src/redis/src/Exception/InvalidRedisConnectionException.php index c1f527606..542ea4ce1 100644 --- a/src/redis/src/Exception/InvalidRedisConnectionException.php +++ b/src/redis/src/Exception/InvalidRedisConnectionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Exception; use RuntimeException; diff --git a/src/redis/src/Exception/InvalidRedisOptionException.php b/src/redis/src/Exception/InvalidRedisOptionException.php index 7c7722f68..08661534b 100644 --- a/src/redis/src/Exception/InvalidRedisOptionException.php +++ b/src/redis/src/Exception/InvalidRedisOptionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Exception; use RuntimeException; diff --git a/src/redis/src/Exception/InvalidRedisProxyException.php b/src/redis/src/Exception/InvalidRedisProxyException.php index c1d6f020c..d4aae007d 100644 --- a/src/redis/src/Exception/InvalidRedisProxyException.php +++ b/src/redis/src/Exception/InvalidRedisProxyException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Exception; use RuntimeException; diff --git a/src/redis/src/Exception/RedisNotFoundException.php b/src/redis/src/Exception/RedisNotFoundException.php index 30eb85e03..27a1fd723 100644 --- a/src/redis/src/Exception/RedisNotFoundException.php +++ b/src/redis/src/Exception/RedisNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Exception; use RuntimeException; diff --git a/src/redis/src/Frequency.php b/src/redis/src/Frequency.php index dd957a71c..0ea5d0d9c 100644 --- a/src/redis/src/Frequency.php +++ b/src/redis/src/Frequency.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; use Hyperf\Pool\Frequency as DefaultFrequency; diff --git a/src/redis/src/Lua/Hash/HGetAllMultiple.php b/src/redis/src/Lua/Hash/HGetAllMultiple.php index c4d063e80..04a3242e4 100644 --- a/src/redis/src/Lua/Hash/HGetAllMultiple.php +++ b/src/redis/src/Lua/Hash/HGetAllMultiple.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Lua\Hash; use Hyperf\Redis\Lua\Script; diff --git a/src/redis/src/Lua/Hash/HIncrByFloatIfExists.php b/src/redis/src/Lua/Hash/HIncrByFloatIfExists.php index 743546116..8db91c303 100644 --- a/src/redis/src/Lua/Hash/HIncrByFloatIfExists.php +++ b/src/redis/src/Lua/Hash/HIncrByFloatIfExists.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Lua\Hash; use Hyperf\Redis\Lua\Script; diff --git a/src/redis/src/Lua/Script.php b/src/redis/src/Lua/Script.php index 63db5a7ec..50155f79e 100644 --- a/src/redis/src/Lua/Script.php +++ b/src/redis/src/Lua/Script.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Lua; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/redis/src/Lua/ScriptInterface.php b/src/redis/src/Lua/ScriptInterface.php index a6267db2b..981db3d86 100644 --- a/src/redis/src/Lua/ScriptInterface.php +++ b/src/redis/src/Lua/ScriptInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Lua; interface ScriptInterface diff --git a/src/redis/src/Pool/PoolFactory.php b/src/redis/src/Pool/PoolFactory.php index d412d54ba..c1931aa2b 100644 --- a/src/redis/src/Pool/PoolFactory.php +++ b/src/redis/src/Pool/PoolFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Pool; use Hyperf\Di\Container; diff --git a/src/redis/src/Pool/RedisPool.php b/src/redis/src/Pool/RedisPool.php index 40b13c664..0f233a1aa 100644 --- a/src/redis/src/Pool/RedisPool.php +++ b/src/redis/src/Pool/RedisPool.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Pool; use Hyperf\Collection\Arr; diff --git a/src/redis/src/Redis.php b/src/redis/src/Redis.php index 387a108e8..4b7a6c81f 100644 --- a/src/redis/src/Redis.php +++ b/src/redis/src/Redis.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; use Hyperf\Context\Context; diff --git a/src/redis/src/RedisConnection.php b/src/redis/src/RedisConnection.php index 24d3ba431..ae1de44fb 100644 --- a/src/redis/src/RedisConnection.php +++ b/src/redis/src/RedisConnection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; use Hyperf\Contract\ConnectionInterface; @@ -33,7 +34,7 @@ class RedisConnection extends BaseConnection implements ConnectionInterface use Traits\ScanCaller; use Traits\MultiExec; - protected Redis|RedisCluster|null $connection = null; + protected null|Redis|RedisCluster $connection = null; protected array $config = [ 'host' => 'localhost', diff --git a/src/redis/src/RedisFactory.php b/src/redis/src/RedisFactory.php index fb73a5029..5852ff04a 100644 --- a/src/redis/src/RedisFactory.php +++ b/src/redis/src/RedisFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; use Hyperf\Contract\ConfigInterface; diff --git a/src/redis/src/RedisProxy.php b/src/redis/src/RedisProxy.php index ea823597b..70a376dd1 100644 --- a/src/redis/src/RedisProxy.php +++ b/src/redis/src/RedisProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; use Hyperf\Redis\Pool\PoolFactory; diff --git a/src/redis/src/RedisSentinelFactory.php b/src/redis/src/RedisSentinelFactory.php index a1dff7c69..f17c6c784 100644 --- a/src/redis/src/RedisSentinelFactory.php +++ b/src/redis/src/RedisSentinelFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis; use RedisSentinel; diff --git a/src/redis/src/Traits/MultiExec.php b/src/redis/src/Traits/MultiExec.php index 7374e5166..11a823b7a 100644 --- a/src/redis/src/Traits/MultiExec.php +++ b/src/redis/src/Traits/MultiExec.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Traits; use Redis; diff --git a/src/redis/src/Traits/ScanCaller.php b/src/redis/src/Traits/ScanCaller.php index e10ae5760..e1d80e258 100644 --- a/src/redis/src/Traits/ScanCaller.php +++ b/src/redis/src/Traits/ScanCaller.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Redis\Traits; trait ScanCaller diff --git a/src/redis/tests/Lua/EvalTest.php b/src/redis/tests/Lua/EvalTest.php index bc916972e..8fd722e20 100644 --- a/src/redis/tests/Lua/EvalTest.php +++ b/src/redis/tests/Lua/EvalTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Lua; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/redis/tests/Lua/HashTest.php b/src/redis/tests/Lua/HashTest.php index 02f631fe7..cd64c9035 100644 --- a/src/redis/tests/Lua/HashTest.php +++ b/src/redis/tests/Lua/HashTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Lua; use Hyperf\Redis\Lua\Hash\HGetAllMultiple; diff --git a/src/redis/tests/RedisConnectionTest.php b/src/redis/tests/RedisConnectionTest.php index 0ac74faf0..0cf8a4230 100644 --- a/src/redis/tests/RedisConnectionTest.php +++ b/src/redis/tests/RedisConnectionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis; use Hyperf\Config\Config; diff --git a/src/redis/tests/RedisProxyTest.php b/src/redis/tests/RedisProxyTest.php index 71a716baa..8009760c4 100644 --- a/src/redis/tests/RedisProxyTest.php +++ b/src/redis/tests/RedisProxyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis; use Hyperf\Config\Config; diff --git a/src/redis/tests/RedisTest.php b/src/redis/tests/RedisTest.php index 3693b1879..0fb0e37fb 100644 --- a/src/redis/tests/RedisTest.php +++ b/src/redis/tests/RedisTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis; use Hyperf\Config\Config; diff --git a/src/redis/tests/Stub/ContainerStub.php b/src/redis/tests/Stub/ContainerStub.php index 6c5eae974..21a4467e2 100644 --- a/src/redis/tests/Stub/ContainerStub.php +++ b/src/redis/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Hyperf\Config\Config; diff --git a/src/redis/tests/Stub/HGetAllMultipleStub.php b/src/redis/tests/Stub/HGetAllMultipleStub.php index 4ef13a27a..5f930c5af 100644 --- a/src/redis/tests/Stub/HGetAllMultipleStub.php +++ b/src/redis/tests/Stub/HGetAllMultipleStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Hyperf\Redis\Lua\Hash\HGetAllMultiple; diff --git a/src/redis/tests/Stub/HIncrByFloatIfExistsStub.php b/src/redis/tests/Stub/HIncrByFloatIfExistsStub.php index 5851a10a5..56ec4b17b 100644 --- a/src/redis/tests/Stub/HIncrByFloatIfExistsStub.php +++ b/src/redis/tests/Stub/HIncrByFloatIfExistsStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Hyperf\Redis\Lua\Hash\HIncrByFloatIfExists; diff --git a/src/redis/tests/Stub/RedisConnectionFailedStub.php b/src/redis/tests/Stub/RedisConnectionFailedStub.php index 4f6094582..76c663562 100644 --- a/src/redis/tests/Stub/RedisConnectionFailedStub.php +++ b/src/redis/tests/Stub/RedisConnectionFailedStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Exception; diff --git a/src/redis/tests/Stub/RedisConnectionStub.php b/src/redis/tests/Stub/RedisConnectionStub.php index 9fefa19a4..3e6ce8c26 100644 --- a/src/redis/tests/Stub/RedisConnectionStub.php +++ b/src/redis/tests/Stub/RedisConnectionStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Hyperf\Pool\Pool; diff --git a/src/redis/tests/Stub/RedisPoolFailedStub.php b/src/redis/tests/Stub/RedisPoolFailedStub.php index 030e753f3..9b2caa384 100644 --- a/src/redis/tests/Stub/RedisPoolFailedStub.php +++ b/src/redis/tests/Stub/RedisPoolFailedStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Hyperf\Contract\ConnectionInterface; diff --git a/src/redis/tests/Stub/RedisPoolStub.php b/src/redis/tests/Stub/RedisPoolStub.php index 448433da3..7a79ec944 100644 --- a/src/redis/tests/Stub/RedisPoolStub.php +++ b/src/redis/tests/Stub/RedisPoolStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Redis\Stub; use Hyperf\Contract\ConnectionInterface; diff --git a/src/resource-grpc/src/AnonymousGrpcResourceCollection.php b/src/resource-grpc/src/AnonymousGrpcResourceCollection.php index 66cbdad64..46c08131c 100644 --- a/src/resource-grpc/src/AnonymousGrpcResourceCollection.php +++ b/src/resource-grpc/src/AnonymousGrpcResourceCollection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ResourceGrpc; class AnonymousGrpcResourceCollection extends GrpcResourceCollection diff --git a/src/resource-grpc/src/ConfigProvider.php b/src/resource-grpc/src/ConfigProvider.php index 4f64e5c5e..b815f123a 100644 --- a/src/resource-grpc/src/ConfigProvider.php +++ b/src/resource-grpc/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ResourceGrpc; class ConfigProvider diff --git a/src/resource-grpc/src/GrpcResource.php b/src/resource-grpc/src/GrpcResource.php index 182df82ec..1282a8c0d 100644 --- a/src/resource-grpc/src/GrpcResource.php +++ b/src/resource-grpc/src/GrpcResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ResourceGrpc; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource-grpc/src/GrpcResourceCollection.php b/src/resource-grpc/src/GrpcResourceCollection.php index d9dbcfcfe..16f30a535 100644 --- a/src/resource-grpc/src/GrpcResourceCollection.php +++ b/src/resource-grpc/src/GrpcResourceCollection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ResourceGrpc; use Hyperf\Collection\Collection; diff --git a/src/resource-grpc/src/GrpcResponse.php b/src/resource-grpc/src/GrpcResponse.php index 05d74fa8f..b526ad75d 100644 --- a/src/resource-grpc/src/GrpcResponse.php +++ b/src/resource-grpc/src/GrpcResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ResourceGrpc; use Google\Protobuf\Internal\Message; diff --git a/src/resource-grpc/src/UndefinedGrpcResourceExpectMessage.php b/src/resource-grpc/src/UndefinedGrpcResourceExpectMessage.php index f501869dc..281d973a6 100644 --- a/src/resource-grpc/src/UndefinedGrpcResourceExpectMessage.php +++ b/src/resource-grpc/src/UndefinedGrpcResourceExpectMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ResourceGrpc; use Exception; diff --git a/src/resource-grpc/tests/GrpcResourceTest.php b/src/resource-grpc/tests/GrpcResourceTest.php index 21d3f5eee..bb7b3dde8 100644 --- a/src/resource-grpc/tests/GrpcResourceTest.php +++ b/src/resource-grpc/tests/GrpcResourceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ResourceGrpc; use HyperfTest\ResourceGrpc\Stubs\Grpc\AllReply; @@ -20,6 +21,7 @@ use HyperfTest\ResourceGrpc\Stubs\Resources\AllReplyResource; use HyperfTest\ResourceGrpc\Stubs\Resources\HiReplyResource; use HyperfTest\ResourceGrpc\Stubs\Resources\HiUserResource; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\TestCase; use function Hyperf\Collection\collect; @@ -28,7 +30,7 @@ use function Hyperf\Collection\collect; * @coversNothing */ #[CoversNothing] -class GrpcResourceTest extends \PHPUnit\Framework\TestCase +class GrpcResourceTest extends TestCase { public function testResourceToMessage() { diff --git a/src/resource-grpc/tests/Stubs/Grpc/AllReply.php b/src/resource-grpc/tests/Stubs/Grpc/AllReply.php index 273b09a4b..9ba3a5f59 100644 --- a/src/resource-grpc/tests/Stubs/Grpc/AllReply.php +++ b/src/resource-grpc/tests/Stubs/Grpc/AllReply.php @@ -13,12 +13,16 @@ declare(strict_types=1); namespace HyperfTest\ResourceGrpc\Stubs\Grpc; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use Google\Protobuf\Internal\RepeatedField; +use HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc; /** * Generated from protobuf message HyperfTest.ResourceGrpc.Stubs.Grpc.AllReply. */ -class AllReply extends \Google\Protobuf\Internal\Message +class AllReply extends Message { /** * Generated from protobuf field string message = 1;. @@ -36,13 +40,13 @@ class AllReply extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var string $message - * @var \Google\Protobuf\Internal\RepeatedField|\HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[] $users - * } + * @var string $message + * @var \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[]|RepeatedField $users + * } */ public function __construct($data = null) { - \HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc::initOnce(); + Grpc::initOnce(); parent::__construct($data); } @@ -70,7 +74,7 @@ class AllReply extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field repeated .HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser users = 2;. - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getUsers() { @@ -79,12 +83,12 @@ class AllReply extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field repeated .HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser users = 2;. - * @param \Google\Protobuf\Internal\RepeatedField|\HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[] $var + * @param \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[]|RepeatedField $var * @return $this */ public function setUsers($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, HiUser::class); $this->users = $arr; return $this; diff --git a/src/resource-grpc/tests/Stubs/Grpc/GPBMetadata/Grpc/Grpc.php b/src/resource-grpc/tests/Stubs/Grpc/GPBMetadata/Grpc/Grpc.php index 8c7b03625..502cc573d 100644 --- a/src/resource-grpc/tests/Stubs/Grpc/GPBMetadata/Grpc/Grpc.php +++ b/src/resource-grpc/tests/Stubs/Grpc/GPBMetadata/Grpc/Grpc.php @@ -13,13 +13,15 @@ declare(strict_types=1); namespace HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc; +use Google\Protobuf\Internal\DescriptorPool; + class Grpc { public static $is_initialized = false; public static function initOnce() { - $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool(); + $pool = DescriptorPool::getGeneratedPool(); if (static::$is_initialized == true) { return; diff --git a/src/resource-grpc/tests/Stubs/Grpc/HiReply.php b/src/resource-grpc/tests/Stubs/Grpc/HiReply.php index 73563d1b2..40a5f6c5d 100644 --- a/src/resource-grpc/tests/Stubs/Grpc/HiReply.php +++ b/src/resource-grpc/tests/Stubs/Grpc/HiReply.php @@ -14,11 +14,13 @@ declare(strict_types=1); namespace HyperfTest\ResourceGrpc\Stubs\Grpc; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc; /** * Generated from protobuf message HyperfTest.ResourceGrpc.Stubs.Grpc.HiReply. */ -class HiReply extends \Google\Protobuf\Internal\Message +class HiReply extends Message { /** * Generated from protobuf field string message = 1;. @@ -36,13 +38,13 @@ class HiReply extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var string $message - * @var \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser $user - * } + * @var string $message + * @var HiUser $user + * } */ public function __construct($data = null) { - \HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc::initOnce(); + Grpc::initOnce(); parent::__construct($data); } @@ -70,7 +72,7 @@ class HiReply extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser user = 2;. - * @return \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser + * @return HiUser */ public function getUser() { @@ -79,12 +81,12 @@ class HiReply extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser user = 2;. - * @param \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser $var + * @param HiUser $var * @return $this */ public function setUser($var) { - GPBUtil::checkMessage($var, \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser::class); + GPBUtil::checkMessage($var, HiUser::class); $this->user = $var; return $this; diff --git a/src/resource-grpc/tests/Stubs/Grpc/HiUser.php b/src/resource-grpc/tests/Stubs/Grpc/HiUser.php index ef3b5e827..8a6030be5 100644 --- a/src/resource-grpc/tests/Stubs/Grpc/HiUser.php +++ b/src/resource-grpc/tests/Stubs/Grpc/HiUser.php @@ -14,11 +14,13 @@ declare(strict_types=1); namespace HyperfTest\ResourceGrpc\Stubs\Grpc; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\Internal\Message; +use HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc; /** * Generated from protobuf message HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser. */ -class HiUser extends \Google\Protobuf\Internal\Message +class HiUser extends Message { /** * Generated from protobuf field string name = 1;. @@ -36,13 +38,13 @@ class HiUser extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var string $name - * @var int $sex - * } + * @var string $name + * @var int $sex + * } */ public function __construct($data = null) { - \HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc::initOnce(); + Grpc::initOnce(); parent::__construct($data); } diff --git a/src/resource-grpc/tests/Stubs/Models/Reply.php b/src/resource-grpc/tests/Stubs/Models/Reply.php index 8f864ee37..27194b9e8 100644 --- a/src/resource-grpc/tests/Stubs/Models/Reply.php +++ b/src/resource-grpc/tests/Stubs/Models/Reply.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ResourceGrpc\Stubs\Models; use Hyperf\Database\Model\Model; diff --git a/src/resource-grpc/tests/Stubs/Models/User.php b/src/resource-grpc/tests/Stubs/Models/User.php index a71d3b339..781e7c38f 100644 --- a/src/resource-grpc/tests/Stubs/Models/User.php +++ b/src/resource-grpc/tests/Stubs/Models/User.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ResourceGrpc\Stubs\Models; use Hyperf\Database\Model\Model; diff --git a/src/resource-grpc/tests/Stubs/Resources/AllReplyResource.php b/src/resource-grpc/tests/Stubs/Resources/AllReplyResource.php index d2ac974e4..3f611e2c0 100644 --- a/src/resource-grpc/tests/Stubs/Resources/AllReplyResource.php +++ b/src/resource-grpc/tests/Stubs/Resources/AllReplyResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ResourceGrpc\Stubs\Resources; use Hyperf\ResourceGrpc\GrpcResource; diff --git a/src/resource-grpc/tests/Stubs/Resources/HiReplyResource.php b/src/resource-grpc/tests/Stubs/Resources/HiReplyResource.php index d7b168da0..1ec531cb1 100644 --- a/src/resource-grpc/tests/Stubs/Resources/HiReplyResource.php +++ b/src/resource-grpc/tests/Stubs/Resources/HiReplyResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ResourceGrpc\Stubs\Resources; use Hyperf\ResourceGrpc\GrpcResource; diff --git a/src/resource-grpc/tests/Stubs/Resources/HiUserResource.php b/src/resource-grpc/tests/Stubs/Resources/HiUserResource.php index 74a83bfc5..e819367ec 100644 --- a/src/resource-grpc/tests/Stubs/Resources/HiUserResource.php +++ b/src/resource-grpc/tests/Stubs/Resources/HiUserResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ResourceGrpc\Stubs\Resources; use Hyperf\ResourceGrpc\GrpcResource; diff --git a/src/resource/src/Concerns/CollectsResources.php b/src/resource/src/Concerns/CollectsResources.php index 8171a663d..26e250c37 100644 --- a/src/resource/src/Concerns/CollectsResources.php +++ b/src/resource/src/Concerns/CollectsResources.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Concerns; use Hyperf\Collection\Collection; diff --git a/src/resource/src/Concerns/ConditionallyLoadsAttributes.php b/src/resource/src/Concerns/ConditionallyLoadsAttributes.php index 1058512c8..4e593201e 100644 --- a/src/resource/src/Concerns/ConditionallyLoadsAttributes.php +++ b/src/resource/src/Concerns/ConditionallyLoadsAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Concerns; use Countable; diff --git a/src/resource/src/Concerns/DelegatesToResource.php b/src/resource/src/Concerns/DelegatesToResource.php index da6e880b7..808f94e6f 100644 --- a/src/resource/src/Concerns/DelegatesToResource.php +++ b/src/resource/src/Concerns/DelegatesToResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Concerns; use Exception; diff --git a/src/resource/src/ConfigProvider.php b/src/resource/src/ConfigProvider.php index 788c288c2..a5a5deeca 100644 --- a/src/resource/src/ConfigProvider.php +++ b/src/resource/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource; class ConfigProvider diff --git a/src/resource/src/Exception/ResourceException.php b/src/resource/src/Exception/ResourceException.php index 97d9fc17a..7977b9cfb 100644 --- a/src/resource/src/Exception/ResourceException.php +++ b/src/resource/src/Exception/ResourceException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Exception; use RuntimeException; diff --git a/src/resource/src/Json/AnonymousResourceCollection.php b/src/resource/src/Json/AnonymousResourceCollection.php index 2a3c369f4..0fc7b9c11 100644 --- a/src/resource/src/Json/AnonymousResourceCollection.php +++ b/src/resource/src/Json/AnonymousResourceCollection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Json; class AnonymousResourceCollection extends ResourceCollection diff --git a/src/resource/src/Json/JsonResource.php b/src/resource/src/Json/JsonResource.php index 03274c6c1..9bed0dd3f 100644 --- a/src/resource/src/Json/JsonResource.php +++ b/src/resource/src/Json/JsonResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Json; use ArrayAccess; diff --git a/src/resource/src/Json/ResourceCollection.php b/src/resource/src/Json/ResourceCollection.php index 96a96ad40..cbc9026b2 100644 --- a/src/resource/src/Json/ResourceCollection.php +++ b/src/resource/src/Json/ResourceCollection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Json; use Countable; diff --git a/src/resource/src/JsonEncodingException.php b/src/resource/src/JsonEncodingException.php index 71166626f..08eb51fd3 100644 --- a/src/resource/src/JsonEncodingException.php +++ b/src/resource/src/JsonEncodingException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/src/Response/PaginatedResponse.php b/src/resource/src/Response/PaginatedResponse.php index a1fb8af13..f27b9e7a7 100644 --- a/src/resource/src/Response/PaginatedResponse.php +++ b/src/resource/src/Response/PaginatedResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Response; use Hyperf\Codec\Json; diff --git a/src/resource/src/Response/Response.php b/src/resource/src/Response/Response.php index 0b1e43b28..518558237 100644 --- a/src/resource/src/Response/Response.php +++ b/src/resource/src/Response/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Response; use Hyperf\Codec\Json; diff --git a/src/resource/src/Value/MergeValue.php b/src/resource/src/Value/MergeValue.php index 7636ebad5..8d5c9bfe6 100644 --- a/src/resource/src/Value/MergeValue.php +++ b/src/resource/src/Value/MergeValue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Value; use Hyperf\Collection\Collection; diff --git a/src/resource/src/Value/MissingValue.php b/src/resource/src/Value/MissingValue.php index cd6e5c421..c2abace50 100644 --- a/src/resource/src/Value/MissingValue.php +++ b/src/resource/src/Value/MissingValue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Value; class MissingValue implements PotentiallyMissing diff --git a/src/resource/src/Value/PotentiallyMissing.php b/src/resource/src/Value/PotentiallyMissing.php index 37cd09e90..6f6f65e88 100644 --- a/src/resource/src/Value/PotentiallyMissing.php +++ b/src/resource/src/Value/PotentiallyMissing.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Resource\Value; interface PotentiallyMissing diff --git a/src/resource/tests/HttpResponse.php b/src/resource/tests/HttpResponse.php index 836cafa60..6ed1b4dbb 100644 --- a/src/resource/tests/HttpResponse.php +++ b/src/resource/tests/HttpResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource; use Hyperf\Collection\Arr; diff --git a/src/resource/tests/ResourceTest.php b/src/resource/tests/ResourceTest.php index 9a47edd09..554e05fe1 100644 --- a/src/resource/tests/ResourceTest.php +++ b/src/resource/tests/ResourceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource; use Hyperf\Collection\Collection; diff --git a/src/resource/tests/Stubs/Models/Author.php b/src/resource/tests/Stubs/Models/Author.php index f20f676a5..83d7fdc2e 100644 --- a/src/resource/tests/Stubs/Models/Author.php +++ b/src/resource/tests/Stubs/Models/Author.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Models; use Hyperf\Database\Model\Model; diff --git a/src/resource/tests/Stubs/Models/Post.php b/src/resource/tests/Stubs/Models/Post.php index e82fc62a6..2ecf7922a 100644 --- a/src/resource/tests/Stubs/Models/Post.php +++ b/src/resource/tests/Stubs/Models/Post.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Models; use Hyperf\Database\Model\Model; diff --git a/src/resource/tests/Stubs/Models/Subscription.php b/src/resource/tests/Stubs/Models/Subscription.php index 80ffedb25..fee9618c7 100644 --- a/src/resource/tests/Stubs/Models/Subscription.php +++ b/src/resource/tests/Stubs/Models/Subscription.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Models; class Subscription diff --git a/src/resource/tests/Stubs/Resources/AuthorResource.php b/src/resource/tests/Stubs/Resources/AuthorResource.php index b05a31c5a..c0e46ff69 100644 --- a/src/resource/tests/Stubs/Resources/AuthorResource.php +++ b/src/resource/tests/Stubs/Resources/AuthorResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/tests/Stubs/Resources/AuthorResourceWithOptionalRelationship.php b/src/resource/tests/Stubs/Resources/AuthorResourceWithOptionalRelationship.php index f16cb3c61..b0be86a9e 100644 --- a/src/resource/tests/Stubs/Resources/AuthorResourceWithOptionalRelationship.php +++ b/src/resource/tests/Stubs/Resources/AuthorResourceWithOptionalRelationship.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use function Hyperf\Support\optional; diff --git a/src/resource/tests/Stubs/Resources/CommentCollection.php b/src/resource/tests/Stubs/Resources/CommentCollection.php index ec483ee06..e7af0965a 100644 --- a/src/resource/tests/Stubs/Resources/CommentCollection.php +++ b/src/resource/tests/Stubs/Resources/CommentCollection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\ResourceCollection; diff --git a/src/resource/tests/Stubs/Resources/EmptyPostCollectionResource.php b/src/resource/tests/Stubs/Resources/EmptyPostCollectionResource.php index 2ba2e39e4..3e1336cc8 100644 --- a/src/resource/tests/Stubs/Resources/EmptyPostCollectionResource.php +++ b/src/resource/tests/Stubs/Resources/EmptyPostCollectionResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\ResourceCollection; diff --git a/src/resource/tests/Stubs/Resources/EmptyPostResource.php b/src/resource/tests/Stubs/Resources/EmptyPostResource.php index 21036ee82..ce28e231c 100644 --- a/src/resource/tests/Stubs/Resources/EmptyPostResource.php +++ b/src/resource/tests/Stubs/Resources/EmptyPostResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; class EmptyPostResource extends PostResource diff --git a/src/resource/tests/Stubs/Resources/JsonSerializableResource.php b/src/resource/tests/Stubs/Resources/JsonSerializableResource.php index fd4662284..bf288827c 100644 --- a/src/resource/tests/Stubs/Resources/JsonSerializableResource.php +++ b/src/resource/tests/Stubs/Resources/JsonSerializableResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use JsonSerializable; diff --git a/src/resource/tests/Stubs/Resources/ObjectResource.php b/src/resource/tests/Stubs/Resources/ObjectResource.php index 0523ab691..90c627c25 100644 --- a/src/resource/tests/Stubs/Resources/ObjectResource.php +++ b/src/resource/tests/Stubs/Resources/ObjectResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/tests/Stubs/Resources/PostCollectionResource.php b/src/resource/tests/Stubs/Resources/PostCollectionResource.php index 3a5bd8578..9982947fb 100644 --- a/src/resource/tests/Stubs/Resources/PostCollectionResource.php +++ b/src/resource/tests/Stubs/Resources/PostCollectionResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\ResourceCollection; diff --git a/src/resource/tests/Stubs/Resources/PostResource.php b/src/resource/tests/Stubs/Resources/PostResource.php index 9469f50a2..052f8e895 100644 --- a/src/resource/tests/Stubs/Resources/PostResource.php +++ b/src/resource/tests/Stubs/Resources/PostResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/tests/Stubs/Resources/PostResourceWithExtraData.php b/src/resource/tests/Stubs/Resources/PostResourceWithExtraData.php index 53041cc94..b13d6b18c 100644 --- a/src/resource/tests/Stubs/Resources/PostResourceWithExtraData.php +++ b/src/resource/tests/Stubs/Resources/PostResourceWithExtraData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; class PostResourceWithExtraData extends PostResource diff --git a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalData.php b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalData.php index 402384898..9060a566e 100644 --- a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalData.php +++ b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalMerging.php b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalMerging.php index e01aa58c0..563771b84 100644 --- a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalMerging.php +++ b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalMerging.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalPivotRelationship.php b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalPivotRelationship.php index 223a81e65..1057c9335 100644 --- a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalPivotRelationship.php +++ b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalPivotRelationship.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use HyperfTest\Resource\Stubs\Models\Subscription; diff --git a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalRelationship.php b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalRelationship.php index ce67ff328..141ba3746 100644 --- a/src/resource/tests/Stubs/Resources/PostResourceWithOptionalRelationship.php +++ b/src/resource/tests/Stubs/Resources/PostResourceWithOptionalRelationship.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; class PostResourceWithOptionalRelationship extends PostResource diff --git a/src/resource/tests/Stubs/Resources/PostResourceWithoutWrap.php b/src/resource/tests/Stubs/Resources/PostResourceWithoutWrap.php index 9aea4f7f9..bb81cedf7 100644 --- a/src/resource/tests/Stubs/Resources/PostResourceWithoutWrap.php +++ b/src/resource/tests/Stubs/Resources/PostResourceWithoutWrap.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; class PostResourceWithoutWrap extends PostResource diff --git a/src/resource/tests/Stubs/Resources/ReallyEmptyPostResource.php b/src/resource/tests/Stubs/Resources/ReallyEmptyPostResource.php index 0809e8b74..c781b8287 100644 --- a/src/resource/tests/Stubs/Resources/ReallyEmptyPostResource.php +++ b/src/resource/tests/Stubs/Resources/ReallyEmptyPostResource.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; use Hyperf\Resource\Json\JsonResource; diff --git a/src/resource/tests/Stubs/Resources/ResourceWithPreservedKeys.php b/src/resource/tests/Stubs/Resources/ResourceWithPreservedKeys.php index e965bb215..385fdb0ed 100644 --- a/src/resource/tests/Stubs/Resources/ResourceWithPreservedKeys.php +++ b/src/resource/tests/Stubs/Resources/ResourceWithPreservedKeys.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource\Stubs\Resources; class ResourceWithPreservedKeys extends PostResource diff --git a/src/resource/tests/TestCase.php b/src/resource/tests/TestCase.php index 052040b0d..468768fb0 100644 --- a/src/resource/tests/TestCase.php +++ b/src/resource/tests/TestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Resource; use FastRoute\Dispatcher; diff --git a/src/retry/src/Annotation/AbstractRetry.php b/src/retry/src/Annotation/AbstractRetry.php index b36ab8546..cda4493c7 100644 --- a/src/retry/src/Annotation/AbstractRetry.php +++ b/src/retry/src/Annotation/AbstractRetry.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Hyperf\Di\Annotation\AbstractAnnotation; diff --git a/src/retry/src/Annotation/BackoffRetryFalsy.php b/src/retry/src/Annotation/BackoffRetryFalsy.php index a9089de4c..139d02c29 100644 --- a/src/retry/src/Annotation/BackoffRetryFalsy.php +++ b/src/retry/src/Annotation/BackoffRetryFalsy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/retry/src/Annotation/BackoffRetryThrowable.php b/src/retry/src/Annotation/BackoffRetryThrowable.php index 731ea104b..fd334d6e0 100644 --- a/src/retry/src/Annotation/BackoffRetryThrowable.php +++ b/src/retry/src/Annotation/BackoffRetryThrowable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/retry/src/Annotation/CircuitBreaker.php b/src/retry/src/Annotation/CircuitBreaker.php index 92f8463fa..6cf07b349 100644 --- a/src/retry/src/Annotation/CircuitBreaker.php +++ b/src/retry/src/Annotation/CircuitBreaker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/retry/src/Annotation/Retry.php b/src/retry/src/Annotation/Retry.php index bb98e869b..90efad4d2 100644 --- a/src/retry/src/Annotation/Retry.php +++ b/src/retry/src/Annotation/Retry.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/retry/src/Annotation/RetryFalsy.php b/src/retry/src/Annotation/RetryFalsy.php index c44e55e8a..f3f4590fe 100644 --- a/src/retry/src/Annotation/RetryFalsy.php +++ b/src/retry/src/Annotation/RetryFalsy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/retry/src/Annotation/RetryThrowable.php b/src/retry/src/Annotation/RetryThrowable.php index 134ab1acf..7f6a7734f 100644 --- a/src/retry/src/Annotation/RetryThrowable.php +++ b/src/retry/src/Annotation/RetryThrowable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Annotation; use Attribute; diff --git a/src/retry/src/Aspect/RetryAnnotationAspect.php b/src/retry/src/Aspect/RetryAnnotationAspect.php index af37df10c..20e1667b1 100644 --- a/src/retry/src/Aspect/RetryAnnotationAspect.php +++ b/src/retry/src/Aspect/RetryAnnotationAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/retry/src/BackoffStrategy.php b/src/retry/src/BackoffStrategy.php index f39384cbc..e45665c7d 100644 --- a/src/retry/src/BackoffStrategy.php +++ b/src/retry/src/BackoffStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; use Hyperf\Support\Backoff; diff --git a/src/retry/src/CircuitBreakerState.php b/src/retry/src/CircuitBreakerState.php index 64439aa00..e00ac97e9 100644 --- a/src/retry/src/CircuitBreakerState.php +++ b/src/retry/src/CircuitBreakerState.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; class CircuitBreakerState diff --git a/src/retry/src/ConfigProvider.php b/src/retry/src/ConfigProvider.php index af0ecf45a..92e6a11bf 100644 --- a/src/retry/src/ConfigProvider.php +++ b/src/retry/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; use Hyperf\Retry\Aspect\RetryAnnotationAspect; diff --git a/src/retry/src/FlatStrategy.php b/src/retry/src/FlatStrategy.php index a9173ea14..897842075 100644 --- a/src/retry/src/FlatStrategy.php +++ b/src/retry/src/FlatStrategy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; class FlatStrategy implements SleepStrategyInterface diff --git a/src/retry/src/FluentRetry.php b/src/retry/src/FluentRetry.php index 76c56e298..44b99ba3d 100644 --- a/src/retry/src/FluentRetry.php +++ b/src/retry/src/FluentRetry.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; use BadMethodCallException; diff --git a/src/retry/src/NoOpRetryBudget.php b/src/retry/src/NoOpRetryBudget.php index 7518ae6b3..cc3aa2397 100644 --- a/src/retry/src/NoOpRetryBudget.php +++ b/src/retry/src/NoOpRetryBudget.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; class NoOpRetryBudget implements RetryBudgetInterface diff --git a/src/retry/src/Policy/BaseRetryPolicy.php b/src/retry/src/Policy/BaseRetryPolicy.php index 3e5872e0c..c2faabe38 100644 --- a/src/retry/src/Policy/BaseRetryPolicy.php +++ b/src/retry/src/Policy/BaseRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryContext; diff --git a/src/retry/src/Policy/BudgetRetryPolicy.php b/src/retry/src/Policy/BudgetRetryPolicy.php index 9aae6c147..fa7789297 100644 --- a/src/retry/src/Policy/BudgetRetryPolicy.php +++ b/src/retry/src/Policy/BudgetRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryBudgetInterface; diff --git a/src/retry/src/Policy/CircuitBreakerRetryPolicy.php b/src/retry/src/Policy/CircuitBreakerRetryPolicy.php index d65c2e003..c8f90455c 100644 --- a/src/retry/src/Policy/CircuitBreakerRetryPolicy.php +++ b/src/retry/src/Policy/CircuitBreakerRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\CircuitBreakerState; diff --git a/src/retry/src/Policy/ClassifierRetryPolicy.php b/src/retry/src/Policy/ClassifierRetryPolicy.php index e8ac71ed6..0527b485a 100644 --- a/src/retry/src/Policy/ClassifierRetryPolicy.php +++ b/src/retry/src/Policy/ClassifierRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Collection\Arr; diff --git a/src/retry/src/Policy/ExpressionRetryPolicy.php b/src/retry/src/Policy/ExpressionRetryPolicy.php index bceb4c450..e5f3ec213 100644 --- a/src/retry/src/Policy/ExpressionRetryPolicy.php +++ b/src/retry/src/Policy/ExpressionRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryContext; diff --git a/src/retry/src/Policy/FallbackRetryPolicy.php b/src/retry/src/Policy/FallbackRetryPolicy.php index 74581ad1f..5197d150c 100644 --- a/src/retry/src/Policy/FallbackRetryPolicy.php +++ b/src/retry/src/Policy/FallbackRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Context\ApplicationContext; diff --git a/src/retry/src/Policy/HybridRetryPolicy.php b/src/retry/src/Policy/HybridRetryPolicy.php index ab85a4a27..789461fc3 100644 --- a/src/retry/src/Policy/HybridRetryPolicy.php +++ b/src/retry/src/Policy/HybridRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Collection\Collection; diff --git a/src/retry/src/Policy/MaxAttemptsRetryPolicy.php b/src/retry/src/Policy/MaxAttemptsRetryPolicy.php index 8b4505717..cb2a45f3f 100644 --- a/src/retry/src/Policy/MaxAttemptsRetryPolicy.php +++ b/src/retry/src/Policy/MaxAttemptsRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryContext; diff --git a/src/retry/src/Policy/RetryPolicyInterface.php b/src/retry/src/Policy/RetryPolicyInterface.php index 4cdbb96cc..80f311795 100644 --- a/src/retry/src/Policy/RetryPolicyInterface.php +++ b/src/retry/src/Policy/RetryPolicyInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryContext; diff --git a/src/retry/src/Policy/SleepRetryPolicy.php b/src/retry/src/Policy/SleepRetryPolicy.php index d7840d073..fec54fe83 100644 --- a/src/retry/src/Policy/SleepRetryPolicy.php +++ b/src/retry/src/Policy/SleepRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryContext; diff --git a/src/retry/src/Policy/TimeoutRetryPolicy.php b/src/retry/src/Policy/TimeoutRetryPolicy.php index 4405968bc..126dcc4b5 100644 --- a/src/retry/src/Policy/TimeoutRetryPolicy.php +++ b/src/retry/src/Policy/TimeoutRetryPolicy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry\Policy; use Hyperf\Retry\RetryContext; diff --git a/src/retry/src/Retry.php b/src/retry/src/Retry.php index 7fed46b20..35a72d8ab 100644 --- a/src/retry/src/Retry.php +++ b/src/retry/src/Retry.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; use Hyperf\Retry\Policy\RetryPolicyInterface; diff --git a/src/retry/src/RetryBudget.php b/src/retry/src/RetryBudget.php index 852485118..ccd1e173f 100644 --- a/src/retry/src/RetryBudget.php +++ b/src/retry/src/RetryBudget.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; use Hyperf\Coordinator\Timer; diff --git a/src/retry/src/RetryBudgetInterface.php b/src/retry/src/RetryBudgetInterface.php index 2c7b9c649..dd6dd1981 100644 --- a/src/retry/src/RetryBudgetInterface.php +++ b/src/retry/src/RetryBudgetInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; interface RetryBudgetInterface diff --git a/src/retry/src/RetryContext.php b/src/retry/src/RetryContext.php index 77c978d74..afb5ce5d0 100644 --- a/src/retry/src/RetryContext.php +++ b/src/retry/src/RetryContext.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; use Hyperf\Di\Aop\ProceedingJoinPoint; diff --git a/src/retry/src/SleepStrategyInterface.php b/src/retry/src/SleepStrategyInterface.php index 37416d129..c739600f2 100644 --- a/src/retry/src/SleepStrategyInterface.php +++ b/src/retry/src/SleepStrategyInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Retry; interface SleepStrategyInterface diff --git a/src/retry/tests/CircuitBreakerAnotationAspectTest.php b/src/retry/tests/CircuitBreakerAnotationAspectTest.php index 107081c91..2f5ea209a 100644 --- a/src/retry/tests/CircuitBreakerAnotationAspectTest.php +++ b/src/retry/tests/CircuitBreakerAnotationAspectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry; use Hyperf\Context\ApplicationContext; diff --git a/src/retry/tests/CircuitBreakerStateTest.php b/src/retry/tests/CircuitBreakerStateTest.php index e2f6d4e40..e43d1053c 100644 --- a/src/retry/tests/CircuitBreakerStateTest.php +++ b/src/retry/tests/CircuitBreakerStateTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry; use Hyperf\Retry\CircuitBreakerState; diff --git a/src/retry/tests/RetryAnnotationAspectTest.php b/src/retry/tests/RetryAnnotationAspectTest.php index ad0ecbb61..4fc78ebfe 100644 --- a/src/retry/tests/RetryAnnotationAspectTest.php +++ b/src/retry/tests/RetryAnnotationAspectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry; use Exception; @@ -26,6 +27,7 @@ use Hyperf\Retry\Annotation\CircuitBreaker; use Hyperf\Retry\Annotation\Retry; use Hyperf\Retry\Aspect\RetryAnnotationAspect; use Hyperf\Retry\BackoffStrategy; +use Hyperf\Retry\CircuitBreakerState; use Hyperf\Retry\FlatStrategy; use Hyperf\Retry\NoOpRetryBudget; use Hyperf\Retry\Policy\TimeoutRetryPolicy; @@ -51,7 +53,7 @@ class RetryAnnotationAspectTest extends TestCase $container = new Container(new DefinitionSource([ RetryBudgetInterface::class => NoOpRetryBudget::class, RetryBudget::class => NoOpRetryBudget::class, - SleepStrategyInterface::class => flatStrategy::class, + SleepStrategyInterface::class => FlatStrategy::class, ])); ApplicationContext::setContainer($container); } @@ -282,7 +284,7 @@ class RetryAnnotationAspectTest extends TestCase public function __construct() { $state = Mockery::mock( - \Hyperf\Retry\CircuitBreakerState::class + CircuitBreakerState::class ); $state->shouldReceive('open')->andReturnNull(); $state->shouldReceive('isOpen')->twice()->andReturns(false); @@ -312,7 +314,7 @@ class RetryAnnotationAspectTest extends TestCase public function __construct() { - $state = new \Hyperf\Retry\CircuitBreakerState(10); + $state = new CircuitBreakerState(10); $retry = new CircuitBreaker(circuitBreakerState: $state); $retry->sleepStrategyClass = FlatStrategy::class; $retry->fallback = Foo::class . '@fallbackWithThrowable'; diff --git a/src/retry/tests/RetryBudgetTest.php b/src/retry/tests/RetryBudgetTest.php index 14c1e6e4a..a973c749b 100644 --- a/src/retry/tests/RetryBudgetTest.php +++ b/src/retry/tests/RetryBudgetTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry; use Hyperf\Retry\RetryBudget; diff --git a/src/retry/tests/RetryFalsyTest.php b/src/retry/tests/RetryFalsyTest.php index 6954a6220..79e7f66cd 100644 --- a/src/retry/tests/RetryFalsyTest.php +++ b/src/retry/tests/RetryFalsyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry; use Hyperf\Retry\Annotation\RetryFalsy; diff --git a/src/retry/tests/RetryTest.php b/src/retry/tests/RetryTest.php index 0cb7bf98f..df5659330 100644 --- a/src/retry/tests/RetryTest.php +++ b/src/retry/tests/RetryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry; use Hyperf\Context\ApplicationContext; diff --git a/src/retry/tests/Stub/Foo.php b/src/retry/tests/Stub/Foo.php index 69bb89050..79646c2b7 100644 --- a/src/retry/tests/Stub/Foo.php +++ b/src/retry/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Retry\Stub; use Throwable; diff --git a/src/rpc-client/composer.json b/src/rpc-client/composer.json index 067aa40ff..da3b1c05e 100644 --- a/src/rpc-client/composer.json +++ b/src/rpc-client/composer.json @@ -19,12 +19,13 @@ }, "require": { "php": ">=8.1", - "psr/container": "^1.0|^2.0", "hyperf/code-parser": "~3.1.0", "hyperf/load-balancer": "~3.1.0", "hyperf/rpc": "~3.1.0", "hyperf/support": "~3.1.0", - "hyperf/utils": "~3.1.0" + "hyperf/utils": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0", + "psr/container": "^1.0|^2.0" }, "suggest": { "hyperf/service-governance": "Required to fetch the nodes info from service governance.", diff --git a/src/rpc-client/src/AbstractServiceClient.php b/src/rpc-client/src/AbstractServiceClient.php index 947e2fa22..5ae36d13a 100644 --- a/src/rpc-client/src/AbstractServiceClient.php +++ b/src/rpc-client/src/AbstractServiceClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient; use Hyperf\Contract\ConfigInterface; diff --git a/src/rpc-client/src/Client.php b/src/rpc-client/src/Client.php index 24e6af8ad..a9269b14a 100644 --- a/src/rpc-client/src/Client.php +++ b/src/rpc-client/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient; use Hyperf\Contract\NormalizerInterface; diff --git a/src/rpc-client/src/ConfigProvider.php b/src/rpc-client/src/ConfigProvider.php index 3c9b2d647..246a4dd0b 100644 --- a/src/rpc-client/src/ConfigProvider.php +++ b/src/rpc-client/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient; use Hyperf\RpcClient\Listener\AddConsumerDefinitionListener; diff --git a/src/rpc-client/src/Exception/RequestException.php b/src/rpc-client/src/Exception/RequestException.php index 8e2e90d27..14cc48875 100644 --- a/src/rpc-client/src/Exception/RequestException.php +++ b/src/rpc-client/src/Exception/RequestException.php @@ -9,30 +9,30 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient\Exception; +use JetBrains\PhpStorm\ArrayShape; use RuntimeException; class RequestException extends RuntimeException { - /** - * @param $throwable - * [ - * 'class' => 'RuntimeException', // The exception class name - * 'code' => 0, // The exception code - * 'message' => '', // The exception message - * 'attributes' => [ - * 'message' => '', // The exception message - * 'code' => 0, // The exception code - * 'file' => '/opt/www/hyperf/app/JsonRpc/CalculatorService.php', // The file path which the exception occurred - * 'line' => 99, // The line of file which the exception occurred - * ], - * ] - * @param string $message - * @param int $code - */ - public function __construct($message = '', $code = 0, protected array $throwable = []) - { + public function __construct( + string $message = '', + int $code = 0, + #[ArrayShape([ + 'class' => 'string', // The exception class name + 'code' => 'int', // The exception code + 'message' => 'string', // The exception message + 'attributes' => [ + 'message' => 'string', // The exception message + 'code' => 'int', // The exception code + 'file' => 'string', // The file path which the exception occurred + 'line' => 'int', // The line of file which the exception occurred + ], + ])] + protected array $throwable = [] + ) { parent::__construct($message, $code); } diff --git a/src/rpc-client/src/Listener/AddConsumerDefinitionListener.php b/src/rpc-client/src/Listener/AddConsumerDefinitionListener.php index b53c112ca..f075df9bb 100644 --- a/src/rpc-client/src/Listener/AddConsumerDefinitionListener.php +++ b/src/rpc-client/src/Listener/AddConsumerDefinitionListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/rpc-client/src/Proxy/AbstractProxyService.php b/src/rpc-client/src/Proxy/AbstractProxyService.php index ed3293878..f12b21e05 100644 --- a/src/rpc-client/src/Proxy/AbstractProxyService.php +++ b/src/rpc-client/src/Proxy/AbstractProxyService.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient\Proxy; use Hyperf\RpcClient\ServiceClient; diff --git a/src/rpc-client/src/Proxy/Ast.php b/src/rpc-client/src/Proxy/Ast.php index 381671e1c..aad847c13 100644 --- a/src/rpc-client/src/Proxy/Ast.php +++ b/src/rpc-client/src/Proxy/Ast.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient\Proxy; use InvalidArgumentException; diff --git a/src/rpc-client/src/Proxy/CodeLoader.php b/src/rpc-client/src/Proxy/CodeLoader.php index b3a0a8bfa..c251f1815 100644 --- a/src/rpc-client/src/Proxy/CodeLoader.php +++ b/src/rpc-client/src/Proxy/CodeLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient\Proxy; use Hyperf\Support\Composer; diff --git a/src/rpc-client/src/Proxy/ProxyCallVisitor.php b/src/rpc-client/src/Proxy/ProxyCallVisitor.php index 8e1303c8c..21bf6380a 100644 --- a/src/rpc-client/src/Proxy/ProxyCallVisitor.php +++ b/src/rpc-client/src/Proxy/ProxyCallVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient\Proxy; use Hyperf\CodeParser\PhpParser; diff --git a/src/rpc-client/src/ProxyFactory.php b/src/rpc-client/src/ProxyFactory.php index e4ecf6790..1363f25d3 100644 --- a/src/rpc-client/src/ProxyFactory.php +++ b/src/rpc-client/src/ProxyFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient; use Hyperf\Coroutine\Locker; diff --git a/src/rpc-client/src/ServiceClient.php b/src/rpc-client/src/ServiceClient.php index a15b43bf3..f70194b93 100644 --- a/src/rpc-client/src/ServiceClient.php +++ b/src/rpc-client/src/ServiceClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcClient; use Hyperf\Collection\Arr; diff --git a/src/rpc-client/tests/AbstractServiceClientTest.php b/src/rpc-client/tests/AbstractServiceClientTest.php index 7d80c0cf3..90a8c2dd6 100644 --- a/src/rpc-client/tests/AbstractServiceClientTest.php +++ b/src/rpc-client/tests/AbstractServiceClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcClient; use Hyperf\Config\Config; diff --git a/src/rpc-client/tests/AstTest.php b/src/rpc-client/tests/AstTest.php index 4dcb4b58c..fd285633b 100644 --- a/src/rpc-client/tests/AstTest.php +++ b/src/rpc-client/tests/AstTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcClient; use Hyperf\RpcClient\Proxy\Ast; diff --git a/src/rpc-client/tests/ClientTest.php b/src/rpc-client/tests/ClientTest.php index 9d161a643..bfb1c09c4 100644 --- a/src/rpc-client/tests/ClientTest.php +++ b/src/rpc-client/tests/ClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcClient; use Hyperf\Codec\Json; diff --git a/src/rpc-client/tests/Stub/FooInterface.php b/src/rpc-client/tests/Stub/FooInterface.php index 36e60d91c..640cf8bfa 100644 --- a/src/rpc-client/tests/Stub/FooInterface.php +++ b/src/rpc-client/tests/Stub/FooInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcClient\Stub; interface FooInterface extends ParInterface diff --git a/src/rpc-client/tests/Stub/FooServiceClient.php b/src/rpc-client/tests/Stub/FooServiceClient.php index 62029860d..6e7335a5d 100644 --- a/src/rpc-client/tests/Stub/FooServiceClient.php +++ b/src/rpc-client/tests/Stub/FooServiceClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcClient\Stub; use Hyperf\Contract\ConfigInterface; diff --git a/src/rpc-client/tests/Stub/ParInterface.php b/src/rpc-client/tests/Stub/ParInterface.php index d7e481b91..40e354bfa 100644 --- a/src/rpc-client/tests/Stub/ParInterface.php +++ b/src/rpc-client/tests/Stub/ParInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcClient\Stub; interface ParInterface diff --git a/src/rpc-multiplex/composer.json b/src/rpc-multiplex/composer.json index 57f62ee64..385cf0990 100644 --- a/src/rpc-multiplex/composer.json +++ b/src/rpc-multiplex/composer.json @@ -19,6 +19,7 @@ "hyperf/server": "~3.1.0", "hyperf/support": "~3.1.0", "hyperf/utils": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0", "multiplex/socket": "^1.0", "swow/psr7-plus": "^1.0" }, diff --git a/src/rpc-multiplex/src/Client.php b/src/rpc-multiplex/src/Client.php index 8bae9c94f..946597d57 100644 --- a/src/rpc-multiplex/src/Client.php +++ b/src/rpc-multiplex/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\Contract\IdGeneratorInterface; @@ -19,6 +20,7 @@ use Hyperf\RpcClient\AbstractServiceClient; use Hyperf\RpcClient\Exception\RequestException; use Hyperf\RpcMultiplex\Contract\DataFetcherInterface; use Hyperf\RpcMultiplex\Exception\InvalidArgumentException; +use JetBrains\PhpStorm\ArrayShape; use Psr\Container\ContainerInterface; class Client extends AbstractServiceClient @@ -34,14 +36,16 @@ class Client extends AbstractServiceClient private NormalizerInterface $normalizer; - /** - * @param $options = [ - * 'service_interface' => '', - * 'load_balancer' => 'random', - * ] - */ - public function __construct(ContainerInterface $container, string $serviceName, string $protocol = 'jsonrpc-http', array $options = []) - { + public function __construct( + ContainerInterface $container, + string $serviceName, + string $protocol = 'jsonrpc-http', + #[ArrayShape([ + 'service_interface' => 'string', + 'load_balancer' => 'string', + ])] + array $options = [] + ) { $this->serviceName = $serviceName; $this->protocol = $protocol; $this->setOptions($options); diff --git a/src/rpc-multiplex/src/ConfigProvider.php b/src/rpc-multiplex/src/ConfigProvider.php index a77699fd6..ce0e8ba33 100644 --- a/src/rpc-multiplex/src/ConfigProvider.php +++ b/src/rpc-multiplex/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\RpcMultiplex\Contract\HostReaderInterface; diff --git a/src/rpc-multiplex/src/Constant.php b/src/rpc-multiplex/src/Constant.php index 0ed31d035..6c7b7c7b6 100644 --- a/src/rpc-multiplex/src/Constant.php +++ b/src/rpc-multiplex/src/Constant.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; class Constant diff --git a/src/rpc-multiplex/src/Contract/DataFetcherInterface.php b/src/rpc-multiplex/src/Contract/DataFetcherInterface.php index fcb2d3ab5..2622d2e53 100644 --- a/src/rpc-multiplex/src/Contract/DataFetcherInterface.php +++ b/src/rpc-multiplex/src/Contract/DataFetcherInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Contract; use Hyperf\RpcClient\Exception\RequestException; diff --git a/src/rpc-multiplex/src/Contract/DnsResolverInterface.php b/src/rpc-multiplex/src/Contract/DnsResolverInterface.php index 1a9593d05..a87a6791f 100644 --- a/src/rpc-multiplex/src/Contract/DnsResolverInterface.php +++ b/src/rpc-multiplex/src/Contract/DnsResolverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Contract; interface DnsResolverInterface diff --git a/src/rpc-multiplex/src/Contract/HostReaderInterface.php b/src/rpc-multiplex/src/Contract/HostReaderInterface.php index 289a825d8..41d432acf 100644 --- a/src/rpc-multiplex/src/Contract/HostReaderInterface.php +++ b/src/rpc-multiplex/src/Contract/HostReaderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Contract; use Hyperf\Contract\IPReaderInterface; diff --git a/src/rpc-multiplex/src/Contract/HttpMessageBuilderInterface.php b/src/rpc-multiplex/src/Contract/HttpMessageBuilderInterface.php index c282cc422..6c07fae7e 100644 --- a/src/rpc-multiplex/src/Contract/HttpMessageBuilderInterface.php +++ b/src/rpc-multiplex/src/Contract/HttpMessageBuilderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Contract; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/rpc-multiplex/src/CoreMiddleware.php b/src/rpc-multiplex/src/CoreMiddleware.php index 3cb4a8831..74094b321 100644 --- a/src/rpc-multiplex/src/CoreMiddleware.php +++ b/src/rpc-multiplex/src/CoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Closure; diff --git a/src/rpc-multiplex/src/DataFormatter.php b/src/rpc-multiplex/src/DataFormatter.php index 24ff13e21..da2e45ae7 100644 --- a/src/rpc-multiplex/src/DataFormatter.php +++ b/src/rpc-multiplex/src/DataFormatter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\Codec\Json; diff --git a/src/rpc-multiplex/src/Exception/Handler/DefaultExceptionHandler.php b/src/rpc-multiplex/src/Exception/Handler/DefaultExceptionHandler.php index effbfa9f1..2cd3b6b25 100644 --- a/src/rpc-multiplex/src/Exception/Handler/DefaultExceptionHandler.php +++ b/src/rpc-multiplex/src/Exception/Handler/DefaultExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Exception\Handler; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/rpc-multiplex/src/Exception/InvalidArgumentException.php b/src/rpc-multiplex/src/Exception/InvalidArgumentException.php index d43f50771..7c358b08c 100644 --- a/src/rpc-multiplex/src/Exception/InvalidArgumentException.php +++ b/src/rpc-multiplex/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/rpc-multiplex/src/Exception/NoAvailableNodesException.php b/src/rpc-multiplex/src/Exception/NoAvailableNodesException.php index d542bcc0a..a25ae13bc 100644 --- a/src/rpc-multiplex/src/Exception/NoAvailableNodesException.php +++ b/src/rpc-multiplex/src/Exception/NoAvailableNodesException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Exception; use RuntimeException; diff --git a/src/rpc-multiplex/src/Exception/NotSupportException.php b/src/rpc-multiplex/src/Exception/NotSupportException.php index 5fb21433b..37779855d 100644 --- a/src/rpc-multiplex/src/Exception/NotSupportException.php +++ b/src/rpc-multiplex/src/Exception/NotSupportException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Exception; use RuntimeException; diff --git a/src/rpc-multiplex/src/HttpMessage/HostReader/NullHostReader.php b/src/rpc-multiplex/src/HttpMessage/HostReader/NullHostReader.php index f996b7d89..cbd2909ef 100644 --- a/src/rpc-multiplex/src/HttpMessage/HostReader/NullHostReader.php +++ b/src/rpc-multiplex/src/HttpMessage/HostReader/NullHostReader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\HttpMessage\HostReader; use Hyperf\RpcMultiplex\Contract\HostReaderInterface; diff --git a/src/rpc-multiplex/src/HttpMessageBuilder.php b/src/rpc-multiplex/src/HttpMessageBuilder.php index 37cb5c229..8aaba17a2 100644 --- a/src/rpc-multiplex/src/HttpMessageBuilder.php +++ b/src/rpc-multiplex/src/HttpMessageBuilder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\Codec\Json; diff --git a/src/rpc-multiplex/src/Listener/RegisterProtocolListener.php b/src/rpc-multiplex/src/Listener/RegisterProtocolListener.php index 0a69c52e7..435560751 100644 --- a/src/rpc-multiplex/src/Listener/RegisterProtocolListener.php +++ b/src/rpc-multiplex/src/Listener/RegisterProtocolListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Listener; use Hyperf\Codec\Packer\PhpSerializerPacker; diff --git a/src/rpc-multiplex/src/Listener/RegisterServiceListener.php b/src/rpc-multiplex/src/Listener/RegisterServiceListener.php index 2c3aceace..9db7abaad 100644 --- a/src/rpc-multiplex/src/Listener/RegisterServiceListener.php +++ b/src/rpc-multiplex/src/Listener/RegisterServiceListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/rpc-multiplex/src/Packer/JsonPacker.php b/src/rpc-multiplex/src/Packer/JsonPacker.php index a743dfd83..306f8b312 100644 --- a/src/rpc-multiplex/src/Packer/JsonPacker.php +++ b/src/rpc-multiplex/src/Packer/JsonPacker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex\Packer; use Hyperf\Codec\Json; diff --git a/src/rpc-multiplex/src/PathGenerator.php b/src/rpc-multiplex/src/PathGenerator.php index a165b7c58..b92bda563 100644 --- a/src/rpc-multiplex/src/PathGenerator.php +++ b/src/rpc-multiplex/src/PathGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; class PathGenerator extends \Hyperf\Rpc\PathGenerator\PathGenerator diff --git a/src/rpc-multiplex/src/Socket.php b/src/rpc-multiplex/src/Socket.php index 7314d03c0..f12697ec4 100644 --- a/src/rpc-multiplex/src/Socket.php +++ b/src/rpc-multiplex/src/Socket.php @@ -9,14 +9,16 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Multiplex\Contract\IdGeneratorInterface; use Multiplex\Contract\PackerInterface; use Multiplex\Contract\SerializerInterface; +use Multiplex\Socket\Client; use Psr\Container\ContainerInterface; -class Socket extends \Multiplex\Socket\Client +class Socket extends Client { public function __construct(ContainerInterface $container) { diff --git a/src/rpc-multiplex/src/SocketFactory.php b/src/rpc-multiplex/src/SocketFactory.php index 9318961a2..98dd62ab0 100644 --- a/src/rpc-multiplex/src/SocketFactory.php +++ b/src/rpc-multiplex/src/SocketFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\Collection\Arr; diff --git a/src/rpc-multiplex/src/TcpServer.php b/src/rpc-multiplex/src/TcpServer.php index 92642f15f..421374db3 100644 --- a/src/rpc-multiplex/src/TcpServer.php +++ b/src/rpc-multiplex/src/TcpServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\Collection\Arr; diff --git a/src/rpc-multiplex/src/Transporter.php b/src/rpc-multiplex/src/Transporter.php index 7ecf6b776..c6fdb656a 100644 --- a/src/rpc-multiplex/src/Transporter.php +++ b/src/rpc-multiplex/src/Transporter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcMultiplex; use Hyperf\LoadBalancer\LoadBalancerInterface; diff --git a/src/rpc-multiplex/tests/Cases/AbstractTestCase.php b/src/rpc-multiplex/tests/Cases/AbstractTestCase.php index 9557951fc..96ef82154 100644 --- a/src/rpc-multiplex/tests/Cases/AbstractTestCase.php +++ b/src/rpc-multiplex/tests/Cases/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Cases; use Mockery; diff --git a/src/rpc-multiplex/tests/Cases/ChannelManagerTest.php b/src/rpc-multiplex/tests/Cases/ChannelManagerTest.php index 2c22c8491..5ef112109 100644 --- a/src/rpc-multiplex/tests/Cases/ChannelManagerTest.php +++ b/src/rpc-multiplex/tests/Cases/ChannelManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Cases; use Hyperf\Coroutine\Coroutine; diff --git a/src/rpc-multiplex/tests/Cases/HttpMessageBuilderTest.php b/src/rpc-multiplex/tests/Cases/HttpMessageBuilderTest.php index 1bed46e14..a6ffe5f3e 100644 --- a/src/rpc-multiplex/tests/Cases/HttpMessageBuilderTest.php +++ b/src/rpc-multiplex/tests/Cases/HttpMessageBuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Cases; use Hyperf\Rpc\Context; diff --git a/src/rpc-multiplex/tests/Cases/SocketFactoryTest.php b/src/rpc-multiplex/tests/Cases/SocketFactoryTest.php index 0e6531f7b..37b8b3f65 100644 --- a/src/rpc-multiplex/tests/Cases/SocketFactoryTest.php +++ b/src/rpc-multiplex/tests/Cases/SocketFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Cases; use Hyperf\Coordinator\Constants; diff --git a/src/rpc-multiplex/tests/Cases/TcpServerTest.php b/src/rpc-multiplex/tests/Cases/TcpServerTest.php index 2b0fef8a9..316994cfa 100644 --- a/src/rpc-multiplex/tests/Cases/TcpServerTest.php +++ b/src/rpc-multiplex/tests/Cases/TcpServerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Cases; use Hyperf\Config\Config; diff --git a/src/rpc-multiplex/tests/Cases/TransporterTest.php b/src/rpc-multiplex/tests/Cases/TransporterTest.php index c8f02c123..b8be57315 100644 --- a/src/rpc-multiplex/tests/Cases/TransporterTest.php +++ b/src/rpc-multiplex/tests/Cases/TransporterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Cases; use Hyperf\LoadBalancer\LoadBalancerInterface; diff --git a/src/rpc-multiplex/tests/Stub/ContainerStub.php b/src/rpc-multiplex/tests/Stub/ContainerStub.php index 50539edba..a7d053209 100644 --- a/src/rpc-multiplex/tests/Stub/ContainerStub.php +++ b/src/rpc-multiplex/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcMultiplex\Stub; use Hyperf\Config\Config; diff --git a/src/rpc-server/src/Annotation/RpcService.php b/src/rpc-server/src/Annotation/RpcService.php index 1a288aaaf..86e50c815 100644 --- a/src/rpc-server/src/Annotation/RpcService.php +++ b/src/rpc-server/src/Annotation/RpcService.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Annotation; use Attribute; diff --git a/src/rpc-server/src/ConfigProvider.php b/src/rpc-server/src/ConfigProvider.php index eefb90ea7..4911c2430 100644 --- a/src/rpc-server/src/ConfigProvider.php +++ b/src/rpc-server/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer; class ConfigProvider diff --git a/src/rpc-server/src/CoreMiddleware.php b/src/rpc-server/src/CoreMiddleware.php index 380c98978..c3c99cca3 100644 --- a/src/rpc-server/src/CoreMiddleware.php +++ b/src/rpc-server/src/CoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer; use Closure; diff --git a/src/rpc-server/src/Event/AfterPathRegister.php b/src/rpc-server/src/Event/AfterPathRegister.php index 58e391af5..75be1106c 100644 --- a/src/rpc-server/src/Event/AfterPathRegister.php +++ b/src/rpc-server/src/Event/AfterPathRegister.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Event; use Hyperf\Contract\Arrayable; diff --git a/src/rpc-server/src/Event/RequestEvent.php b/src/rpc-server/src/Event/RequestEvent.php index 42e27bf39..5f24fefdb 100644 --- a/src/rpc-server/src/Event/RequestEvent.php +++ b/src/rpc-server/src/Event/RequestEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Event; use Psr\Http\Message\ResponseInterface; diff --git a/src/rpc-server/src/Event/RequestHandled.php b/src/rpc-server/src/Event/RequestHandled.php index 5694dee92..c10e61d5a 100644 --- a/src/rpc-server/src/Event/RequestHandled.php +++ b/src/rpc-server/src/Event/RequestHandled.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Event; class RequestHandled extends RequestEvent diff --git a/src/rpc-server/src/Event/RequestReceived.php b/src/rpc-server/src/Event/RequestReceived.php index 6393c8d66..43952021d 100644 --- a/src/rpc-server/src/Event/RequestReceived.php +++ b/src/rpc-server/src/Event/RequestReceived.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Event; class RequestReceived extends RequestEvent diff --git a/src/rpc-server/src/Event/RequestTerminated.php b/src/rpc-server/src/Event/RequestTerminated.php index a7fc8a30a..5b9988893 100644 --- a/src/rpc-server/src/Event/RequestTerminated.php +++ b/src/rpc-server/src/Event/RequestTerminated.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Event; class RequestTerminated extends RequestEvent diff --git a/src/rpc-server/src/RequestDispatcher.php b/src/rpc-server/src/RequestDispatcher.php index 2bfc359c7..be6ae2bfb 100644 --- a/src/rpc-server/src/RequestDispatcher.php +++ b/src/rpc-server/src/RequestDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer; use Hyperf\Dispatcher\HttpDispatcher; diff --git a/src/rpc-server/src/Router/DispatcherFactory.php b/src/rpc-server/src/Router/DispatcherFactory.php index abd1b3dd6..3ef73476a 100644 --- a/src/rpc-server/src/Router/DispatcherFactory.php +++ b/src/rpc-server/src/Router/DispatcherFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Router; use FastRoute\DataGenerator\GroupCountBased as DataGenerator; diff --git a/src/rpc-server/src/Router/RouteCollector.php b/src/rpc-server/src/Router/RouteCollector.php index 8d009015a..33987ef8c 100644 --- a/src/rpc-server/src/Router/RouteCollector.php +++ b/src/rpc-server/src/Router/RouteCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Router; use FastRoute\DataGenerator; diff --git a/src/rpc-server/src/Router/Router.php b/src/rpc-server/src/Router/Router.php index b389fd1a5..f95d61e4a 100644 --- a/src/rpc-server/src/Router/Router.php +++ b/src/rpc-server/src/Router/Router.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer\Router; /** diff --git a/src/rpc-server/src/Server.php b/src/rpc-server/src/Server.php index cfcfbc1dc..fc9eea73b 100644 --- a/src/rpc-server/src/Server.php +++ b/src/rpc-server/src/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\RpcServer; use Hyperf\Context\RequestContext; @@ -149,7 +150,7 @@ abstract class Server implements OnReceiveInterface, MiddlewareInitializerInterf } /** - * @param \Swoole\Coroutine\Server\Connection|SwooleServer $server + * @param Connection|SwooleServer $server */ protected function send($server, int $fd, ResponseInterface $response): void { diff --git a/src/rpc-server/tests/RouterDispatcherFactoryTest.php b/src/rpc-server/tests/RouterDispatcherFactoryTest.php index 6c6c2e577..5a04a1ee5 100644 --- a/src/rpc-server/tests/RouterDispatcherFactoryTest.php +++ b/src/rpc-server/tests/RouterDispatcherFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcServer; use Hyperf\HttpServer\Annotation\Middleware; diff --git a/src/rpc-server/tests/Stub/ContainerStub.php b/src/rpc-server/tests/Stub/ContainerStub.php index 30e87f5aa..003c67f3d 100644 --- a/src/rpc-server/tests/Stub/ContainerStub.php +++ b/src/rpc-server/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcServer\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/rpc-server/tests/Stub/IdGeneratorStub.php b/src/rpc-server/tests/Stub/IdGeneratorStub.php index b993f088f..88c40a1a3 100644 --- a/src/rpc-server/tests/Stub/IdGeneratorStub.php +++ b/src/rpc-server/tests/Stub/IdGeneratorStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcServer\Stub; class IdGeneratorStub diff --git a/src/rpc-server/tests/Stub/MiddlewareStub.php b/src/rpc-server/tests/Stub/MiddlewareStub.php index 680962707..a4bacfeb5 100644 --- a/src/rpc-server/tests/Stub/MiddlewareStub.php +++ b/src/rpc-server/tests/Stub/MiddlewareStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\RpcServer\Stub; class MiddlewareStub diff --git a/src/rpc/composer.json b/src/rpc/composer.json index deaa859f4..db9ef864a 100644 --- a/src/rpc/composer.json +++ b/src/rpc/composer.json @@ -19,7 +19,8 @@ "php": ">=8.1", "hyperf/codec": "~3.1.0", "hyperf/contract": "~3.1.0", - "hyperf/support": "~3.1.0" + "hyperf/support": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0" }, "autoload": { "psr-4": { diff --git a/src/rpc/src/Context.php b/src/rpc/src/Context.php index 023fb87f1..19e263d74 100644 --- a/src/rpc/src/Context.php +++ b/src/rpc/src/Context.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc; use Hyperf\Collection\Arr; diff --git a/src/rpc/src/Contract/DataFormatterInterface.php b/src/rpc/src/Contract/DataFormatterInterface.php index 54d300aba..10d0849ac 100644 --- a/src/rpc/src/Contract/DataFormatterInterface.php +++ b/src/rpc/src/Contract/DataFormatterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; use Hyperf\Rpc\ErrorResponse; diff --git a/src/rpc/src/Contract/EofInterface.php b/src/rpc/src/Contract/EofInterface.php index f96f63919..5e7f2e7b1 100644 --- a/src/rpc/src/Contract/EofInterface.php +++ b/src/rpc/src/Contract/EofInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; interface EofInterface diff --git a/src/rpc/src/Contract/PackerInterface.php b/src/rpc/src/Contract/PackerInterface.php index 13a8e3a7e..9b55d546c 100644 --- a/src/rpc/src/Contract/PackerInterface.php +++ b/src/rpc/src/Contract/PackerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; /** diff --git a/src/rpc/src/Contract/PathGeneratorInterface.php b/src/rpc/src/Contract/PathGeneratorInterface.php index a72b280c0..3a842fb5d 100644 --- a/src/rpc/src/Contract/PathGeneratorInterface.php +++ b/src/rpc/src/Contract/PathGeneratorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; interface PathGeneratorInterface diff --git a/src/rpc/src/Contract/RequestInterface.php b/src/rpc/src/Contract/RequestInterface.php index 385465484..511e38017 100644 --- a/src/rpc/src/Contract/RequestInterface.php +++ b/src/rpc/src/Contract/RequestInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; interface RequestInterface diff --git a/src/rpc/src/Contract/ResponseInterface.php b/src/rpc/src/Contract/ResponseInterface.php index f392750d3..f60ca225c 100644 --- a/src/rpc/src/Contract/ResponseInterface.php +++ b/src/rpc/src/Contract/ResponseInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; interface ResponseInterface extends \Psr\Http\Message\ResponseInterface diff --git a/src/rpc/src/Contract/TransporterInterface.php b/src/rpc/src/Contract/TransporterInterface.php index 03cb55f4e..3108cb669 100644 --- a/src/rpc/src/Contract/TransporterInterface.php +++ b/src/rpc/src/Contract/TransporterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Contract; use Hyperf\LoadBalancer\LoadBalancerInterface; diff --git a/src/rpc/src/ErrorResponse.php b/src/rpc/src/ErrorResponse.php index 133fca010..d0385aa30 100644 --- a/src/rpc/src/ErrorResponse.php +++ b/src/rpc/src/ErrorResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc; class ErrorResponse diff --git a/src/rpc/src/Exception/RecvException.php b/src/rpc/src/Exception/RecvException.php index 9e6b22e49..eb2cf26d0 100644 --- a/src/rpc/src/Exception/RecvException.php +++ b/src/rpc/src/Exception/RecvException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\Exception; use RuntimeException; diff --git a/src/rpc/src/IdGenerator/IdGeneratorInterface.php b/src/rpc/src/IdGenerator/IdGeneratorInterface.php index f00065fdb..f9d1d17cb 100644 --- a/src/rpc/src/IdGenerator/IdGeneratorInterface.php +++ b/src/rpc/src/IdGenerator/IdGeneratorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\IdGenerator; use Hyperf\Contract; diff --git a/src/rpc/src/IdGenerator/NodeRequestIdGenerator.php b/src/rpc/src/IdGenerator/NodeRequestIdGenerator.php index eb4e373c3..80f015c26 100644 --- a/src/rpc/src/IdGenerator/NodeRequestIdGenerator.php +++ b/src/rpc/src/IdGenerator/NodeRequestIdGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\IdGenerator; use DateTime; diff --git a/src/rpc/src/IdGenerator/RequestIdGenerator.php b/src/rpc/src/IdGenerator/RequestIdGenerator.php index 55f897ed7..d7509113d 100644 --- a/src/rpc/src/IdGenerator/RequestIdGenerator.php +++ b/src/rpc/src/IdGenerator/RequestIdGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\IdGenerator; use Hyperf\Contract\IdGeneratorInterface; diff --git a/src/rpc/src/IdGenerator/UniqidIdGenerator.php b/src/rpc/src/IdGenerator/UniqidIdGenerator.php index 65be6a6b2..9e0e3861c 100644 --- a/src/rpc/src/IdGenerator/UniqidIdGenerator.php +++ b/src/rpc/src/IdGenerator/UniqidIdGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\IdGenerator; class UniqidIdGenerator implements IdGeneratorInterface diff --git a/src/rpc/src/PathGenerator/DotPathGenerator.php b/src/rpc/src/PathGenerator/DotPathGenerator.php index 08ebd41f2..6068a9e1b 100644 --- a/src/rpc/src/PathGenerator/DotPathGenerator.php +++ b/src/rpc/src/PathGenerator/DotPathGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\PathGenerator; use Hyperf\Rpc\Contract\PathGeneratorInterface; diff --git a/src/rpc/src/PathGenerator/FullPathGenerator.php b/src/rpc/src/PathGenerator/FullPathGenerator.php index 4c4f2e53f..b54d01bd0 100644 --- a/src/rpc/src/PathGenerator/FullPathGenerator.php +++ b/src/rpc/src/PathGenerator/FullPathGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\PathGenerator; use Hyperf\Rpc\Contract\PathGeneratorInterface; diff --git a/src/rpc/src/PathGenerator/PathGenerator.php b/src/rpc/src/PathGenerator/PathGenerator.php index e24e6e200..29a9587fc 100644 --- a/src/rpc/src/PathGenerator/PathGenerator.php +++ b/src/rpc/src/PathGenerator/PathGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc\PathGenerator; use Hyperf\Rpc\Contract\PathGeneratorInterface; diff --git a/src/rpc/src/Protocol.php b/src/rpc/src/Protocol.php index 395c6d58a..f00138d6e 100644 --- a/src/rpc/src/Protocol.php +++ b/src/rpc/src/Protocol.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc; use Hyperf\Contract\NormalizerInterface; diff --git a/src/rpc/src/ProtocolManager.php b/src/rpc/src/ProtocolManager.php index f00070767..f5fc2be88 100644 --- a/src/rpc/src/ProtocolManager.php +++ b/src/rpc/src/ProtocolManager.php @@ -9,17 +9,15 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc; use Hyperf\Contract\ConfigInterface; use Hyperf\Contract\NormalizerInterface; -use Hyperf\RpcMultiplex\DataFormatter; -use Hyperf\RpcMultiplex\Packer\JsonPacker; -use Hyperf\RpcMultiplex\PathGenerator; -use Hyperf\RpcMultiplex\Transporter; use Hyperf\Stringable\Str; use Hyperf\Stringable\StrCache; use InvalidArgumentException; +use JetBrains\PhpStorm\ArrayShape; class ProtocolManager { @@ -27,17 +25,17 @@ class ProtocolManager { } - /** - * @param $data = [ - * 'packer' => JsonPacker::class, - * 'transporter' => Transporter::class, - * 'path-generator' => PathGenerator::class, - * 'data-formatter' => DataFormatter::class, - * 'normalizer' => JsonRpcNormalizer::class, - * ] - */ - public function register(string $name, array $data): void - { + public function register( + string $name, + #[ArrayShape([ + 'packer' => 'string', // \Hyperf\RpcMultiplex\Packer\JsonPacker::class, + 'transporter' => 'string', // \Hyperf\RpcMultiplex\Transporter::class, + 'path-generator' => 'string', // \Hyperf\RpcMultiplex\PathGenerator::class, + 'data-formatter' => 'string', // \Hyperf\RpcMultiplex\DataFormatter::class, + 'normalizer' => 'string', // \Hyperf\JsonRpc\JsonRpcNormalizer::class, + ])] + array $data + ): void { $this->config->set('protocols.' . $name, $data); } diff --git a/src/rpc/src/Request.php b/src/rpc/src/Request.php index 0b8202a73..18154f624 100644 --- a/src/rpc/src/Request.php +++ b/src/rpc/src/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc; class Request diff --git a/src/rpc/src/Response.php b/src/rpc/src/Response.php index 32722faa3..5b269755c 100644 --- a/src/rpc/src/Response.php +++ b/src/rpc/src/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpc; class Response diff --git a/src/rpc/tests/ContextTest.php b/src/rpc/tests/ContextTest.php index ef70c9b8d..a930c4064 100644 --- a/src/rpc/tests/ContextTest.php +++ b/src/rpc/tests/ContextTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpc; use Hyperf\Rpc\Context; diff --git a/src/rpc/tests/IdGenerator/NodeRequestIdGeneratorTest.php b/src/rpc/tests/IdGenerator/NodeRequestIdGeneratorTest.php index 284c88329..2e8842222 100644 --- a/src/rpc/tests/IdGenerator/NodeRequestIdGeneratorTest.php +++ b/src/rpc/tests/IdGenerator/NodeRequestIdGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpc\IdGenerator; use DateTime; diff --git a/src/rpc/tests/IdGenerator/RequestIdGeneratorTest.php b/src/rpc/tests/IdGenerator/RequestIdGeneratorTest.php index 2bd476bec..1806bea9a 100644 --- a/src/rpc/tests/IdGenerator/RequestIdGeneratorTest.php +++ b/src/rpc/tests/IdGenerator/RequestIdGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpc\IdGenerator; use Hyperf\Rpc\IdGenerator\RequestIdGenerator; diff --git a/src/rpc/tests/PathGenerator/FullPathGeneratorTest.php b/src/rpc/tests/PathGenerator/FullPathGeneratorTest.php index 862a62df4..8a549f4fc 100644 --- a/src/rpc/tests/PathGenerator/FullPathGeneratorTest.php +++ b/src/rpc/tests/PathGenerator/FullPathGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpc\PathGenerator; use Hyperf\Rpc\PathGenerator\FullPathGenerator; diff --git a/src/rpc/tests/PathGenerator/PathGeneratorTest.php b/src/rpc/tests/PathGenerator/PathGeneratorTest.php index 0df67b785..54268f657 100644 --- a/src/rpc/tests/PathGenerator/PathGeneratorTest.php +++ b/src/rpc/tests/PathGenerator/PathGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpc\PathGenerator; use Hyperf\JsonRpc\PathGenerator; diff --git a/src/rpc/tests/ProtocolTest.php b/src/rpc/tests/ProtocolTest.php index 13898bee5..94e2ab96d 100644 --- a/src/rpc/tests/ProtocolTest.php +++ b/src/rpc/tests/ProtocolTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpc; use Hyperf\Config\Config; diff --git a/src/rpn/src/Calculator.php b/src/rpn/src/Calculator.php index d2d74103e..096e6be0a 100644 --- a/src/rpn/src/Calculator.php +++ b/src/rpn/src/Calculator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn; use Hyperf\Rpn\Exception\InvalidExpressionException; diff --git a/src/rpn/src/ConfigProvider.php b/src/rpn/src/ConfigProvider.php index 59938502e..0eb8adc76 100644 --- a/src/rpn/src/ConfigProvider.php +++ b/src/rpn/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn; class ConfigProvider diff --git a/src/rpn/src/Exception/InvalidExpressionException.php b/src/rpn/src/Exception/InvalidExpressionException.php index f3b32d332..dc4c443c4 100644 --- a/src/rpn/src/Exception/InvalidExpressionException.php +++ b/src/rpn/src/Exception/InvalidExpressionException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Exception; use InvalidArgumentException; diff --git a/src/rpn/src/Exception/InvalidOperatorException.php b/src/rpn/src/Exception/InvalidOperatorException.php index 1c6f2c23d..c3b9f1ebc 100644 --- a/src/rpn/src/Exception/InvalidOperatorException.php +++ b/src/rpn/src/Exception/InvalidOperatorException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Exception; use InvalidArgumentException; diff --git a/src/rpn/src/Exception/InvalidValueException.php b/src/rpn/src/Exception/InvalidValueException.php index b83c2a4f1..35df5a50f 100644 --- a/src/rpn/src/Exception/InvalidValueException.php +++ b/src/rpn/src/Exception/InvalidValueException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Exception; use InvalidArgumentException; diff --git a/src/rpn/src/Exception/NotFoundException.php b/src/rpn/src/Exception/NotFoundException.php index b0612d987..ee1e63f7e 100644 --- a/src/rpn/src/Exception/NotFoundException.php +++ b/src/rpn/src/Exception/NotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Exception; use Exception; diff --git a/src/rpn/src/Operator/AddOperator.php b/src/rpn/src/Operator/AddOperator.php index 0cf174f47..01d7a5f73 100644 --- a/src/rpn/src/Operator/AddOperator.php +++ b/src/rpn/src/Operator/AddOperator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; class AddOperator extends Operator diff --git a/src/rpn/src/Operator/DivideOperator.php b/src/rpn/src/Operator/DivideOperator.php index c32c4be22..7fff40d55 100644 --- a/src/rpn/src/Operator/DivideOperator.php +++ b/src/rpn/src/Operator/DivideOperator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; class DivideOperator extends Operator diff --git a/src/rpn/src/Operator/HasBindings.php b/src/rpn/src/Operator/HasBindings.php index 730c3eabe..d74389251 100644 --- a/src/rpn/src/Operator/HasBindings.php +++ b/src/rpn/src/Operator/HasBindings.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; use Hyperf\Rpn\Exception\InvalidValueException; diff --git a/src/rpn/src/Operator/MultiplyOperator.php b/src/rpn/src/Operator/MultiplyOperator.php index 19979df10..cf4eaad40 100644 --- a/src/rpn/src/Operator/MultiplyOperator.php +++ b/src/rpn/src/Operator/MultiplyOperator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; class MultiplyOperator extends Operator diff --git a/src/rpn/src/Operator/Operator.php b/src/rpn/src/Operator/Operator.php index 43b398c66..e44ba91b2 100644 --- a/src/rpn/src/Operator/Operator.php +++ b/src/rpn/src/Operator/Operator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; abstract class Operator implements OperatorInterface diff --git a/src/rpn/src/Operator/OperatorInterface.php b/src/rpn/src/Operator/OperatorInterface.php index 41313ddfb..b10223620 100644 --- a/src/rpn/src/Operator/OperatorInterface.php +++ b/src/rpn/src/Operator/OperatorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; interface OperatorInterface diff --git a/src/rpn/src/Operator/SubtractOperator.php b/src/rpn/src/Operator/SubtractOperator.php index c52c1a346..8c10eafca 100644 --- a/src/rpn/src/Operator/SubtractOperator.php +++ b/src/rpn/src/Operator/SubtractOperator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Rpn\Operator; class SubtractOperator extends Operator diff --git a/src/rpn/tests/AbstractTestCase.php b/src/rpn/tests/AbstractTestCase.php index e45f79509..6c2abf8ab 100644 --- a/src/rpn/tests/AbstractTestCase.php +++ b/src/rpn/tests/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpn; use PHPUnit\Framework\TestCase; diff --git a/src/rpn/tests/CalculatorTest.php b/src/rpn/tests/CalculatorTest.php index a889434ed..90fef1a41 100644 --- a/src/rpn/tests/CalculatorTest.php +++ b/src/rpn/tests/CalculatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpn; use Hyperf\Rpn\Calculator; diff --git a/src/rpn/tests/ExampleTest.php b/src/rpn/tests/ExampleTest.php index e3b3dbba6..839f27bd7 100644 --- a/src/rpn/tests/ExampleTest.php +++ b/src/rpn/tests/ExampleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpn; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/rpn/tests/HasBindingsTest.php b/src/rpn/tests/HasBindingsTest.php index e1a4a2a5a..ca3bcd43e 100644 --- a/src/rpn/tests/HasBindingsTest.php +++ b/src/rpn/tests/HasBindingsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpn; use HyperfTest\Rpn\Stub\HasBindingsStub; diff --git a/src/rpn/tests/Stub/HasBindingsStub.php b/src/rpn/tests/Stub/HasBindingsStub.php index 30a0bde0f..ae3ab893c 100644 --- a/src/rpn/tests/Stub/HasBindingsStub.php +++ b/src/rpn/tests/Stub/HasBindingsStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Rpn\Stub; use Hyperf\Rpn\Operator\HasBindings; diff --git a/src/scout/publish/scout.php b/src/scout/publish/scout.php index 365ead004..0dc2a9ca5 100644 --- a/src/scout/publish/scout.php +++ b/src/scout/publish/scout.php @@ -9,6 +9,8 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Scout\Provider\ElasticsearchProvider; + use function Hyperf\Support\env; return [ @@ -22,7 +24,7 @@ return [ 'concurrency' => 100, 'engine' => [ 'elasticsearch' => [ - 'driver' => Hyperf\Scout\Provider\ElasticsearchProvider::class, + 'driver' => ElasticsearchProvider::class, 'index' => null, 'hosts' => [ env('ELASTICSEARCH_HOST', 'http://127.0.0.1:9200'), diff --git a/src/scout/src/Builder.php b/src/scout/src/Builder.php index 74ead4662..430a5a714 100644 --- a/src/scout/src/Builder.php +++ b/src/scout/src/Builder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; use Closure; diff --git a/src/scout/src/ConfigProvider.php b/src/scout/src/ConfigProvider.php index 3c91afbc9..d6e7f53a5 100644 --- a/src/scout/src/ConfigProvider.php +++ b/src/scout/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; use Hyperf\Scout\Console\FlushCommand; diff --git a/src/scout/src/Console/FlushCommand.php b/src/scout/src/Console/FlushCommand.php index 26dd3e5bd..73a441678 100644 --- a/src/scout/src/Console/FlushCommand.php +++ b/src/scout/src/Console/FlushCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Console; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/scout/src/Console/ImportCommand.php b/src/scout/src/Console/ImportCommand.php index c25922d1f..0e060d930 100644 --- a/src/scout/src/Console/ImportCommand.php +++ b/src/scout/src/Console/ImportCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Console; use Hyperf\Command\Command; diff --git a/src/scout/src/Engine/ElasticsearchEngine.php b/src/scout/src/Engine/ElasticsearchEngine.php index fb4f02324..8b4bf0540 100644 --- a/src/scout/src/Engine/ElasticsearchEngine.php +++ b/src/scout/src/Engine/ElasticsearchEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Engine; use Elasticsearch\Client; diff --git a/src/scout/src/Engine/Engine.php b/src/scout/src/Engine/Engine.php index 709671ad1..b15a70e5e 100644 --- a/src/scout/src/Engine/Engine.php +++ b/src/scout/src/Engine/Engine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Engine; use Hyperf\Collection\Collection as BaseCollection; diff --git a/src/scout/src/Engine/NullEngine.php b/src/scout/src/Engine/NullEngine.php index b1d8d4658..71070a08f 100644 --- a/src/scout/src/Engine/NullEngine.php +++ b/src/scout/src/Engine/NullEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Engine; use Hyperf\Collection\Collection as BaseCollection; diff --git a/src/scout/src/EngineFactory.php b/src/scout/src/EngineFactory.php index 8fba93f29..38422358b 100644 --- a/src/scout/src/EngineFactory.php +++ b/src/scout/src/EngineFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; use Hyperf\Contract\ConfigInterface; diff --git a/src/scout/src/Event/ModelsFlushed.php b/src/scout/src/Event/ModelsFlushed.php index 27e3bf3c9..cb2f2598f 100644 --- a/src/scout/src/Event/ModelsFlushed.php +++ b/src/scout/src/Event/ModelsFlushed.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Event; use Hyperf\Database\Model\Collection; diff --git a/src/scout/src/Event/ModelsImported.php b/src/scout/src/Event/ModelsImported.php index 79f5a4fae..63e33e638 100644 --- a/src/scout/src/Event/ModelsImported.php +++ b/src/scout/src/Event/ModelsImported.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Event; use Hyperf\Database\Model\Collection; diff --git a/src/scout/src/Exception/RuntimeException.php b/src/scout/src/Exception/RuntimeException.php index 8d4defb96..3edd851dc 100644 --- a/src/scout/src/Exception/RuntimeException.php +++ b/src/scout/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Exception; class RuntimeException extends \RuntimeException diff --git a/src/scout/src/ModelObserver.php b/src/scout/src/ModelObserver.php index 8f4dcda02..9d2e1c6e8 100644 --- a/src/scout/src/ModelObserver.php +++ b/src/scout/src/ModelObserver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; use Hyperf\Context\Context; diff --git a/src/scout/src/Provider/ElasticsearchProvider.php b/src/scout/src/Provider/ElasticsearchProvider.php index 1cdc9c83b..98057fcf0 100644 --- a/src/scout/src/Provider/ElasticsearchProvider.php +++ b/src/scout/src/Provider/ElasticsearchProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Provider; use Hyperf\Contract\ConfigInterface; diff --git a/src/scout/src/Provider/ProviderInterface.php b/src/scout/src/Provider/ProviderInterface.php index 467e30929..0270fe576 100644 --- a/src/scout/src/Provider/ProviderInterface.php +++ b/src/scout/src/Provider/ProviderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout\Provider; use Hyperf\Scout\Engine\Engine; diff --git a/src/scout/src/Searchable.php b/src/scout/src/Searchable.php index a657de2a5..90446697c 100644 --- a/src/scout/src/Searchable.php +++ b/src/scout/src/Searchable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; use Closure; diff --git a/src/scout/src/SearchableInterface.php b/src/scout/src/SearchableInterface.php index bcd38e651..f732ca824 100644 --- a/src/scout/src/SearchableInterface.php +++ b/src/scout/src/SearchableInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; /** diff --git a/src/scout/src/SearchableScope.php b/src/scout/src/SearchableScope.php index 2776d45a7..677f2e089 100644 --- a/src/scout/src/SearchableScope.php +++ b/src/scout/src/SearchableScope.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Scout; use Hyperf\Context\ApplicationContext; diff --git a/src/scout/tests/Cases/BuilderTest.php b/src/scout/tests/Cases/BuilderTest.php index 75d099447..16d5cc8ce 100644 --- a/src/scout/tests/Cases/BuilderTest.php +++ b/src/scout/tests/Cases/BuilderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Cases; use Hyperf\Database\Model\Collection; diff --git a/src/scout/tests/Cases/ElasticsearchEngineTest.php b/src/scout/tests/Cases/ElasticsearchEngineTest.php index 773fc9d64..92ec841d2 100644 --- a/src/scout/tests/Cases/ElasticsearchEngineTest.php +++ b/src/scout/tests/Cases/ElasticsearchEngineTest.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Cases; +use Elasticsearch\Client; use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Model; use Hyperf\Scout\Builder; @@ -19,6 +21,7 @@ use HyperfTest\Scout\Stub\ContainerStub; use HyperfTest\Scout\Stub\ElasticsearchEngineTestModel; use HyperfTest\Scout\Stub\SearchableModel; use Mockery; +use Mockery\MockInterface; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; @@ -112,14 +115,14 @@ class ElasticsearchEngineTest extends TestCase public function testBuilderCallbackCanManipulateSearchParametersToElasticsearch() { - /** @var \Elasticsearch\Client|\Mockery\MockInterface $client */ - $client = Mockery::mock(\Elasticsearch\Client::class); + /** @var Client|MockInterface $client */ + $client = Mockery::mock(Client::class); $client->shouldReceive('search')->with(['modified_by_callback']); $engine = new ElasticsearchEngine($client, 'scout'); $builder = new Builder( new ElasticsearchEngineTestModel(), 'huayra', - function (\Elasticsearch\Client $client, $query, $params) { + function (Client $client, $query, $params) { $this->assertNotEmpty($params); $this->assertEquals('huayra', $query); $params = ['modified_by_callback']; diff --git a/src/scout/tests/Cases/ModelObserverTest.php b/src/scout/tests/Cases/ModelObserverTest.php index 82fe297fa..618c742bf 100644 --- a/src/scout/tests/Cases/ModelObserverTest.php +++ b/src/scout/tests/Cases/ModelObserverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Cases; use Hyperf\Database\Model\Events\Deleted; diff --git a/src/scout/tests/Cases/SearchableTest.php b/src/scout/tests/Cases/SearchableTest.php index 863ee527c..8e870efbe 100644 --- a/src/scout/tests/Cases/SearchableTest.php +++ b/src/scout/tests/Cases/SearchableTest.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Cases; +use Hyperf\Database\Model\Collection; use HyperfTest\Scout\Stub\ContainerStub; use HyperfTest\Scout\Stub\ModelStubForMakeAllSearchable; use HyperfTest\Scout\Stub\SearchableModel; @@ -39,7 +41,7 @@ class SearchableTest extends TestCase public function testSearchableUsingUpdateIsCalledOnCollection() { - $collection = m::mock(\Hyperf\Database\Model\Collection::class); + $collection = m::mock(Collection::class); $collection->shouldReceive('isEmpty')->andReturn(false); $collection->shouldReceive('first->searchableUsing->update')->with($collection); $model = new SearchableModel(); @@ -48,7 +50,7 @@ class SearchableTest extends TestCase public function testSearchableUsingUpdateIsNotCalledOnEmptyCollection() { - $collection = m::mock(\Hyperf\Database\Model\Collection::class); + $collection = m::mock(Collection::class); $collection->shouldReceive('isEmpty')->andReturn(true); $collection->shouldNotReceive('first->searchableUsing->update'); $model = new SearchableModel(); @@ -57,7 +59,7 @@ class SearchableTest extends TestCase public function testSearchableUsingDeleteIsCalledOnCollection() { - $collection = m::mock(\Hyperf\Database\Model\Collection::class); + $collection = m::mock(Collection::class); $collection->shouldReceive('isEmpty')->andReturn(false); $collection->shouldReceive('first->searchableUsing->delete')->with($collection); $model = new SearchableModel(); @@ -66,7 +68,7 @@ class SearchableTest extends TestCase public function testSearchableUsingDeleteIsNotCalledOnEmptyCollection() { - $collection = m::mock(\Hyperf\Database\Model\Collection::class); + $collection = m::mock(Collection::class); $collection->shouldReceive('isEmpty')->andReturn(true); $collection->shouldNotReceive('first->searchableUsing->delete'); $model = new SearchableModel(); diff --git a/src/scout/tests/Stub/ContainerStub.php b/src/scout/tests/Stub/ContainerStub.php index 90fbf0f29..4d4d7cc51 100644 --- a/src/scout/tests/Stub/ContainerStub.php +++ b/src/scout/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/scout/tests/Stub/ElasticsearchEngineTestModel.php b/src/scout/tests/Stub/ElasticsearchEngineTestModel.php index 843f0c9d3..b1418edee 100644 --- a/src/scout/tests/Stub/ElasticsearchEngineTestModel.php +++ b/src/scout/tests/Stub/ElasticsearchEngineTestModel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Stub; use Hyperf\Database\Model\Model; diff --git a/src/scout/tests/Stub/ModelStubForMakeAllSearchable.php b/src/scout/tests/Stub/ModelStubForMakeAllSearchable.php index 02790fc31..d0b2ac641 100644 --- a/src/scout/tests/Stub/ModelStubForMakeAllSearchable.php +++ b/src/scout/tests/Stub/ModelStubForMakeAllSearchable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Stub; use Hyperf\Scout\Builder; diff --git a/src/scout/tests/Stub/SearchableModel.php b/src/scout/tests/Stub/SearchableModel.php index 81e602a5e..b74fdf9de 100644 --- a/src/scout/tests/Stub/SearchableModel.php +++ b/src/scout/tests/Stub/SearchableModel.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Scout\Stub; use Closure; diff --git a/src/serializer/src/ConfigProvider.php b/src/serializer/src/ConfigProvider.php index 050c530de..1c5989998 100644 --- a/src/serializer/src/ConfigProvider.php +++ b/src/serializer/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Hyperf\Contract\NormalizerInterface; diff --git a/src/serializer/src/ExceptionNormalizer.php b/src/serializer/src/ExceptionNormalizer.php index dc3694eb0..ddb696415 100644 --- a/src/serializer/src/ExceptionNormalizer.php +++ b/src/serializer/src/ExceptionNormalizer.php @@ -9,16 +9,19 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Doctrine\Instantiator\Instantiator; use Hyperf\Di\ReflectionManager; +use ReflectionException; use RuntimeException; use Serializable; use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use Throwable; +use TypeError; use function get_class; @@ -47,13 +50,13 @@ class ExceptionNormalizer implements NormalizerInterface, DenormalizerInterface, } } return $exception; - } catch (\ReflectionException) { + } catch (ReflectionException) { return new RuntimeException(sprintf( 'Bad data %s: %s', $data['class'], $data['message'] ), $data['code']); - } catch (\TypeError) { + } catch (TypeError) { return new RuntimeException(sprintf( 'Uncaught data %s: %s', $data['class'], diff --git a/src/serializer/src/JsonDeNormalizer.php b/src/serializer/src/JsonDeNormalizer.php index b93fd69fb..94f780244 100644 --- a/src/serializer/src/JsonDeNormalizer.php +++ b/src/serializer/src/JsonDeNormalizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Hyperf\Contract\NormalizerInterface; diff --git a/src/serializer/src/ScalarNormalizer.php b/src/serializer/src/ScalarNormalizer.php index 7ffa888cc..0b6059685 100644 --- a/src/serializer/src/ScalarNormalizer.php +++ b/src/serializer/src/ScalarNormalizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; diff --git a/src/serializer/src/Serializer.php b/src/serializer/src/Serializer.php index d9ddf50b3..a4787bf6b 100644 --- a/src/serializer/src/Serializer.php +++ b/src/serializer/src/Serializer.php @@ -9,11 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Countable; use Hyperf\Contract\NormalizerInterface as Normalizer; -use Symfony\Component\Serializer\Encoder; use Symfony\Component\Serializer\Encoder\ChainDecoder; use Symfony\Component\Serializer\Encoder\ChainEncoder; use Symfony\Component\Serializer\Encoder\ContextAwareDecoderInterface; @@ -61,12 +61,12 @@ class Serializer implements Normalizer, SerializerInterface, ContextAwareNormali ]; /** - * @var Encoder\ChainEncoder + * @var ChainEncoder */ protected $encoder; /** - * @var Encoder\ChainDecoder + * @var ChainDecoder */ protected $decoder; @@ -77,8 +77,8 @@ class Serializer implements Normalizer, SerializerInterface, ContextAwareNormali protected $normalizerCache = []; /** - * @param (NormalizerInterface|DenormalizerInterface|mixed)[] $normalizers - * @param (EncoderInterface|DecoderInterface|mixed)[] $encoders + * @param (DenormalizerInterface|mixed|NormalizerInterface)[] $normalizers + * @param (DecoderInterface|EncoderInterface|mixed)[] $encoders */ public function __construct(array $normalizers = [], array $encoders = []) { diff --git a/src/serializer/src/SerializerFactory.php b/src/serializer/src/SerializerFactory.php index a2b4dda0c..0a07fe953 100644 --- a/src/serializer/src/SerializerFactory.php +++ b/src/serializer/src/SerializerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; diff --git a/src/serializer/src/SimpleNormalizer.php b/src/serializer/src/SimpleNormalizer.php index 401e351ec..3892a657b 100644 --- a/src/serializer/src/SimpleNormalizer.php +++ b/src/serializer/src/SimpleNormalizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Hyperf\Contract\NormalizerInterface; diff --git a/src/serializer/src/SymfonyNormalizer.php b/src/serializer/src/SymfonyNormalizer.php index 992146b67..c893654cb 100644 --- a/src/serializer/src/SymfonyNormalizer.php +++ b/src/serializer/src/SymfonyNormalizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Serializer; use Hyperf\Contract\NormalizerInterface; diff --git a/src/serializer/tests/ExceptionNormalizerTest.php b/src/serializer/tests/ExceptionNormalizerTest.php index 8d8328e1b..65a9769f0 100644 --- a/src/serializer/tests/ExceptionNormalizerTest.php +++ b/src/serializer/tests/ExceptionNormalizerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer; use Hyperf\Serializer\ExceptionNormalizer; diff --git a/src/serializer/tests/Foo.php b/src/serializer/tests/Foo.php index c7280e0c3..9745e6ea4 100644 --- a/src/serializer/tests/Foo.php +++ b/src/serializer/tests/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer; use Hyperf\Contract\JsonDeSerializable; diff --git a/src/serializer/tests/JsonDeSerializableTest.php b/src/serializer/tests/JsonDeSerializableTest.php index e35e88377..71193d814 100644 --- a/src/serializer/tests/JsonDeSerializableTest.php +++ b/src/serializer/tests/JsonDeSerializableTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer; use Hyperf\Codec\Json; diff --git a/src/serializer/tests/Stub/Foo.php b/src/serializer/tests/Stub/Foo.php index d99837df7..7707b1cc1 100644 --- a/src/serializer/tests/Stub/Foo.php +++ b/src/serializer/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer\Stub; class Foo diff --git a/src/serializer/tests/Stub/FooException.php b/src/serializer/tests/Stub/FooException.php index 4c9f5c4ff..a86210570 100644 --- a/src/serializer/tests/Stub/FooException.php +++ b/src/serializer/tests/Stub/FooException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer\Stub; use Exception; diff --git a/src/serializer/tests/Stub/SerializableException.php b/src/serializer/tests/Stub/SerializableException.php index b30900dcd..670de802d 100644 --- a/src/serializer/tests/Stub/SerializableException.php +++ b/src/serializer/tests/Stub/SerializableException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer\Stub; use RuntimeException; diff --git a/src/serializer/tests/SymfonySerializerTest.php b/src/serializer/tests/SymfonySerializerTest.php index f885d3033..5bf93cb1f 100644 --- a/src/serializer/tests/SymfonySerializerTest.php +++ b/src/serializer/tests/SymfonySerializerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Serializer; use Hyperf\Serializer\SerializerFactory; diff --git a/src/server/publish/server.php b/src/server/publish/server.php index 04f05b6ca..175e94610 100644 --- a/src/server/publish/server.php +++ b/src/server/publish/server.php @@ -9,6 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Framework\Bootstrap\PipeMessageCallback; +use Hyperf\Framework\Bootstrap\ServerStartCallback; +use Hyperf\Framework\Bootstrap\WorkerExitCallback; +use Hyperf\Framework\Bootstrap\WorkerStartCallback; use Hyperf\Server\Event; use Hyperf\Server\Server; use Hyperf\Server\ServerInterface; @@ -45,9 +49,9 @@ return [ 'socket_buffer_size' => 2 * 1024 * 1024, ], 'callbacks' => [ - Event::ON_BEFORE_START => [Hyperf\Framework\Bootstrap\ServerStartCallback::class, 'beforeStart'], - Event::ON_WORKER_START => [Hyperf\Framework\Bootstrap\WorkerStartCallback::class, 'onWorkerStart'], - Event::ON_PIPE_MESSAGE => [Hyperf\Framework\Bootstrap\PipeMessageCallback::class, 'onPipeMessage'], - Event::ON_WORKER_EXIT => [Hyperf\Framework\Bootstrap\WorkerExitCallback::class, 'onWorkerExit'], + Event::ON_BEFORE_START => [ServerStartCallback::class, 'beforeStart'], + Event::ON_WORKER_START => [WorkerStartCallback::class, 'onWorkerStart'], + Event::ON_PIPE_MESSAGE => [PipeMessageCallback::class, 'onPipeMessage'], + Event::ON_WORKER_EXIT => [WorkerExitCallback::class, 'onWorkerExit'], ], ]; diff --git a/src/server/src/Command/StartServer.php b/src/server/src/Command/StartServer.php index 687047711..542406cdc 100644 --- a/src/server/src/Command/StartServer.php +++ b/src/server/src/Command/StartServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Command; use Hyperf\Contract\ConfigInterface; diff --git a/src/server/src/ConfigProvider.php b/src/server/src/ConfigProvider.php index f409bff0b..562eac405 100644 --- a/src/server/src/ConfigProvider.php +++ b/src/server/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Server\Command\StartServer; diff --git a/src/server/src/Connection.php b/src/server/src/Connection.php index 5dace22b0..b66ffaf5e 100644 --- a/src/server/src/Connection.php +++ b/src/server/src/Connection.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Engine\Contract\SocketInterface; diff --git a/src/server/src/CoroutineServer.php b/src/server/src/CoroutineServer.php index 8bd1a156c..a2aeece97 100644 --- a/src/server/src/CoroutineServer.php +++ b/src/server/src/CoroutineServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Contract\ConfigInterface; @@ -36,7 +37,7 @@ class CoroutineServer implements ServerInterface { protected ?ServerConfig $config = null; - protected HttpServer|Server|null $server = null; + protected null|HttpServer|Server $server = null; /** * @var callable diff --git a/src/server/src/Entry/EventDispatcher.php b/src/server/src/Entry/EventDispatcher.php index 8f7065467..53817fa79 100644 --- a/src/server/src/Entry/EventDispatcher.php +++ b/src/server/src/Entry/EventDispatcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Entry; use Psr\EventDispatcher\EventDispatcherInterface; diff --git a/src/server/src/Entry/Logger.php b/src/server/src/Entry/Logger.php index ac1454362..a8ba3c870 100644 --- a/src/server/src/Entry/Logger.php +++ b/src/server/src/Entry/Logger.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Entry; use Psr\Log\LoggerInterface; diff --git a/src/server/src/Event.php b/src/server/src/Event.php index c05c0b578..ede1a6e65 100644 --- a/src/server/src/Event.php +++ b/src/server/src/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; class Event diff --git a/src/server/src/Event/AllCoroutineServersClosed.php b/src/server/src/Event/AllCoroutineServersClosed.php index e94aec4ee..d851e025d 100644 --- a/src/server/src/Event/AllCoroutineServersClosed.php +++ b/src/server/src/Event/AllCoroutineServersClosed.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Event; class AllCoroutineServersClosed diff --git a/src/server/src/Event/CoroutineServerStart.php b/src/server/src/Event/CoroutineServerStart.php index df4e7cccf..cc1df2ecf 100644 --- a/src/server/src/Event/CoroutineServerStart.php +++ b/src/server/src/Event/CoroutineServerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Event; use Swoole\Coroutine\Server; diff --git a/src/server/src/Event/CoroutineServerStop.php b/src/server/src/Event/CoroutineServerStop.php index 18e7aa402..71911ae65 100644 --- a/src/server/src/Event/CoroutineServerStop.php +++ b/src/server/src/Event/CoroutineServerStop.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Event; use Swoole\Coroutine\Server; diff --git a/src/server/src/Event/MainCoroutineServerStart.php b/src/server/src/Event/MainCoroutineServerStart.php index 7d4838068..61b68ecdf 100644 --- a/src/server/src/Event/MainCoroutineServerStart.php +++ b/src/server/src/Event/MainCoroutineServerStart.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Event; use Swoole\Coroutine\Http\Server as HttpServer; diff --git a/src/server/src/Exception/InvalidArgumentException.php b/src/server/src/Exception/InvalidArgumentException.php index ae1420cc1..051c31a82 100644 --- a/src/server/src/Exception/InvalidArgumentException.php +++ b/src/server/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/server/src/Exception/RuntimeException.php b/src/server/src/Exception/RuntimeException.php index a9a4f2f36..d700d5f2a 100644 --- a/src/server/src/Exception/RuntimeException.php +++ b/src/server/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Exception; class RuntimeException extends \RuntimeException diff --git a/src/server/src/Exception/ServerException.php b/src/server/src/Exception/ServerException.php index 683ead151..747f7bd3d 100644 --- a/src/server/src/Exception/ServerException.php +++ b/src/server/src/Exception/ServerException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Exception; class ServerException extends RuntimeException diff --git a/src/server/src/Listener/AfterWorkerStartListener.php b/src/server/src/Listener/AfterWorkerStartListener.php index 2e5d7b03a..62bd14302 100644 --- a/src/server/src/Listener/AfterWorkerStartListener.php +++ b/src/server/src/Listener/AfterWorkerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Listener; use Hyperf\Contract\StdoutLoggerInterface; @@ -19,6 +20,7 @@ use Hyperf\Server\Event\MainCoroutineServerStart; use Hyperf\Server\ServerInterface; use Hyperf\Server\ServerManager; use Psr\Log\LoggerInterface; +use Swoole\Coroutine\Server; use Swoole\Server\Port; use function Hyperf\Support\value; @@ -52,7 +54,7 @@ class AfterWorkerStartListener implements ListenerInterface /** @var AfterWorkerStart|MainCoroutineServerStart $event */ $isCoroutineServer = $event instanceof MainCoroutineServerStart; if ($isCoroutineServer || $event->workerId === 0) { - /** @var Port|\Swoole\Coroutine\Server $server */ + /** @var Port|Server $server */ foreach (ServerManager::list() as [$type, $server]) { $listen = $server->host . ':' . $server->port; $type = value(function () use ($type, $server) { @@ -60,7 +62,7 @@ class AfterWorkerStartListener implements ListenerInterface case ServerInterface::SERVER_BASE: $sockType = $server->type; // type of Swoole\Coroutine\Server is AF_INET which is equal to SWOOLE_SOCK_UDP - if ($server instanceof \Swoole\Coroutine\Server || in_array($sockType, [SocketType::TCP, SocketType::TCP6])) { + if ($server instanceof Server || in_array($sockType, [SocketType::TCP, SocketType::TCP6])) { return 'TCP'; } if (in_array($sockType, [SocketType::UDP, SocketType::UDP6])) { diff --git a/src/server/src/Listener/InitProcessTitleListener.php b/src/server/src/Listener/InitProcessTitleListener.php index 8e8b62820..e0b3893db 100644 --- a/src/server/src/Listener/InitProcessTitleListener.php +++ b/src/server/src/Listener/InitProcessTitleListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/server/src/Listener/StoreServerNameListener.php b/src/server/src/Listener/StoreServerNameListener.php index e989b4d10..01fe5bb1a 100644 --- a/src/server/src/Listener/StoreServerNameListener.php +++ b/src/server/src/Listener/StoreServerNameListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server\Listener; use Hyperf\Context\Context; diff --git a/src/server/src/Option.php b/src/server/src/Option.php index af75a25c1..f4c85a376 100644 --- a/src/server/src/Option.php +++ b/src/server/src/Option.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\HttpServer\PriorityMiddleware; diff --git a/src/server/src/Port.php b/src/server/src/Port.php index d3f32384e..b25b022d2 100644 --- a/src/server/src/Port.php +++ b/src/server/src/Port.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; class Port diff --git a/src/server/src/Server.php b/src/server/src/Server.php index 8c94da125..1fa425b6e 100644 --- a/src/server/src/Server.php +++ b/src/server/src/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Contract\MiddlewareInitializerInterface; @@ -79,7 +80,7 @@ class Server implements ServerInterface $this->eventDispatcher->dispatch(new BeforeMainServerStart($this->server, $config->toArray())); } } else { - /** @var bool|\Swoole\Server\Port $slaveServer */ + /** @var bool|SwoolePort $slaveServer */ $slaveServer = $this->server->addlistener($host, $port, $sockType); if (! $slaveServer) { throw new \RuntimeException("Failed to listen server port [{$host}:{$port}]"); diff --git a/src/server/src/ServerConfig.php b/src/server/src/ServerConfig.php index 5061a4365..9bb92f5d0 100644 --- a/src/server/src/ServerConfig.php +++ b/src/server/src/ServerConfig.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Contract\Arrayable; diff --git a/src/server/src/ServerFactory.php b/src/server/src/ServerFactory.php index e20f4a3e5..278629510 100644 --- a/src/server/src/ServerFactory.php +++ b/src/server/src/ServerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Server\Entry\EventDispatcher; diff --git a/src/server/src/ServerInterface.php b/src/server/src/ServerInterface.php index 7594be84a..c163c5ea4 100644 --- a/src/server/src/ServerInterface.php +++ b/src/server/src/ServerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Psr\Container\ContainerInterface; diff --git a/src/server/src/ServerManager.php b/src/server/src/ServerManager.php index 30cf37373..7be72d129 100644 --- a/src/server/src/ServerManager.php +++ b/src/server/src/ServerManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Support\Traits\Container; diff --git a/src/server/src/SwooleServerFactory.php b/src/server/src/SwooleServerFactory.php index 58150fcec..c3476d3a4 100644 --- a/src/server/src/SwooleServerFactory.php +++ b/src/server/src/SwooleServerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Psr\Container\ContainerInterface; diff --git a/src/server/src/SwowServer.php b/src/server/src/SwowServer.php index 1c67483b4..cc194a4dd 100644 --- a/src/server/src/SwowServer.php +++ b/src/server/src/SwowServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Server; use Hyperf\Contract\ConfigInterface; diff --git a/src/server/tests/Listener/InitProcessTitleListenerTest.php b/src/server/tests/Listener/InitProcessTitleListenerTest.php index 44d3204ce..d70bb5c14 100644 --- a/src/server/tests/Listener/InitProcessTitleListenerTest.php +++ b/src/server/tests/Listener/InitProcessTitleListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Server\Listener; use Hyperf\Config\Config; diff --git a/src/server/tests/PortTest.php b/src/server/tests/PortTest.php index 6c4365fec..d99438ed5 100644 --- a/src/server/tests/PortTest.php +++ b/src/server/tests/PortTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Server; use Hyperf\Server\Port; diff --git a/src/server/tests/Stub/DemoProcess.php b/src/server/tests/Stub/DemoProcess.php index 64d99b0a9..554871739 100644 --- a/src/server/tests/Stub/DemoProcess.php +++ b/src/server/tests/Stub/DemoProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Server\Stub; use Hyperf\Process\AbstractProcess; diff --git a/src/server/tests/Stub/InitProcessTitleListenerStub.php b/src/server/tests/Stub/InitProcessTitleListenerStub.php index ff450f9a1..79c6b44d3 100644 --- a/src/server/tests/Stub/InitProcessTitleListenerStub.php +++ b/src/server/tests/Stub/InitProcessTitleListenerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Server\Stub; use Hyperf\Context\Context; diff --git a/src/server/tests/Stub/InitProcessTitleListenerStub2.php b/src/server/tests/Stub/InitProcessTitleListenerStub2.php index 5c876f347..cdafed92e 100644 --- a/src/server/tests/Stub/InitProcessTitleListenerStub2.php +++ b/src/server/tests/Stub/InitProcessTitleListenerStub2.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Server\Stub; use Hyperf\Context\Context; diff --git a/src/service-governance-consul/src/ConfigProvider.php b/src/service-governance-consul/src/ConfigProvider.php index a73e566b2..0f737b2f2 100644 --- a/src/service-governance-consul/src/ConfigProvider.php +++ b/src/service-governance-consul/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceConsul; use Hyperf\ServiceGovernanceConsul\Listener\RegisterDriverListener; diff --git a/src/service-governance-consul/src/ConsulAgent.php b/src/service-governance-consul/src/ConsulAgent.php index ac8339d65..15f5c7499 100644 --- a/src/service-governance-consul/src/ConsulAgent.php +++ b/src/service-governance-consul/src/ConsulAgent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceConsul; use Hyperf\Consul\AgentInterface; diff --git a/src/service-governance-consul/src/ConsulAgentFactory.php b/src/service-governance-consul/src/ConsulAgentFactory.php index dbd96fc91..88e25535a 100644 --- a/src/service-governance-consul/src/ConsulAgentFactory.php +++ b/src/service-governance-consul/src/ConsulAgentFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceConsul; use Hyperf\Consul\Agent; diff --git a/src/service-governance-consul/src/ConsulDriver.php b/src/service-governance-consul/src/ConsulDriver.php index d3d502439..ce2538b86 100644 --- a/src/service-governance-consul/src/ConsulDriver.php +++ b/src/service-governance-consul/src/ConsulDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceConsul; use Hyperf\Consul\AgentInterface; diff --git a/src/service-governance-consul/src/Listener/RegisterDriverListener.php b/src/service-governance-consul/src/Listener/RegisterDriverListener.php index 19c49e16a..b9b8ac750 100644 --- a/src/service-governance-consul/src/Listener/RegisterDriverListener.php +++ b/src/service-governance-consul/src/Listener/RegisterDriverListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceConsul\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/service-governance-consul/tests/ConsulDriverTest.php b/src/service-governance-consul/tests/ConsulDriverTest.php index a35b04dd1..2df403b45 100644 --- a/src/service-governance-consul/tests/ConsulDriverTest.php +++ b/src/service-governance-consul/tests/ConsulDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ServiceGovernanceConsul; use Hyperf\Config\Config; diff --git a/src/service-governance-nacos/src/Client.php b/src/service-governance-nacos/src/Client.php index 540dfc9b5..f810d2231 100644 --- a/src/service-governance-nacos/src/Client.php +++ b/src/service-governance-nacos/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos; use Hyperf\Nacos\Application; diff --git a/src/service-governance-nacos/src/ClientFactory.php b/src/service-governance-nacos/src/ClientFactory.php index 28679feb3..05a569eaf 100644 --- a/src/service-governance-nacos/src/ClientFactory.php +++ b/src/service-governance-nacos/src/ClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos; use Hyperf\Contract\ConfigInterface; diff --git a/src/service-governance-nacos/src/ConfigProvider.php b/src/service-governance-nacos/src/ConfigProvider.php index d3b7546cc..0d05e2abe 100644 --- a/src/service-governance-nacos/src/ConfigProvider.php +++ b/src/service-governance-nacos/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos; use Hyperf\ServiceGovernanceNacos\Listener\RegisterDriverListener; diff --git a/src/service-governance-nacos/src/Listener/MainWorkerStartListener.php b/src/service-governance-nacos/src/Listener/MainWorkerStartListener.php index a9cc379ce..44800cf70 100644 --- a/src/service-governance-nacos/src/Listener/MainWorkerStartListener.php +++ b/src/service-governance-nacos/src/Listener/MainWorkerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/service-governance-nacos/src/Listener/OnShutdownListener.php b/src/service-governance-nacos/src/Listener/OnShutdownListener.php index 8626b1d1b..fc3bfe070 100644 --- a/src/service-governance-nacos/src/Listener/OnShutdownListener.php +++ b/src/service-governance-nacos/src/Listener/OnShutdownListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/service-governance-nacos/src/Listener/RegisterDriverListener.php b/src/service-governance-nacos/src/Listener/RegisterDriverListener.php index a0b817a32..c5479ad44 100644 --- a/src/service-governance-nacos/src/Listener/RegisterDriverListener.php +++ b/src/service-governance-nacos/src/Listener/RegisterDriverListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/service-governance-nacos/src/NacosDriver.php b/src/service-governance-nacos/src/NacosDriver.php index 6549ad958..04e3976db 100644 --- a/src/service-governance-nacos/src/NacosDriver.php +++ b/src/service-governance-nacos/src/NacosDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos; use Hyperf\Codec\Json; diff --git a/src/service-governance-nacos/src/NacosGrpcDriver.php b/src/service-governance-nacos/src/NacosGrpcDriver.php index 76be2bc51..19c00bb00 100644 --- a/src/service-governance-nacos/src/NacosGrpcDriver.php +++ b/src/service-governance-nacos/src/NacosGrpcDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos; use Hyperf\Codec\Json; diff --git a/src/service-governance-nacos/src/Process/InstanceBeatProcess.php b/src/service-governance-nacos/src/Process/InstanceBeatProcess.php index 26207f5bb..8c2859232 100644 --- a/src/service-governance-nacos/src/Process/InstanceBeatProcess.php +++ b/src/service-governance-nacos/src/Process/InstanceBeatProcess.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernanceNacos\Process; use Hyperf\Contract\ConfigInterface; diff --git a/src/service-governance/composer.json b/src/service-governance/composer.json index 782c880c1..cd8a89c54 100644 --- a/src/service-governance/composer.json +++ b/src/service-governance/composer.json @@ -18,7 +18,8 @@ "require": { "php": ">=8.1", "hyperf/contract": "~3.1.0", - "hyperf/support": "~3.1.0" + "hyperf/support": "~3.1.0", + "jetbrains/phpstorm-attributes": "^1.0" }, "suggest": { "hyperf/event": "Required to use RegisterServiceListener.", diff --git a/src/service-governance/src/ConfigProvider.php b/src/service-governance/src/ConfigProvider.php index 34a732fd5..851e5a869 100644 --- a/src/service-governance/src/ConfigProvider.php +++ b/src/service-governance/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance; use Hyperf\Contract\IPReaderInterface; diff --git a/src/service-governance/src/DriverInterface.php b/src/service-governance/src/DriverInterface.php index 73ebf74e3..df49639d5 100644 --- a/src/service-governance/src/DriverInterface.php +++ b/src/service-governance/src/DriverInterface.php @@ -9,32 +9,51 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance; +use JetBrains\PhpStorm\ArrayShape; + interface DriverInterface { /** - * @param $metadata = [ - * 'protocol' => 'default', - * 'nodes' => [], // The nodes before - * ] * @return array = [['host' => '127.0.0.1', 'port' => 9501]] */ - public function getNodes(string $uri, string $name, array $metadata): array; + public function getNodes( + string $uri, + string $name, + #[ArrayShape([ + 'protocol' => 'string', + 'nodes' => [ + [ + 'host' => 'string', + 'port' => 'int', + 'weight' => 'int', + ], + ], + ])] + array $metadata + ): array; public function isLongPolling(): bool; - /** - * @param $metadata = [ - * 'protocol' => 'default', - * ] - */ - public function register(string $name, string $host, int $port, array $metadata): void; + public function register( + string $name, + string $host, + int $port, + #[ArrayShape([ + 'protocol' => 'string', + ])] + array $metadata + ): void; - /** - * @param $metadata = [ - * 'protocol' => 'default', - * ] - */ - public function isRegistered(string $name, string $host, int $port, array $metadata): bool; + public function isRegistered( + string $name, + string $host, + int $port, + #[ArrayShape([ + 'protocol' => 'string', + ])] + array $metadata + ): bool; } diff --git a/src/service-governance/src/DriverManager.php b/src/service-governance/src/DriverManager.php index 8f78e1545..1caefcffb 100644 --- a/src/service-governance/src/DriverManager.php +++ b/src/service-governance/src/DriverManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance; class DriverManager diff --git a/src/service-governance/src/Exception/ComponentRequiredException.php b/src/service-governance/src/Exception/ComponentRequiredException.php index 8601f367a..321f408bb 100644 --- a/src/service-governance/src/Exception/ComponentRequiredException.php +++ b/src/service-governance/src/Exception/ComponentRequiredException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance\Exception; use RuntimeException; diff --git a/src/service-governance/src/Exception/RegisterInstanceException.php b/src/service-governance/src/Exception/RegisterInstanceException.php index 4a787c774..2cc07e16f 100644 --- a/src/service-governance/src/Exception/RegisterInstanceException.php +++ b/src/service-governance/src/Exception/RegisterInstanceException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance\Exception; use RuntimeException; diff --git a/src/service-governance/src/Listener/RegisterServiceListener.php b/src/service-governance/src/Listener/RegisterServiceListener.php index 31741a627..6ca5f1291 100644 --- a/src/service-governance/src/Listener/RegisterServiceListener.php +++ b/src/service-governance/src/Listener/RegisterServiceListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance\Listener; use Exception; diff --git a/src/service-governance/src/ServiceManager.php b/src/service-governance/src/ServiceManager.php index e204450dc..9a61f3fa6 100644 --- a/src/service-governance/src/ServiceManager.php +++ b/src/service-governance/src/ServiceManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ServiceGovernance; class ServiceManager diff --git a/src/service-governance/tests/Listener/RegisterServiceListenerTest.php b/src/service-governance/tests/Listener/RegisterServiceListenerTest.php index 02482fd30..46bfe0976 100644 --- a/src/service-governance/tests/Listener/RegisterServiceListenerTest.php +++ b/src/service-governance/tests/Listener/RegisterServiceListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ServiceGovernance\Listener; use GuzzleHttp\Psr7\Response; diff --git a/src/service-governance/tests/ServiceManagerTest.php b/src/service-governance/tests/ServiceManagerTest.php index 47b56daa8..167cf0c02 100644 --- a/src/service-governance/tests/ServiceManagerTest.php +++ b/src/service-governance/tests/ServiceManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ServiceGovernance; use Hyperf\ServiceGovernance\ServiceManager; diff --git a/src/session/src/ConfigProvider.php b/src/session/src/ConfigProvider.php index 50922e261..10264c13d 100644 --- a/src/session/src/ConfigProvider.php +++ b/src/session/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session; use Hyperf\Contract\SessionInterface; diff --git a/src/session/src/FlashTrait.php b/src/session/src/FlashTrait.php index 0f284b01a..b099ff527 100644 --- a/src/session/src/FlashTrait.php +++ b/src/session/src/FlashTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session; trait FlashTrait diff --git a/src/session/src/Handler/DatabaseHandler.php b/src/session/src/Handler/DatabaseHandler.php index a1e524385..e499530ba 100644 --- a/src/session/src/Handler/DatabaseHandler.php +++ b/src/session/src/Handler/DatabaseHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use Carbon\Carbon; @@ -36,7 +37,7 @@ class DatabaseHandler implements SessionHandlerInterface return true; } - public function read($id): string|false + public function read($id): false|string { $session = (object) $this->getQuery()->find($id); @@ -72,7 +73,7 @@ class DatabaseHandler implements SessionHandlerInterface return true; } - public function gc(int $max_lifetime): int|false + public function gc(int $max_lifetime): false|int { return $this->getQuery() ->where('last_activity', '<=', $this->currentTime() - $max_lifetime) diff --git a/src/session/src/Handler/DatabaseHandlerFactory.php b/src/session/src/Handler/DatabaseHandlerFactory.php index 132774a56..46ad13837 100644 --- a/src/session/src/Handler/DatabaseHandlerFactory.php +++ b/src/session/src/Handler/DatabaseHandlerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use Hyperf\Contract\ConfigInterface; diff --git a/src/session/src/Handler/FileHandler.php b/src/session/src/Handler/FileHandler.php index 9d54d51c7..0f4e33040 100644 --- a/src/session/src/Handler/FileHandler.php +++ b/src/session/src/Handler/FileHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use Carbon\Carbon; @@ -57,7 +58,7 @@ class FileHandler implements SessionHandlerInterface * * @see https://php.net/manual/en/sessionhandlerinterface.gc.php */ - public function gc(int $max_lifetime): int|false + public function gc(int $max_lifetime): false|int { $files = Finder::create() ->in($this->path) @@ -93,7 +94,7 @@ class FileHandler implements SessionHandlerInterface * @param string $id the session id to read data for * @return string */ - public function read(string $id): string|false + public function read(string $id): false|string { if ($this->files->isFile($path = $this->path . '/' . $id)) { if ($this->files->lastModified($path) >= Carbon::now()->subMinutes($this->minutes)->getTimestamp()) { diff --git a/src/session/src/Handler/FileHandlerFactory.php b/src/session/src/Handler/FileHandlerFactory.php index b5cd68bdb..3a3c0505a 100644 --- a/src/session/src/Handler/FileHandlerFactory.php +++ b/src/session/src/Handler/FileHandlerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use Hyperf\Contract\ConfigInterface; diff --git a/src/session/src/Handler/NullHandler.php b/src/session/src/Handler/NullHandler.php index 644d08d74..0623dcc0c 100644 --- a/src/session/src/Handler/NullHandler.php +++ b/src/session/src/Handler/NullHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use SessionHandlerInterface; @@ -41,7 +42,7 @@ class NullHandler implements SessionHandlerInterface * * @see https://php.net/manual/en/sessionhandlerinterface.gc.php */ - public function gc(int $max_lifetime): int|false + public function gc(int $max_lifetime): false|int { return 0; } @@ -65,7 +66,7 @@ class NullHandler implements SessionHandlerInterface * @param string $id the session id to read data for * @return string */ - public function read(string $id): string|false + public function read(string $id): false|string { return ''; } diff --git a/src/session/src/Handler/RedisHandler.php b/src/session/src/Handler/RedisHandler.php index b3bae6b52..37df69332 100644 --- a/src/session/src/Handler/RedisHandler.php +++ b/src/session/src/Handler/RedisHandler.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use Hyperf\Redis\Redis as RedisProxy; use InvalidArgumentException; +use Predis\Client; use Redis; use RedisArray; use RedisCluster; @@ -25,13 +27,13 @@ use function is_object; class RedisHandler implements SessionHandlerInterface { /** - * @var \Hyperf\Redis\Redis|\Predis\Client|Redis|RedisArray|RedisCluster + * @var Client|Redis|RedisArray|RedisCluster|RedisProxy */ protected $redis; public function __construct($redis, protected int $gcMaxLifeTime = 1200) { - if (! $redis instanceof Redis && ! $redis instanceof RedisArray && ! $redis instanceof RedisCluster && ! $redis instanceof \Predis\Client && ! $redis instanceof RedisProxy) { + if (! $redis instanceof Redis && ! $redis instanceof RedisArray && ! $redis instanceof RedisCluster && ! $redis instanceof Client && ! $redis instanceof RedisProxy) { throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster, Predis\Client or Hyperf\Redis\Redis, %s given', __METHOD__, is_object($redis) ? get_class($redis) : gettype($redis))); } @@ -65,7 +67,7 @@ class RedisHandler implements SessionHandlerInterface * * @see https://php.net/manual/en/sessionhandlerinterface.gc.php */ - public function gc(int $max_lifetime): int|false + public function gc(int $max_lifetime): false|int { return 0; } @@ -89,7 +91,7 @@ class RedisHandler implements SessionHandlerInterface * @param string $id the session id to read data for * @return string */ - public function read(string $id): string|false + public function read(string $id): false|string { return $this->redis->get($id) ?: ''; } diff --git a/src/session/src/Handler/RedisHandlerFactory.php b/src/session/src/Handler/RedisHandlerFactory.php index 6d7d5aa48..51d6b12d5 100644 --- a/src/session/src/Handler/RedisHandlerFactory.php +++ b/src/session/src/Handler/RedisHandlerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Handler; use Hyperf\Contract\ConfigInterface; diff --git a/src/session/src/Middleware/SessionMiddleware.php b/src/session/src/Middleware/SessionMiddleware.php index 0fc727fc3..d3e5f2e49 100644 --- a/src/session/src/Middleware/SessionMiddleware.php +++ b/src/session/src/Middleware/SessionMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session\Middleware; use Carbon\Carbon; diff --git a/src/session/src/Session.php b/src/session/src/Session.php index 2449860a8..a45e480a8 100644 --- a/src/session/src/Session.php +++ b/src/session/src/Session.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session; use Hyperf\Collection\Arr; diff --git a/src/session/src/SessionManager.php b/src/session/src/SessionManager.php index 3162bbc6f..a202b0b5d 100644 --- a/src/session/src/SessionManager.php +++ b/src/session/src/SessionManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session; use Hyperf\Context\Context; diff --git a/src/session/src/SessionProxy.php b/src/session/src/SessionProxy.php index 03ced45f5..2fdd025a5 100644 --- a/src/session/src/SessionProxy.php +++ b/src/session/src/SessionProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Session; use Hyperf\Context\Context; diff --git a/src/session/tests/ConfigProviderTest.php b/src/session/tests/ConfigProviderTest.php index 85619afe3..a9a5eb14e 100644 --- a/src/session/tests/ConfigProviderTest.php +++ b/src/session/tests/ConfigProviderTest.php @@ -9,16 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session; use Hyperf\Session\ConfigProvider; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Session\ConfigProvider::class)] +#[CoversClass(ConfigProvider::class)] class ConfigProviderTest extends TestCase { public function testConfigProvider() diff --git a/src/session/tests/FileHandlerTest.php b/src/session/tests/FileHandlerTest.php index f75e7ad26..02608dd39 100644 --- a/src/session/tests/FileHandlerTest.php +++ b/src/session/tests/FileHandlerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session; use Hyperf\Engine\Channel; diff --git a/src/session/tests/SessionManagerTest.php b/src/session/tests/SessionManagerTest.php index 6df54efcf..7499e7043 100644 --- a/src/session/tests/SessionManagerTest.php +++ b/src/session/tests/SessionManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session; use Hyperf\Contract\ConfigInterface; @@ -18,6 +19,7 @@ use Hyperf\Session\SessionManager; use Hyperf\Stringable\Str; use HyperfTest\Session\Stub\MockStub; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use ReflectionClass; @@ -26,7 +28,7 @@ use ReflectionClass; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Session\SessionManager::class)] +#[CoversClass(SessionManager::class)] /** * @internal * @coversNothing diff --git a/src/session/tests/SessionMiddlewareTest.php b/src/session/tests/SessionMiddlewareTest.php index aa5cddea0..c547e13c6 100644 --- a/src/session/tests/SessionMiddlewareTest.php +++ b/src/session/tests/SessionMiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session; use Carbon\Carbon; @@ -28,6 +29,7 @@ use Hyperf\Stringable\Str; use Hyperf\Support\Filesystem\Filesystem; use HyperfTest\Session\Stub\FooHandler; use Mockery; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; @@ -39,8 +41,8 @@ use SessionHandlerInterface; * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Session\Middleware\SessionMiddleware::class)] -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Session\SessionManager::class)] +#[CoversClass(SessionMiddleware::class)] +#[CoversClass(SessionManager::class)] /** * @internal * @coversNothing diff --git a/src/session/tests/SessionTest.php b/src/session/tests/SessionTest.php index aa8013f6d..aaa7e756e 100644 --- a/src/session/tests/SessionTest.php +++ b/src/session/tests/SessionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session; use Hyperf\Session\Handler\FileHandler; @@ -16,13 +17,14 @@ use Hyperf\Session\Handler\NullHandler; use Hyperf\Session\Session; use Hyperf\Stringable\Str; use Hyperf\Support\Filesystem\Filesystem; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Session\Session::class)] +#[CoversClass(Session::class)] class SessionTest extends TestCase { public function testSession() diff --git a/src/session/tests/Stub/FooHandler.php b/src/session/tests/Stub/FooHandler.php index fbc3867fd..5d0dc7b47 100644 --- a/src/session/tests/Stub/FooHandler.php +++ b/src/session/tests/Stub/FooHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session\Stub; use SessionHandlerInterface; @@ -34,7 +35,6 @@ class FooHandler implements SessionHandlerInterface * Destroy a session. * * @see https://php.net/manual/en/sessionhandlerinterface.destroy.php - * @param string $session_id the session ID being destroyed * @return bool

* The return value (usually TRUE on success, FALSE on failure). * Note this value is returned internally to PHP for processing. @@ -50,17 +50,13 @@ class FooHandler implements SessionHandlerInterface * Cleanup old sessions. * * @see https://php.net/manual/en/sessionhandlerinterface.gc.php - * @param int $maxlifetime

- * Sessions that have not updated for - * the last maxlifetime seconds will be removed. - *

* @return bool

* The return value (usually TRUE on success, FALSE on failure). * Note this value is returned internally to PHP for processing. *

* @since 5.4.0 */ - public function gc(int $max_lifetime): int|false + public function gc(int $max_lifetime): false|int { return 0; } @@ -69,7 +65,6 @@ class FooHandler implements SessionHandlerInterface * Initialize session. * * @see https://php.net/manual/en/sessionhandlerinterface.open.php - * @param string $save_path the path where to store/retrieve the session * @param string $name the session name * @return bool

* The return value (usually TRUE on success, FALSE on failure). @@ -86,7 +81,6 @@ class FooHandler implements SessionHandlerInterface * Read session data. * * @see https://php.net/manual/en/sessionhandlerinterface.read.php - * @param string $session_id the session id to read data for * @return string

* Returns an encoded string of the read data. * If nothing was read, it must return an empty string. @@ -94,7 +88,7 @@ class FooHandler implements SessionHandlerInterface *

* @since 5.4.0 */ - public function read(string $id): string|false + public function read(string $id): false|string { return ''; } @@ -103,14 +97,6 @@ class FooHandler implements SessionHandlerInterface * Write session data. * * @see https://php.net/manual/en/sessionhandlerinterface.write.php - * @param string $session_id the session id - * @param string $session_data

- * The encoded session data. This data is the - * result of the PHP internally encoding - * the $_SESSION superglobal to a serialized - * string and passing it as this parameter. - * Please note sessions use an alternative serialization method. - *

* @return bool

* The return value (usually TRUE on success, FALSE on failure). * Note this value is returned internally to PHP for processing. diff --git a/src/session/tests/Stub/MockStub.php b/src/session/tests/Stub/MockStub.php index e5fb553e3..e2a55b27d 100644 --- a/src/session/tests/Stub/MockStub.php +++ b/src/session/tests/Stub/MockStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session\Stub; use Hyperf\Config\Config; diff --git a/src/session/tests/Stub/NonSessionHandler.php b/src/session/tests/Stub/NonSessionHandler.php index 319e47fb8..264f439f5 100644 --- a/src/session/tests/Stub/NonSessionHandler.php +++ b/src/session/tests/Stub/NonSessionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Session\Stub; class NonSessionHandler diff --git a/src/signal/src/Annotation/Signal.php b/src/signal/src/Annotation/Signal.php index f3d7b387c..b40cf951e 100644 --- a/src/signal/src/Annotation/Signal.php +++ b/src/signal/src/Annotation/Signal.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal\Annotation; use Attribute; diff --git a/src/signal/src/ConfigProvider.php b/src/signal/src/ConfigProvider.php index 05d91865f..02ab300dc 100644 --- a/src/signal/src/ConfigProvider.php +++ b/src/signal/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal; use Hyperf\Signal\Listener\SignalDeregisterListener; diff --git a/src/signal/src/Handler/CoroutineServerStopHandler.php b/src/signal/src/Handler/CoroutineServerStopHandler.php index 560186134..4485d9a86 100644 --- a/src/signal/src/Handler/CoroutineServerStopHandler.php +++ b/src/signal/src/Handler/CoroutineServerStopHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal\Handler; use Hyperf\Contract\ConfigInterface; diff --git a/src/signal/src/Handler/WorkerStopHandler.php b/src/signal/src/Handler/WorkerStopHandler.php index fad31f929..7f19f1ed6 100644 --- a/src/signal/src/Handler/WorkerStopHandler.php +++ b/src/signal/src/Handler/WorkerStopHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal\Handler; use Hyperf\Contract\ConfigInterface; diff --git a/src/signal/src/Listener/SignalDeregisterListener.php b/src/signal/src/Listener/SignalDeregisterListener.php index b3a87a9e0..c369bb23f 100644 --- a/src/signal/src/Listener/SignalDeregisterListener.php +++ b/src/signal/src/Listener/SignalDeregisterListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/signal/src/Listener/SignalRegisterListener.php b/src/signal/src/Listener/SignalRegisterListener.php index 202ae8d30..39132d206 100644 --- a/src/signal/src/Listener/SignalRegisterListener.php +++ b/src/signal/src/Listener/SignalRegisterListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/signal/src/SignalHandlerInterface.php b/src/signal/src/SignalHandlerInterface.php index ca6cc00b0..44c429d02 100644 --- a/src/signal/src/SignalHandlerInterface.php +++ b/src/signal/src/SignalHandlerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal; interface SignalHandlerInterface diff --git a/src/signal/src/SignalManager.php b/src/signal/src/SignalManager.php index 8a7e69340..e6bcf8562 100644 --- a/src/signal/src/SignalManager.php +++ b/src/signal/src/SignalManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Signal; use Hyperf\Contract\ConfigInterface; @@ -39,7 +40,7 @@ class SignalManager public function init() { foreach ($this->getQueue() as $class) { - /** @var SignalHandlerInterface $handler */ + /** @var SignalHandler $handler */ $handler = $this->container->get($class); foreach ($handler->listen() as [$process, $signal]) { if ($process & SignalHandler::WORKER) { diff --git a/src/signal/tests/SignalManagerTest.php b/src/signal/tests/SignalManagerTest.php index 17669ab5e..32db1a3d6 100644 --- a/src/signal/tests/SignalManagerTest.php +++ b/src/signal/tests/SignalManagerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Signal; use Hyperf\Config\Config; diff --git a/src/signal/tests/Stub/SignalHandler2Stub.php b/src/signal/tests/Stub/SignalHandler2Stub.php index 9bb3bd584..ce5472708 100644 --- a/src/signal/tests/Stub/SignalHandler2Stub.php +++ b/src/signal/tests/Stub/SignalHandler2Stub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Signal\Stub; use Hyperf\Context\Context; diff --git a/src/signal/tests/Stub/SignalHandlerStub.php b/src/signal/tests/Stub/SignalHandlerStub.php index 12c52e063..fffb04f97 100644 --- a/src/signal/tests/Stub/SignalHandlerStub.php +++ b/src/signal/tests/Stub/SignalHandlerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Signal\Stub; use Hyperf\Context\Context; diff --git a/src/snowflake/src/Concern/Snowflake.php b/src/snowflake/src/Concern/Snowflake.php index 1bf04dddb..460c4500a 100644 --- a/src/snowflake/src/Concern/Snowflake.php +++ b/src/snowflake/src/Concern/Snowflake.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\Concern; use Hyperf\Context\ApplicationContext; diff --git a/src/snowflake/src/ConfigProvider.php b/src/snowflake/src/ConfigProvider.php index 089f938f3..9fc7f80af 100644 --- a/src/snowflake/src/ConfigProvider.php +++ b/src/snowflake/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; use Hyperf\Snowflake\IdGenerator\SnowflakeIdGenerator; diff --git a/src/snowflake/src/Configuration.php b/src/snowflake/src/Configuration.php index 892e0f23a..6a53c33f7 100644 --- a/src/snowflake/src/Configuration.php +++ b/src/snowflake/src/Configuration.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; class Configuration implements ConfigurationInterface diff --git a/src/snowflake/src/ConfigurationInterface.php b/src/snowflake/src/ConfigurationInterface.php index 686c07146..70e3316b4 100644 --- a/src/snowflake/src/ConfigurationInterface.php +++ b/src/snowflake/src/ConfigurationInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; interface ConfigurationInterface diff --git a/src/snowflake/src/Exception/SnowflakeException.php b/src/snowflake/src/Exception/SnowflakeException.php index 76d3188c7..d8f15b716 100644 --- a/src/snowflake/src/Exception/SnowflakeException.php +++ b/src/snowflake/src/Exception/SnowflakeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\Exception; use RuntimeException; diff --git a/src/snowflake/src/IdGenerator.php b/src/snowflake/src/IdGenerator.php index d4ac25638..d04ce63ec 100644 --- a/src/snowflake/src/IdGenerator.php +++ b/src/snowflake/src/IdGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; abstract class IdGenerator implements IdGeneratorInterface diff --git a/src/snowflake/src/IdGenerator/SnowflakeIdGenerator.php b/src/snowflake/src/IdGenerator/SnowflakeIdGenerator.php index 1a6dc9b02..b3c567fca 100644 --- a/src/snowflake/src/IdGenerator/SnowflakeIdGenerator.php +++ b/src/snowflake/src/IdGenerator/SnowflakeIdGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\IdGenerator; use Hyperf\Snowflake\IdGenerator; diff --git a/src/snowflake/src/IdGeneratorInterface.php b/src/snowflake/src/IdGeneratorInterface.php index 4a4fc9f03..2e93aa40e 100644 --- a/src/snowflake/src/IdGeneratorInterface.php +++ b/src/snowflake/src/IdGeneratorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; interface IdGeneratorInterface extends \Hyperf\Contract\IdGeneratorInterface diff --git a/src/snowflake/src/Meta.php b/src/snowflake/src/Meta.php index f8ed7fa58..b273538d6 100644 --- a/src/snowflake/src/Meta.php +++ b/src/snowflake/src/Meta.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; class Meta diff --git a/src/snowflake/src/MetaGenerator.php b/src/snowflake/src/MetaGenerator.php index 8a08327a8..6c1c5d823 100644 --- a/src/snowflake/src/MetaGenerator.php +++ b/src/snowflake/src/MetaGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; use Hyperf\Snowflake\Exception\SnowflakeException; diff --git a/src/snowflake/src/MetaGenerator/RandomMilliSecondMetaGenerator.php b/src/snowflake/src/MetaGenerator/RandomMilliSecondMetaGenerator.php index 91e0fc3c6..29c63cacc 100644 --- a/src/snowflake/src/MetaGenerator/RandomMilliSecondMetaGenerator.php +++ b/src/snowflake/src/MetaGenerator/RandomMilliSecondMetaGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\MetaGenerator; use Hyperf\Snowflake\ConfigurationInterface; diff --git a/src/snowflake/src/MetaGenerator/RedisMetaGenerator.php b/src/snowflake/src/MetaGenerator/RedisMetaGenerator.php index 63ba32c05..ed8d0eef8 100644 --- a/src/snowflake/src/MetaGenerator/RedisMetaGenerator.php +++ b/src/snowflake/src/MetaGenerator/RedisMetaGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\MetaGenerator; use Hyperf\Contract\ConfigInterface; diff --git a/src/snowflake/src/MetaGenerator/RedisMilliSecondMetaGenerator.php b/src/snowflake/src/MetaGenerator/RedisMilliSecondMetaGenerator.php index 024b00283..822488ffe 100644 --- a/src/snowflake/src/MetaGenerator/RedisMilliSecondMetaGenerator.php +++ b/src/snowflake/src/MetaGenerator/RedisMilliSecondMetaGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\MetaGenerator; use Hyperf\Contract\ConfigInterface; diff --git a/src/snowflake/src/MetaGenerator/RedisSecondMetaGenerator.php b/src/snowflake/src/MetaGenerator/RedisSecondMetaGenerator.php index 83a0d8f02..cfa0d5551 100644 --- a/src/snowflake/src/MetaGenerator/RedisSecondMetaGenerator.php +++ b/src/snowflake/src/MetaGenerator/RedisSecondMetaGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake\MetaGenerator; use Hyperf\Contract\ConfigInterface; diff --git a/src/snowflake/src/MetaGeneratorFactory.php b/src/snowflake/src/MetaGeneratorFactory.php index 9f76231d1..54c43390a 100644 --- a/src/snowflake/src/MetaGeneratorFactory.php +++ b/src/snowflake/src/MetaGeneratorFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; use Hyperf\Contract\ConfigInterface; diff --git a/src/snowflake/src/MetaGeneratorInterface.php b/src/snowflake/src/MetaGeneratorInterface.php index 9f33e0964..82fec2e79 100644 --- a/src/snowflake/src/MetaGeneratorInterface.php +++ b/src/snowflake/src/MetaGeneratorInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Snowflake; interface MetaGeneratorInterface diff --git a/src/snowflake/tests/MetaGeneratorTest.php b/src/snowflake/tests/MetaGeneratorTest.php index da5843760..087a4c1ca 100644 --- a/src/snowflake/tests/MetaGeneratorTest.php +++ b/src/snowflake/tests/MetaGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Snowflake; use Hyperf\Snowflake\Configuration; diff --git a/src/snowflake/tests/RedisMetaGeneratorTest.php b/src/snowflake/tests/RedisMetaGeneratorTest.php index fd54b52cf..f936bb458 100644 --- a/src/snowflake/tests/RedisMetaGeneratorTest.php +++ b/src/snowflake/tests/RedisMetaGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Snowflake; use Hyperf\Config\Config; diff --git a/src/snowflake/tests/SnowflakeGeneratorTest.php b/src/snowflake/tests/SnowflakeGeneratorTest.php index ea2fac95a..fd317d340 100644 --- a/src/snowflake/tests/SnowflakeGeneratorTest.php +++ b/src/snowflake/tests/SnowflakeGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Snowflake; use Hyperf\Snowflake\Configuration; diff --git a/src/snowflake/tests/Stub/UserDefinedIdGenerator.php b/src/snowflake/tests/Stub/UserDefinedIdGenerator.php index da93f7fb3..8d60764a4 100644 --- a/src/snowflake/tests/Stub/UserDefinedIdGenerator.php +++ b/src/snowflake/tests/Stub/UserDefinedIdGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Snowflake\Stub; use Hyperf\Snowflake\IdGenerator; diff --git a/src/socket/src/ConfigProvider.php b/src/socket/src/ConfigProvider.php index 8ad0e7d4a..a2ecff0f6 100644 --- a/src/socket/src/ConfigProvider.php +++ b/src/socket/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Socket; class ConfigProvider diff --git a/src/socket/src/Exception/SocketException.php b/src/socket/src/Exception/SocketException.php index 450d64208..9b9810bc5 100644 --- a/src/socket/src/Exception/SocketException.php +++ b/src/socket/src/Exception/SocketException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Socket\Exception; use RuntimeException; diff --git a/src/socket/src/Socket.php b/src/socket/src/Socket.php index c871c892b..3a990f2da 100644 --- a/src/socket/src/Socket.php +++ b/src/socket/src/Socket.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Socket; use Hyperf\Protocol\ProtocolPackerInterface; diff --git a/src/socket/src/SocketInterface.php b/src/socket/src/SocketInterface.php index 97e5d53d8..cdafdea2a 100644 --- a/src/socket/src/SocketInterface.php +++ b/src/socket/src/SocketInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Socket; interface SocketInterface diff --git a/src/socket/tests/SocketTest.php b/src/socket/tests/SocketTest.php index a48458d07..ac3291b8b 100644 --- a/src/socket/tests/SocketTest.php +++ b/src/socket/tests/SocketTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Socket; use Hyperf\Protocol\Packer\SerializePacker; @@ -16,6 +17,7 @@ use Hyperf\Socket\Socket; use HyperfTest\Socket\Stub\DemoStub; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Swoole\Coroutine\Socket as CoSocket; use Swoole\Process; @@ -65,7 +67,7 @@ class SocketTest extends TestCase $this->assertEquals($demo, $res); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testProcessStreamSocket() { $demo = new DemoStub(); @@ -87,7 +89,7 @@ class SocketTest extends TestCase }); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testProcessDgramSocket() { $demo = new DemoStub(); diff --git a/src/socket/tests/Stub/BigDemoStub.php b/src/socket/tests/Stub/BigDemoStub.php index 5a0988819..9db73d2ee 100644 --- a/src/socket/tests/Stub/BigDemoStub.php +++ b/src/socket/tests/Stub/BigDemoStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Socket\Stub; class BigDemoStub diff --git a/src/socket/tests/Stub/DemoStub.php b/src/socket/tests/Stub/DemoStub.php index 0ad92750d..0d760def6 100644 --- a/src/socket/tests/Stub/DemoStub.php +++ b/src/socket/tests/Stub/DemoStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Socket\Stub; class DemoStub diff --git a/src/socketio-server/src/Annotation/Event.php b/src/socketio-server/src/Annotation/Event.php index ad6486f7d..c985cf3b1 100644 --- a/src/socketio-server/src/Annotation/Event.php +++ b/src/socketio-server/src/Annotation/Event.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Annotation; use Attribute; diff --git a/src/socketio-server/src/Annotation/SocketIONamespace.php b/src/socketio-server/src/Annotation/SocketIONamespace.php index 51ae09f39..256a94156 100644 --- a/src/socketio-server/src/Annotation/SocketIONamespace.php +++ b/src/socketio-server/src/Annotation/SocketIONamespace.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Annotation; use Attribute; diff --git a/src/socketio-server/src/Aspect/SessionAspect.php b/src/socketio-server/src/Aspect/SessionAspect.php index 652bc913c..91100cf59 100644 --- a/src/socketio-server/src/Aspect/SessionAspect.php +++ b/src/socketio-server/src/Aspect/SessionAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Aspect; use Hyperf\Contract\ConfigInterface; diff --git a/src/socketio-server/src/Atomic.php b/src/socketio-server/src/Atomic.php index 8e08b509a..ae5834e0b 100644 --- a/src/socketio-server/src/Atomic.php +++ b/src/socketio-server/src/Atomic.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; use Hyperf\Server\Server; diff --git a/src/socketio-server/src/BaseNamespace.php b/src/socketio-server/src/BaseNamespace.php index 161292486..31ae3a079 100644 --- a/src/socketio-server/src/BaseNamespace.php +++ b/src/socketio-server/src/BaseNamespace.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/src/Collector/EventAnnotationCollector.php b/src/socketio-server/src/Collector/EventAnnotationCollector.php index 4cacdb9ca..bf1184135 100644 --- a/src/socketio-server/src/Collector/EventAnnotationCollector.php +++ b/src/socketio-server/src/Collector/EventAnnotationCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Collector; use Hyperf\Di\MetadataCollector; diff --git a/src/socketio-server/src/Collector/SocketIORouter.php b/src/socketio-server/src/Collector/SocketIORouter.php index f61c12a6e..48444e9a7 100644 --- a/src/socketio-server/src/Collector/SocketIORouter.php +++ b/src/socketio-server/src/Collector/SocketIORouter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Collector; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/src/Command/RemoveRedisGarbage.php b/src/socketio-server/src/Command/RemoveRedisGarbage.php index c3c3351ca..43fba3fba 100644 --- a/src/socketio-server/src/Command/RemoveRedisGarbage.php +++ b/src/socketio-server/src/Command/RemoveRedisGarbage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Command; use Hyperf\Command\Command; diff --git a/src/socketio-server/src/ConfigProvider.php b/src/socketio-server/src/ConfigProvider.php index ebec920b9..bd2415f19 100644 --- a/src/socketio-server/src/ConfigProvider.php +++ b/src/socketio-server/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; use Hyperf\SocketIOServer\Collector\EventAnnotationCollector; diff --git a/src/socketio-server/src/Emitter/Emitter.php b/src/socketio-server/src/Emitter/Emitter.php index ea7d0e633..80a905ab1 100644 --- a/src/socketio-server/src/Emitter/Emitter.php +++ b/src/socketio-server/src/Emitter/Emitter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Emitter; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/src/Emitter/Future.php b/src/socketio-server/src/Emitter/Future.php index e8ed09096..4598de926 100644 --- a/src/socketio-server/src/Emitter/Future.php +++ b/src/socketio-server/src/Emitter/Future.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Emitter; use Hyperf\Engine\Channel; diff --git a/src/socketio-server/src/Exception/ConnectionClosedException.php b/src/socketio-server/src/Exception/ConnectionClosedException.php index 9edfddd05..5b97d1cd0 100644 --- a/src/socketio-server/src/Exception/ConnectionClosedException.php +++ b/src/socketio-server/src/Exception/ConnectionClosedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Exception; use Hyperf\Server\Exception\RuntimeException; diff --git a/src/socketio-server/src/Exception/RouteNotFoundException.php b/src/socketio-server/src/Exception/RouteNotFoundException.php index 87ea7e748..606f8fcc4 100644 --- a/src/socketio-server/src/Exception/RouteNotFoundException.php +++ b/src/socketio-server/src/Exception/RouteNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Exception; use InvalidArgumentException; diff --git a/src/socketio-server/src/Listener/AddRouteListener.php b/src/socketio-server/src/Listener/AddRouteListener.php index 560402e92..66fc64082 100644 --- a/src/socketio-server/src/Listener/AddRouteListener.php +++ b/src/socketio-server/src/Listener/AddRouteListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/socketio-server/src/Listener/ServerIdListener.php b/src/socketio-server/src/Listener/ServerIdListener.php index bd2eed35f..45fe061de 100644 --- a/src/socketio-server/src/Listener/ServerIdListener.php +++ b/src/socketio-server/src/Listener/ServerIdListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/socketio-server/src/Listener/StartSubscriberListener.php b/src/socketio-server/src/Listener/StartSubscriberListener.php index 840eed8bc..1686a2ef5 100644 --- a/src/socketio-server/src/Listener/StartSubscriberListener.php +++ b/src/socketio-server/src/Listener/StartSubscriberListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/socketio-server/src/NamespaceInterface.php b/src/socketio-server/src/NamespaceInterface.php index 7071b1368..31889ea5a 100644 --- a/src/socketio-server/src/NamespaceInterface.php +++ b/src/socketio-server/src/NamespaceInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; use Hyperf\SocketIOServer\Room\AdapterInterface; diff --git a/src/socketio-server/src/Parser/Decoder.php b/src/socketio-server/src/Parser/Decoder.php index a1567b5c5..dc6e1fc85 100644 --- a/src/socketio-server/src/Parser/Decoder.php +++ b/src/socketio-server/src/Parser/Decoder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Parser; use InvalidArgumentException; diff --git a/src/socketio-server/src/Parser/Encoder.php b/src/socketio-server/src/Parser/Encoder.php index ae8d752e5..b391c6fc0 100644 --- a/src/socketio-server/src/Parser/Encoder.php +++ b/src/socketio-server/src/Parser/Encoder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Parser; class Encoder diff --git a/src/socketio-server/src/Parser/Engine.php b/src/socketio-server/src/Parser/Engine.php index af5698fb5..f371dfcd3 100644 --- a/src/socketio-server/src/Parser/Engine.php +++ b/src/socketio-server/src/Parser/Engine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Parser; class Engine diff --git a/src/socketio-server/src/Parser/Packet.php b/src/socketio-server/src/Parser/Packet.php index c563885e7..0d2824bdb 100644 --- a/src/socketio-server/src/Parser/Packet.php +++ b/src/socketio-server/src/Parser/Packet.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Parser; use ArrayAccess; diff --git a/src/socketio-server/src/Room/AdapterInterface.php b/src/socketio-server/src/Room/AdapterInterface.php index 2ccd7eca3..47672678d 100644 --- a/src/socketio-server/src/Room/AdapterInterface.php +++ b/src/socketio-server/src/Room/AdapterInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; interface AdapterInterface diff --git a/src/socketio-server/src/Room/EphemeralInterface.php b/src/socketio-server/src/Room/EphemeralInterface.php index 50026d2e6..4b2bdb5eb 100644 --- a/src/socketio-server/src/Room/EphemeralInterface.php +++ b/src/socketio-server/src/Room/EphemeralInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; interface EphemeralInterface diff --git a/src/socketio-server/src/Room/MemoryAdapter.php b/src/socketio-server/src/Room/MemoryAdapter.php index 82171ea47..b97bf3ef0 100644 --- a/src/socketio-server/src/Room/MemoryAdapter.php +++ b/src/socketio-server/src/Room/MemoryAdapter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; use Hyperf\Engine\WebSocket\Frame; diff --git a/src/socketio-server/src/Room/MemoryRoom.php b/src/socketio-server/src/Room/MemoryRoom.php index b69f883e1..2a9f0867e 100644 --- a/src/socketio-server/src/Room/MemoryRoom.php +++ b/src/socketio-server/src/Room/MemoryRoom.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; class MemoryRoom implements RoomInterface diff --git a/src/socketio-server/src/Room/NullAdapter.php b/src/socketio-server/src/Room/NullAdapter.php index 6823ecee3..2fb74519a 100644 --- a/src/socketio-server/src/Room/NullAdapter.php +++ b/src/socketio-server/src/Room/NullAdapter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; class NullAdapter implements AdapterInterface diff --git a/src/socketio-server/src/Room/RedisAdapter.php b/src/socketio-server/src/Room/RedisAdapter.php index 6851aa493..be4f8980c 100644 --- a/src/socketio-server/src/Room/RedisAdapter.php +++ b/src/socketio-server/src/Room/RedisAdapter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/src/Room/RedisNsqAdapter.php b/src/socketio-server/src/Room/RedisNsqAdapter.php index 6e5b3f8d6..3001347cb 100644 --- a/src/socketio-server/src/Room/RedisNsqAdapter.php +++ b/src/socketio-server/src/Room/RedisNsqAdapter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; use Hyperf\Codec\Json; diff --git a/src/socketio-server/src/Room/RoomInterface.php b/src/socketio-server/src/Room/RoomInterface.php index 14bb9bb08..97833ba3a 100644 --- a/src/socketio-server/src/Room/RoomInterface.php +++ b/src/socketio-server/src/Room/RoomInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\Room; interface RoomInterface diff --git a/src/socketio-server/src/SidProvider/DistributedSidProvider.php b/src/socketio-server/src/SidProvider/DistributedSidProvider.php index dfa2d9250..867ab0dc9 100644 --- a/src/socketio-server/src/SidProvider/DistributedSidProvider.php +++ b/src/socketio-server/src/SidProvider/DistributedSidProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\SidProvider; use Hyperf\SocketIOServer\SocketIO; diff --git a/src/socketio-server/src/SidProvider/LocalSidProvider.php b/src/socketio-server/src/SidProvider/LocalSidProvider.php index 25f6b82e6..eea8fd954 100644 --- a/src/socketio-server/src/SidProvider/LocalSidProvider.php +++ b/src/socketio-server/src/SidProvider/LocalSidProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\SidProvider; class LocalSidProvider implements SidProviderInterface diff --git a/src/socketio-server/src/SidProvider/SessionSidProvider.php b/src/socketio-server/src/SidProvider/SessionSidProvider.php index 24bdbd70f..88bfe9885 100644 --- a/src/socketio-server/src/SidProvider/SessionSidProvider.php +++ b/src/socketio-server/src/SidProvider/SessionSidProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\SidProvider; use Hyperf\Contract\ConfigInterface; diff --git a/src/socketio-server/src/SidProvider/SidProviderInterface.php b/src/socketio-server/src/SidProvider/SidProviderInterface.php index 33b967ca7..1ce9989a9 100644 --- a/src/socketio-server/src/SidProvider/SidProviderInterface.php +++ b/src/socketio-server/src/SidProvider/SidProviderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer\SidProvider; interface SidProviderInterface diff --git a/src/socketio-server/src/Socket.php b/src/socketio-server/src/Socket.php index bc46df422..bd0644bf4 100644 --- a/src/socketio-server/src/Socket.php +++ b/src/socketio-server/src/Socket.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; use Hyperf\SocketIOServer\Emitter\Emitter; diff --git a/src/socketio-server/src/SocketIO.php b/src/socketio-server/src/SocketIO.php index b51e5a559..0054c1a22 100644 --- a/src/socketio-server/src/SocketIO.php +++ b/src/socketio-server/src/SocketIO.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; use Closure; diff --git a/src/socketio-server/src/SocketIOConfig.php b/src/socketio-server/src/SocketIOConfig.php index 75b86a7d5..53738024e 100644 --- a/src/socketio-server/src/SocketIOConfig.php +++ b/src/socketio-server/src/SocketIOConfig.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SocketIOServer; class SocketIOConfig diff --git a/src/socketio-server/tests/Cases/AbstractTestCase.php b/src/socketio-server/tests/Cases/AbstractTestCase.php index 53c08c281..2c5ad22d2 100644 --- a/src/socketio-server/tests/Cases/AbstractTestCase.php +++ b/src/socketio-server/tests/Cases/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\Config\Config; diff --git a/src/socketio-server/tests/Cases/DecoderTest.php b/src/socketio-server/tests/Cases/DecoderTest.php index 11bd9a9f0..6cd53ef7b 100644 --- a/src/socketio-server/tests/Cases/DecoderTest.php +++ b/src/socketio-server/tests/Cases/DecoderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\SocketIOServer\Parser\Decoder; diff --git a/src/socketio-server/tests/Cases/EncoderTest.php b/src/socketio-server/tests/Cases/EncoderTest.php index b43a2c90b..51bddb7ea 100644 --- a/src/socketio-server/tests/Cases/EncoderTest.php +++ b/src/socketio-server/tests/Cases/EncoderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\SocketIOServer\Parser\Encoder; diff --git a/src/socketio-server/tests/Cases/FutureTest.php b/src/socketio-server/tests/Cases/FutureTest.php index c0a78a5be..10ba4fe03 100644 --- a/src/socketio-server/tests/Cases/FutureTest.php +++ b/src/socketio-server/tests/Cases/FutureTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/tests/Cases/IONamespaceTest.php b/src/socketio-server/tests/Cases/IONamespaceTest.php index 8580bb51a..6f0ca14af 100644 --- a/src/socketio-server/tests/Cases/IONamespaceTest.php +++ b/src/socketio-server/tests/Cases/IONamespaceTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/tests/Cases/RoomAdapterTest.php b/src/socketio-server/tests/Cases/RoomAdapterTest.php index f347a73df..41311d7df 100644 --- a/src/socketio-server/tests/Cases/RoomAdapterTest.php +++ b/src/socketio-server/tests/Cases/RoomAdapterTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\Config\Config; diff --git a/src/socketio-server/tests/Cases/SocketTest.php b/src/socketio-server/tests/Cases/SocketTest.php index 309c39601..a53498a2d 100644 --- a/src/socketio-server/tests/Cases/SocketTest.php +++ b/src/socketio-server/tests/Cases/SocketTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/socketio-server/tests/Stub/EphemeralAdapter.php b/src/socketio-server/tests/Stub/EphemeralAdapter.php index 5f75763fb..cb673152b 100644 --- a/src/socketio-server/tests/Stub/EphemeralAdapter.php +++ b/src/socketio-server/tests/Stub/EphemeralAdapter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SocketIOServer\Stub; use Hyperf\SocketIOServer\Room\EphemeralInterface; diff --git a/src/stdlib/src/SplPriorityQueue.php b/src/stdlib/src/SplPriorityQueue.php index 1b7755c74..ff0fc9320 100644 --- a/src/stdlib/src/SplPriorityQueue.php +++ b/src/stdlib/src/SplPriorityQueue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Stdlib; use const PHP_INT_MAX; diff --git a/src/stdlib/tests/SplPriorityQueueTest.php b/src/stdlib/tests/SplPriorityQueueTest.php index 78f833bd5..3ab8af49f 100644 --- a/src/stdlib/tests/SplPriorityQueueTest.php +++ b/src/stdlib/tests/SplPriorityQueueTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Stdlib; use Hyperf\Stdlib\SplPriorityQueue; diff --git a/src/stringable/src/Functions.php b/src/stringable/src/Functions.php index 06c15bcad..aefbc0dce 100644 --- a/src/stringable/src/Functions.php +++ b/src/stringable/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Stringable; /** diff --git a/src/stringable/src/Pluralizer.php b/src/stringable/src/Pluralizer.php index e717d5a34..a757c3500 100644 --- a/src/stringable/src/Pluralizer.php +++ b/src/stringable/src/Pluralizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Stringable; use Doctrine\Inflector\CachedWordInflector; diff --git a/src/stringable/src/Str.php b/src/stringable/src/Str.php index e0cfc7264..44369d2f4 100644 --- a/src/stringable/src/Str.php +++ b/src/stringable/src/Str.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Stringable; use Closure; @@ -1084,7 +1085,7 @@ class Str return implode(array_reverse(mb_str_split($value))); } - public static function squish($value): array|string|null + public static function squish($value): null|array|string { return preg_replace('~(\s|\x{3164}|\x{1160})+~u', ' ', preg_replace('~^[\s\x{FEFF}]+|[\s\x{FEFF}]+$~u', '', $value)); } diff --git a/src/stringable/src/StrCache.php b/src/stringable/src/StrCache.php index 96f41da27..57a956581 100644 --- a/src/stringable/src/StrCache.php +++ b/src/stringable/src/StrCache.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Stringable; class StrCache diff --git a/src/stringable/src/Stringable.php b/src/stringable/src/Stringable.php index 016c133ac..e9ba15d24 100644 --- a/src/stringable/src/Stringable.php +++ b/src/stringable/src/Stringable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Stringable; use ArrayAccess; diff --git a/src/stringable/tests/FunctionsTest.php b/src/stringable/tests/FunctionsTest.php index 25a35cee5..173447701 100644 --- a/src/stringable/tests/FunctionsTest.php +++ b/src/stringable/tests/FunctionsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Stringable; use Hyperf\Stringable\Stringable; diff --git a/src/stringable/tests/StrTest.php b/src/stringable/tests/StrTest.php index f515342c8..b5e414eb4 100644 --- a/src/stringable/tests/StrTest.php +++ b/src/stringable/tests/StrTest.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Stringable; use Hyperf\Stringable\Str; use Hyperf\Stringable\StrCache; use InvalidArgumentException; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Ramsey\Uuid\UuidInterface; @@ -322,19 +324,13 @@ class StrTest extends TestCase $this->assertSame('Hello-World', StrCache::studly('hello world', '-')); } - /** - * @param mixed $validUrl - */ - #[\PHPUnit\Framework\Attributes\DataProvider('validUrls')] + #[DataProvider('validUrls')] public function testValidUrls($url) { $this->assertTrue(Str::isUrl($url)); } - /** - * @param mixed $invalidUrl - */ - #[\PHPUnit\Framework\Attributes\DataProvider('invalidUrls')] + #[DataProvider('invalidUrls')] public function testInvalidUrls($url) { $this->assertFalse(Str::isUrl($url)); diff --git a/src/stringable/tests/StringableTest.php b/src/stringable/tests/StringableTest.php index 8ef208301..a309d54ca 100644 --- a/src/stringable/tests/StringableTest.php +++ b/src/stringable/tests/StringableTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Stringable; use Hyperf\Stringable\Str; diff --git a/src/super-globals/src/ConfigProvider.php b/src/super-globals/src/ConfigProvider.php index 63c63ccea..8fc75cf3f 100644 --- a/src/super-globals/src/ConfigProvider.php +++ b/src/super-globals/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals; use Hyperf\SuperGlobals\Listener\SuperGlobalsInitializeListener; diff --git a/src/super-globals/src/Exception/ContainerNotFoundException.php b/src/super-globals/src/Exception/ContainerNotFoundException.php index bb5449f88..a604450d5 100644 --- a/src/super-globals/src/Exception/ContainerNotFoundException.php +++ b/src/super-globals/src/Exception/ContainerNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Exception; use RuntimeException; diff --git a/src/super-globals/src/Exception/InvalidOperationException.php b/src/super-globals/src/Exception/InvalidOperationException.php index 50b8064bc..fcd188964 100644 --- a/src/super-globals/src/Exception/InvalidOperationException.php +++ b/src/super-globals/src/Exception/InvalidOperationException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Exception; use RuntimeException; diff --git a/src/super-globals/src/Exception/RequestNotFoundException.php b/src/super-globals/src/Exception/RequestNotFoundException.php index 9062c7e97..47d17a94a 100644 --- a/src/super-globals/src/Exception/RequestNotFoundException.php +++ b/src/super-globals/src/Exception/RequestNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Exception; use RuntimeException; diff --git a/src/super-globals/src/Exception/SessionNotFoundException.php b/src/super-globals/src/Exception/SessionNotFoundException.php index e3c8d3893..8cd9fb93a 100644 --- a/src/super-globals/src/Exception/SessionNotFoundException.php +++ b/src/super-globals/src/Exception/SessionNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Exception; use RuntimeException; diff --git a/src/super-globals/src/Listener/SuperGlobalsInitializeListener.php b/src/super-globals/src/Listener/SuperGlobalsInitializeListener.php index 682a3a6ae..d28273169 100644 --- a/src/super-globals/src/Listener/SuperGlobalsInitializeListener.php +++ b/src/super-globals/src/Listener/SuperGlobalsInitializeListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Listener; use Hyperf\Contract\SessionInterface; diff --git a/src/super-globals/src/Proxy.php b/src/super-globals/src/Proxy.php index 76f4e7893..8f2a7da40 100644 --- a/src/super-globals/src/Proxy.php +++ b/src/super-globals/src/Proxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals; use ArrayAccess; diff --git a/src/super-globals/src/Proxy/Cookie.php b/src/super-globals/src/Proxy/Cookie.php index 73862b14b..c4544e942 100644 --- a/src/super-globals/src/Proxy/Cookie.php +++ b/src/super-globals/src/Proxy/Cookie.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\SuperGlobals\Proxy; diff --git a/src/super-globals/src/Proxy/File.php b/src/super-globals/src/Proxy/File.php index 9242b5de6..349a81c3a 100644 --- a/src/super-globals/src/Proxy/File.php +++ b/src/super-globals/src/Proxy/File.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\SuperGlobals\Proxy; diff --git a/src/super-globals/src/Proxy/Get.php b/src/super-globals/src/Proxy/Get.php index 2ff14f57a..73c01eedc 100644 --- a/src/super-globals/src/Proxy/Get.php +++ b/src/super-globals/src/Proxy/Get.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\SuperGlobals\Proxy; diff --git a/src/super-globals/src/Proxy/Post.php b/src/super-globals/src/Proxy/Post.php index 6e3e8b0fd..1bfc40228 100644 --- a/src/super-globals/src/Proxy/Post.php +++ b/src/super-globals/src/Proxy/Post.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\SuperGlobals\Proxy; diff --git a/src/super-globals/src/Proxy/Request.php b/src/super-globals/src/Proxy/Request.php index 09e51e179..381a86227 100644 --- a/src/super-globals/src/Proxy/Request.php +++ b/src/super-globals/src/Proxy/Request.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\HttpServer\Request as HyperfRequest; diff --git a/src/super-globals/src/Proxy/Server.php b/src/super-globals/src/Proxy/Server.php index 078dc20e5..101d936ab 100644 --- a/src/super-globals/src/Proxy/Server.php +++ b/src/super-globals/src/Proxy/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\Stringable\Str; diff --git a/src/super-globals/src/Proxy/Session.php b/src/super-globals/src/Proxy/Session.php index c57f0cc24..33ba57c11 100644 --- a/src/super-globals/src/Proxy/Session.php +++ b/src/super-globals/src/Proxy/Session.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\SuperGlobals\Proxy; use Hyperf\Contract\SessionInterface; diff --git a/src/super-globals/tests/ProxyTest.php b/src/super-globals/tests/ProxyTest.php index 0bf25ab08..0ec028f1e 100644 --- a/src/super-globals/tests/ProxyTest.php +++ b/src/super-globals/tests/ProxyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SuperGlobals; use Hyperf\Context\Context; diff --git a/src/super-globals/tests/Stub/ContainerStub.php b/src/super-globals/tests/Stub/ContainerStub.php index 80187f866..9ed8cdd80 100644 --- a/src/super-globals/tests/Stub/ContainerStub.php +++ b/src/super-globals/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\SuperGlobals\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/support/src/Backoff.php b/src/support/src/Backoff.php index 0b6a4a71d..792095a6d 100644 --- a/src/support/src/Backoff.php +++ b/src/support/src/Backoff.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use InvalidArgumentException; diff --git a/src/support/src/Backoff/ArrayBackoff.php b/src/support/src/Backoff/ArrayBackoff.php index bd73395bd..1ea5f2b2c 100644 --- a/src/support/src/Backoff/ArrayBackoff.php +++ b/src/support/src/Backoff/ArrayBackoff.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Backoff; use Hyperf\Collection\Arr; diff --git a/src/support/src/ClearStatCache.php b/src/support/src/ClearStatCache.php index 291d5c72a..d5c693706 100644 --- a/src/support/src/ClearStatCache.php +++ b/src/support/src/ClearStatCache.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; class ClearStatCache diff --git a/src/support/src/Composer.php b/src/support/src/Composer.php index fc1a95811..3e19fe4b9 100644 --- a/src/support/src/Composer.php +++ b/src/support/src/Composer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Composer\Autoload\ClassLoader; diff --git a/src/support/src/Exception/ExceptionThrower.php b/src/support/src/Exception/ExceptionThrower.php index d31d4e38f..dbc1a24a6 100644 --- a/src/support/src/Exception/ExceptionThrower.php +++ b/src/support/src/Exception/ExceptionThrower.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Exception; use Throwable; diff --git a/src/support/src/Exception/IPReadFailedException.php b/src/support/src/Exception/IPReadFailedException.php index 20e6d0c72..9051ee33d 100644 --- a/src/support/src/Exception/IPReadFailedException.php +++ b/src/support/src/Exception/IPReadFailedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Exception; use RuntimeException; diff --git a/src/support/src/Exception/InvalidArgumentException.php b/src/support/src/Exception/InvalidArgumentException.php index 60c6851d4..827315cf5 100644 --- a/src/support/src/Exception/InvalidArgumentException.php +++ b/src/support/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/support/src/Filesystem/FileNotFoundException.php b/src/support/src/Filesystem/FileNotFoundException.php index c52ef33af..132107a81 100644 --- a/src/support/src/Filesystem/FileNotFoundException.php +++ b/src/support/src/Filesystem/FileNotFoundException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Filesystem; use Exception; diff --git a/src/support/src/Filesystem/Filesystem.php b/src/support/src/Filesystem/Filesystem.php index c06a98419..dcb799475 100644 --- a/src/support/src/Filesystem/Filesystem.php +++ b/src/support/src/Filesystem/Filesystem.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Filesystem; use ErrorException; diff --git a/src/support/src/Fluent.php b/src/support/src/Fluent.php index 33a53c533..79e1e1c7f 100755 --- a/src/support/src/Fluent.php +++ b/src/support/src/Fluent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use ArrayAccess; diff --git a/src/support/src/Functions.php b/src/support/src/Functions.php index ca9780dd4..01e4dfd8a 100644 --- a/src/support/src/Functions.php +++ b/src/support/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Carbon\Carbon; @@ -16,6 +17,7 @@ use Closure; use DateTimeZone; use Hyperf\Collection\Arr; use Hyperf\Context\ApplicationContext; +use Hyperf\Di\Container; use Hyperf\Stringable\StrCache; use Hyperf\Support\Backoff\ArrayBackoff; use Throwable; @@ -198,7 +200,7 @@ function getter(string $property): string function make(string $name, array $parameters = []) { if (ApplicationContext::hasContainer()) { - /** @var \Hyperf\Di\Container $container */ + /** @var Container $container */ $container = ApplicationContext::getContainer(); if (method_exists($container, 'make')) { return $container->make($name, $parameters); diff --git a/src/support/src/IPReader.php b/src/support/src/IPReader.php index 4e6037eff..cbf540846 100644 --- a/src/support/src/IPReader.php +++ b/src/support/src/IPReader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Hyperf\Contract\IPReaderInterface; diff --git a/src/support/src/MessageBag.php b/src/support/src/MessageBag.php index 6a5146aeb..5558bc1f4 100644 --- a/src/support/src/MessageBag.php +++ b/src/support/src/MessageBag.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Countable; diff --git a/src/support/src/MimeTypeExtensionGuesser.php b/src/support/src/MimeTypeExtensionGuesser.php index ae7fa8b00..3a2107a9a 100644 --- a/src/support/src/MimeTypeExtensionGuesser.php +++ b/src/support/src/MimeTypeExtensionGuesser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; class MimeTypeExtensionGuesser diff --git a/src/support/src/Network.php b/src/support/src/Network.php index 8672b0524..52d215501 100644 --- a/src/support/src/Network.php +++ b/src/support/src/Network.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Hyperf\Stringable\Str; diff --git a/src/support/src/Optional.php b/src/support/src/Optional.php index 0bc8ee3bb..6eb38f4ea 100644 --- a/src/support/src/Optional.php +++ b/src/support/src/Optional.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use ArrayAccess; diff --git a/src/support/src/Pluralizer.php b/src/support/src/Pluralizer.php index 8dab76ebe..71cb46299 100644 --- a/src/support/src/Pluralizer.php +++ b/src/support/src/Pluralizer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Doctrine\Inflector\CachedWordInflector; diff --git a/src/support/src/Reflection/ClassInvoker.php b/src/support/src/Reflection/ClassInvoker.php index 8963f92d6..ca9300d1c 100644 --- a/src/support/src/Reflection/ClassInvoker.php +++ b/src/support/src/Reflection/ClassInvoker.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Reflection; use ReflectionClass; diff --git a/src/support/src/ResourceGenerator.php b/src/support/src/ResourceGenerator.php index d6e2f9f03..8e4e17c6e 100644 --- a/src/support/src/ResourceGenerator.php +++ b/src/support/src/ResourceGenerator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; class ResourceGenerator diff --git a/src/support/src/SafeCaller.php b/src/support/src/SafeCaller.php index d51a4ec8d..c63c5533d 100644 --- a/src/support/src/SafeCaller.php +++ b/src/support/src/SafeCaller.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; use Closure; diff --git a/src/support/src/System.php b/src/support/src/System.php index 0a00953e2..90daeb4a6 100644 --- a/src/support/src/System.php +++ b/src/support/src/System.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support; class System diff --git a/src/support/src/Traits/Container.php b/src/support/src/Traits/Container.php index 064e38f1d..619cacc11 100644 --- a/src/support/src/Traits/Container.php +++ b/src/support/src/Traits/Container.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Traits; trait Container diff --git a/src/support/src/Traits/ForwardsCalls.php b/src/support/src/Traits/ForwardsCalls.php index d558e03b4..f09f50ba3 100644 --- a/src/support/src/Traits/ForwardsCalls.php +++ b/src/support/src/Traits/ForwardsCalls.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Traits; use BadMethodCallException; @@ -28,7 +29,7 @@ trait ForwardsCalls { try { return $object->{$method}(...$parameters); - } catch (Error|BadMethodCallException $e) { + } catch (BadMethodCallException|Error $e) { $pattern = '~^Call to undefined method (?P[^:]+)::(?P[^\(]+)\(\)$~'; if (! preg_match($pattern, $e->getMessage(), $matches)) { diff --git a/src/support/src/Traits/InteractsWithTime.php b/src/support/src/Traits/InteractsWithTime.php index d64c85541..6ba876f3c 100644 --- a/src/support/src/Traits/InteractsWithTime.php +++ b/src/support/src/Traits/InteractsWithTime.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Traits; use Carbon\Carbon; diff --git a/src/support/src/Traits/StaticInstance.php b/src/support/src/Traits/StaticInstance.php index 6762fc27b..9634dd61f 100644 --- a/src/support/src/Traits/StaticInstance.php +++ b/src/support/src/Traits/StaticInstance.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Support\Traits; use Hyperf\Context\Context; diff --git a/src/support/tests/BackoffTest.php b/src/support/tests/BackoffTest.php index 4b7ef918b..a78bb8f8a 100644 --- a/src/support/tests/BackoffTest.php +++ b/src/support/tests/BackoffTest.php @@ -9,16 +9,18 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support; use Hyperf\Support\Backoff; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; /** * @internal * @coversNothing */ -#[\PHPUnit\Framework\Attributes\CoversClass(\Hyperf\Support\Backoff::class)] +#[CoversClass(Backoff::class)] class BackoffTest extends TestCase { public function testBackoff() diff --git a/src/support/tests/ComposerTest.php b/src/support/tests/ComposerTest.php index 101df181c..4698d7598 100644 --- a/src/support/tests/ComposerTest.php +++ b/src/support/tests/ComposerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support; use Composer\Autoload\ClassLoader; diff --git a/src/support/tests/Exception/RetryException.php b/src/support/tests/Exception/RetryException.php index d3094837c..fac1aa994 100644 --- a/src/support/tests/Exception/RetryException.php +++ b/src/support/tests/Exception/RetryException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Exception; use Exception; diff --git a/src/support/tests/Filesystem/FilesystemTest.php b/src/support/tests/Filesystem/FilesystemTest.php index 0dd67af86..2b408746b 100644 --- a/src/support/tests/Filesystem/FilesystemTest.php +++ b/src/support/tests/Filesystem/FilesystemTest.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Filesystem; use Hyperf\Coroutine\Parallel; use Hyperf\Engine\Channel; use Hyperf\Support\Filesystem\Filesystem; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Swoole\Runtime; use Throwable; @@ -50,7 +52,7 @@ class FilesystemTest extends TestCase unlink('./test.txt'); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testFopenInCoroutine() { run(function () { @@ -84,7 +86,7 @@ class FilesystemTest extends TestCase $this->assertTrue(true); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testPutLockInCoroutine() { run(function () { diff --git a/src/support/tests/FunctionTest.php b/src/support/tests/FunctionTest.php index 85da16fa2..8aa555b8c 100644 --- a/src/support/tests/FunctionTest.php +++ b/src/support/tests/FunctionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support; use HyperfTest\Support\Exception\RetryException; diff --git a/src/support/tests/NetworkTest.php b/src/support/tests/NetworkTest.php index 475e2f05e..52cbd24d9 100644 --- a/src/support/tests/NetworkTest.php +++ b/src/support/tests/NetworkTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support; use Hyperf\Support\Network; diff --git a/src/support/tests/OptionalTest.php b/src/support/tests/OptionalTest.php index 9060ea6c3..e05dd8310 100644 --- a/src/support/tests/OptionalTest.php +++ b/src/support/tests/OptionalTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support; use ArrayObject; diff --git a/src/support/tests/Reflection/ClassInvokerTest.php b/src/support/tests/Reflection/ClassInvokerTest.php index 5a28bec8c..a9c4f8810 100644 --- a/src/support/tests/Reflection/ClassInvokerTest.php +++ b/src/support/tests/Reflection/ClassInvokerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Reflection; use Hyperf\Support\Reflection\ClassInvoker; diff --git a/src/support/tests/ResourceGeneratorTest.php b/src/support/tests/ResourceGeneratorTest.php index c35694dda..89cbbbc50 100644 --- a/src/support/tests/ResourceGeneratorTest.php +++ b/src/support/tests/ResourceGeneratorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support; use Hyperf\Support\ResourceGenerator; diff --git a/src/support/tests/Stub/Bar.php b/src/support/tests/Stub/Bar.php index cdf520650..9ee3cbba7 100644 --- a/src/support/tests/Stub/Bar.php +++ b/src/support/tests/Stub/Bar.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Stub; use HyperfTest\Support\Stub\Traits\BarTrait; diff --git a/src/support/tests/Stub/Foo.php b/src/support/tests/Stub/Foo.php index 711484833..fa045fe62 100644 --- a/src/support/tests/Stub/Foo.php +++ b/src/support/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Stub; use HyperfTest\Support\Stub\Traits\FooTrait; diff --git a/src/support/tests/Stub/FooClosure.php b/src/support/tests/Stub/FooClosure.php index 5e59a3111..57e46a8bf 100644 --- a/src/support/tests/Stub/FooClosure.php +++ b/src/support/tests/Stub/FooClosure.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Stub; class FooClosure diff --git a/src/support/tests/Stub/Traits/BarTrait.php b/src/support/tests/Stub/Traits/BarTrait.php index b05ccf5a8..72b9f3993 100644 --- a/src/support/tests/Stub/Traits/BarTrait.php +++ b/src/support/tests/Stub/Traits/BarTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Stub\Traits; trait BarTrait diff --git a/src/support/tests/Stub/Traits/FooTrait.php b/src/support/tests/Stub/Traits/FooTrait.php index d777d71c8..db7ff61e7 100644 --- a/src/support/tests/Stub/Traits/FooTrait.php +++ b/src/support/tests/Stub/Traits/FooTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Support\Stub\Traits; trait FooTrait diff --git a/src/swagger/src/Annotation/AdditionalProperties.php b/src/swagger/src/Annotation/AdditionalProperties.php index 0da9996d7..096824ca4 100644 --- a/src/swagger/src/Annotation/AdditionalProperties.php +++ b/src/swagger/src/Annotation/AdditionalProperties.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/AnnotationTrait.php b/src/swagger/src/Annotation/AnnotationTrait.php index 3c99a0954..da4aef55c 100644 --- a/src/swagger/src/Annotation/AnnotationTrait.php +++ b/src/swagger/src/Annotation/AnnotationTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/swagger/src/Annotation/Attachable.php b/src/swagger/src/Annotation/Attachable.php index b850cb03f..d827b1e2b 100644 --- a/src/swagger/src/Annotation/Attachable.php +++ b/src/swagger/src/Annotation/Attachable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Components.php b/src/swagger/src/Annotation/Components.php index db8c885c4..b70612f25 100644 --- a/src/swagger/src/Annotation/Components.php +++ b/src/swagger/src/Annotation/Components.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Contact.php b/src/swagger/src/Annotation/Contact.php index fbe8fca2a..a022e2d02 100644 --- a/src/swagger/src/Annotation/Contact.php +++ b/src/swagger/src/Annotation/Contact.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/CookieParameter.php b/src/swagger/src/Annotation/CookieParameter.php index 2bf7614fc..207ebaca1 100644 --- a/src/swagger/src/Annotation/CookieParameter.php +++ b/src/swagger/src/Annotation/CookieParameter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Delete.php b/src/swagger/src/Annotation/Delete.php index d885c4e31..72c1ec3ec 100644 --- a/src/swagger/src/Annotation/Delete.php +++ b/src/swagger/src/Annotation/Delete.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Discriminator.php b/src/swagger/src/Annotation/Discriminator.php index 7aa30b8c0..cb8ce2d90 100644 --- a/src/swagger/src/Annotation/Discriminator.php +++ b/src/swagger/src/Annotation/Discriminator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Examples.php b/src/swagger/src/Annotation/Examples.php index cc8b7f655..bbc7bbab9 100644 --- a/src/swagger/src/Annotation/Examples.php +++ b/src/swagger/src/Annotation/Examples.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/ExternalDocumentation.php b/src/swagger/src/Annotation/ExternalDocumentation.php index 3db1a633d..5f1e712c1 100644 --- a/src/swagger/src/Annotation/ExternalDocumentation.php +++ b/src/swagger/src/Annotation/ExternalDocumentation.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Flow.php b/src/swagger/src/Annotation/Flow.php index 113a80482..b3cb67591 100644 --- a/src/swagger/src/Annotation/Flow.php +++ b/src/swagger/src/Annotation/Flow.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Get.php b/src/swagger/src/Annotation/Get.php index 74fe4bb76..09f3a1ba4 100644 --- a/src/swagger/src/Annotation/Get.php +++ b/src/swagger/src/Annotation/Get.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Head.php b/src/swagger/src/Annotation/Head.php index ac5f60591..23bfbc1df 100644 --- a/src/swagger/src/Annotation/Head.php +++ b/src/swagger/src/Annotation/Head.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Header.php b/src/swagger/src/Annotation/Header.php index 6c698505d..ffa72c739 100644 --- a/src/swagger/src/Annotation/Header.php +++ b/src/swagger/src/Annotation/Header.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/HeaderParameter.php b/src/swagger/src/Annotation/HeaderParameter.php index b249e6325..8a1d34d1c 100644 --- a/src/swagger/src/Annotation/HeaderParameter.php +++ b/src/swagger/src/Annotation/HeaderParameter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/HyperfServer.php b/src/swagger/src/Annotation/HyperfServer.php index 4022621e8..09ecf48cf 100644 --- a/src/swagger/src/Annotation/HyperfServer.php +++ b/src/swagger/src/Annotation/HyperfServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Info.php b/src/swagger/src/Annotation/Info.php index aeaa08e61..ed5429e55 100644 --- a/src/swagger/src/Annotation/Info.php +++ b/src/swagger/src/Annotation/Info.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Items.php b/src/swagger/src/Annotation/Items.php index 742c94f86..aba116e62 100644 --- a/src/swagger/src/Annotation/Items.php +++ b/src/swagger/src/Annotation/Items.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/JsonContent.php b/src/swagger/src/Annotation/JsonContent.php index 7073a754d..e70f7ec34 100644 --- a/src/swagger/src/Annotation/JsonContent.php +++ b/src/swagger/src/Annotation/JsonContent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/License.php b/src/swagger/src/Annotation/License.php index 9e8ac9e1c..5064b1fa0 100644 --- a/src/swagger/src/Annotation/License.php +++ b/src/swagger/src/Annotation/License.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Link.php b/src/swagger/src/Annotation/Link.php index 5bf300631..3305fdb5a 100644 --- a/src/swagger/src/Annotation/Link.php +++ b/src/swagger/src/Annotation/Link.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/MediaType.php b/src/swagger/src/Annotation/MediaType.php index 7e00e2c84..0f907ba55 100644 --- a/src/swagger/src/Annotation/MediaType.php +++ b/src/swagger/src/Annotation/MediaType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/MultipleAnnotationTrait.php b/src/swagger/src/Annotation/MultipleAnnotationTrait.php index adc95341a..204649e08 100644 --- a/src/swagger/src/Annotation/MultipleAnnotationTrait.php +++ b/src/swagger/src/Annotation/MultipleAnnotationTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Hyperf\Di\Annotation\AnnotationCollector; diff --git a/src/swagger/src/Annotation/OpenApi.php b/src/swagger/src/Annotation/OpenApi.php index 09cb018dc..5e73f8b9c 100644 --- a/src/swagger/src/Annotation/OpenApi.php +++ b/src/swagger/src/Annotation/OpenApi.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Options.php b/src/swagger/src/Annotation/Options.php index cabe9aef6..58f92767e 100644 --- a/src/swagger/src/Annotation/Options.php +++ b/src/swagger/src/Annotation/Options.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Parameter.php b/src/swagger/src/Annotation/Parameter.php index da5917b8d..4e121bd0f 100644 --- a/src/swagger/src/Annotation/Parameter.php +++ b/src/swagger/src/Annotation/Parameter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Patch.php b/src/swagger/src/Annotation/Patch.php index bca244651..5e51aa756 100644 --- a/src/swagger/src/Annotation/Patch.php +++ b/src/swagger/src/Annotation/Patch.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/PathItem.php b/src/swagger/src/Annotation/PathItem.php index 4d772c1e4..2feff9bde 100644 --- a/src/swagger/src/Annotation/PathItem.php +++ b/src/swagger/src/Annotation/PathItem.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/PathParameter.php b/src/swagger/src/Annotation/PathParameter.php index aa83af662..75292114f 100644 --- a/src/swagger/src/Annotation/PathParameter.php +++ b/src/swagger/src/Annotation/PathParameter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Post.php b/src/swagger/src/Annotation/Post.php index 7b476a879..6712d1546 100644 --- a/src/swagger/src/Annotation/Post.php +++ b/src/swagger/src/Annotation/Post.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Property.php b/src/swagger/src/Annotation/Property.php index 446c8b7cf..55ffeec96 100644 --- a/src/swagger/src/Annotation/Property.php +++ b/src/swagger/src/Annotation/Property.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; @@ -24,7 +25,7 @@ class Property extends \OpenApi\Attributes\Property { public function __construct( ?string $property = null, - object|string|null $ref = null, + null|object|string $ref = null, ?string $schema = null, ?string $title = null, ?string $description = null, @@ -47,7 +48,7 @@ class Property extends \OpenApi\Attributes\Property ?int $minItems = null, ?bool $uniqueItems = null, ?string $pattern = null, - array|string|null $enum = null, + null|array|string $enum = null, ?Discriminator $discriminator = null, ?bool $readOnly = null, ?bool $writeOnly = null, @@ -59,7 +60,7 @@ class Property extends \OpenApi\Attributes\Property ?array $allOf = null, ?array $anyOf = null, ?array $oneOf = null, - AdditionalProperties|bool|null $additionalProperties = null, + null|AdditionalProperties|bool $additionalProperties = null, ?array $x = null, ?array $attachables = null, public mixed $rules = null, diff --git a/src/swagger/src/Annotation/Put.php b/src/swagger/src/Annotation/Put.php index bfa50fd46..1fd4e94c1 100644 --- a/src/swagger/src/Annotation/Put.php +++ b/src/swagger/src/Annotation/Put.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/QueryParameter.php b/src/swagger/src/Annotation/QueryParameter.php index 92cc5829b..cab465bc7 100644 --- a/src/swagger/src/Annotation/QueryParameter.php +++ b/src/swagger/src/Annotation/QueryParameter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; @@ -32,11 +33,11 @@ class QueryParameter extends \OpenApi\Attributes\QueryParameter implements Annot ?bool $required = null, ?bool $deprecated = null, ?bool $allowEmptyValue = null, - object|string|null $ref = null, + null|object|string $ref = null, ?Schema $schema = null, mixed $example = Generator::UNDEFINED, ?array $examples = null, - JsonContent|array|Attachable|XmlContent|null $content = null, + null|array|Attachable|JsonContent|XmlContent $content = null, ?string $style = null, ?bool $explode = null, ?bool $allowReserved = null, diff --git a/src/swagger/src/Annotation/RequestBody.php b/src/swagger/src/Annotation/RequestBody.php index 85bdb1917..e2e7ec3ef 100644 --- a/src/swagger/src/Annotation/RequestBody.php +++ b/src/swagger/src/Annotation/RequestBody.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; @@ -25,11 +26,11 @@ class RequestBody extends \OpenApi\Attributes\RequestBody implements AnnotationI public mixed $_content = null; public function __construct( - object|string|null $ref = null, + null|object|string $ref = null, ?string $request = null, ?string $description = null, ?bool $required = null, - JsonContent|array|Attachable|XmlContent|null $content = null, + null|array|Attachable|JsonContent|XmlContent $content = null, ?array $x = null, ?array $attachables = null ) { diff --git a/src/swagger/src/Annotation/Response.php b/src/swagger/src/Annotation/Response.php index 7e9d6e464..3f189bf06 100644 --- a/src/swagger/src/Annotation/Response.php +++ b/src/swagger/src/Annotation/Response.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Schema.php b/src/swagger/src/Annotation/Schema.php index 64bab524a..1242fe945 100644 --- a/src/swagger/src/Annotation/Schema.php +++ b/src/swagger/src/Annotation/Schema.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/SecurityScheme.php b/src/swagger/src/Annotation/SecurityScheme.php index ab5cfba2e..cae20218b 100644 --- a/src/swagger/src/Annotation/SecurityScheme.php +++ b/src/swagger/src/Annotation/SecurityScheme.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Server.php b/src/swagger/src/Annotation/Server.php index 58803bb63..aa5d362fd 100644 --- a/src/swagger/src/Annotation/Server.php +++ b/src/swagger/src/Annotation/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/ServerVariable.php b/src/swagger/src/Annotation/ServerVariable.php index c22402567..a4880c966 100644 --- a/src/swagger/src/Annotation/ServerVariable.php +++ b/src/swagger/src/Annotation/ServerVariable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Tag.php b/src/swagger/src/Annotation/Tag.php index 993b0badc..93b56de8d 100644 --- a/src/swagger/src/Annotation/Tag.php +++ b/src/swagger/src/Annotation/Tag.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Trace.php b/src/swagger/src/Annotation/Trace.php index 1e5d87c4c..d4f6baf47 100644 --- a/src/swagger/src/Annotation/Trace.php +++ b/src/swagger/src/Annotation/Trace.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/Xml.php b/src/swagger/src/Annotation/Xml.php index 958076803..2608add65 100644 --- a/src/swagger/src/Annotation/Xml.php +++ b/src/swagger/src/Annotation/Xml.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Annotation/XmlContent.php b/src/swagger/src/Annotation/XmlContent.php index 19893c670..bff6b4d86 100644 --- a/src/swagger/src/Annotation/XmlContent.php +++ b/src/swagger/src/Annotation/XmlContent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Annotation; use Attribute; diff --git a/src/swagger/src/Command/Ast/ModelSchemaVisitor.php b/src/swagger/src/Command/Ast/ModelSchemaVisitor.php index 52a5f64f6..722ab6fda 100644 --- a/src/swagger/src/Command/Ast/ModelSchemaVisitor.php +++ b/src/swagger/src/Command/Ast/ModelSchemaVisitor.php @@ -9,10 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Command\Ast; +use Hyperf\Database\Connection; use Hyperf\Database\Model\Model; -use Hyperf\Database\Schema\Builder; use Hyperf\Database\Schema\Column; use Hyperf\Stringable\Str; use PhpParser\Node; @@ -28,8 +29,9 @@ class ModelSchemaVisitor extends NodeVisitorAbstract public function __construct(public ReflectionClass $ref, public Model $model) { - /** @var Builder $builder */ - $builder = $this->model->getConnection()->getSchemaBuilder(); + /** @var Connection $connection */ + $connection = $this->model->getConnection(); + $builder = $connection->getSchemaBuilder(); $this->columns = array_filter($builder->getColumns(), function (Column $column) { return $column->getTable() === $this->model->getTable(); diff --git a/src/swagger/src/Command/GenCommand.php b/src/swagger/src/Command/GenCommand.php index 5b39b9664..7eb39d097 100644 --- a/src/swagger/src/Command/GenCommand.php +++ b/src/swagger/src/Command/GenCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Command; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/swagger/src/Command/GenSchemaCommand.php b/src/swagger/src/Command/GenSchemaCommand.php index ebb80d1f3..c613edac4 100644 --- a/src/swagger/src/Command/GenSchemaCommand.php +++ b/src/swagger/src/Command/GenSchemaCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Command; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/swagger/src/ConfigProvider.php b/src/swagger/src/ConfigProvider.php index 33aca99b3..f8a38348a 100644 --- a/src/swagger/src/ConfigProvider.php +++ b/src/swagger/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger; use Hyperf\Swagger\Command\GenCommand; diff --git a/src/swagger/src/Exception/RuntimeException.php b/src/swagger/src/Exception/RuntimeException.php index c3d1deed4..9911658c6 100644 --- a/src/swagger/src/Exception/RuntimeException.php +++ b/src/swagger/src/Exception/RuntimeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Exception; class RuntimeException extends \RuntimeException diff --git a/src/swagger/src/Generator.php b/src/swagger/src/Generator.php index b9be3f71e..d7a59d87b 100644 --- a/src/swagger/src/Generator.php +++ b/src/swagger/src/Generator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger; use Hyperf\Codec\Json; diff --git a/src/swagger/src/HttpServer.php b/src/swagger/src/HttpServer.php index 234eb2d20..c721debf8 100644 --- a/src/swagger/src/HttpServer.php +++ b/src/swagger/src/HttpServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger; use Hyperf\Codec\Json; diff --git a/src/swagger/src/Listener/BootSwaggerListener.php b/src/swagger/src/Listener/BootSwaggerListener.php index e7e3beafa..8c714629a 100644 --- a/src/swagger/src/Listener/BootSwaggerListener.php +++ b/src/swagger/src/Listener/BootSwaggerListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Listener; use Hyperf\Contract\ConfigInterface; diff --git a/src/swagger/src/Processor/BuildPathsProcessor.php b/src/swagger/src/Processor/BuildPathsProcessor.php index af7e4672f..fad07087c 100644 --- a/src/swagger/src/Processor/BuildPathsProcessor.php +++ b/src/swagger/src/Processor/BuildPathsProcessor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Processor; use Hyperf\Di\Annotation\AnnotationCollector; @@ -44,7 +45,7 @@ class BuildPathsProcessor implements ProcessorInterface // Merge @OA\Operations into existing @OA\PathItems or create a new one. foreach ($operations as $operation) { $class = $operation->_context->namespace . '\\' . $operation->_context->class; - /** @var HyperfServer $serverAnnotation */ + /** @var null|HyperfServer $serverAnnotation */ $serverAnnotation = AnnotationCollector::getClassAnnotation($class, HyperfServer::class); if (! $serverAnnotation) { continue; @@ -52,19 +53,17 @@ class BuildPathsProcessor implements ProcessorInterface $path = $serverAnnotation->name . '|' . $operation->path; - if ($path) { - if (empty($paths[$path])) { - $paths[$path] = $pathItem = new OA\PathItem( - [ - 'path' => $path, - '_context' => new Context(['generated' => true], $operation->_context), - ] - ); - $analysis->addAnnotation($pathItem, $pathItem->_context); - } - if ($paths[$path]->merge([$operation])) { - $operation->_context->logger->warning('Unable to merge ' . $operation->identity() . ' in ' . $operation->_context); - } + if (empty($paths[$path])) { + $paths[$path] = $pathItem = new OA\PathItem( + [ + 'path' => $path, + '_context' => new Context(['generated' => true], $operation->_context), + ] + ); + $analysis->addAnnotation($pathItem, $pathItem->_context); + } + if ($paths[$path]->merge([$operation])) { + $operation->_context->logger->warning('Unable to merge ' . $operation->identity() . ' in ' . $operation->_context); } } if ($paths) { diff --git a/src/swagger/src/Request/RuleCollector.php b/src/swagger/src/Request/RuleCollector.php index afe885d2f..1f04588ea 100644 --- a/src/swagger/src/Request/RuleCollector.php +++ b/src/swagger/src/Request/RuleCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Request; /** diff --git a/src/swagger/src/Request/SwaggerRequest.php b/src/swagger/src/Request/SwaggerRequest.php index cc46b67bd..1c56f4946 100644 --- a/src/swagger/src/Request/SwaggerRequest.php +++ b/src/swagger/src/Request/SwaggerRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Request; use Hyperf\Context\RequestContext; @@ -45,7 +46,7 @@ class SwaggerRequest extends FormRequest protected function getCallbackByContext(): array { - /** @var Dispatched $dispatched */ + /** @var null|Dispatched $dispatched */ $dispatched = RequestContext::getOrNull()?->getAttribute(Dispatched::class); if (! $dispatched) { throw new RuntimeException('The request is invalid.'); diff --git a/src/swagger/src/Request/ValidationCollector.php b/src/swagger/src/Request/ValidationCollector.php index 73407afa6..49acf68b6 100644 --- a/src/swagger/src/Request/ValidationCollector.php +++ b/src/swagger/src/Request/ValidationCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger\Request; use Hyperf\Di\Annotation\AnnotationCollector; @@ -57,7 +58,7 @@ class ValidationCollector protected static function collectJsonContentRequestBody($methodAnnotations, array $data, string $field): array { - /** @var RequestBody $body */ + /** @var null|RequestBody $body */ $body = Util::findAnnotations($methodAnnotations, RequestBody::class)[0] ?? null; if (! $body) { return $data; @@ -84,7 +85,7 @@ class ValidationCollector protected static function collectMediaTypeRequestBody($methodAnnotations, array $data, string $field): array { - /** @var RequestBody $body */ + /** @var null|RequestBody $body */ $body = Util::findAnnotations($methodAnnotations, RequestBody::class)[0] ?? null; if (! $body || ! is_array($body->content)) { return $data; @@ -94,6 +95,8 @@ class ValidationCollector if (! $content instanceof MediaType) { continue; } + + /* @phpstan-ignore-next-line */ if (! $content->schema || ! is_array($content->schema->properties)) { continue; } diff --git a/src/swagger/src/Util.php b/src/swagger/src/Util.php index 820d2eee4..25b7b9095 100644 --- a/src/swagger/src/Util.php +++ b/src/swagger/src/Util.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Swagger; use Hyperf\Di\Annotation\MultipleAnnotation; diff --git a/src/swagger/tests/Stub/ExampleController.php b/src/swagger/tests/Stub/ExampleController.php index 17caed9b3..ff9dccd01 100644 --- a/src/swagger/tests/Stub/ExampleController.php +++ b/src/swagger/tests/Stub/ExampleController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Swagger\Stub; use Hyperf\Swagger\Annotation as SA; diff --git a/src/swagger/tests/SwaggerRequestTest.php b/src/swagger/tests/SwaggerRequestTest.php index 077ad3221..51a562bea 100644 --- a/src/swagger/tests/SwaggerRequestTest.php +++ b/src/swagger/tests/SwaggerRequestTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Swagger; /* diff --git a/src/tappable/src/Functions.php b/src/tappable/src/Functions.php index 36e733bea..c75c73b15 100644 --- a/src/tappable/src/Functions.php +++ b/src/tappable/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tappable; /** diff --git a/src/tappable/src/HigherOrderTapProxy.php b/src/tappable/src/HigherOrderTapProxy.php index 99546a8eb..6dcb43f61 100644 --- a/src/tappable/src/HigherOrderTapProxy.php +++ b/src/tappable/src/HigherOrderTapProxy.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tappable; class HigherOrderTapProxy diff --git a/src/tappable/src/Tappable.php b/src/tappable/src/Tappable.php index 5c8a0a7c6..05e2021d7 100644 --- a/src/tappable/src/Tappable.php +++ b/src/tappable/src/Tappable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tappable; trait Tappable diff --git a/src/tappable/tests/TappableTest.php b/src/tappable/tests/TappableTest.php index 0478bd95a..7a02a6bbb 100644 --- a/src/tappable/tests/TappableTest.php +++ b/src/tappable/tests/TappableTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTests\Tappable; use Hyperf\Tappable\Tappable; diff --git a/src/task/src/Annotation/Task.php b/src/task/src/Annotation/Task.php index f40d3b6ab..18350e02a 100644 --- a/src/task/src/Annotation/Task.php +++ b/src/task/src/Annotation/Task.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Annotation; use Attribute; diff --git a/src/task/src/Aspect/TaskAspect.php b/src/task/src/Aspect/TaskAspect.php index 99e927f62..7825b7b0b 100644 --- a/src/task/src/Aspect/TaskAspect.php +++ b/src/task/src/Aspect/TaskAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/task/src/ChannelFactory.php b/src/task/src/ChannelFactory.php index 4e8d63f53..c76bd0046 100644 --- a/src/task/src/ChannelFactory.php +++ b/src/task/src/ChannelFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; use Hyperf\Engine\Channel; diff --git a/src/task/src/ConfigProvider.php b/src/task/src/ConfigProvider.php index 2aa51a0e4..16f097bee 100644 --- a/src/task/src/ConfigProvider.php +++ b/src/task/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; use Hyperf\Task\Aspect\TaskAspect; diff --git a/src/task/src/Exception.php b/src/task/src/Exception.php index 099edf9c0..5ff4f95db 100644 --- a/src/task/src/Exception.php +++ b/src/task/src/Exception.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; use Hyperf\Serializer\ExceptionNormalizer; diff --git a/src/task/src/Exception/TaskException.php b/src/task/src/Exception/TaskException.php index f5ea68021..871eff621 100644 --- a/src/task/src/Exception/TaskException.php +++ b/src/task/src/Exception/TaskException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Exception; use RuntimeException; diff --git a/src/task/src/Exception/TaskExecuteException.php b/src/task/src/Exception/TaskExecuteException.php index 8643c5610..c0dc8460a 100644 --- a/src/task/src/Exception/TaskExecuteException.php +++ b/src/task/src/Exception/TaskExecuteException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Exception; class TaskExecuteException extends TaskException diff --git a/src/task/src/Exception/TaskExecuteTimeoutException.php b/src/task/src/Exception/TaskExecuteTimeoutException.php index 8085a71fb..cdcbf54af 100644 --- a/src/task/src/Exception/TaskExecuteTimeoutException.php +++ b/src/task/src/Exception/TaskExecuteTimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Exception; class TaskExecuteTimeoutException extends TaskException diff --git a/src/task/src/Finish.php b/src/task/src/Finish.php index 083ba3ac0..50d24b3aa 100644 --- a/src/task/src/Finish.php +++ b/src/task/src/Finish.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; class Finish diff --git a/src/task/src/Listener/AfterWorkerStartListener.php b/src/task/src/Listener/AfterWorkerStartListener.php index aa75f286c..a471f569d 100644 --- a/src/task/src/Listener/AfterWorkerStartListener.php +++ b/src/task/src/Listener/AfterWorkerStartListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/task/src/Listener/InitServerListener.php b/src/task/src/Listener/InitServerListener.php index 986fe27b3..2ced0ea0a 100644 --- a/src/task/src/Listener/InitServerListener.php +++ b/src/task/src/Listener/InitServerListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/task/src/Listener/OnFinishListener.php b/src/task/src/Listener/OnFinishListener.php index 29027f895..f0c530c45 100644 --- a/src/task/src/Listener/OnFinishListener.php +++ b/src/task/src/Listener/OnFinishListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/task/src/Listener/OnTaskListener.php b/src/task/src/Listener/OnTaskListener.php index 069fc5ad0..fe655ae02 100644 --- a/src/task/src/Listener/OnTaskListener.php +++ b/src/task/src/Listener/OnTaskListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/task/src/Task.php b/src/task/src/Task.php index 2381933fc..31ce6f57c 100644 --- a/src/task/src/Task.php +++ b/src/task/src/Task.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; class Task diff --git a/src/task/src/TaskData.php b/src/task/src/TaskData.php index 1261d3b43..5e379b6b5 100644 --- a/src/task/src/TaskData.php +++ b/src/task/src/TaskData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; class TaskData diff --git a/src/task/src/TaskExecutor.php b/src/task/src/TaskExecutor.php index d09b92b8c..52ff8fa94 100644 --- a/src/task/src/TaskExecutor.php +++ b/src/task/src/TaskExecutor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Task; use Hyperf\Serializer\ExceptionNormalizer; diff --git a/src/task/tests/ChannelFactoryTest.php b/src/task/tests/ChannelFactoryTest.php index 0b469f4ef..7fc30a335 100644 --- a/src/task/tests/ChannelFactoryTest.php +++ b/src/task/tests/ChannelFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Task; use Hyperf\Engine\Channel; diff --git a/src/task/tests/OnTaskListenerTest.php b/src/task/tests/OnTaskListenerTest.php index c330b91b8..2ffef350f 100644 --- a/src/task/tests/OnTaskListenerTest.php +++ b/src/task/tests/OnTaskListenerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Task; use Hyperf\Framework\Event\OnTask; diff --git a/src/task/tests/Stub/Foo.php b/src/task/tests/Stub/Foo.php index ea43ed511..3d44357c9 100644 --- a/src/task/tests/Stub/Foo.php +++ b/src/task/tests/Stub/Foo.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Task\Stub; use RuntimeException; diff --git a/src/task/tests/Stub/SwooleServer.php b/src/task/tests/Stub/SwooleServer.php index cd49a07c5..4e6b1f5dc 100644 --- a/src/task/tests/Stub/SwooleServer.php +++ b/src/task/tests/Stub/SwooleServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Task\Stub; use Hyperf\Server\Server; diff --git a/src/task/tests/TaskAspectTest.php b/src/task/tests/TaskAspectTest.php index ed5d4ccf9..9302c836a 100644 --- a/src/task/tests/TaskAspectTest.php +++ b/src/task/tests/TaskAspectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Task; use Hyperf\Context\ApplicationContext; diff --git a/src/testing/src/Assert.php b/src/testing/src/Assert.php index 6272747c5..8ae6a67aa 100644 --- a/src/testing/src/Assert.php +++ b/src/testing/src/Assert.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; use ArrayAccess; diff --git a/src/testing/src/AssertableJsonString.php b/src/testing/src/AssertableJsonString.php index c64a96f89..b6a257b43 100644 --- a/src/testing/src/AssertableJsonString.php +++ b/src/testing/src/AssertableJsonString.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; use ArrayAccess; diff --git a/src/testing/src/Client.php b/src/testing/src/Client.php index d7cfb3064..36e7e9fd0 100644 --- a/src/testing/src/Client.php +++ b/src/testing/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; use Hyperf\Codec\Packer\JsonPacker; diff --git a/src/testing/src/Concerns/InteractsWithContainer.php b/src/testing/src/Concerns/InteractsWithContainer.php index 8bd647b8b..4297fef67 100644 --- a/src/testing/src/Concerns/InteractsWithContainer.php +++ b/src/testing/src/Concerns/InteractsWithContainer.php @@ -9,19 +9,22 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Concerns; use Closure; use Hyperf\Context\ApplicationContext; +use Hyperf\Contract\ApplicationInterface; use Hyperf\Di\Container; use Hyperf\Di\Definition\DefinitionSourceFactory; use Mockery; +use Mockery\MockInterface; use Psr\Container\ContainerInterface; trait InteractsWithContainer { /** - * @var null|ContainerInterface|\Hyperf\Di\Container + * @var null|Container|ContainerInterface */ protected ?ContainerInterface $container = null; @@ -56,7 +59,7 @@ trait InteractsWithContainer * Mock an instance of an object in the container. * * @param string $abstract - * @return \Mockery\MockInterface + * @return MockInterface */ protected function mock($abstract, ?Closure $mock = null) { @@ -67,7 +70,7 @@ trait InteractsWithContainer * Mock a partial instance of an object in the container. * * @param string $abstract - * @return \Mockery\MockInterface + * @return MockInterface */ protected function partialMock($abstract, ?Closure $mock = null) { @@ -78,7 +81,7 @@ trait InteractsWithContainer * Spy an instance of an object in the container. * * @param string $abstract - * @return \Mockery\MockInterface + * @return MockInterface */ protected function spy($abstract, ?Closure $mock = null) { @@ -108,6 +111,6 @@ trait InteractsWithContainer protected function refreshContainer(): void { $this->container = ApplicationContext::setContainer($this->createContainer()); - $this->container->get(\Hyperf\Contract\ApplicationInterface::class); + $this->container->get(ApplicationInterface::class); } } diff --git a/src/testing/src/Concerns/InteractsWithDatabase.php b/src/testing/src/Concerns/InteractsWithDatabase.php index 3c1e7528b..e828e63fc 100644 --- a/src/testing/src/Concerns/InteractsWithDatabase.php +++ b/src/testing/src/Concerns/InteractsWithDatabase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Concerns; use Hyperf\Context\ApplicationContext; diff --git a/src/testing/src/Concerns/InteractsWithModelFactory.php b/src/testing/src/Concerns/InteractsWithModelFactory.php index 777faadef..5e8f0b983 100644 --- a/src/testing/src/Concerns/InteractsWithModelFactory.php +++ b/src/testing/src/Concerns/InteractsWithModelFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Concerns; use Faker\Factory as FakerFactory; diff --git a/src/testing/src/Concerns/MakesHttpRequests.php b/src/testing/src/Concerns/MakesHttpRequests.php index b171fb0de..c3d2dd48e 100644 --- a/src/testing/src/Concerns/MakesHttpRequests.php +++ b/src/testing/src/Concerns/MakesHttpRequests.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Concerns; use Hyperf\Testing\Http\Client; diff --git a/src/testing/src/Concerns/RunTestsInCoroutine.php b/src/testing/src/Concerns/RunTestsInCoroutine.php index 2558a28aa..b892b0966 100644 --- a/src/testing/src/Concerns/RunTestsInCoroutine.php +++ b/src/testing/src/Concerns/RunTestsInCoroutine.php @@ -9,8 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Concerns; +use Hyperf\Coordinator\Constants; +use Hyperf\Coordinator\CoordinatorManager; +use Swoole\Coroutine; +use Swoole\Timer; use Throwable; /** @@ -36,8 +41,8 @@ trait RunTestsInCoroutine } catch (Throwable $e) { $exception = $e; } finally { - \Swoole\Timer::clearAll(); - \Hyperf\Coordinator\CoordinatorManager::until(\Hyperf\Coordinator\Constants::WORKER_EXIT)->resume(); + Timer::clearAll(); + CoordinatorManager::until(Constants::WORKER_EXIT)->resume(); } }); @@ -50,7 +55,7 @@ trait RunTestsInCoroutine final protected function runTest(): mixed { - if (extension_loaded('swoole') && \Swoole\Coroutine::getCid() === -1 && $this->enableCoroutine) { + if (extension_loaded('swoole') && Coroutine::getCid() === -1 && $this->enableCoroutine) { $this->realTestName = $this->name(); parent::setName('runTestsInCoroutine'); } diff --git a/src/testing/src/Constraint/ArraySubset.php b/src/testing/src/Constraint/ArraySubset.php index 20ed48e62..3c704735f 100644 --- a/src/testing/src/Constraint/ArraySubset.php +++ b/src/testing/src/Constraint/ArraySubset.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Constraint; use ArrayObject; diff --git a/src/testing/src/Constraint/HasInDatabase.php b/src/testing/src/Constraint/HasInDatabase.php index 82ad38666..13162f534 100644 --- a/src/testing/src/Constraint/HasInDatabase.php +++ b/src/testing/src/Constraint/HasInDatabase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Constraint; use Hyperf\Database\ConnectionInterface; diff --git a/src/testing/src/Constraint/SeeInOrder.php b/src/testing/src/Constraint/SeeInOrder.php index 7d95b7916..27dcff441 100644 --- a/src/testing/src/Constraint/SeeInOrder.php +++ b/src/testing/src/Constraint/SeeInOrder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Constraint; use PHPUnit\Framework\Constraint\Constraint; diff --git a/src/testing/src/Debug.php b/src/testing/src/Debug.php index c50cfe7ed..77e0099c7 100644 --- a/src/testing/src/Debug.php +++ b/src/testing/src/Debug.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; class Debug diff --git a/src/testing/src/Exception/InvalidArgumentException.php b/src/testing/src/Exception/InvalidArgumentException.php index 6e92d28dd..d3a52cc8e 100644 --- a/src/testing/src/Exception/InvalidArgumentException.php +++ b/src/testing/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Exception; use PHPUnit\Framework\Exception; diff --git a/src/testing/src/Fluent/AssertableJson.php b/src/testing/src/Fluent/AssertableJson.php index 9eb22032d..a6498f163 100644 --- a/src/testing/src/Fluent/AssertableJson.php +++ b/src/testing/src/Fluent/AssertableJson.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Fluent; use Closure; diff --git a/src/testing/src/Fluent/Concerns/Debugging.php b/src/testing/src/Fluent/Concerns/Debugging.php index 2b65ba501..80f18d83d 100644 --- a/src/testing/src/Fluent/Concerns/Debugging.php +++ b/src/testing/src/Fluent/Concerns/Debugging.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Fluent\Concerns; trait Debugging diff --git a/src/testing/src/Fluent/Concerns/Has.php b/src/testing/src/Fluent/Concerns/Has.php index 1cbe8bc8f..4a310ee47 100644 --- a/src/testing/src/Fluent/Concerns/Has.php +++ b/src/testing/src/Fluent/Concerns/Has.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Fluent\Concerns; use Closure; diff --git a/src/testing/src/Fluent/Concerns/Interaction.php b/src/testing/src/Fluent/Concerns/Interaction.php index bd5e52ea4..22f283733 100644 --- a/src/testing/src/Fluent/Concerns/Interaction.php +++ b/src/testing/src/Fluent/Concerns/Interaction.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Fluent\Concerns; use Hyperf\Stringable\Str; diff --git a/src/testing/src/Fluent/Concerns/Matching.php b/src/testing/src/Fluent/Concerns/Matching.php index 9d59aa6d4..5b8dbbfd3 100644 --- a/src/testing/src/Fluent/Concerns/Matching.php +++ b/src/testing/src/Fluent/Concerns/Matching.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Fluent\Concerns; use Closure; diff --git a/src/testing/src/Http/Client.php b/src/testing/src/Http/Client.php index 026297ae0..10cb5881d 100644 --- a/src/testing/src/Http/Client.php +++ b/src/testing/src/Http/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Http; use Hyperf\Collection\Arr; diff --git a/src/testing/src/Http/Concerns/AssertsStatusCodes.php b/src/testing/src/Http/Concerns/AssertsStatusCodes.php index b159a1d51..729e69344 100644 --- a/src/testing/src/Http/Concerns/AssertsStatusCodes.php +++ b/src/testing/src/Http/Concerns/AssertsStatusCodes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Http\Concerns; use PHPUnit\Framework\Assert as PHPUnit; diff --git a/src/testing/src/Http/TestResponse.php b/src/testing/src/Http/TestResponse.php index a77b7c8e2..3aabdffc5 100644 --- a/src/testing/src/Http/TestResponse.php +++ b/src/testing/src/Http/TestResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\Http; use ArrayAccess; diff --git a/src/testing/src/HttpClient.php b/src/testing/src/HttpClient.php index 5a23d9942..11099a7ff 100644 --- a/src/testing/src/HttpClient.php +++ b/src/testing/src/HttpClient.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; use GuzzleHttp\Client; diff --git a/src/testing/src/HttpMessage/Upload/UploadedFile.php b/src/testing/src/HttpMessage/Upload/UploadedFile.php index b0323545d..b7397f4e1 100644 --- a/src/testing/src/HttpMessage/Upload/UploadedFile.php +++ b/src/testing/src/HttpMessage/Upload/UploadedFile.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing\HttpMessage\Upload; class UploadedFile extends \Hyperf\HttpMessage\Upload\UploadedFile diff --git a/src/testing/src/ModelFactory.php b/src/testing/src/ModelFactory.php index 206d0dd19..22a8029ca 100644 --- a/src/testing/src/ModelFactory.php +++ b/src/testing/src/ModelFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; use Faker\Generator; diff --git a/src/testing/src/TestCase.php b/src/testing/src/TestCase.php index da08ab532..558e19649 100644 --- a/src/testing/src/TestCase.php +++ b/src/testing/src/TestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Testing; use Mockery as m; diff --git a/src/testing/tests/ClientTest.php b/src/testing/tests/ClientTest.php index 30386d453..5a1f9a132 100644 --- a/src/testing/tests/ClientTest.php +++ b/src/testing/tests/ClientTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Testing; use Hyperf\Codec\Json; diff --git a/src/testing/tests/DebugTest.php b/src/testing/tests/DebugTest.php index f3b6a1990..ab7df68b5 100644 --- a/src/testing/tests/DebugTest.php +++ b/src/testing/tests/DebugTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Testing; use Hyperf\Testing\Debug; diff --git a/src/testing/tests/HttpClientTest.php b/src/testing/tests/HttpClientTest.php index dcb65b6b8..c5a8b790f 100644 --- a/src/testing/tests/HttpClientTest.php +++ b/src/testing/tests/HttpClientTest.php @@ -9,11 +9,13 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace tests; use Hyperf\Testing\HttpClient; use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; @@ -31,7 +33,7 @@ class HttpClientTest extends TestCase Mockery::close(); } - #[\PHPUnit\Framework\Attributes\Group('NonCoroutine')] + #[Group('NonCoroutine')] public function testJsonRequest() { run(function () { diff --git a/src/testing/tests/Stub/Exception/Handler/FooExceptionHandler.php b/src/testing/tests/Stub/Exception/Handler/FooExceptionHandler.php index 6ae8831a1..86f9cac3b 100644 --- a/src/testing/tests/Stub/Exception/Handler/FooExceptionHandler.php +++ b/src/testing/tests/Stub/Exception/Handler/FooExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Testing\Stub\Exception\Handler; use Hyperf\ExceptionHandler\ExceptionHandler; diff --git a/src/testing/tests/Stub/FooController.php b/src/testing/tests/Stub/FooController.php index 38df38754..7bf7e2cdf 100644 --- a/src/testing/tests/Stub/FooController.php +++ b/src/testing/tests/Stub/FooController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Testing\Stub; use Hyperf\Context\Context; diff --git a/src/tracer/class_map/GlobalTracer.php b/src/tracer/class_map/GlobalTracer.php index a52c4b5f3..1435219f0 100644 --- a/src/tracer/class_map/GlobalTracer.php +++ b/src/tracer/class_map/GlobalTracer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace OpenTracing; use Hyperf\Tracer\TracerContext; diff --git a/src/tracer/class_map/Map.php b/src/tracer/class_map/Map.php index 26d3a8ad2..be7bde992 100644 --- a/src/tracer/class_map/Map.php +++ b/src/tracer/class_map/Map.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Zipkin\Propagation; use ArrayAccess; @@ -56,7 +57,6 @@ class Map implements Getter, Setter } /** - * {@inheritdoc} * @param array|ArrayAccess $carrier */ public function put(&$carrier, string $key, string $value): void diff --git a/src/tracer/class_map/ThriftUdpTransport.php b/src/tracer/class_map/ThriftUdpTransport.php index 90308d6fd..b22f3eedc 100644 --- a/src/tracer/class_map/ThriftUdpTransport.php +++ b/src/tracer/class_map/ThriftUdpTransport.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Jaeger; use Hyperf\Context\ApplicationContext; diff --git a/src/tracer/publish/opentracing.php b/src/tracer/publish/opentracing.php index 104de6f5f..b0a2b4ee4 100644 --- a/src/tracer/publish/opentracing.php +++ b/src/tracer/publish/opentracing.php @@ -9,6 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ +use Hyperf\Tracer\Adapter\JaegerTracerFactory; +use Hyperf\Tracer\Adapter\NoOpTracerFactory; +use Hyperf\Tracer\Adapter\Reporter\Kafka; +use Hyperf\Tracer\Adapter\ZipkinTracerFactory; +use Zipkin\Reporters\Http; +use Zipkin\Reporters\Noop; use Zipkin\Samplers\BinarySampler; use function Hyperf\Support\env; @@ -30,7 +36,7 @@ return [ ], 'tracer' => [ 'zipkin' => [ - 'driver' => Hyperf\Tracer\Adapter\ZipkinTracerFactory::class, + 'driver' => ZipkinTracerFactory::class, 'app' => [ 'name' => env('APP_NAME', 'skeleton'), // Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null @@ -42,7 +48,7 @@ return [ 'reporters' => [ // options for http reporter 'http' => [ - 'class' => \Zipkin\Reporters\Http::class, + 'class' => Http::class, 'constructor' => [ 'options' => [ 'endpoint_url' => env('ZIPKIN_ENDPOINT_URL', 'http://localhost:9411/api/v2/spans'), @@ -52,7 +58,7 @@ return [ ], // options for kafka reporter 'kafka' => [ - 'class' => \Hyperf\Tracer\Adapter\Reporter\Kafka::class, + 'class' => Kafka::class, 'constructor' => [ 'options' => [ 'topic' => env('ZIPKIN_KAFKA_TOPIC', 'zipkin'), @@ -64,13 +70,13 @@ return [ ], ], 'noop' => [ - 'class' => \Zipkin\Reporters\Noop::class, + 'class' => Noop::class, ], ], 'sampler' => BinarySampler::createAsAlwaysSample(), ], 'jaeger' => [ - 'driver' => Hyperf\Tracer\Adapter\JaegerTracerFactory::class, + 'driver' => JaegerTracerFactory::class, 'name' => env('APP_NAME', 'skeleton'), 'options' => [ /* @@ -90,7 +96,7 @@ return [ ], ], 'noop' => [ - 'driver' => Hyperf\Tracer\Adapter\NoOpTracerFactory::class, + 'driver' => NoOpTracerFactory::class, ], ], 'tags' => [ diff --git a/src/tracer/src/Adapter/HttpClientFactory.php b/src/tracer/src/Adapter/HttpClientFactory.php index 0eb6d4eb1..30d92b5e4 100644 --- a/src/tracer/src/Adapter/HttpClientFactory.php +++ b/src/tracer/src/Adapter/HttpClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter; /** diff --git a/src/tracer/src/Adapter/JaegerTracerFactory.php b/src/tracer/src/Adapter/JaegerTracerFactory.php index d7ccf0e82..3383413f2 100644 --- a/src/tracer/src/Adapter/JaegerTracerFactory.php +++ b/src/tracer/src/Adapter/JaegerTracerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter; use Hyperf\Contract\ConfigInterface; diff --git a/src/tracer/src/Adapter/NoOpTracerFactory.php b/src/tracer/src/Adapter/NoOpTracerFactory.php index 840b395de..d97829d8e 100644 --- a/src/tracer/src/Adapter/NoOpTracerFactory.php +++ b/src/tracer/src/Adapter/NoOpTracerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter; use Hyperf\Tracer\Contract\NamedFactoryInterface; diff --git a/src/tracer/src/Adapter/Reporter/HttpClientFactory.php b/src/tracer/src/Adapter/Reporter/HttpClientFactory.php index 605cabc1c..64ce1e4fb 100644 --- a/src/tracer/src/Adapter/Reporter/HttpClientFactory.php +++ b/src/tracer/src/Adapter/Reporter/HttpClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter\Reporter; use Closure; diff --git a/src/tracer/src/Adapter/Reporter/Kafka.php b/src/tracer/src/Adapter/Reporter/Kafka.php index d26e13312..11f5a1551 100644 --- a/src/tracer/src/Adapter/Reporter/Kafka.php +++ b/src/tracer/src/Adapter/Reporter/Kafka.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter\Reporter; use Psr\Log\LoggerInterface; diff --git a/src/tracer/src/Adapter/Reporter/KafkaClientFactory.php b/src/tracer/src/Adapter/Reporter/KafkaClientFactory.php index 4a6cf8a0b..cad88e987 100644 --- a/src/tracer/src/Adapter/Reporter/KafkaClientFactory.php +++ b/src/tracer/src/Adapter/Reporter/KafkaClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter\Reporter; use Closure; diff --git a/src/tracer/src/Adapter/Reporter/ReporterFactory.php b/src/tracer/src/Adapter/Reporter/ReporterFactory.php index ec8b88c9f..6fc17df4d 100644 --- a/src/tracer/src/Adapter/Reporter/ReporterFactory.php +++ b/src/tracer/src/Adapter/Reporter/ReporterFactory.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter\Reporter; use Hyperf\Contract\StdoutLoggerInterface; use Psr\Container\ContainerInterface; use RuntimeException; use Zipkin\Reporter; +use Zipkin\Reporters\Http; use function Hyperf\Support\make; @@ -38,7 +40,7 @@ class ReporterFactory throw new RuntimeException('Unsupported reporter.'); } - if ($class === \Zipkin\Reporters\Http::class) { + if ($class === Http::class) { $constructor['requesterFactory'] = $this->container->get(HttpClientFactory::class); } diff --git a/src/tracer/src/Adapter/ZipkinTracerFactory.php b/src/tracer/src/Adapter/ZipkinTracerFactory.php index 9f66e5839..6b1f8fbda 100644 --- a/src/tracer/src/Adapter/ZipkinTracerFactory.php +++ b/src/tracer/src/Adapter/ZipkinTracerFactory.php @@ -9,12 +9,14 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Adapter; use Hyperf\Contract\ConfigInterface; use Hyperf\Tracer\Adapter\Reporter\ReporterFactory; use Hyperf\Tracer\Contract\NamedFactoryInterface; use Zipkin\Endpoint; +use Zipkin\Reporters\Http; use Zipkin\Samplers\BinarySampler; use Zipkin\TracingBuilder; use ZipkinOpenTracing\Tracer; @@ -56,7 +58,7 @@ class ZipkinTracerFactory implements NamedFactoryInterface ]), $this->getConfig('sampler', BinarySampler::createAsAlwaysSample()), $this->getConfig('reporters.' . $reporter, [ - 'class' => \Zipkin\Reporters\Http::class, + 'class' => Http::class, 'constructor' => [ 'options' => $this->getConfig('options', []), ], diff --git a/src/tracer/src/Annotation/Trace.php b/src/tracer/src/Annotation/Trace.php index 7cae4fea8..11198cefc 100644 --- a/src/tracer/src/Annotation/Trace.php +++ b/src/tracer/src/Annotation/Trace.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Annotation; use Attribute; diff --git a/src/tracer/src/Aspect/CoroutineAspect.php b/src/tracer/src/Aspect/CoroutineAspect.php index 3536ce122..fca893355 100644 --- a/src/tracer/src/Aspect/CoroutineAspect.php +++ b/src/tracer/src/Aspect/CoroutineAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/tracer/src/Aspect/CreateTraceContextAspect.php b/src/tracer/src/Aspect/CreateTraceContextAspect.php index 24bf7ee77..380bd98f9 100644 --- a/src/tracer/src/Aspect/CreateTraceContextAspect.php +++ b/src/tracer/src/Aspect/CreateTraceContextAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/tracer/src/Aspect/DbAspect.php b/src/tracer/src/Aspect/DbAspect.php index c5c0dda25..d152e6059 100644 --- a/src/tracer/src/Aspect/DbAspect.php +++ b/src/tracer/src/Aspect/DbAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\DB\DB; diff --git a/src/tracer/src/Aspect/ElasticserachAspect.php b/src/tracer/src/Aspect/ElasticserachAspect.php index e38ceb9ee..419cc5508 100644 --- a/src/tracer/src/Aspect/ElasticserachAspect.php +++ b/src/tracer/src/Aspect/ElasticserachAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Elasticsearch\Client; diff --git a/src/tracer/src/Aspect/GrpcAspect.php b/src/tracer/src/Aspect/GrpcAspect.php index 1ec5f0eb9..cbdc55444 100644 --- a/src/tracer/src/Aspect/GrpcAspect.php +++ b/src/tracer/src/Aspect/GrpcAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Context\Context as CT; diff --git a/src/tracer/src/Aspect/HttpClientAspect.php b/src/tracer/src/Aspect/HttpClientAspect.php index 40602fff9..dfc5370c3 100644 --- a/src/tracer/src/Aspect/HttpClientAspect.php +++ b/src/tracer/src/Aspect/HttpClientAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use GuzzleHttp\Client; diff --git a/src/tracer/src/Aspect/JsonRpcAspect.php b/src/tracer/src/Aspect/JsonRpcAspect.php index 57d5be458..a65a5c638 100644 --- a/src/tracer/src/Aspect/JsonRpcAspect.php +++ b/src/tracer/src/Aspect/JsonRpcAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; /** diff --git a/src/tracer/src/Aspect/MethodAspect.php b/src/tracer/src/Aspect/MethodAspect.php index b32a54af3..099c6b995 100644 --- a/src/tracer/src/Aspect/MethodAspect.php +++ b/src/tracer/src/Aspect/MethodAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/tracer/src/Aspect/RedisAspect.php b/src/tracer/src/Aspect/RedisAspect.php index 782725ee7..641a07dba 100644 --- a/src/tracer/src/Aspect/RedisAspect.php +++ b/src/tracer/src/Aspect/RedisAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/tracer/src/Aspect/RpcAspect.php b/src/tracer/src/Aspect/RpcAspect.php index f903e66ee..a2bb5b781 100644 --- a/src/tracer/src/Aspect/RpcAspect.php +++ b/src/tracer/src/Aspect/RpcAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Context\Context as CT; diff --git a/src/tracer/src/Aspect/TraceAnnotationAspect.php b/src/tracer/src/Aspect/TraceAnnotationAspect.php index 0e44cb17e..3e14c45fa 100644 --- a/src/tracer/src/Aspect/TraceAnnotationAspect.php +++ b/src/tracer/src/Aspect/TraceAnnotationAspect.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Aspect; use Hyperf\Di\Aop\AbstractAspect; diff --git a/src/tracer/src/ConfigProvider.php b/src/tracer/src/ConfigProvider.php index 257a5d46c..e98107c61 100644 --- a/src/tracer/src/ConfigProvider.php +++ b/src/tracer/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use GuzzleHttp\Client; diff --git a/src/tracer/src/Contract/NamedFactoryInterface.php b/src/tracer/src/Contract/NamedFactoryInterface.php index cfe81b509..ec81b3e8a 100644 --- a/src/tracer/src/Contract/NamedFactoryInterface.php +++ b/src/tracer/src/Contract/NamedFactoryInterface.php @@ -9,12 +9,15 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Contract; +use OpenTracing\Tracer; + interface NamedFactoryInterface { /** * Create the object from factory. */ - public function make(string $name): \OpenTracing\Tracer; + public function make(string $name): Tracer; } diff --git a/src/tracer/src/Exception/ConnectionClosedException.php b/src/tracer/src/Exception/ConnectionClosedException.php index 427191aa3..051ca9b76 100644 --- a/src/tracer/src/Exception/ConnectionClosedException.php +++ b/src/tracer/src/Exception/ConnectionClosedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Exception; use RuntimeException; diff --git a/src/tracer/src/Exception/InvalidArgumentException.php b/src/tracer/src/Exception/InvalidArgumentException.php index 07bd8f07e..abcb97cfd 100644 --- a/src/tracer/src/Exception/InvalidArgumentException.php +++ b/src/tracer/src/Exception/InvalidArgumentException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Exception; class InvalidArgumentException extends \InvalidArgumentException diff --git a/src/tracer/src/Exception/TimeoutException.php b/src/tracer/src/Exception/TimeoutException.php index ecdffedd6..046619067 100644 --- a/src/tracer/src/Exception/TimeoutException.php +++ b/src/tracer/src/Exception/TimeoutException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Exception; use RuntimeException; diff --git a/src/tracer/src/Listener/DbQueryExecutedListener.php b/src/tracer/src/Listener/DbQueryExecutedListener.php index 74c2fcc06..23b35b74f 100644 --- a/src/tracer/src/Listener/DbQueryExecutedListener.php +++ b/src/tracer/src/Listener/DbQueryExecutedListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Listener; use Hyperf\Collection\Arr; diff --git a/src/tracer/src/Listener/RequestTraceListener.php b/src/tracer/src/Listener/RequestTraceListener.php index 8a8b68f97..f5630a8eb 100644 --- a/src/tracer/src/Listener/RequestTraceListener.php +++ b/src/tracer/src/Listener/RequestTraceListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Listener; use Hyperf\Coroutine\Coroutine; diff --git a/src/tracer/src/Middleware/TraceMiddleware.php b/src/tracer/src/Middleware/TraceMiddleware.php index 92a816e0f..594e96274 100644 --- a/src/tracer/src/Middleware/TraceMiddleware.php +++ b/src/tracer/src/Middleware/TraceMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer\Middleware; use Hyperf\Coroutine\Coroutine; @@ -48,7 +49,7 @@ class TraceMiddleware implements MiddlewareInterface defer(function () use ($tracer) { try { $tracer->flush(); - } catch (\Throwable) { + } catch (Throwable) { } }); try { diff --git a/src/tracer/src/SpanStarter.php b/src/tracer/src/SpanStarter.php index d2339c61b..e6ccf8eff 100644 --- a/src/tracer/src/SpanStarter.php +++ b/src/tracer/src/SpanStarter.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use Hyperf\Context\ApplicationContext; diff --git a/src/tracer/src/SpanTagManager.php b/src/tracer/src/SpanTagManager.php index 07f3bbf60..285d1cd93 100644 --- a/src/tracer/src/SpanTagManager.php +++ b/src/tracer/src/SpanTagManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; class SpanTagManager diff --git a/src/tracer/src/SpanTagManagerFactory.php b/src/tracer/src/SpanTagManagerFactory.php index d6732952a..94e722dd0 100644 --- a/src/tracer/src/SpanTagManagerFactory.php +++ b/src/tracer/src/SpanTagManagerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use Hyperf\Contract\ConfigInterface; diff --git a/src/tracer/src/SwitchManager.php b/src/tracer/src/SwitchManager.php index ebe8d2cec..4e690cd33 100644 --- a/src/tracer/src/SwitchManager.php +++ b/src/tracer/src/SwitchManager.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use Hyperf\Context\Context; @@ -51,7 +52,7 @@ class SwitchManager return $this->config[$identifier] && Context::get('tracer.root') instanceof Span; } - public function isIgnoreException(Throwable|string $exception): bool + public function isIgnoreException(string|Throwable $exception): bool { $ignoreExceptions = $this->config['ignore_exceptions'] ?? []; foreach ($ignoreExceptions as $ignoreException) { diff --git a/src/tracer/src/SwitchManagerFactory.php b/src/tracer/src/SwitchManagerFactory.php index 1e1176db1..68bf65929 100644 --- a/src/tracer/src/SwitchManagerFactory.php +++ b/src/tracer/src/SwitchManagerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use Hyperf\Contract\ConfigInterface; diff --git a/src/tracer/src/TracerContext.php b/src/tracer/src/TracerContext.php index 5e2af2e22..13b3e25d3 100644 --- a/src/tracer/src/TracerContext.php +++ b/src/tracer/src/TracerContext.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use Hyperf\Context\Context; diff --git a/src/tracer/src/TracerFactory.php b/src/tracer/src/TracerFactory.php index 43e8b5f4d..d3cc77f8d 100644 --- a/src/tracer/src/TracerFactory.php +++ b/src/tracer/src/TracerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Tracer; use Hyperf\Contract\ConfigInterface; diff --git a/src/tracer/tests/TracerFactoryTest.php b/src/tracer/tests/TracerFactoryTest.php index 6fd10bdf9..636e93017 100644 --- a/src/tracer/tests/TracerFactoryTest.php +++ b/src/tracer/tests/TracerFactoryTest.php @@ -9,16 +9,26 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Tracer; use Hyperf\Config\Config; use Hyperf\Context\ApplicationContext; +use Hyperf\Contract\ConfigInterface; use Hyperf\Di\Container; +use Hyperf\Tracer\Adapter\JaegerTracerFactory; +use Hyperf\Tracer\Adapter\NoOpTracerFactory; +use Hyperf\Tracer\Adapter\Reporter\HttpClientFactory; +use Hyperf\Tracer\Adapter\Reporter\ReporterFactory; +use Hyperf\Tracer\Adapter\ZipkinTracerFactory; use Hyperf\Tracer\TracerFactory; use Mockery; +use OpenTracing\NoopTracer; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; +use Zipkin\Reporters\Http; use Zipkin\Samplers\BinarySampler; +use ZipkinOpenTracing\Tracer; use function Hyperf\Support\env; @@ -57,7 +67,7 @@ class TracerFactoryTest extends TestCase $container = $this->getContainer($config); $factory = new TracerFactory(); - $this->assertInstanceOf(\ZipkinOpenTracing\Tracer::class, $factory($container)); + $this->assertInstanceOf(Tracer::class, $factory($container)); } public function testZipkinFactory() @@ -69,7 +79,7 @@ class TracerFactoryTest extends TestCase ], 'tracer' => [ 'zipkin' => [ - 'driver' => \Hyperf\Tracer\Adapter\ZipkinTracerFactory::class, + 'driver' => ZipkinTracerFactory::class, 'app' => [ 'name' => 'skeleton', // Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null @@ -82,13 +92,13 @@ class TracerFactoryTest extends TestCase 'sampler' => BinarySampler::createAsAlwaysSample(), ], 'jaeger' => [ - 'driver' => \Hyperf\Tracer\Adapter\JaegerTracerFactory::class, + 'driver' => JaegerTracerFactory::class, 'name' => 'skeleton', 'options' => [ ], ], 'noop' => [ - 'driver' => \Hyperf\Tracer\Adapter\NoOpTracerFactory::class, + 'driver' => NoOpTracerFactory::class, ], ], ], @@ -96,7 +106,7 @@ class TracerFactoryTest extends TestCase $container = $this->getContainer($config); $factory = new TracerFactory(); - $this->assertInstanceOf(\ZipkinOpenTracing\Tracer::class, $factory($container)); + $this->assertInstanceOf(Tracer::class, $factory($container)); } public function testJaegerFactory() @@ -108,7 +118,7 @@ class TracerFactoryTest extends TestCase ], 'tracer' => [ 'zipkin' => [ - 'driver' => \Hyperf\Tracer\Adapter\ZipkinTracerFactory::class, + 'driver' => ZipkinTracerFactory::class, 'app' => [ 'name' => 'skeleton', // Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null @@ -121,13 +131,13 @@ class TracerFactoryTest extends TestCase 'sampler' => BinarySampler::createAsAlwaysSample(), ], 'jaeger' => [ - 'driver' => \Hyperf\Tracer\Adapter\JaegerTracerFactory::class, + 'driver' => JaegerTracerFactory::class, 'name' => 'skeleton', 'options' => [ ], ], 'noop' => [ - 'driver' => \Hyperf\Tracer\Adapter\NoOpTracerFactory::class, + 'driver' => NoOpTracerFactory::class, ], ], ], @@ -147,7 +157,7 @@ class TracerFactoryTest extends TestCase ], 'tracer' => [ 'zipkin' => [ - 'driver' => \Hyperf\Tracer\Adapter\ZipkinTracerFactory::class, + 'driver' => ZipkinTracerFactory::class, 'app' => [ 'name' => 'skeleton', // Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null @@ -160,13 +170,13 @@ class TracerFactoryTest extends TestCase 'sampler' => BinarySampler::createAsAlwaysSample(), ], 'jaeger' => [ - 'driver' => \Hyperf\Tracer\Adapter\JaegerTracerFactory::class, + 'driver' => JaegerTracerFactory::class, 'name' => 'skeleton', 'options' => [ ], ], 'noop' => [ - 'driver' => \Hyperf\Tracer\Adapter\NoOpTracerFactory::class, + 'driver' => NoOpTracerFactory::class, ], ], ], @@ -174,28 +184,28 @@ class TracerFactoryTest extends TestCase $container = $this->getContainer($config); $factory = new TracerFactory(); - $this->assertInstanceOf(\OpenTracing\NoopTracer::class, $factory($container)); + $this->assertInstanceOf(NoopTracer::class, $factory($container)); } protected function getContainer($config) { $container = Mockery::mock(Container::class); - $client = Mockery::mock(\Hyperf\Tracer\Adapter\Reporter\HttpClientFactory::class); - $reporter = Mockery::mock(\Hyperf\Tracer\Adapter\Reporter\ReporterFactory::class); + $client = Mockery::mock(HttpClientFactory::class); + $reporter = Mockery::mock(ReporterFactory::class); $reporter->shouldReceive('make') - ->andReturn(new \Zipkin\Reporters\Http([], $client)); + ->andReturn(new Http([], $client)); $container->shouldReceive('get') - ->with(\Hyperf\Tracer\Adapter\ZipkinTracerFactory::class) - ->andReturn(new \Hyperf\Tracer\Adapter\ZipkinTracerFactory($config, $reporter)); + ->with(ZipkinTracerFactory::class) + ->andReturn(new ZipkinTracerFactory($config, $reporter)); $container->shouldReceive('get') - ->with(\Hyperf\Tracer\Adapter\JaegerTracerFactory::class) - ->andReturn(new \Hyperf\Tracer\Adapter\JaegerTracerFactory($config)); + ->with(JaegerTracerFactory::class) + ->andReturn(new JaegerTracerFactory($config)); $container->shouldReceive('get') - ->with(\Hyperf\Tracer\Adapter\NoOpTracerFactory::class) - ->andReturn(new \Hyperf\Tracer\Adapter\NoOpTracerFactory()); + ->with(NoOpTracerFactory::class) + ->andReturn(new NoOpTracerFactory()); $container->shouldReceive('get') - ->with(\Hyperf\Contract\ConfigInterface::class) + ->with(ConfigInterface::class) ->andReturn($config); ApplicationContext::setContainer($container); diff --git a/src/translation/src/ArrayLoader.php b/src/translation/src/ArrayLoader.php index 1bc4763b3..83c5546d4 100644 --- a/src/translation/src/ArrayLoader.php +++ b/src/translation/src/ArrayLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Contract\TranslatorLoaderInterface; diff --git a/src/translation/src/ConfigProvider.php b/src/translation/src/ConfigProvider.php index 0378ad654..effe10432 100644 --- a/src/translation/src/ConfigProvider.php +++ b/src/translation/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Contract\TranslatorInterface; diff --git a/src/translation/src/FileLoader.php b/src/translation/src/FileLoader.php index 0a280880e..8671e4cdf 100755 --- a/src/translation/src/FileLoader.php +++ b/src/translation/src/FileLoader.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Contract\TranslatorLoaderInterface; diff --git a/src/translation/src/FileLoaderFactory.php b/src/translation/src/FileLoaderFactory.php index fed6b80e7..e325deecf 100644 --- a/src/translation/src/FileLoaderFactory.php +++ b/src/translation/src/FileLoaderFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Contract\ConfigInterface; diff --git a/src/translation/src/Functions.php b/src/translation/src/Functions.php index 34f965469..37d47e148 100644 --- a/src/translation/src/Functions.php +++ b/src/translation/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Context\ApplicationContext; diff --git a/src/translation/src/MessageSelector.php b/src/translation/src/MessageSelector.php index b2df78aa7..7970803c4 100755 --- a/src/translation/src/MessageSelector.php +++ b/src/translation/src/MessageSelector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Stringable\Str; diff --git a/src/translation/src/Translator.php b/src/translation/src/Translator.php index 72bc3aa61..185555784 100755 --- a/src/translation/src/Translator.php +++ b/src/translation/src/Translator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Countable; diff --git a/src/translation/src/TranslatorFactory.php b/src/translation/src/TranslatorFactory.php index e0d0011eb..58b8ebac6 100644 --- a/src/translation/src/TranslatorFactory.php +++ b/src/translation/src/TranslatorFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Translation; use Hyperf\Contract\ConfigInterface; diff --git a/src/translation/tests/FileLoaderTest.php b/src/translation/tests/FileLoaderTest.php index aaa8fb217..3bf4c33ee 100755 --- a/src/translation/tests/FileLoaderTest.php +++ b/src/translation/tests/FileLoaderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Translation; use Hyperf\Config\Config; diff --git a/src/translation/tests/MessageSelectorTest.php b/src/translation/tests/MessageSelectorTest.php index ae46aeb9e..ab4cea0f8 100755 --- a/src/translation/tests/MessageSelectorTest.php +++ b/src/translation/tests/MessageSelectorTest.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Translation; use Hyperf\Translation\MessageSelector; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; /** @@ -27,7 +29,7 @@ class MessageSelectorTest extends TestCase * @param mixed $id * @param mixed $number */ - #[\PHPUnit\Framework\Attributes\DataProvider('chooseTestData')] + #[DataProvider('chooseTestData')] public function testChoose($expected, $id, $number) { $selector = new MessageSelector(); diff --git a/src/translation/tests/TranslatorTest.php b/src/translation/tests/TranslatorTest.php index 5810df98c..50c08fcbc 100755 --- a/src/translation/tests/TranslatorTest.php +++ b/src/translation/tests/TranslatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Translation; use Countable; diff --git a/src/validation/src/Annotation/Scene.php b/src/validation/src/Annotation/Scene.php index 6e2ad73a8..175411d33 100644 --- a/src/validation/src/Annotation/Scene.php +++ b/src/validation/src/Annotation/Scene.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Annotation; use Attribute; diff --git a/src/validation/src/ClosureValidationRule.php b/src/validation/src/ClosureValidationRule.php index 6607292a2..0d04e9f53 100755 --- a/src/validation/src/ClosureValidationRule.php +++ b/src/validation/src/ClosureValidationRule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Closure; diff --git a/src/validation/src/Concerns/FormatsMessages.php b/src/validation/src/Concerns/FormatsMessages.php index aa40b8ff6..20bc83e3a 100755 --- a/src/validation/src/Concerns/FormatsMessages.php +++ b/src/validation/src/Concerns/FormatsMessages.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Concerns; use Closure; @@ -334,7 +335,7 @@ trait FormatsMessages /** * Call a class based validator message replacer. * - * @param \Hyperf\Validation\Validator $validator + * @param Validator $validator */ protected function callClassBasedReplacer(string $callback, string $message, string $attribute, string $rule, array $parameters, $validator): string { diff --git a/src/validation/src/Concerns/ReplacesAttributes.php b/src/validation/src/Concerns/ReplacesAttributes.php index 66eb8090e..6ad1e91c2 100755 --- a/src/validation/src/Concerns/ReplacesAttributes.php +++ b/src/validation/src/Concerns/ReplacesAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Concerns; use Hyperf\Collection\Arr; diff --git a/src/validation/src/Concerns/ValidatesAttributes.php b/src/validation/src/Concerns/ValidatesAttributes.php index ee3b56010..34c22ac0e 100755 --- a/src/validation/src/Concerns/ValidatesAttributes.php +++ b/src/validation/src/Concerns/ValidatesAttributes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Concerns; use Brick\Math\BigDecimal; diff --git a/src/validation/src/ConfigProvider.php b/src/validation/src/ConfigProvider.php index 1cf5a35ab..d3b7dc719 100644 --- a/src/validation/src/ConfigProvider.php +++ b/src/validation/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Validation\Contract\PresenceVerifierInterface; diff --git a/src/validation/src/Contract/DataAwareRule.php b/src/validation/src/Contract/DataAwareRule.php index 8ca79b190..c0bd25ddf 100644 --- a/src/validation/src/Contract/DataAwareRule.php +++ b/src/validation/src/Contract/DataAwareRule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; interface DataAwareRule diff --git a/src/validation/src/Contract/ImplicitRule.php b/src/validation/src/Contract/ImplicitRule.php index 4cd79208e..9548ab49d 100755 --- a/src/validation/src/Contract/ImplicitRule.php +++ b/src/validation/src/Contract/ImplicitRule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; interface ImplicitRule extends Rule diff --git a/src/validation/src/Contract/PresenceVerifierInterface.php b/src/validation/src/Contract/PresenceVerifierInterface.php index 96728ef4a..6fb56a041 100755 --- a/src/validation/src/Contract/PresenceVerifierInterface.php +++ b/src/validation/src/Contract/PresenceVerifierInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; interface PresenceVerifierInterface diff --git a/src/validation/src/Contract/Rule.php b/src/validation/src/Contract/Rule.php index bd4cecde2..ba4c9eee5 100755 --- a/src/validation/src/Contract/Rule.php +++ b/src/validation/src/Contract/Rule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; interface Rule diff --git a/src/validation/src/Contract/ValidatesWhenResolved.php b/src/validation/src/Contract/ValidatesWhenResolved.php index 31994208f..5114c531c 100755 --- a/src/validation/src/Contract/ValidatesWhenResolved.php +++ b/src/validation/src/Contract/ValidatesWhenResolved.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; /** diff --git a/src/validation/src/Contract/ValidatorAwareRule.php b/src/validation/src/Contract/ValidatorAwareRule.php index cfe384d56..71a3a5e70 100644 --- a/src/validation/src/Contract/ValidatorAwareRule.php +++ b/src/validation/src/Contract/ValidatorAwareRule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; use Hyperf\Validation\Validator; diff --git a/src/validation/src/Contract/ValidatorFactoryInterface.php b/src/validation/src/Contract/ValidatorFactoryInterface.php index 48423b9b1..a12893855 100755 --- a/src/validation/src/Contract/ValidatorFactoryInterface.php +++ b/src/validation/src/Contract/ValidatorFactoryInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Contract; use Closure; diff --git a/src/validation/src/DatabasePresenceVerifier.php b/src/validation/src/DatabasePresenceVerifier.php index 4e2920d1f..26403377d 100755 --- a/src/validation/src/DatabasePresenceVerifier.php +++ b/src/validation/src/DatabasePresenceVerifier.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Closure; use Hyperf\Database\ConnectionResolverInterface; +use Hyperf\Database\Query\Builder; use Hyperf\Stringable\Str; use Hyperf\Validation\Contract\PresenceVerifierInterface; @@ -65,7 +67,7 @@ class DatabasePresenceVerifier implements PresenceVerifierInterface /** * Get a query builder for the given table. * - * @return \Hyperf\Database\Query\Builder + * @return Builder */ public function table(string $table) { @@ -83,8 +85,8 @@ class DatabasePresenceVerifier implements PresenceVerifierInterface /** * Add the given conditions to the query. * - * @param \Hyperf\Database\Query\Builder $query - * @return \Hyperf\Database\Query\Builder + * @param Builder $query + * @return Builder */ protected function addConditions($query, array $conditions) { @@ -104,7 +106,7 @@ class DatabasePresenceVerifier implements PresenceVerifierInterface /** * Add a "where" clause to the given query. * - * @param \Hyperf\Database\Query\Builder $query + * @param Builder $query * @param string $extraValue */ protected function addWhere($query, string $key, $extraValue) diff --git a/src/validation/src/DatabasePresenceVerifierFactory.php b/src/validation/src/DatabasePresenceVerifierFactory.php index 4080cf8ae..d27f39b81 100755 --- a/src/validation/src/DatabasePresenceVerifierFactory.php +++ b/src/validation/src/DatabasePresenceVerifierFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Database\ConnectionResolverInterface; diff --git a/src/validation/src/Event/ValidatorFactoryResolved.php b/src/validation/src/Event/ValidatorFactoryResolved.php index 6c18c3995..6c0c308d2 100644 --- a/src/validation/src/Event/ValidatorFactoryResolved.php +++ b/src/validation/src/Event/ValidatorFactoryResolved.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Event; use Hyperf\Validation\Contract\ValidatorFactoryInterface; diff --git a/src/validation/src/Middleware/ValidationMiddleware.php b/src/validation/src/Middleware/ValidationMiddleware.php index 22a8f00be..acb4fcfc2 100644 --- a/src/validation/src/Middleware/ValidationMiddleware.php +++ b/src/validation/src/Middleware/ValidationMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Middleware; use Closure; diff --git a/src/validation/src/Request/FormRequest.php b/src/validation/src/Request/FormRequest.php index 2db23a48e..4f3fc133a 100755 --- a/src/validation/src/Request/FormRequest.php +++ b/src/validation/src/Request/FormRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Request; use Hyperf\Collection\Arr; diff --git a/src/validation/src/Rule.php b/src/validation/src/Rule.php index 37a6ad004..92f52c342 100755 --- a/src/validation/src/Rule.php +++ b/src/validation/src/Rule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Contract\Arrayable; diff --git a/src/validation/src/Rules/DatabaseRule.php b/src/validation/src/Rules/DatabaseRule.php index 1a5fec684..c01fa1435 100755 --- a/src/validation/src/Rules/DatabaseRule.php +++ b/src/validation/src/Rules/DatabaseRule.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Closure; diff --git a/src/validation/src/Rules/Dimensions.php b/src/validation/src/Rules/Dimensions.php index cb3badb09..e64d5789b 100755 --- a/src/validation/src/Rules/Dimensions.php +++ b/src/validation/src/Rules/Dimensions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Stringable; diff --git a/src/validation/src/Rules/ExcludeIf.php b/src/validation/src/Rules/ExcludeIf.php index e262e6b78..0c4a1cb16 100644 --- a/src/validation/src/Rules/ExcludeIf.php +++ b/src/validation/src/Rules/ExcludeIf.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Closure; @@ -17,7 +18,7 @@ use Stringable; class ExcludeIf implements Stringable { - public Closure|bool $condition; + public bool|Closure $condition; /** * Create a new exclude validation rule based on a condition. diff --git a/src/validation/src/Rules/Exists.php b/src/validation/src/Rules/Exists.php index 809e167a5..aa9b53b74 100755 --- a/src/validation/src/Rules/Exists.php +++ b/src/validation/src/Rules/Exists.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Stringable; diff --git a/src/validation/src/Rules/File.php b/src/validation/src/Rules/File.php index 03af2b1e0..8b71b33b2 100644 --- a/src/validation/src/Rules/File.php +++ b/src/validation/src/Rules/File.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Hyperf\Collection\Arr; @@ -80,7 +81,7 @@ class File implements Rule, DataAwareRule, ValidatorAwareRule * @param null|callable|static $callback * @return null|static */ - public static function defaults(File|callable $callback = null) + public static function defaults(null|callable|File $callback = null) { if (is_null($callback)) { return static::default(); diff --git a/src/validation/src/Rules/ImageFile.php b/src/validation/src/Rules/ImageFile.php index d347ae948..95b69a9fa 100644 --- a/src/validation/src/Rules/ImageFile.php +++ b/src/validation/src/Rules/ImageFile.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; class ImageFile extends File diff --git a/src/validation/src/Rules/In.php b/src/validation/src/Rules/In.php index af3306ff4..485f0c047 100755 --- a/src/validation/src/Rules/In.php +++ b/src/validation/src/Rules/In.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Stringable; diff --git a/src/validation/src/Rules/NotIn.php b/src/validation/src/Rules/NotIn.php index 541efa8a4..456b61653 100755 --- a/src/validation/src/Rules/NotIn.php +++ b/src/validation/src/Rules/NotIn.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Stringable; diff --git a/src/validation/src/Rules/ProhibitedIf.php b/src/validation/src/Rules/ProhibitedIf.php index cc060c7e5..830640a23 100644 --- a/src/validation/src/Rules/ProhibitedIf.php +++ b/src/validation/src/Rules/ProhibitedIf.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Closure; @@ -17,7 +18,7 @@ use Stringable; class ProhibitedIf implements Stringable { - public Closure|bool $condition; + public bool|Closure $condition; /** * Create a new prohibited validation rule based on a condition. diff --git a/src/validation/src/Rules/RequiredIf.php b/src/validation/src/Rules/RequiredIf.php index 72748a406..a9aad9967 100755 --- a/src/validation/src/Rules/RequiredIf.php +++ b/src/validation/src/Rules/RequiredIf.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Stringable; diff --git a/src/validation/src/Rules/Unique.php b/src/validation/src/Rules/Unique.php index 34d91931d..926870163 100755 --- a/src/validation/src/Rules/Unique.php +++ b/src/validation/src/Rules/Unique.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation\Rules; use Hyperf\Database\Model\Model; @@ -68,7 +69,7 @@ class Unique implements Stringable /** * Ignore the given model during the unique check. * - * @param \Hyperf\Database\Model\Model $model + * @param Model $model * @return $this */ public function ignoreModel($model, ?string $idColumn = null) diff --git a/src/validation/src/UnauthorizedException.php b/src/validation/src/UnauthorizedException.php index 7e79d3ccb..37ef3474b 100755 --- a/src/validation/src/UnauthorizedException.php +++ b/src/validation/src/UnauthorizedException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use RuntimeException; diff --git a/src/validation/src/ValidatesWhenResolvedTrait.php b/src/validation/src/ValidatesWhenResolvedTrait.php index 2d344b8b0..cd310fc6e 100755 --- a/src/validation/src/ValidatesWhenResolvedTrait.php +++ b/src/validation/src/ValidatesWhenResolvedTrait.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Contract\ValidatorInterface; @@ -55,7 +56,7 @@ trait ValidatesWhenResolvedTrait /** * Handle a failed validation attempt. * - * @throws \Hyperf\Validation\ValidationException + * @throws ValidationException */ protected function failedValidation(ValidatorInterface $validator) { @@ -77,7 +78,7 @@ trait ValidatesWhenResolvedTrait /** * Handle a failed authorization attempt. * - * @throws \Hyperf\Validation\UnauthorizedException + * @throws UnauthorizedException */ protected function failedAuthorization() { diff --git a/src/validation/src/ValidationData.php b/src/validation/src/ValidationData.php index ed6ed49c3..08e544008 100755 --- a/src/validation/src/ValidationData.php +++ b/src/validation/src/ValidationData.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Collection\Arr; diff --git a/src/validation/src/ValidationException.php b/src/validation/src/ValidationException.php index 1c29e79cc..65d9b9d24 100755 --- a/src/validation/src/ValidationException.php +++ b/src/validation/src/ValidationException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Collection\Arr; diff --git a/src/validation/src/ValidationExceptionHandler.php b/src/validation/src/ValidationExceptionHandler.php index 911a03a8b..eee63d561 100755 --- a/src/validation/src/ValidationExceptionHandler.php +++ b/src/validation/src/ValidationExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\ExceptionHandler\ExceptionHandler; @@ -21,7 +22,7 @@ class ValidationExceptionHandler extends ExceptionHandler public function handle(Throwable $throwable, ResponsePlusInterface $response) { $this->stopPropagation(); - /** @var \Hyperf\Validation\ValidationException $throwable */ + /** @var ValidationException $throwable */ $body = $throwable->validator->errors()->first(); if (! $response->hasHeader('content-type')) { $response = $response->addHeader('content-type', 'text/plain; charset=utf-8'); diff --git a/src/validation/src/ValidationRuleParser.php b/src/validation/src/ValidationRuleParser.php index 728fb0713..ee925e63b 100755 --- a/src/validation/src/ValidationRuleParser.php +++ b/src/validation/src/ValidationRuleParser.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Closure; diff --git a/src/validation/src/Validator.php b/src/validation/src/Validator.php index c30536f10..9cdadfb55 100755 --- a/src/validation/src/Validator.php +++ b/src/validation/src/Validator.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use BadMethodCallException; @@ -270,7 +271,7 @@ class Validator implements ValidatorContract /** * Run the validator's rules against its data. * - * @throws \Hyperf\Validation\ValidationException if validate fails + * @throws ValidationException if validate fails */ public function validate(): array { @@ -284,7 +285,7 @@ class Validator implements ValidatorContract /** * Get the attributes and values that were validated. * - * @throws \Hyperf\Validation\ValidationException if invalid + * @throws ValidationException if invalid */ public function validated(): array { @@ -644,7 +645,7 @@ class Validator implements ValidatorContract /** * Get the Presence Verifier implementation. * - *@throws RuntimeException + * @throws RuntimeException */ public function getPresenceVerifier(): PresenceVerifierInterface { diff --git a/src/validation/src/ValidatorFactory.php b/src/validation/src/ValidatorFactory.php index 2a0516f53..d32da221d 100755 --- a/src/validation/src/ValidatorFactory.php +++ b/src/validation/src/ValidatorFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Closure; @@ -24,7 +25,7 @@ class ValidatorFactory implements ValidatorFactoryInterface /** * The Presence Verifier implementation. * - * @var \Hyperf\Validation\Contract\PresenceVerifierInterface + * @var PresenceVerifierInterface */ protected $verifier; @@ -113,7 +114,7 @@ class ValidatorFactory implements ValidatorFactoryInterface /** * Validate the given data against the provided rules. * - * @throws \Hyperf\Validation\ValidationException + * @throws ValidationException */ public function validate(array $data, array $rules, array $messages = [], array $customAttributes = []): array { diff --git a/src/validation/src/ValidatorFactoryFactory.php b/src/validation/src/ValidatorFactoryFactory.php index d0da95d59..ec12c1d8d 100755 --- a/src/validation/src/ValidatorFactoryFactory.php +++ b/src/validation/src/ValidatorFactoryFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Validation; use Hyperf\Contract\TranslatorInterface; @@ -26,7 +27,7 @@ class ValidatorFactoryFactory { $translator = $container->get(TranslatorInterface::class); - /** @var \Hyperf\Validation\ValidatorFactory $validatorFactory */ + /** @var ValidatorFactory $validatorFactory */ $validatorFactory = make(ValidatorFactory::class, compact('translator', 'container')); if ($container->has(ConnectionResolverInterface::class) && $container->has(PresenceVerifierInterface::class)) { diff --git a/src/validation/tests/Cases/AbstractTestCase.php b/src/validation/tests/Cases/AbstractTestCase.php index 688eaad94..e4edcbff8 100644 --- a/src/validation/tests/Cases/AbstractTestCase.php +++ b/src/validation/tests/Cases/AbstractTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use PHPUnit\Framework\TestCase; diff --git a/src/validation/tests/Cases/FormRequestTest.php b/src/validation/tests/Cases/FormRequestTest.php index 831ec96bb..79b91ae2f 100644 --- a/src/validation/tests/Cases/FormRequestTest.php +++ b/src/validation/tests/Cases/FormRequestTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/validation/tests/Cases/Stub/BarSceneRequest.php b/src/validation/tests/Cases/Stub/BarSceneRequest.php index f267135cb..dd523ecda 100644 --- a/src/validation/tests/Cases/Stub/BarSceneRequest.php +++ b/src/validation/tests/Cases/Stub/BarSceneRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\Stub; use Hyperf\Validation\Request\FormRequest; diff --git a/src/validation/tests/Cases/Stub/DemoController.php b/src/validation/tests/Cases/Stub/DemoController.php index 919eb723a..9001e04fa 100644 --- a/src/validation/tests/Cases/Stub/DemoController.php +++ b/src/validation/tests/Cases/Stub/DemoController.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\Stub; class DemoController diff --git a/src/validation/tests/Cases/Stub/DemoRequest.php b/src/validation/tests/Cases/Stub/DemoRequest.php index 4e9f741b0..ae82ddd16 100644 --- a/src/validation/tests/Cases/Stub/DemoRequest.php +++ b/src/validation/tests/Cases/Stub/DemoRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\Stub; use Hyperf\Context\Context; diff --git a/src/validation/tests/Cases/Stub/FooMiddleware.php b/src/validation/tests/Cases/Stub/FooMiddleware.php index e15854361..91cd1eb61 100644 --- a/src/validation/tests/Cases/Stub/FooMiddleware.php +++ b/src/validation/tests/Cases/Stub/FooMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\Stub; use Psr\Http\Message\ResponseInterface; diff --git a/src/validation/tests/Cases/Stub/FooSceneRequest.php b/src/validation/tests/Cases/Stub/FooSceneRequest.php index 01172a5c0..a5074ca4c 100644 --- a/src/validation/tests/Cases/Stub/FooSceneRequest.php +++ b/src/validation/tests/Cases/Stub/FooSceneRequest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\Stub; use Hyperf\Validation\Request\FormRequest; diff --git a/src/validation/tests/Cases/Stub/ValidatesAttributesStub.php b/src/validation/tests/Cases/Stub/ValidatesAttributesStub.php index 8061028fc..f1e0eb515 100644 --- a/src/validation/tests/Cases/Stub/ValidatesAttributesStub.php +++ b/src/validation/tests/Cases/Stub/ValidatesAttributesStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\Stub; use Hyperf\Validation\Concerns\ValidatesAttributes; diff --git a/src/validation/tests/Cases/ValidateAttributesTest.php b/src/validation/tests/Cases/ValidateAttributesTest.php index dcd20aa86..ba6d78a67 100644 --- a/src/validation/tests/Cases/ValidateAttributesTest.php +++ b/src/validation/tests/Cases/ValidateAttributesTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use HyperfTest\Validation\Cases\Stub\ValidatesAttributesStub; diff --git a/src/validation/tests/Cases/ValidationAddFailureTest.php b/src/validation/tests/Cases/ValidationAddFailureTest.php index 9485a5700..e4efb34b1 100644 --- a/src/validation/tests/Cases/ValidationAddFailureTest.php +++ b/src/validation/tests/Cases/ValidationAddFailureTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Validation\Validator; diff --git a/src/validation/tests/Cases/ValidationDatabasePresenceVerifierTest.php b/src/validation/tests/Cases/ValidationDatabasePresenceVerifierTest.php index 5012cd942..9c758e6fc 100644 --- a/src/validation/tests/Cases/ValidationDatabasePresenceVerifierTest.php +++ b/src/validation/tests/Cases/ValidationDatabasePresenceVerifierTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Closure; diff --git a/src/validation/tests/Cases/ValidationDimensionsRuleTest.php b/src/validation/tests/Cases/ValidationDimensionsRuleTest.php index c79b9a754..4ca4410b9 100644 --- a/src/validation/tests/Cases/ValidationDimensionsRuleTest.php +++ b/src/validation/tests/Cases/ValidationDimensionsRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Validation\Rule; diff --git a/src/validation/tests/Cases/ValidationExceptionTest.php b/src/validation/tests/Cases/ValidationExceptionTest.php index cdff28356..57d14ad66 100644 --- a/src/validation/tests/Cases/ValidationExceptionTest.php +++ b/src/validation/tests/Cases/ValidationExceptionTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/validation/tests/Cases/ValidationExcludeIfTest.php b/src/validation/tests/Cases/ValidationExcludeIfTest.php index 70efbc332..6203b9469 100644 --- a/src/validation/tests/Cases/ValidationExcludeIfTest.php +++ b/src/validation/tests/Cases/ValidationExcludeIfTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Exception; diff --git a/src/validation/tests/Cases/ValidationExistsRuleTest.php b/src/validation/tests/Cases/ValidationExistsRuleTest.php index 66b66de1f..eab26b37a 100644 --- a/src/validation/tests/Cases/ValidationExistsRuleTest.php +++ b/src/validation/tests/Cases/ValidationExistsRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Context\ApplicationContext; diff --git a/src/validation/tests/Cases/ValidationFactoryTest.php b/src/validation/tests/Cases/ValidationFactoryTest.php index e0a1a1495..25252735b 100755 --- a/src/validation/tests/Cases/ValidationFactoryTest.php +++ b/src/validation/tests/Cases/ValidationFactoryTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Contract\TranslatorInterface; diff --git a/src/validation/tests/Cases/ValidationFileRuleTest.php b/src/validation/tests/Cases/ValidationFileRuleTest.php index 4e01a9846..52c49922a 100644 --- a/src/validation/tests/Cases/ValidationFileRuleTest.php +++ b/src/validation/tests/Cases/ValidationFileRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Collection\Arr; diff --git a/src/validation/tests/Cases/ValidationImageFileRuleTest.php b/src/validation/tests/Cases/ValidationImageFileRuleTest.php index b2db959a0..6c602936e 100644 --- a/src/validation/tests/Cases/ValidationImageFileRuleTest.php +++ b/src/validation/tests/Cases/ValidationImageFileRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Collection\Arr; @@ -48,13 +49,13 @@ class ValidationImageFileRuleTest extends TestCase public function testDimensions() { $this->fails( - ( new ImageFile())->dimensions(Rule::dimensions()->width(100)->height(100)), + (new ImageFile())->dimensions(Rule::dimensions()->width(100)->height(100)), (new FileFactory())->image('foo.png', 101, 101), ['validation.dimensions'], ); $this->passes( - ( new ImageFile())->dimensions(Rule::dimensions()->width(100)->height(100)), + (new ImageFile())->dimensions(Rule::dimensions()->width(100)->height(100)), (new FileFactory())->image('foo.png', 100, 100), ); } diff --git a/src/validation/tests/Cases/ValidationInRuleTest.php b/src/validation/tests/Cases/ValidationInRuleTest.php index cd144476e..66fb4afa6 100644 --- a/src/validation/tests/Cases/ValidationInRuleTest.php +++ b/src/validation/tests/Cases/ValidationInRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Validation\Rule; diff --git a/src/validation/tests/Cases/ValidationMiddlewareTest.php b/src/validation/tests/Cases/ValidationMiddlewareTest.php index fda027f58..8fcd39786 100644 --- a/src/validation/tests/Cases/ValidationMiddlewareTest.php +++ b/src/validation/tests/Cases/ValidationMiddlewareTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Context\ApplicationContext; @@ -91,7 +92,7 @@ class ValidationMiddlewareTest extends TestCase $router = $factory->getRouter('http'); $router->addRoute('POST', '/sign-up', 'HyperfTest\Validation\Cases\Stub\DemoController@signUp'); $router->addRoute('POST', '/sign-in', 'HyperfTest\Validation\Cases\Stub\DemoController::signIn'); - $router->addRoute('POST', '/sign-out', [\HyperfTest\Validation\Cases\Stub\DemoController::class, 'signOut']); + $router->addRoute('POST', '/sign-out', [DemoController::class, 'signOut']); $router->addRoute('POST', '/info/{id:\d}', 'HyperfTest\Validation\Cases\Stub\DemoController::info'); $dispatcher = $factory->getDispatcher('http'); diff --git a/src/validation/tests/Cases/ValidationNotInRuleTest.php b/src/validation/tests/Cases/ValidationNotInRuleTest.php index df8d8e907..3acb22a74 100644 --- a/src/validation/tests/Cases/ValidationNotInRuleTest.php +++ b/src/validation/tests/Cases/ValidationNotInRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Validation\Rule; diff --git a/src/validation/tests/Cases/ValidationProhibitedIfTest.php b/src/validation/tests/Cases/ValidationProhibitedIfTest.php index 67027d68c..46193cf67 100644 --- a/src/validation/tests/Cases/ValidationProhibitedIfTest.php +++ b/src/validation/tests/Cases/ValidationProhibitedIfTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Exception; diff --git a/src/validation/tests/Cases/ValidationRequiredIfTest.php b/src/validation/tests/Cases/ValidationRequiredIfTest.php index 0ca07ccfd..7b01e7a90 100644 --- a/src/validation/tests/Cases/ValidationRequiredIfTest.php +++ b/src/validation/tests/Cases/ValidationRequiredIfTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Validation\Rules\RequiredIf; diff --git a/src/validation/tests/Cases/ValidationRuleTest.php b/src/validation/tests/Cases/ValidationRuleTest.php index bc22501fd..722dc680e 100644 --- a/src/validation/tests/Cases/ValidationRuleTest.php +++ b/src/validation/tests/Cases/ValidationRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Validation\Rule; diff --git a/src/validation/tests/Cases/ValidationUniqueRuleTest.php b/src/validation/tests/Cases/ValidationUniqueRuleTest.php index a5fd0c349..1c53f0a6d 100644 --- a/src/validation/tests/Cases/ValidationUniqueRuleTest.php +++ b/src/validation/tests/Cases/ValidationUniqueRuleTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Hyperf\Database\Model\Model; diff --git a/src/validation/tests/Cases/ValidationValidatorTest.php b/src/validation/tests/Cases/ValidationValidatorTest.php index 75b9e3e68..9868232e3 100755 --- a/src/validation/tests/Cases/ValidationValidatorTest.php +++ b/src/validation/tests/Cases/ValidationValidatorTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases; use Carbon\Carbon; @@ -33,6 +34,7 @@ use Hyperf\Validation\Validator; use InvalidArgumentException; use Mockery as m; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use SplFileInfo; @@ -2368,7 +2370,7 @@ class ValidationValidatorTest extends TestCase /** * @param mixed $validUrl */ - #[\PHPUnit\Framework\Attributes\DataProvider('validUrls')] + #[DataProvider('validUrls')] public function testValidateUrlWithValidUrls($validUrl) { $trans = $this->getIlluminateArrayTranslator(); @@ -2379,7 +2381,7 @@ class ValidationValidatorTest extends TestCase /** * @param mixed $invalidUrl */ - #[\PHPUnit\Framework\Attributes\DataProvider('invalidUrls')] + #[DataProvider('invalidUrls')] public function testValidateUrlWithInvalidUrls($invalidUrl) { $trans = $this->getIlluminateArrayTranslator(); @@ -4744,7 +4746,7 @@ class ValidationValidatorTest extends TestCase /** * @param mixed $uuid */ - #[\PHPUnit\Framework\Attributes\DataProvider('validUuidList')] + #[DataProvider('validUuidList')] public function testValidateWithValidUuid($uuid) { $trans = $this->getIlluminateArrayTranslator(); @@ -4755,7 +4757,7 @@ class ValidationValidatorTest extends TestCase /** * @param mixed $uuid */ - #[\PHPUnit\Framework\Attributes\DataProvider('invalidUuidList')] + #[DataProvider('invalidUuidList')] public function testValidateWithInvalidUuid($uuid) { $trans = $this->getIlluminateArrayTranslator(); diff --git a/src/validation/tests/Cases/fixtures/Values.php b/src/validation/tests/Cases/fixtures/Values.php index 6071c9ca6..c1d09ca00 100644 --- a/src/validation/tests/Cases/fixtures/Values.php +++ b/src/validation/tests/Cases/fixtures/Values.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\Cases\fixtures; use Hyperf\Contract\Arrayable; diff --git a/src/validation/tests/File/File.php b/src/validation/tests/File/File.php index bb1364ad3..371c53ec3 100644 --- a/src/validation/tests/File/File.php +++ b/src/validation/tests/File/File.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\File; use Hyperf\Testing\HttpMessage\Upload\UploadedFile; diff --git a/src/validation/tests/File/FileFactory.php b/src/validation/tests/File/FileFactory.php index fcf51d36b..e3ef8efb4 100644 --- a/src/validation/tests/File/FileFactory.php +++ b/src/validation/tests/File/FileFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\File; use LogicException; diff --git a/src/validation/tests/File/MimeType.php b/src/validation/tests/File/MimeType.php index f45885d06..0369938aa 100644 --- a/src/validation/tests/File/MimeType.php +++ b/src/validation/tests/File/MimeType.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation\File; use Hyperf\Support\MimeTypeExtensionGuesser; diff --git a/src/validation/tests/FileTest.php b/src/validation/tests/FileTest.php index f929236e3..2849688e7 100644 --- a/src/validation/tests/FileTest.php +++ b/src/validation/tests/FileTest.php @@ -9,8 +9,10 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Validation; +use HyperfTest\Validation\File\File; use PHPUnit\Framework\TestCase; /** @@ -22,12 +24,12 @@ class FileTest extends TestCase { public function testFile() { - $file = \HyperfTest\Validation\File\File::create('foo.txt', 1024); + $file = File::create('foo.txt', 1024); $this->assertSame('text/plain', $file->getMimeType()); $this->assertSame(1024 * 1024, $file->getSize()); $this->assertSame(0, $file->getError()); - $file = \HyperfTest\Validation\File\File::createWithContent('foo.txt', 'bar'); + $file = File::createWithContent('foo.txt', 'bar'); $this->assertSame('text/plain', $file->getMimeType()); $this->assertSame(3, $file->getSize()); $this->assertSame(0, $file->getError()); @@ -35,7 +37,7 @@ class FileTest extends TestCase public function testImage() { - $file = \HyperfTest\Validation\File\File::image('foo.png', 1024, 1024); + $file = File::image('foo.png', 1024, 1024); $this->assertSame('image/png', $file->getMimeType()); // 读取图片尺寸 $imageSize = getimagesize($file->getPathname()); @@ -43,7 +45,7 @@ class FileTest extends TestCase $this->assertSame(0, $file->getError()); $this->assertSame('png', $file->getExtension()); - $file = \HyperfTest\Validation\File\File::image('foo.jpg', 1024, 1024); + $file = File::image('foo.jpg', 1024, 1024); $this->assertSame('image/jpeg', $file->getMimeType()); // 读取图片尺寸 $imageSize = getimagesize($file->getPathname()); @@ -51,7 +53,7 @@ class FileTest extends TestCase $this->assertSame(0, $file->getError()); $this->assertSame('jpg', $file->getExtension()); - $file = \HyperfTest\Validation\File\File::image('foo.gif', 1024, 1024); + $file = File::image('foo.gif', 1024, 1024); $this->assertSame('image/gif', $file->getMimeType()); // 读取图片尺寸 $imageSize = getimagesize($file->getPathname()); diff --git a/src/view-engine/src/Blade.php b/src/view-engine/src/Blade.php index df34cd927..cdf1ec3ba 100644 --- a/src/view-engine/src/Blade.php +++ b/src/view-engine/src/Blade.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/src/Command/GenerateViewCacheCommand.php b/src/view-engine/src/Command/GenerateViewCacheCommand.php index 02cf5d026..177d89b16 100644 --- a/src/view-engine/src/Command/GenerateViewCacheCommand.php +++ b/src/view-engine/src/Command/GenerateViewCacheCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Command; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/view-engine/src/Command/ViewPublishCommand.php b/src/view-engine/src/Command/ViewPublishCommand.php index e372915c4..cc91a748f 100644 --- a/src/view-engine/src/Command/ViewPublishCommand.php +++ b/src/view-engine/src/Command/ViewPublishCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Command; use Hyperf\Command\Command as HyperfCommand; diff --git a/src/view-engine/src/Compiler/BladeCompiler.php b/src/view-engine/src/Compiler/BladeCompiler.php index 20774b23a..c6d9dc49e 100644 --- a/src/view-engine/src/Compiler/BladeCompiler.php +++ b/src/view-engine/src/Compiler/BladeCompiler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler; use Hyperf\Collection\Arr; diff --git a/src/view-engine/src/Compiler/Compiler.php b/src/view-engine/src/Compiler/Compiler.php index e712d0c2b..8fee9c958 100755 --- a/src/view-engine/src/Compiler/Compiler.php +++ b/src/view-engine/src/Compiler/Compiler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler; use Hyperf\Support\Filesystem\Filesystem; diff --git a/src/view-engine/src/Compiler/CompilerInterface.php b/src/view-engine/src/Compiler/CompilerInterface.php index 0934ae313..91de323c7 100755 --- a/src/view-engine/src/Compiler/CompilerInterface.php +++ b/src/view-engine/src/Compiler/CompilerInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler; interface CompilerInterface diff --git a/src/view-engine/src/Compiler/ComponentTagCompiler.php b/src/view-engine/src/Compiler/ComponentTagCompiler.php index 4b57ecec9..8887e727a 100644 --- a/src/view-engine/src/Compiler/ComponentTagCompiler.php +++ b/src/view-engine/src/Compiler/ComponentTagCompiler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler; use Hyperf\Stringable\Str; @@ -117,8 +118,6 @@ class ComponentTagCompiler /** * Guess the view or class name for the given component. - * - * @return string */ public function guessComponentFromAutoload(FactoryInterface $viewFactory, string $component): ?string { diff --git a/src/view-engine/src/Compiler/Concern/CompilesComments.php b/src/view-engine/src/Compiler/Concern/CompilesComments.php index dfe8b7f94..e9252c3e8 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesComments.php +++ b/src/view-engine/src/Compiler/Concern/CompilesComments.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesComments diff --git a/src/view-engine/src/Compiler/Concern/CompilesComponents.php b/src/view-engine/src/Compiler/Concern/CompilesComponents.php index a832fb136..7c1241c65 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesComponents.php +++ b/src/view-engine/src/Compiler/Concern/CompilesComponents.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; use Hyperf\Stringable\Str; diff --git a/src/view-engine/src/Compiler/Concern/CompilesConditionals.php b/src/view-engine/src/Compiler/Concern/CompilesConditionals.php index 978ea447d..c7aa1a8ca 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesConditionals.php +++ b/src/view-engine/src/Compiler/Concern/CompilesConditionals.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; use Hyperf\Contract\ConfigInterface; diff --git a/src/view-engine/src/Compiler/Concern/CompilesEchos.php b/src/view-engine/src/Compiler/Concern/CompilesEchos.php index f7f7283e9..37286791a 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesEchos.php +++ b/src/view-engine/src/Compiler/Concern/CompilesEchos.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesEchos diff --git a/src/view-engine/src/Compiler/Concern/CompilesErrors.php b/src/view-engine/src/Compiler/Concern/CompilesErrors.php index f2c7bfc17..e8aa2259c 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesErrors.php +++ b/src/view-engine/src/Compiler/Concern/CompilesErrors.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesErrors diff --git a/src/view-engine/src/Compiler/Concern/CompilesIncludes.php b/src/view-engine/src/Compiler/Concern/CompilesIncludes.php index bb211709a..c6bf33204 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesIncludes.php +++ b/src/view-engine/src/Compiler/Concern/CompilesIncludes.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesIncludes diff --git a/src/view-engine/src/Compiler/Concern/CompilesInjections.php b/src/view-engine/src/Compiler/Concern/CompilesInjections.php index dda4d7695..62aa91047 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesInjections.php +++ b/src/view-engine/src/Compiler/Concern/CompilesInjections.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesInjections diff --git a/src/view-engine/src/Compiler/Concern/CompilesJson.php b/src/view-engine/src/Compiler/Concern/CompilesJson.php index aff7c0701..28f4a1661 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesJson.php +++ b/src/view-engine/src/Compiler/Concern/CompilesJson.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesJson diff --git a/src/view-engine/src/Compiler/Concern/CompilesLayouts.php b/src/view-engine/src/Compiler/Concern/CompilesLayouts.php index b480b3549..9d98becda 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesLayouts.php +++ b/src/view-engine/src/Compiler/Concern/CompilesLayouts.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; use Hyperf\ViewEngine\Factory as ViewFactory; diff --git a/src/view-engine/src/Compiler/Concern/CompilesLoops.php b/src/view-engine/src/Compiler/Concern/CompilesLoops.php index d872a52a5..b63b4ca33 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesLoops.php +++ b/src/view-engine/src/Compiler/Concern/CompilesLoops.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; use Hyperf\ViewEngine\Exception\ViewCompilationException; diff --git a/src/view-engine/src/Compiler/Concern/CompilesRawPhp.php b/src/view-engine/src/Compiler/Concern/CompilesRawPhp.php index 3f0127df4..d653273d6 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesRawPhp.php +++ b/src/view-engine/src/Compiler/Concern/CompilesRawPhp.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesRawPhp diff --git a/src/view-engine/src/Compiler/Concern/CompilesStacks.php b/src/view-engine/src/Compiler/Concern/CompilesStacks.php index f10689f22..e84b11540 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesStacks.php +++ b/src/view-engine/src/Compiler/Concern/CompilesStacks.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesStacks diff --git a/src/view-engine/src/Compiler/Concern/CompilesTranslations.php b/src/view-engine/src/Compiler/Concern/CompilesTranslations.php index 8f5af62b3..06e14d23d 100644 --- a/src/view-engine/src/Compiler/Concern/CompilesTranslations.php +++ b/src/view-engine/src/Compiler/Concern/CompilesTranslations.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Compiler\Concern; trait CompilesTranslations diff --git a/src/view-engine/src/Component/AnonymousComponent.php b/src/view-engine/src/Component/AnonymousComponent.php index 74d9f72c7..adae4712c 100644 --- a/src/view-engine/src/Component/AnonymousComponent.php +++ b/src/view-engine/src/Component/AnonymousComponent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Component; class AnonymousComponent extends Component diff --git a/src/view-engine/src/Component/Component.php b/src/view-engine/src/Component/Component.php index 850b552a5..0fad6bd49 100644 --- a/src/view-engine/src/Component/Component.php +++ b/src/view-engine/src/Component/Component.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Component; use Closure; diff --git a/src/view-engine/src/Component/ComponentAttributeBag.php b/src/view-engine/src/Component/ComponentAttributeBag.php index 33f674b42..65ca99f5f 100644 --- a/src/view-engine/src/Component/ComponentAttributeBag.php +++ b/src/view-engine/src/Component/ComponentAttributeBag.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Component; use ArrayAccess; @@ -18,6 +19,7 @@ use Hyperf\Macroable\Macroable; use Hyperf\Stringable\Str; use Hyperf\ViewEngine\Contract\Htmlable; use Hyperf\ViewEngine\HtmlString; +use Hyperf\ViewEngine\T; use IteratorAggregate; use Traversable; @@ -221,7 +223,7 @@ class ComponentAttributeBag implements ArrayAccess, Htmlable, IteratorAggregate return $value; } - return \Hyperf\ViewEngine\T::e($value); + return T::e($value); }, $attributeDefaults); foreach ($this->attributes as $key => $value) { diff --git a/src/view-engine/src/Component/DynamicComponent.php b/src/view-engine/src/Component/DynamicComponent.php index 58a42c3c1..9ea7f2239 100644 --- a/src/view-engine/src/Component/DynamicComponent.php +++ b/src/view-engine/src/Component/DynamicComponent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Component; use Hyperf\Stringable\Str; diff --git a/src/view-engine/src/Component/InvokableComponentVariable.php b/src/view-engine/src/Component/InvokableComponentVariable.php index 49cd6ef07..5cb90510c 100644 --- a/src/view-engine/src/Component/InvokableComponentVariable.php +++ b/src/view-engine/src/Component/InvokableComponentVariable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Component; use ArrayIterator; diff --git a/src/view-engine/src/Concern/ManagesComponents.php b/src/view-engine/src/Concern/ManagesComponents.php index 088d4d4bb..e55354b20 100644 --- a/src/view-engine/src/Concern/ManagesComponents.php +++ b/src/view-engine/src/Concern/ManagesComponents.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Concern; use Closure; diff --git a/src/view-engine/src/Concern/ManagesEvents.php b/src/view-engine/src/Concern/ManagesEvents.php index d26612038..b42807262 100644 --- a/src/view-engine/src/Concern/ManagesEvents.php +++ b/src/view-engine/src/Concern/ManagesEvents.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Concern; use Closure; diff --git a/src/view-engine/src/Concern/ManagesLayouts.php b/src/view-engine/src/Concern/ManagesLayouts.php index 268f90005..2e4df2ce1 100644 --- a/src/view-engine/src/Concern/ManagesLayouts.php +++ b/src/view-engine/src/Concern/ManagesLayouts.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Concern; use Hyperf\ViewEngine\Contract\ViewInterface; diff --git a/src/view-engine/src/Concern/ManagesLoops.php b/src/view-engine/src/Concern/ManagesLoops.php index f359c2f54..dde343e2c 100644 --- a/src/view-engine/src/Concern/ManagesLoops.php +++ b/src/view-engine/src/Concern/ManagesLoops.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Concern; use Countable; diff --git a/src/view-engine/src/Concern/ManagesStacks.php b/src/view-engine/src/Concern/ManagesStacks.php index ca9edbf43..5db357d12 100644 --- a/src/view-engine/src/Concern/ManagesStacks.php +++ b/src/view-engine/src/Concern/ManagesStacks.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Concern; use InvalidArgumentException; diff --git a/src/view-engine/src/Concern/ManagesTranslations.php b/src/view-engine/src/Concern/ManagesTranslations.php index 94291a09b..10ad32cd4 100644 --- a/src/view-engine/src/Concern/ManagesTranslations.php +++ b/src/view-engine/src/Concern/ManagesTranslations.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Concern; use Hyperf\ViewEngine\Blade; diff --git a/src/view-engine/src/ConfigProvider.php b/src/view-engine/src/ConfigProvider.php index a443183b7..2d63da5d3 100644 --- a/src/view-engine/src/ConfigProvider.php +++ b/src/view-engine/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\ViewEngine\Command\GenerateViewCacheCommand; diff --git a/src/view-engine/src/Contract/DeferringDisplayableValue.php b/src/view-engine/src/Contract/DeferringDisplayableValue.php index a15756b85..16a93b809 100644 --- a/src/view-engine/src/Contract/DeferringDisplayableValue.php +++ b/src/view-engine/src/Contract/DeferringDisplayableValue.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; interface DeferringDisplayableValue diff --git a/src/view-engine/src/Contract/EngineInterface.php b/src/view-engine/src/Contract/EngineInterface.php index f3d8f2591..f45fffdab 100755 --- a/src/view-engine/src/Contract/EngineInterface.php +++ b/src/view-engine/src/Contract/EngineInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; interface EngineInterface diff --git a/src/view-engine/src/Contract/EngineResolverInterface.php b/src/view-engine/src/Contract/EngineResolverInterface.php index fc794fea6..dd3c57e1a 100644 --- a/src/view-engine/src/Contract/EngineResolverInterface.php +++ b/src/view-engine/src/Contract/EngineResolverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; use Closure; diff --git a/src/view-engine/src/Contract/Enumerable.php b/src/view-engine/src/Contract/Enumerable.php index 09798bbf2..68431baef 100644 --- a/src/view-engine/src/Contract/Enumerable.php +++ b/src/view-engine/src/Contract/Enumerable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; use Countable; diff --git a/src/view-engine/src/Contract/FactoryInterface.php b/src/view-engine/src/Contract/FactoryInterface.php index 2012637be..a62e06fb6 100644 --- a/src/view-engine/src/Contract/FactoryInterface.php +++ b/src/view-engine/src/Contract/FactoryInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; use Closure; diff --git a/src/view-engine/src/Contract/FinderInterface.php b/src/view-engine/src/Contract/FinderInterface.php index 14b4ad994..8253fe927 100755 --- a/src/view-engine/src/Contract/FinderInterface.php +++ b/src/view-engine/src/Contract/FinderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; interface FinderInterface diff --git a/src/view-engine/src/Contract/Htmlable.php b/src/view-engine/src/Contract/Htmlable.php index 8b4f72565..de7de9fd9 100644 --- a/src/view-engine/src/Contract/Htmlable.php +++ b/src/view-engine/src/Contract/Htmlable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; use Stringable; diff --git a/src/view-engine/src/Contract/Renderable.php b/src/view-engine/src/Contract/Renderable.php index 09f85b837..952bdf86c 100644 --- a/src/view-engine/src/Contract/Renderable.php +++ b/src/view-engine/src/Contract/Renderable.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; interface Renderable diff --git a/src/view-engine/src/Contract/ViewInterface.php b/src/view-engine/src/Contract/ViewInterface.php index 0a314a9ea..b7fa3b3aa 100644 --- a/src/view-engine/src/Contract/ViewInterface.php +++ b/src/view-engine/src/Contract/ViewInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Contract; interface ViewInterface extends Renderable diff --git a/src/view-engine/src/Engine/CompilerEngine.php b/src/view-engine/src/Engine/CompilerEngine.php index b335d5dd9..326954a0f 100755 --- a/src/view-engine/src/Engine/CompilerEngine.php +++ b/src/view-engine/src/Engine/CompilerEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Engine; use ErrorException; diff --git a/src/view-engine/src/Engine/Engine.php b/src/view-engine/src/Engine/Engine.php index 5e245e40a..f2a4abf58 100755 --- a/src/view-engine/src/Engine/Engine.php +++ b/src/view-engine/src/Engine/Engine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Engine; abstract class Engine diff --git a/src/view-engine/src/Engine/EngineResolver.php b/src/view-engine/src/Engine/EngineResolver.php index 51d0050bd..1ba45a3ec 100755 --- a/src/view-engine/src/Engine/EngineResolver.php +++ b/src/view-engine/src/Engine/EngineResolver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Engine; use Closure; diff --git a/src/view-engine/src/Engine/FileEngine.php b/src/view-engine/src/Engine/FileEngine.php index 8565fdceb..a8b6925a3 100644 --- a/src/view-engine/src/Engine/FileEngine.php +++ b/src/view-engine/src/Engine/FileEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Engine; use Hyperf\Support\Filesystem\Filesystem; diff --git a/src/view-engine/src/Engine/PhpEngine.php b/src/view-engine/src/Engine/PhpEngine.php index 0ee1261fd..c925a6536 100755 --- a/src/view-engine/src/Engine/PhpEngine.php +++ b/src/view-engine/src/Engine/PhpEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Engine; use Hyperf\Support\Filesystem\Filesystem; diff --git a/src/view-engine/src/Exception/ViewCompilationException.php b/src/view-engine/src/Exception/ViewCompilationException.php index 96cf1af59..9f084a748 100644 --- a/src/view-engine/src/Exception/ViewCompilationException.php +++ b/src/view-engine/src/Exception/ViewCompilationException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Exception; use Exception; diff --git a/src/view-engine/src/Factory.php b/src/view-engine/src/Factory.php index fa813c4d7..e434879e4 100755 --- a/src/view-engine/src/Factory.php +++ b/src/view-engine/src/Factory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Closure; diff --git a/src/view-engine/src/Factory/CompilerFactory.php b/src/view-engine/src/Factory/CompilerFactory.php index 630b32d05..3c6276a99 100644 --- a/src/view-engine/src/Factory/CompilerFactory.php +++ b/src/view-engine/src/Factory/CompilerFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Factory; use Hyperf\Di\Container; diff --git a/src/view-engine/src/Factory/EngineResolverFactory.php b/src/view-engine/src/Factory/EngineResolverFactory.php index 376bb8aea..a3061f690 100644 --- a/src/view-engine/src/Factory/EngineResolverFactory.php +++ b/src/view-engine/src/Factory/EngineResolverFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Factory; use Hyperf\Di\Container; diff --git a/src/view-engine/src/Factory/FinderFactory.php b/src/view-engine/src/Factory/FinderFactory.php index b1a8737af..d71978d1c 100644 --- a/src/view-engine/src/Factory/FinderFactory.php +++ b/src/view-engine/src/Factory/FinderFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Factory; use Hyperf\Support\Filesystem\Filesystem; diff --git a/src/view-engine/src/Finder.php b/src/view-engine/src/Finder.php index 3377d10ab..3d7d1d807 100755 --- a/src/view-engine/src/Finder.php +++ b/src/view-engine/src/Finder.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\Support\Filesystem\Filesystem; diff --git a/src/view-engine/src/Functions.php b/src/view-engine/src/Functions.php index b42fa7e81..bf92ac8f0 100644 --- a/src/view-engine/src/Functions.php +++ b/src/view-engine/src/Functions.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/src/HtmlString.php b/src/view-engine/src/HtmlString.php index 183600d74..d805ae6c4 100644 --- a/src/view-engine/src/HtmlString.php +++ b/src/view-engine/src/HtmlString.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\ViewEngine\Contract\Htmlable; diff --git a/src/view-engine/src/Http/Middleware/ShareErrorsFromSession.php b/src/view-engine/src/Http/Middleware/ShareErrorsFromSession.php index 0b2101b99..19d69087a 100644 --- a/src/view-engine/src/Http/Middleware/ShareErrorsFromSession.php +++ b/src/view-engine/src/Http/Middleware/ShareErrorsFromSession.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Http\Middleware; use Hyperf\Contract\SessionInterface; diff --git a/src/view-engine/src/Http/Middleware/ValidationExceptionHandle.php b/src/view-engine/src/Http/Middleware/ValidationExceptionHandle.php index 43b13adcd..39dbc386c 100644 --- a/src/view-engine/src/Http/Middleware/ValidationExceptionHandle.php +++ b/src/view-engine/src/Http/Middleware/ValidationExceptionHandle.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine\Http\Middleware; use Hyperf\Contract\MessageProvider; diff --git a/src/view-engine/src/HyperfViewEngine.php b/src/view-engine/src/HyperfViewEngine.php index e92d40df0..0274ab6e5 100644 --- a/src/view-engine/src/HyperfViewEngine.php +++ b/src/view-engine/src/HyperfViewEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/src/T.php b/src/view-engine/src/T.php index 83d2068b6..024ddb613 100644 --- a/src/view-engine/src/T.php +++ b/src/view-engine/src/T.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/src/View.php b/src/view-engine/src/View.php index cb79c0c40..fee5330d3 100755 --- a/src/view-engine/src/View.php +++ b/src/view-engine/src/View.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use ArrayAccess; diff --git a/src/view-engine/src/ViewErrorBag.php b/src/view-engine/src/ViewErrorBag.php index 78ff5c850..b8f3a5101 100644 --- a/src/view-engine/src/ViewErrorBag.php +++ b/src/view-engine/src/ViewErrorBag.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\ViewEngine; use Countable; diff --git a/src/view-engine/tests/Blade/AbstractBladeTestCase.php b/src/view-engine/tests/Blade/AbstractBladeTestCase.php index 19cdc0e26..c3123e82f 100644 --- a/src/view-engine/tests/Blade/AbstractBladeTestCase.php +++ b/src/view-engine/tests/Blade/AbstractBladeTestCase.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use Hyperf\Support\Filesystem\Filesystem; diff --git a/src/view-engine/tests/Blade/BladeCommentsTest.php b/src/view-engine/tests/Blade/BladeCommentsTest.php index 328801dbe..2427cc088 100644 --- a/src/view-engine/tests/Blade/BladeCommentsTest.php +++ b/src/view-engine/tests/Blade/BladeCommentsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeComponentTagCompilerTest.php b/src/view-engine/tests/Blade/BladeComponentTagCompilerTest.php index 7a690703a..da861d91d 100644 --- a/src/view-engine/tests/Blade/BladeComponentTagCompilerTest.php +++ b/src/view-engine/tests/Blade/BladeComponentTagCompilerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use Hyperf\ViewEngine\Compiler\BladeCompiler; diff --git a/src/view-engine/tests/Blade/BladeComponentsTest.php b/src/view-engine/tests/Blade/BladeComponentsTest.php index bc76d3db6..e960d160f 100644 --- a/src/view-engine/tests/Blade/BladeComponentsTest.php +++ b/src/view-engine/tests/Blade/BladeComponentsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeConditionalsTest.php b/src/view-engine/tests/Blade/BladeConditionalsTest.php index 67b812bfa..c134ccde8 100644 --- a/src/view-engine/tests/Blade/BladeConditionalsTest.php +++ b/src/view-engine/tests/Blade/BladeConditionalsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeCustomTest.php b/src/view-engine/tests/Blade/BladeCustomTest.php index 3b70357c1..1abc30115 100644 --- a/src/view-engine/tests/Blade/BladeCustomTest.php +++ b/src/view-engine/tests/Blade/BladeCustomTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use InvalidArgumentException; diff --git a/src/view-engine/tests/Blade/BladeEchosTest.php b/src/view-engine/tests/Blade/BladeEchosTest.php index 306049046..8343cdba2 100644 --- a/src/view-engine/tests/Blade/BladeEchosTest.php +++ b/src/view-engine/tests/Blade/BladeEchosTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeErrorsTest.php b/src/view-engine/tests/Blade/BladeErrorsTest.php index 68bac7dfe..746180692 100644 --- a/src/view-engine/tests/Blade/BladeErrorsTest.php +++ b/src/view-engine/tests/Blade/BladeErrorsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeIncludesTest.php b/src/view-engine/tests/Blade/BladeIncludesTest.php index f143a59b8..96925dcb8 100644 --- a/src/view-engine/tests/Blade/BladeIncludesTest.php +++ b/src/view-engine/tests/Blade/BladeIncludesTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeInjectTest.php b/src/view-engine/tests/Blade/BladeInjectTest.php index 9d30aff49..a98ffb7e1 100644 --- a/src/view-engine/tests/Blade/BladeInjectTest.php +++ b/src/view-engine/tests/Blade/BladeInjectTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeJsonTest.php b/src/view-engine/tests/Blade/BladeJsonTest.php index c0d1336c6..0db3e220b 100644 --- a/src/view-engine/tests/Blade/BladeJsonTest.php +++ b/src/view-engine/tests/Blade/BladeJsonTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeLayoutsTest.php b/src/view-engine/tests/Blade/BladeLayoutsTest.php index 1c7ecf751..49827393b 100644 --- a/src/view-engine/tests/Blade/BladeLayoutsTest.php +++ b/src/view-engine/tests/Blade/BladeLayoutsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeLoopsTest.php b/src/view-engine/tests/Blade/BladeLoopsTest.php index ce3318938..e0c2fc7f6 100644 --- a/src/view-engine/tests/Blade/BladeLoopsTest.php +++ b/src/view-engine/tests/Blade/BladeLoopsTest.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use Hyperf\ViewEngine\Exception\ViewCompilationException; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\DataProvider; /** * @internal @@ -98,7 +100,7 @@ empty /** * @param mixed $initialStatement */ - #[\PHPUnit\Framework\Attributes\DataProvider('invalidForelseStatementsDataProvider')] + #[DataProvider('invalidForelseStatementsDataProvider')] public function testForelseStatementsThrowHumanizedMessageWhenInvalidStatement($initialStatement) { $this->expectException(ViewCompilationException::class); @@ -238,7 +240,7 @@ tag info $this->assertEquals($expected, $this->compiler->compileString($string)); } - #[\PHPUnit\Framework\Attributes\DataProvider('invalidForeachStatementsDataProvider')] + #[DataProvider('invalidForeachStatementsDataProvider')] public function testForeachStatementsThrowHumanizedMessageWhenInvalidStatement(string $initialStatement) { $this->expectException(ViewCompilationException::class); diff --git a/src/view-engine/tests/Blade/BladeRawPhpTest.php b/src/view-engine/tests/Blade/BladeRawPhpTest.php index fef09a8e8..f1be73a66 100644 --- a/src/view-engine/tests/Blade/BladeRawPhpTest.php +++ b/src/view-engine/tests/Blade/BladeRawPhpTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeStacksTest.php b/src/view-engine/tests/Blade/BladeStacksTest.php index 1c38281f7..c4f8b9cde 100644 --- a/src/view-engine/tests/Blade/BladeStacksTest.php +++ b/src/view-engine/tests/Blade/BladeStacksTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeTranslationsTest.php b/src/view-engine/tests/Blade/BladeTranslationsTest.php index fe85618aa..2d0b2684e 100644 --- a/src/view-engine/tests/Blade/BladeTranslationsTest.php +++ b/src/view-engine/tests/Blade/BladeTranslationsTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/Blade/BladeVerbatimTest.php b/src/view-engine/tests/Blade/BladeVerbatimTest.php index ffe620c9e..3e90a5622 100644 --- a/src/view-engine/tests/Blade/BladeVerbatimTest.php +++ b/src/view-engine/tests/Blade/BladeVerbatimTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Blade; use PHPUnit\Framework\Attributes\CoversNothing; diff --git a/src/view-engine/tests/BladeTest.php b/src/view-engine/tests/BladeTest.php index ad82aaacc..716895c66 100644 --- a/src/view-engine/tests/BladeTest.php +++ b/src/view-engine/tests/BladeTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/tests/Stub/Alert.php b/src/view-engine/tests/Stub/Alert.php index f8cd59b92..fc0a9c15d 100644 --- a/src/view-engine/tests/Stub/Alert.php +++ b/src/view-engine/tests/Stub/Alert.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/tests/Stub/AlertAttributeMerge.php b/src/view-engine/tests/Stub/AlertAttributeMerge.php index 800c3a736..ff352ac62 100644 --- a/src/view-engine/tests/Stub/AlertAttributeMerge.php +++ b/src/view-engine/tests/Stub/AlertAttributeMerge.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/tests/Stub/AlertAttributeMergeForce.php b/src/view-engine/tests/Stub/AlertAttributeMergeForce.php index 8c1d0a53f..1729b1260 100644 --- a/src/view-engine/tests/Stub/AlertAttributeMergeForce.php +++ b/src/view-engine/tests/Stub/AlertAttributeMergeForce.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/tests/Stub/AlertSlot.php b/src/view-engine/tests/Stub/AlertSlot.php index 30590f14c..c1686b34d 100644 --- a/src/view-engine/tests/Stub/AlertSlot.php +++ b/src/view-engine/tests/Stub/AlertSlot.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Stub; use Hyperf\Context\ApplicationContext; diff --git a/src/view-engine/tests/Stub/ContainerStub.php b/src/view-engine/tests/Stub/ContainerStub.php index 8abd441db..163458e1f 100644 --- a/src/view-engine/tests/Stub/ContainerStub.php +++ b/src/view-engine/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\ViewEngine\Stub; use Hyperf\Config\Config; diff --git a/src/view/src/ConfigProvider.php b/src/view/src/ConfigProvider.php index c35e10201..aff0864ec 100644 --- a/src/view/src/ConfigProvider.php +++ b/src/view/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View; class ConfigProvider diff --git a/src/view/src/Engine/BladeEngine.php b/src/view/src/Engine/BladeEngine.php index 495fbbcef..6a3ee24fd 100644 --- a/src/view/src/Engine/BladeEngine.php +++ b/src/view/src/Engine/BladeEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; use duncan3dc\Laravel\BladeInstance; diff --git a/src/view/src/Engine/EngineInterface.php b/src/view/src/Engine/EngineInterface.php index 31efdf890..c6a3c0775 100644 --- a/src/view/src/Engine/EngineInterface.php +++ b/src/view/src/Engine/EngineInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; interface EngineInterface diff --git a/src/view/src/Engine/NoneEngine.php b/src/view/src/Engine/NoneEngine.php index 4734a6add..90721b74f 100644 --- a/src/view/src/Engine/NoneEngine.php +++ b/src/view/src/Engine/NoneEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; class NoneEngine implements EngineInterface diff --git a/src/view/src/Engine/PlatesEngine.php b/src/view/src/Engine/PlatesEngine.php index 35d5eb58f..c461c1df4 100644 --- a/src/view/src/Engine/PlatesEngine.php +++ b/src/view/src/Engine/PlatesEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; use League\Plates\Engine; diff --git a/src/view/src/Engine/SmartyEngine.php b/src/view/src/Engine/SmartyEngine.php index dbbc88ee2..eb6f91343 100644 --- a/src/view/src/Engine/SmartyEngine.php +++ b/src/view/src/Engine/SmartyEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; use Smarty; diff --git a/src/view/src/Engine/ThinkEngine.php b/src/view/src/Engine/ThinkEngine.php index 7546b2d75..5c7a22bf1 100644 --- a/src/view/src/Engine/ThinkEngine.php +++ b/src/view/src/Engine/ThinkEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; use think\Template; diff --git a/src/view/src/Engine/TwigEngine.php b/src/view/src/Engine/TwigEngine.php index 357a29b4a..967ed0326 100644 --- a/src/view/src/Engine/TwigEngine.php +++ b/src/view/src/Engine/TwigEngine.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Engine; use Twig\Environment; diff --git a/src/view/src/Exception/EngineNotFindException.php b/src/view/src/Exception/EngineNotFindException.php index f1db71656..31da98d11 100644 --- a/src/view/src/Exception/EngineNotFindException.php +++ b/src/view/src/Exception/EngineNotFindException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Exception; use RuntimeException; diff --git a/src/view/src/Exception/RenderException.php b/src/view/src/Exception/RenderException.php index 38a16089c..ac1b115ab 100644 --- a/src/view/src/Exception/RenderException.php +++ b/src/view/src/Exception/RenderException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View\Exception; use RuntimeException; diff --git a/src/view/src/Mode.php b/src/view/src/Mode.php index 3da2a9294..81f01ba5f 100644 --- a/src/view/src/Mode.php +++ b/src/view/src/Mode.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View; class Mode diff --git a/src/view/src/Render.php b/src/view/src/Render.php index 1cc0922dc..a18d94801 100644 --- a/src/view/src/Render.php +++ b/src/view/src/Render.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View; use Hyperf\Context\ResponseContext; diff --git a/src/view/src/RenderInterface.php b/src/view/src/RenderInterface.php index 8ecdb5ed5..193cf7496 100644 --- a/src/view/src/RenderInterface.php +++ b/src/view/src/RenderInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\View; use Psr\Http\Message\ResponseInterface; diff --git a/src/view/tests/NoneTest.php b/src/view/tests/NoneTest.php index ee2174b91..cf93f7b97 100644 --- a/src/view/tests/NoneTest.php +++ b/src/view/tests/NoneTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\View; use Hyperf\View\Engine\NoneEngine; diff --git a/src/view/tests/PlatesTest.php b/src/view/tests/PlatesTest.php index d9f9af129..2eb8f0554 100644 --- a/src/view/tests/PlatesTest.php +++ b/src/view/tests/PlatesTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\View; use Hyperf\View\Engine\PlatesEngine; diff --git a/src/view/tests/RenderTest.php b/src/view/tests/RenderTest.php index 0c9496c5c..15c051221 100644 --- a/src/view/tests/RenderTest.php +++ b/src/view/tests/RenderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\View; use Hyperf\Config\Config; diff --git a/src/view/tests/SmartyTest.php b/src/view/tests/SmartyTest.php index 7db20885a..89b42d3af 100644 --- a/src/view/tests/SmartyTest.php +++ b/src/view/tests/SmartyTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\View; use Hyperf\View\Engine\SmartyEngine; diff --git a/src/view/tests/ThinkTest.php b/src/view/tests/ThinkTest.php index dc4ca7572..7d4a63a4c 100644 --- a/src/view/tests/ThinkTest.php +++ b/src/view/tests/ThinkTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\View; use Hyperf\View\Engine\ThinkEngine; diff --git a/src/view/tests/TwigTest.php b/src/view/tests/TwigTest.php index dc73a3dfa..6b5d911ce 100644 --- a/src/view/tests/TwigTest.php +++ b/src/view/tests/TwigTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\View; use Hyperf\View\Engine\TwigEngine; diff --git a/src/watcher/src/Ast/Metadata.php b/src/watcher/src/Ast/Metadata.php index d661f7034..026e305bd 100644 --- a/src/watcher/src/Ast/Metadata.php +++ b/src/watcher/src/Ast/Metadata.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Ast; class Metadata diff --git a/src/watcher/src/Ast/RewriteClassNameVisitor.php b/src/watcher/src/Ast/RewriteClassNameVisitor.php index fbf0190d1..c2048c374 100644 --- a/src/watcher/src/Ast/RewriteClassNameVisitor.php +++ b/src/watcher/src/Ast/RewriteClassNameVisitor.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Ast; use PhpParser\Node; diff --git a/src/watcher/src/Command/WatchCommand.php b/src/watcher/src/Command/WatchCommand.php index d1441f2c0..d402afd69 100644 --- a/src/watcher/src/Command/WatchCommand.php +++ b/src/watcher/src/Command/WatchCommand.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Command; use Hyperf\Command\Command; diff --git a/src/watcher/src/ConfigProvider.php b/src/watcher/src/ConfigProvider.php index f9ce68d9b..08b7c497f 100644 --- a/src/watcher/src/ConfigProvider.php +++ b/src/watcher/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher; use Hyperf\Watcher\Command\WatchCommand; diff --git a/src/watcher/src/Driver/AbstractDriver.php b/src/watcher/src/Driver/AbstractDriver.php index 753e3540a..36b0773a8 100644 --- a/src/watcher/src/Driver/AbstractDriver.php +++ b/src/watcher/src/Driver/AbstractDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Driver; use Hyperf\Coordinator\Timer; diff --git a/src/watcher/src/Driver/DriverInterface.php b/src/watcher/src/Driver/DriverInterface.php index 199d92b98..f8310930d 100644 --- a/src/watcher/src/Driver/DriverInterface.php +++ b/src/watcher/src/Driver/DriverInterface.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Driver; use Hyperf\Engine\Channel; diff --git a/src/watcher/src/Driver/FindDriver.php b/src/watcher/src/Driver/FindDriver.php index 6664d02e7..87812a3c5 100644 --- a/src/watcher/src/Driver/FindDriver.php +++ b/src/watcher/src/Driver/FindDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Driver; use Hyperf\Engine\Channel; diff --git a/src/watcher/src/Driver/FindNewerDriver.php b/src/watcher/src/Driver/FindNewerDriver.php index ab0a6a6ae..01587b659 100644 --- a/src/watcher/src/Driver/FindNewerDriver.php +++ b/src/watcher/src/Driver/FindNewerDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Driver; use Hyperf\Engine\Channel; diff --git a/src/watcher/src/Driver/FswatchDriver.php b/src/watcher/src/Driver/FswatchDriver.php index 3db7ee679..590eba04d 100644 --- a/src/watcher/src/Driver/FswatchDriver.php +++ b/src/watcher/src/Driver/FswatchDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Driver; use Hyperf\Engine\Channel; diff --git a/src/watcher/src/Driver/ScanFileDriver.php b/src/watcher/src/Driver/ScanFileDriver.php index 0ef27e85a..22774f40e 100644 --- a/src/watcher/src/Driver/ScanFileDriver.php +++ b/src/watcher/src/Driver/ScanFileDriver.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher\Driver; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/watcher/src/Functions.php b/src/watcher/src/Functions.php index 847581e8d..37454bd43 100644 --- a/src/watcher/src/Functions.php +++ b/src/watcher/src/Functions.php @@ -9,9 +9,11 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher; use RuntimeException; +use Swoole\Coroutine\System; use function passthru; @@ -21,8 +23,8 @@ if (function_exists('exec')) { */ function exec(string $command) { - if (class_exists(\Swoole\Coroutine\System::class)) { - return \Swoole\Coroutine\System::exec($command); + if (class_exists(System::class)) { + return System::exec($command); } if (function_exists('\exec')) { diff --git a/src/watcher/src/Option.php b/src/watcher/src/Option.php index 7e17939d9..a3a521ef3 100644 --- a/src/watcher/src/Option.php +++ b/src/watcher/src/Option.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher; use Hyperf\Watcher\Driver\ScanFileDriver; diff --git a/src/watcher/src/Process.php b/src/watcher/src/Process.php index 6280899c9..a73d7781e 100644 --- a/src/watcher/src/Process.php +++ b/src/watcher/src/Process.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher; use Hyperf\Di\Annotation\AnnotationInterface; diff --git a/src/watcher/src/Watcher.php b/src/watcher/src/Watcher.php index 093109645..fdaf038da 100644 --- a/src/watcher/src/Watcher.php +++ b/src/watcher/src/Watcher.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\Watcher; use Hyperf\Codec\Json; @@ -22,6 +23,7 @@ use Hyperf\Watcher\Driver\DriverInterface; use PhpParser\PrettyPrinter\Standard; use Psr\Container\ContainerInterface; use Symfony\Component\Console\Output\OutputInterface; +use Throwable; use function Hyperf\Support\make; @@ -110,7 +112,7 @@ class Watcher if (posix_kill((int) $pid, 0)) { posix_kill((int) $pid, SIGTERM); } - } catch (\Throwable) { + } catch (Throwable) { $this->output->writeln('Stop server failed. Please execute `composer dump-autoload -o`'); } } diff --git a/src/watcher/tests/Driver/FindDriverTest.php b/src/watcher/tests/Driver/FindDriverTest.php index 129abaf79..c4e4ec78a 100644 --- a/src/watcher/tests/Driver/FindDriverTest.php +++ b/src/watcher/tests/Driver/FindDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Driver; use Hyperf\Contract\ConfigInterface; diff --git a/src/watcher/tests/Driver/FindNewerDriverTest.php b/src/watcher/tests/Driver/FindNewerDriverTest.php index 815608d58..17d438a65 100644 --- a/src/watcher/tests/Driver/FindNewerDriverTest.php +++ b/src/watcher/tests/Driver/FindNewerDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Driver; use Hyperf\Contract\ConfigInterface; diff --git a/src/watcher/tests/Driver/FswatchDriverTest.php b/src/watcher/tests/Driver/FswatchDriverTest.php index c312ff2a2..ebc7e5ea7 100644 --- a/src/watcher/tests/Driver/FswatchDriverTest.php +++ b/src/watcher/tests/Driver/FswatchDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Driver; use Hyperf\Contract\ConfigInterface; diff --git a/src/watcher/tests/Driver/ScanFileDriverTest.php b/src/watcher/tests/Driver/ScanFileDriverTest.php index f765a5e82..b28ca6f39 100644 --- a/src/watcher/tests/Driver/ScanFileDriverTest.php +++ b/src/watcher/tests/Driver/ScanFileDriverTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Driver; use Hyperf\Contract\ConfigInterface; diff --git a/src/watcher/tests/Stub/ContainerStub.php b/src/watcher/tests/Stub/ContainerStub.php index 8e86a39aa..20df25c38 100644 --- a/src/watcher/tests/Stub/ContainerStub.php +++ b/src/watcher/tests/Stub/ContainerStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Stub; use Hyperf\Config\Config; @@ -21,7 +22,7 @@ use Psr\Container\ContainerInterface; class ContainerStub { - public static function getContainer(string $driver): MockInterface|ContainerInterface + public static function getContainer(string $driver): ContainerInterface|MockInterface { $container = Mockery::mock(ContainerInterface::class); ApplicationContext::setContainer($container); diff --git a/src/watcher/tests/Stub/FindDriverStub.php b/src/watcher/tests/Stub/FindDriverStub.php index 4739b001f..d0fb1a960 100644 --- a/src/watcher/tests/Stub/FindDriverStub.php +++ b/src/watcher/tests/Stub/FindDriverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Stub; use Hyperf\Watcher\Driver\FindDriver; diff --git a/src/watcher/tests/Stub/FindNewerDriverStub.php b/src/watcher/tests/Stub/FindNewerDriverStub.php index e53e944df..c63f54b89 100644 --- a/src/watcher/tests/Stub/FindNewerDriverStub.php +++ b/src/watcher/tests/Stub/FindNewerDriverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Stub; use Hyperf\Watcher\Driver\FindNewerDriver; diff --git a/src/watcher/tests/Stub/ScanFileDriverStub.php b/src/watcher/tests/Stub/ScanFileDriverStub.php index d6ae82337..aaeefec99 100644 --- a/src/watcher/tests/Stub/ScanFileDriverStub.php +++ b/src/watcher/tests/Stub/ScanFileDriverStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher\Stub; use Hyperf\Watcher\Driver\ScanFileDriver; diff --git a/src/watcher/tests/WatcherTest.php b/src/watcher/tests/WatcherTest.php index 1dc28f9dd..7f0383ab8 100644 --- a/src/watcher/tests/WatcherTest.php +++ b/src/watcher/tests/WatcherTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\Watcher; use Hyperf\Config\Config; diff --git a/src/websocket-client/src/Client.php b/src/websocket-client/src/Client.php index 204a20765..223f24519 100644 --- a/src/websocket-client/src/Client.php +++ b/src/websocket-client/src/Client.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketClient; use Hyperf\HttpMessage\Server\Response; diff --git a/src/websocket-client/src/ClientFactory.php b/src/websocket-client/src/ClientFactory.php index db9d5f215..b000cbbb9 100644 --- a/src/websocket-client/src/ClientFactory.php +++ b/src/websocket-client/src/ClientFactory.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketClient; use Hyperf\HttpMessage\Uri\Uri; diff --git a/src/websocket-client/src/ConfigProvider.php b/src/websocket-client/src/ConfigProvider.php index 3f6021147..df9062c09 100644 --- a/src/websocket-client/src/ConfigProvider.php +++ b/src/websocket-client/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketClient; class ConfigProvider diff --git a/src/websocket-client/src/Exception/ConnectException.php b/src/websocket-client/src/Exception/ConnectException.php index 0db33898c..6289f5693 100644 --- a/src/websocket-client/src/Exception/ConnectException.php +++ b/src/websocket-client/src/Exception/ConnectException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketClient\Exception; use RuntimeException; diff --git a/src/websocket-client/src/Frame.php b/src/websocket-client/src/Frame.php index 4ec41955f..60a4ed39e 100644 --- a/src/websocket-client/src/Frame.php +++ b/src/websocket-client/src/Frame.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketClient; use Stringable; diff --git a/src/websocket-client/tests/ClientTest.php b/src/websocket-client/tests/ClientTest.php index 667ab0619..c920e88d5 100644 --- a/src/websocket-client/tests/ClientTest.php +++ b/src/websocket-client/tests/ClientTest.php @@ -9,10 +9,12 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketClient; use Hyperf\HttpMessage\Uri\Uri; use Hyperf\WebSocketClient\Client; +use Hyperf\WebSocketClient\Exception\ConnectException; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; @@ -25,7 +27,7 @@ class ClientTest extends TestCase { public function testClientConnectFailed() { - $this->expectException(\Hyperf\WebSocketClient\Exception\ConnectException::class); + $this->expectException(ConnectException::class); new Client(new Uri('ws://172.168.1.1:9522')); } diff --git a/src/websocket-client/tests/FrameTest.php b/src/websocket-client/tests/FrameTest.php index e3e418caf..eac4f56a8 100644 --- a/src/websocket-client/tests/FrameTest.php +++ b/src/websocket-client/tests/FrameTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketClient; use Hyperf\WebSocketClient\Frame; diff --git a/src/websocket-server/src/Collector/Fd.php b/src/websocket-server/src/Collector/Fd.php index 5b3793cb9..d6677db4b 100644 --- a/src/websocket-server/src/Collector/Fd.php +++ b/src/websocket-server/src/Collector/Fd.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Collector; class Fd diff --git a/src/websocket-server/src/Collector/FdCollector.php b/src/websocket-server/src/Collector/FdCollector.php index 795e2b6af..c82559c6c 100644 --- a/src/websocket-server/src/Collector/FdCollector.php +++ b/src/websocket-server/src/Collector/FdCollector.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Collector; class FdCollector diff --git a/src/websocket-server/src/ConfigProvider.php b/src/websocket-server/src/ConfigProvider.php index 60cf2b58f..97ca310c5 100644 --- a/src/websocket-server/src/ConfigProvider.php +++ b/src/websocket-server/src/ConfigProvider.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; class ConfigProvider diff --git a/src/websocket-server/src/Constant/Opcode.php b/src/websocket-server/src/Constant/Opcode.php index b2a2e1d44..8fc50adb4 100644 --- a/src/websocket-server/src/Constant/Opcode.php +++ b/src/websocket-server/src/Constant/Opcode.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Constant; class Opcode diff --git a/src/websocket-server/src/Context.php b/src/websocket-server/src/Context.php index 8c08e632b..70e01299e 100644 --- a/src/websocket-server/src/Context.php +++ b/src/websocket-server/src/Context.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; use Closure; diff --git a/src/websocket-server/src/CoreMiddleware.php b/src/websocket-server/src/CoreMiddleware.php index 0415d6f6a..20bad54db 100644 --- a/src/websocket-server/src/CoreMiddleware.php +++ b/src/websocket-server/src/CoreMiddleware.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; use Hyperf\Context\ResponseContext; diff --git a/src/websocket-server/src/Event/OnOpenEvent.php b/src/websocket-server/src/Event/OnOpenEvent.php index a0aaa78ce..7d524843c 100644 --- a/src/websocket-server/src/Event/OnOpenEvent.php +++ b/src/websocket-server/src/Event/OnOpenEvent.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Event; use Swoole\Http\Request; diff --git a/src/websocket-server/src/Exception/Handler/WebSocketExceptionHandler.php b/src/websocket-server/src/Exception/Handler/WebSocketExceptionHandler.php index ab51f679e..4962e2a09 100644 --- a/src/websocket-server/src/Exception/Handler/WebSocketExceptionHandler.php +++ b/src/websocket-server/src/Exception/Handler/WebSocketExceptionHandler.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Exception\Handler; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/websocket-server/src/Exception/InvalidMethodException.php b/src/websocket-server/src/Exception/InvalidMethodException.php index 9f3e9adb5..d0c49aefd 100644 --- a/src/websocket-server/src/Exception/InvalidMethodException.php +++ b/src/websocket-server/src/Exception/InvalidMethodException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Exception; use Hyperf\Server\Exception\ServerException; diff --git a/src/websocket-server/src/Exception/WebSocketHandeShakeException.php b/src/websocket-server/src/Exception/WebSocketHandeShakeException.php index b78bf0289..95230704c 100644 --- a/src/websocket-server/src/Exception/WebSocketHandeShakeException.php +++ b/src/websocket-server/src/Exception/WebSocketHandeShakeException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Exception; use Hyperf\HttpMessage\Exception\BadRequestHttpException; diff --git a/src/websocket-server/src/Exception/WebSocketMessageException.php b/src/websocket-server/src/Exception/WebSocketMessageException.php index 4250e8608..f132b7ce0 100644 --- a/src/websocket-server/src/Exception/WebSocketMessageException.php +++ b/src/websocket-server/src/Exception/WebSocketMessageException.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Exception; use Hyperf\Server\Exception\ServerException; diff --git a/src/websocket-server/src/Listener/InitSenderListener.php b/src/websocket-server/src/Listener/InitSenderListener.php index 5f6514dab..a3490abbf 100644 --- a/src/websocket-server/src/Listener/InitSenderListener.php +++ b/src/websocket-server/src/Listener/InitSenderListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Listener; use Hyperf\Event\Contract\ListenerInterface; diff --git a/src/websocket-server/src/Listener/OnPipeMessageListener.php b/src/websocket-server/src/Listener/OnPipeMessageListener.php index a95075846..91364f532 100644 --- a/src/websocket-server/src/Listener/OnPipeMessageListener.php +++ b/src/websocket-server/src/Listener/OnPipeMessageListener.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer\Listener; use Hyperf\Contract\StdoutLoggerInterface; diff --git a/src/websocket-server/src/Security.php b/src/websocket-server/src/Security.php index cfb984428..0d9e2a71c 100644 --- a/src/websocket-server/src/Security.php +++ b/src/websocket-server/src/Security.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; class Security diff --git a/src/websocket-server/src/Sender.php b/src/websocket-server/src/Sender.php index d5c13e8a5..6a4e0cf70 100644 --- a/src/websocket-server/src/Sender.php +++ b/src/websocket-server/src/Sender.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; use Hyperf\Contract\ConfigInterface; diff --git a/src/websocket-server/src/SenderPipeMessage.php b/src/websocket-server/src/SenderPipeMessage.php index bcf6dcd86..0b9d6297a 100644 --- a/src/websocket-server/src/SenderPipeMessage.php +++ b/src/websocket-server/src/SenderPipeMessage.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; class SenderPipeMessage diff --git a/src/websocket-server/src/Server.php b/src/websocket-server/src/Server.php index aa89164a6..d5ff434aa 100644 --- a/src/websocket-server/src/Server.php +++ b/src/websocket-server/src/Server.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace Hyperf\WebSocketServer; use Hyperf\Context\Context; @@ -46,6 +47,7 @@ use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Swoole\Coroutine\Http\Server as SwCoServer; +use Swoole\Http\Request; use Swoole\Http\Response as SwooleResponse; use Swoole\Server as SwooleServer; use Swoole\WebSocket\Server as WebSocketServer; @@ -86,7 +88,7 @@ class Server implements MiddlewareInitializerInterface, OnHandShakeInterface, On ]); } - public function getServer(): SwCoServer|WebSocketServer|HttpServer + public function getServer(): HttpServer|SwCoServer|WebSocketServer { if ($this->server) { return $this->server; @@ -110,7 +112,7 @@ class Server implements MiddlewareInitializerInterface, OnHandShakeInterface, On } /** - * @param \Swoole\Http\Request|\Swow\Http\Server\Request $request + * @param Request|\Swow\Http\Server\Request $request * @param SwooleResponse|SwowServerConnection $response */ public function onHandShake($request, $response): void diff --git a/src/websocket-server/tests/ContextTest.php b/src/websocket-server/tests/ContextTest.php index 7b9a78911..e7ab2c127 100644 --- a/src/websocket-server/tests/ContextTest.php +++ b/src/websocket-server/tests/ContextTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketServer; use Hyperf\Context\Context as CoContext; diff --git a/src/websocket-server/tests/SenderTest.php b/src/websocket-server/tests/SenderTest.php index e3b73aa49..76e266740 100644 --- a/src/websocket-server/tests/SenderTest.php +++ b/src/websocket-server/tests/SenderTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketServer; use Hyperf\Config\Config; @@ -21,6 +22,7 @@ use Mockery; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; +use Swoole\Server; /** * @internal @@ -37,12 +39,12 @@ class SenderTest extends TestCase public function testSenderCheck() { $container = $this->getContainer(); - $server = Mockery::mock(\Swoole\Server::class); + $server = Mockery::mock(Server::class); $server->shouldReceive('connection_info')->once()->andReturn(false); $server->shouldReceive('connection_info')->once()->andReturn([]); $server->shouldReceive('connection_info')->once()->andReturn(['websocket_status' => WEBSOCKET_STATUS_CLOSING]); $server->shouldReceive('connection_info')->once()->andReturn(['websocket_status' => WEBSOCKET_STATUS_ACTIVE]); - $container->shouldReceive('get')->with(\Swoole\Server::class)->andReturn($server); + $container->shouldReceive('get')->with(Server::class)->andReturn($server); $sender = new Sender($container); $this->assertFalse($sender->check(1)); diff --git a/src/websocket-server/tests/ServerTest.php b/src/websocket-server/tests/ServerTest.php index f1538854b..039730eb8 100644 --- a/src/websocket-server/tests/ServerTest.php +++ b/src/websocket-server/tests/ServerTest.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketServer; use Hyperf\Context\ApplicationContext; diff --git a/src/websocket-server/tests/Stub/FooServer.php b/src/websocket-server/tests/Stub/FooServer.php index b9bae6094..f84b84e89 100644 --- a/src/websocket-server/tests/Stub/FooServer.php +++ b/src/websocket-server/tests/Stub/FooServer.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketServer\Stub; use Hyperf\Engine\Http\Server as HttpServer; @@ -16,7 +17,7 @@ use Swow\Http\Server\Connection; class FooServer { - public function getServer(int|Connection $id): HttpServer|int + public function getServer(Connection|int $id): HttpServer|int { return $id; } diff --git a/src/websocket-server/tests/Stub/WebSocketStub.php b/src/websocket-server/tests/Stub/WebSocketStub.php index 80f3b903e..e8b0af65b 100644 --- a/src/websocket-server/tests/Stub/WebSocketStub.php +++ b/src/websocket-server/tests/Stub/WebSocketStub.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + namespace HyperfTest\WebSocketServer\Stub; use Hyperf\Contract\OnOpenInterface;