Skip to content

Commit 443c03a

Browse files
authored
Format code by the latest cs-fixer. (#6617)
1 parent 0eee9f6 commit 443c03a

16 files changed

+46
-23
lines changed

src/AnonymousGrpcResourceCollection.php

+1
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\ResourceGrpc;
1314

1415
class AnonymousGrpcResourceCollection extends GrpcResourceCollection

src/ConfigProvider.php

+1
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\ResourceGrpc;
1314

1415
class ConfigProvider

src/GrpcResource.php

+1
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\ResourceGrpc;
1314

1415
use Hyperf\Resource\Json\JsonResource;

src/GrpcResourceCollection.php

+1
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\ResourceGrpc;
1314

1415
use Hyperf\Collection\Collection;

src/GrpcResponse.php

+1
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\ResourceGrpc;
1314

1415
use Google\Protobuf\Internal\Message;

src/UndefinedGrpcResourceExpectMessage.php

+1
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\ResourceGrpc;
1314

1415
use Exception;

tests/GrpcResourceTest.php

+3-1
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 HyperfTest\ResourceGrpc;
1314

1415
use HyperfTest\ResourceGrpc\Stubs\Grpc\AllReply;
@@ -20,6 +21,7 @@
2021
use HyperfTest\ResourceGrpc\Stubs\Resources\HiReplyResource;
2122
use HyperfTest\ResourceGrpc\Stubs\Resources\HiUserResource;
2223
use PHPUnit\Framework\Attributes\CoversNothing;
24+
use PHPUnit\Framework\TestCase;
2325

2426
use function Hyperf\Collection\collect;
2527

@@ -28,7 +30,7 @@
2830
* @coversNothing
2931
*/
3032
#[CoversNothing]
31-
class GrpcResourceTest extends \PHPUnit\Framework\TestCase
33+
class GrpcResourceTest extends TestCase
3234
{
3335
public function testResourceToMessage()
3436
{

tests/Stubs/Grpc/AllReply.php

+12-8
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313

1414
namespace HyperfTest\ResourceGrpc\Stubs\Grpc;
1515

16+
use Google\Protobuf\Internal\GPBType;
1617
use Google\Protobuf\Internal\GPBUtil;
18+
use Google\Protobuf\Internal\Message;
19+
use Google\Protobuf\Internal\RepeatedField;
20+
use HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc;
1721

1822
/**
1923
* Generated from protobuf message <code>HyperfTest.ResourceGrpc.Stubs.Grpc.AllReply</code>.
2024
*/
21-
class AllReply extends \Google\Protobuf\Internal\Message
25+
class AllReply extends Message
2226
{
2327
/**
2428
* Generated from protobuf field <code>string message = 1;</code>.
@@ -36,13 +40,13 @@ class AllReply extends \Google\Protobuf\Internal\Message
3640
* @param array $data {
3741
* Optional. Data for populating the Message object.
3842
*
39-
* @var string $message
40-
* @var \Google\Protobuf\Internal\RepeatedField|\HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[] $users
41-
* }
43+
* @var string $message
44+
* @var \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[]|RepeatedField $users
45+
* }
4246
*/
4347
public function __construct($data = null)
4448
{
45-
\HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc::initOnce();
49+
Grpc::initOnce();
4650
parent::__construct($data);
4751
}
4852

@@ -70,7 +74,7 @@ public function setMessage($var)
7074

7175
/**
7276
* Generated from protobuf field <code>repeated .HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser users = 2;</code>.
73-
* @return \Google\Protobuf\Internal\RepeatedField
77+
* @return RepeatedField
7478
*/
7579
public function getUsers()
7680
{
@@ -79,12 +83,12 @@ public function getUsers()
7983

8084
/**
8185
* Generated from protobuf field <code>repeated .HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser users = 2;</code>.
82-
* @param \Google\Protobuf\Internal\RepeatedField|\HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[] $var
86+
* @param \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser[]|RepeatedField $var
8387
* @return $this
8488
*/
8589
public function setUsers($var)
8690
{
87-
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser::class);
91+
$arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, HiUser::class);
8892
$this->users = $arr;
8993

9094
return $this;

tests/Stubs/Grpc/GPBMetadata/Grpc/Grpc.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313

1414
namespace HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc;
1515

16+
use Google\Protobuf\Internal\DescriptorPool;
17+
1618
class Grpc
1719
{
1820
public static $is_initialized = false;
1921

2022
public static function initOnce()
2123
{
22-
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
24+
$pool = DescriptorPool::getGeneratedPool();
2325

2426
if (static::$is_initialized == true) {
2527
return;

tests/Stubs/Grpc/HiReply.php

+10-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
namespace HyperfTest\ResourceGrpc\Stubs\Grpc;
1515

1616
use Google\Protobuf\Internal\GPBUtil;
17+
use Google\Protobuf\Internal\Message;
18+
use HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc;
1719

1820
/**
1921
* Generated from protobuf message <code>HyperfTest.ResourceGrpc.Stubs.Grpc.HiReply</code>.
2022
*/
21-
class HiReply extends \Google\Protobuf\Internal\Message
23+
class HiReply extends Message
2224
{
2325
/**
2426
* Generated from protobuf field <code>string message = 1;</code>.
@@ -36,13 +38,13 @@ class HiReply extends \Google\Protobuf\Internal\Message
3638
* @param array $data {
3739
* Optional. Data for populating the Message object.
3840
*
39-
* @var string $message
40-
* @var \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser $user
41-
* }
41+
* @var string $message
42+
* @var HiUser $user
43+
* }
4244
*/
4345
public function __construct($data = null)
4446
{
45-
\HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc::initOnce();
47+
Grpc::initOnce();
4648
parent::__construct($data);
4749
}
4850

@@ -70,7 +72,7 @@ public function setMessage($var)
7072

7173
/**
7274
* Generated from protobuf field <code>.HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser user = 2;</code>.
73-
* @return \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser
75+
* @return HiUser
7476
*/
7577
public function getUser()
7678
{
@@ -79,12 +81,12 @@ public function getUser()
7981

8082
/**
8183
* Generated from protobuf field <code>.HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser user = 2;</code>.
82-
* @param \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser $var
84+
* @param HiUser $var
8385
* @return $this
8486
*/
8587
public function setUser($var)
8688
{
87-
GPBUtil::checkMessage($var, \HyperfTest\ResourceGrpc\Stubs\Grpc\HiUser::class);
89+
GPBUtil::checkMessage($var, HiUser::class);
8890
$this->user = $var;
8991

9092
return $this;

tests/Stubs/Grpc/HiUser.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
namespace HyperfTest\ResourceGrpc\Stubs\Grpc;
1515

1616
use Google\Protobuf\Internal\GPBUtil;
17+
use Google\Protobuf\Internal\Message;
18+
use HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc;
1719

1820
/**
1921
* Generated from protobuf message <code>HyperfTest.ResourceGrpc.Stubs.Grpc.HiUser</code>.
2022
*/
21-
class HiUser extends \Google\Protobuf\Internal\Message
23+
class HiUser extends Message
2224
{
2325
/**
2426
* Generated from protobuf field <code>string name = 1;</code>.
@@ -36,13 +38,13 @@ class HiUser extends \Google\Protobuf\Internal\Message
3638
* @param array $data {
3739
* Optional. Data for populating the Message object.
3840
*
39-
* @var string $name
40-
* @var int $sex
41-
* }
41+
* @var string $name
42+
* @var int $sex
43+
* }
4244
*/
4345
public function __construct($data = null)
4446
{
45-
\HyperfTest\ResourceGrpc\Stubs\Grpc\GPBMetadata\Grpc\Grpc::initOnce();
47+
Grpc::initOnce();
4648
parent::__construct($data);
4749
}
4850

tests/Stubs/Models/Reply.php

+1
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 HyperfTest\ResourceGrpc\Stubs\Models;
1314

1415
use Hyperf\Database\Model\Model;

tests/Stubs/Models/User.php

+1
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 HyperfTest\ResourceGrpc\Stubs\Models;
1314

1415
use Hyperf\Database\Model\Model;

tests/Stubs/Resources/AllReplyResource.php

+1
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 HyperfTest\ResourceGrpc\Stubs\Resources;
1314

1415
use Hyperf\ResourceGrpc\GrpcResource;

tests/Stubs/Resources/HiReplyResource.php

+1
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 HyperfTest\ResourceGrpc\Stubs\Resources;
1314

1415
use Hyperf\ResourceGrpc\GrpcResource;

tests/Stubs/Resources/HiUserResource.php

+1
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 HyperfTest\ResourceGrpc\Stubs\Resources;
1314

1415
use Hyperf\ResourceGrpc\GrpcResource;

0 commit comments

Comments
 (0)