Skip to content

Commit 465cbb4

Browse files
authored
Format code by the latest cs-fixer. (#6617)
1 parent 962501e commit 465cbb4

30 files changed

+46
-9
lines changed

src/Assert.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing;
1314

1415
use ArrayAccess;

src/AssertableJsonString.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing;
1314

1415
use ArrayAccess;

src/Client.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing;
1314

1415
use Hyperf\Codec\Packer\JsonPacker;

src/Concerns/InteractsWithContainer.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Concerns;
1314

1415
use Closure;
1516
use Hyperf\Context\ApplicationContext;
17+
use Hyperf\Contract\ApplicationInterface;
1618
use Hyperf\Di\Container;
1719
use Hyperf\Di\Definition\DefinitionSourceFactory;
1820
use Mockery;
21+
use Mockery\MockInterface;
1922
use Psr\Container\ContainerInterface;
2023

2124
trait InteractsWithContainer
2225
{
2326
/**
24-
* @var null|ContainerInterface|\Hyperf\Di\Container
27+
* @var null|Container|ContainerInterface
2528
*/
2629
protected ?ContainerInterface $container = null;
2730

@@ -56,7 +59,7 @@ protected function instance($abstract, $instance)
5659
* Mock an instance of an object in the container.
5760
*
5861
* @param string $abstract
59-
* @return \Mockery\MockInterface
62+
* @return MockInterface
6063
*/
6164
protected function mock($abstract, ?Closure $mock = null)
6265
{
@@ -67,7 +70,7 @@ protected function mock($abstract, ?Closure $mock = null)
6770
* Mock a partial instance of an object in the container.
6871
*
6972
* @param string $abstract
70-
* @return \Mockery\MockInterface
73+
* @return MockInterface
7174
*/
7275
protected function partialMock($abstract, ?Closure $mock = null)
7376
{
@@ -78,7 +81,7 @@ protected function partialMock($abstract, ?Closure $mock = null)
7881
* Spy an instance of an object in the container.
7982
*
8083
* @param string $abstract
81-
* @return \Mockery\MockInterface
84+
* @return MockInterface
8285
*/
8386
protected function spy($abstract, ?Closure $mock = null)
8487
{
@@ -108,6 +111,6 @@ protected function setContainer(ContainerInterface $container): void
108111
protected function refreshContainer(): void
109112
{
110113
$this->container = ApplicationContext::setContainer($this->createContainer());
111-
$this->container->get(\Hyperf\Contract\ApplicationInterface::class);
114+
$this->container->get(ApplicationInterface::class);
112115
}
113116
}

src/Concerns/InteractsWithDatabase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Concerns;
1314

1415
use Hyperf\Context\ApplicationContext;

src/Concerns/InteractsWithModelFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Concerns;
1314

1415
use Faker\Factory as FakerFactory;

src/Concerns/MakesHttpRequests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Concerns;
1314

1415
use Hyperf\Testing\Http\Client;

src/Concerns/RunTestsInCoroutine.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Concerns;
1314

15+
use Hyperf\Coordinator\Constants;
16+
use Hyperf\Coordinator\CoordinatorManager;
17+
use Swoole\Coroutine;
18+
use Swoole\Timer;
1419
use Throwable;
1520

1621
/**
@@ -36,8 +41,8 @@ final protected function runTestsInCoroutine(...$arguments)
3641
} catch (Throwable $e) {
3742
$exception = $e;
3843
} finally {
39-
\Swoole\Timer::clearAll();
40-
\Hyperf\Coordinator\CoordinatorManager::until(\Hyperf\Coordinator\Constants::WORKER_EXIT)->resume();
44+
Timer::clearAll();
45+
CoordinatorManager::until(Constants::WORKER_EXIT)->resume();
4146
}
4247
});
4348

@@ -50,7 +55,7 @@ final protected function runTestsInCoroutine(...$arguments)
5055

5156
final protected function runTest(): mixed
5257
{
53-
if (extension_loaded('swoole') && \Swoole\Coroutine::getCid() === -1 && $this->enableCoroutine) {
58+
if (extension_loaded('swoole') && Coroutine::getCid() === -1 && $this->enableCoroutine) {
5459
$this->realTestName = $this->name();
5560
parent::setName('runTestsInCoroutine');
5661
}

src/Constraint/ArraySubset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Constraint;
1314

1415
use ArrayObject;

src/Constraint/HasInDatabase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Testing\Constraint;
1314

1415
use Hyperf\Database\ConnectionInterface;

0 commit comments

Comments
 (0)