Skip to content

Commit cbece8b

Browse files
Fix the lint failings and optim the codes in FQN style (#2960)
1 parent 9ccf262 commit cbece8b

27 files changed

+435
-462
lines changed

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"clipboard": "^2.0.11",
1313
"dynamics.js": "^1.1.5",
1414
"gsap": "^3.13.0",
15-
"tailwindcss": "^3.4.17"
15+
"tailwindcss": "^3.4.18"
1616
},
1717
"devDependencies": {
1818
"@types/markdown-it": "^14.1.2",
19-
"@types/node": "^22.18.6",
19+
"@types/node": "^22.18.12",
2020
"postcss": "^8.5.6",
2121
"postcss-import": "^16.1.1",
22-
"tenyun": "^0.13.4",
22+
"tenyun": "^0.14.0",
2323
"vitepress": "1.6.3"
2424
},
2525
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"

docs/pnpm-lock.yaml

Lines changed: 396 additions & 387 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ parameters:
5757
-
5858
message: '#Method EasyWeChat\\Pay\\Client::createMockClient\(\) should return Mockery\\Mock\|Symfony\\Contracts\\HttpClient\\HttpClientInterface but returns Mockery\\LegacyMockInterface#'
5959
path: src/Pay/Client.php
60-
-
61-
message: '#Call to function is_string\(\) with string will always evaluate to true#'
62-
path: src/Pay/Client.php
6360
-
6461
message: '#Parameter \#1 \$scopes of method Overtrue\\Socialite\\Providers\\Base::scopes\(\) expects array<string>#'
6562
path: src/Work/Application.php

src/Kernel/Config.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use EasyWeChat\Kernel\Contracts\Config as ConfigInterface;
99
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
1010
use EasyWeChat\Kernel\Support\Arr;
11-
use JetBrains\PhpStorm\Pure;
1211

1312
use function strval;
1413

@@ -33,7 +32,7 @@ public function __construct(
3332
$this->checkMissingKeys();
3433
}
3534

36-
#[Pure]
35+
#[\JetBrains\PhpStorm\Pure]
3736
public function has(string $key): bool
3837
{
3938
return Arr::has($this->items, $key);
@@ -42,7 +41,7 @@ public function has(string $key): bool
4241
/**
4342
* @param array<string>|string $key
4443
*/
45-
#[Pure]
44+
#[\JetBrains\PhpStorm\Pure]
4645
public function get(array|string $key, mixed $default = null): mixed
4746
{
4847
if (is_array($key)) {
@@ -56,7 +55,7 @@ public function get(array|string $key, mixed $default = null): mixed
5655
* @param array<string> $keys
5756
* @return array<string, mixed>
5857
*/
59-
#[Pure]
58+
#[\JetBrains\PhpStorm\Pure]
6059
public function getMany(array $keys): array
6160
{
6261
$config = [];
@@ -85,13 +84,13 @@ public function all(): array
8584
return $this->items;
8685
}
8786

88-
#[Pure]
87+
#[\JetBrains\PhpStorm\Pure]
8988
public function offsetExists(mixed $offset): bool
9089
{
9190
return $this->has(strval($offset));
9291
}
9392

94-
#[Pure]
93+
#[\JetBrains\PhpStorm\Pure]
9594
public function offsetGet(mixed $offset): mixed
9695
{
9796
return $this->get(strval($offset));

src/Kernel/Form/Form.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace EasyWeChat\Kernel\Form;
44

5-
use JetBrains\PhpStorm\ArrayShape;
65
use Symfony\Component\Mime\Part\DataPart;
76
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
87

@@ -26,7 +25,7 @@ public static function create(array $fields): Form
2625
/**
2726
* @return array{headers:array<string,string|string[]>,body:string}
2827
*/
29-
#[ArrayShape(['headers' => 'array', 'body' => 'string'])]
28+
#[\JetBrains\PhpStorm\ArrayShape(['headers' => 'array', 'body' => 'string'])]
3029
public function toArray(): array
3130
{
3231
return $this->toOptions();
@@ -35,7 +34,7 @@ public function toArray(): array
3534
/**
3635
* @return array{headers:array<string,string|string[]>,body:string}
3736
*/
38-
#[ArrayShape(['headers' => 'array', 'body' => 'string'])]
37+
#[\JetBrains\PhpStorm\ArrayShape(['headers' => 'array', 'body' => 'string'])]
3938
public function toOptions(): array
4039
{
4140
$formData = new FormDataPart($this->fields);

src/Kernel/HttpClient/RequestUtil.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use EasyWeChat\Kernel\Support\UserAgent;
1010
use EasyWeChat\Kernel\Support\Xml;
1111
use InvalidArgumentException;
12-
use JetBrains\PhpStorm\ArrayShape;
1312
use Nyholm\Psr7\Factory\Psr17Factory;
1413
use Nyholm\Psr7Server\ServerRequestCreator;
1514
use Psr\Http\Message\ServerRequestInterface;
@@ -28,7 +27,7 @@ class RequestUtil
2827
* @param array<string, mixed> $options
2928
* @return array<string, mixed>
3029
*/
31-
#[ArrayShape([
30+
#[\JetBrains\PhpStorm\ArrayShape([
3231
'status_codes' => 'array',
3332
'delay' => 'int',
3433
'max_delay' => 'int',

src/Kernel/Support/Arr.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44

55
namespace EasyWeChat\Kernel\Support;
66

7-
use JetBrains\PhpStorm\Pure;
8-
97
use function is_string;
108

119
class Arr
1210
{
13-
#[Pure]
11+
#[\JetBrains\PhpStorm\Pure]
1412
public static function get(mixed $array, string|int|null $key, mixed $default = null): mixed
1513
{
1614
if (! is_array($array)) {
@@ -97,7 +95,7 @@ public static function dot(array $array, string $prepend = ''): array
9795
* @param array<string|int, mixed> $array
9896
* @param string|int|array<string|int, mixed>|null $keys
9997
*/
100-
#[Pure]
98+
#[\JetBrains\PhpStorm\Pure]
10199
public static function has(array $array, string|int|array|null $keys): bool
102100
{
103101
if (is_null($keys)) {

src/Kernel/Support/PrivateKey.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace EasyWeChat\Kernel\Support;
44

5-
use JetBrains\PhpStorm\Pure;
6-
75
use function file_exists;
86
use function file_get_contents;
97
use function str_starts_with;
@@ -31,7 +29,7 @@ public function getPassphrase(): ?string
3129
return $this->passphrase;
3230
}
3331

34-
#[Pure]
32+
#[\JetBrains\PhpStorm\Pure]
3533
public function __toString(): string
3634
{
3735
return $this->getKey();

src/Kernel/Traits/InteractWithHandlers.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Closure;
88
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
9-
use JetBrains\PhpStorm\ArrayShape;
109

1110
use function array_reverse;
1211
use function array_unshift;
@@ -52,7 +51,7 @@ public function withHandler(callable|string $handler): static
5251
/**
5352
* @return array{hash: string, handler: callable}
5453
*/
55-
#[ArrayShape(['hash' => 'string', 'handler' => 'callable'])]
54+
#[\JetBrains\PhpStorm\ArrayShape(['hash' => 'string', 'handler' => 'callable'])]
5655
public function createHandlerItem(callable|string $handler): array
5756
{
5857
return [

src/Kernel/Traits/MockableHttpClient.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace EasyWeChat\Kernel\Traits;
44

5-
use JetBrains\PhpStorm\Pure;
65
use Mockery\Mock;
76
use Symfony\Component\HttpClient\DecoratorTrait;
87
use Symfony\Component\HttpClient\MockHttpClient;
@@ -53,13 +52,13 @@ public function __call(string $name, array $arguments): mixed
5352
return $this->client->$name(...$arguments);
5453
}
5554

56-
#[Pure]
55+
#[\JetBrains\PhpStorm\Pure]
5756
public function getRequestMethod(): string
5857
{
5958
return $this->mockResponse->getRequestMethod();
6059
}
6160

62-
#[Pure]
61+
#[\JetBrains\PhpStorm\Pure]
6362
public function getRequestUrl(): string
6463
{
6564
return $this->mockResponse->getRequestUrl();
@@ -68,7 +67,7 @@ public function getRequestUrl(): string
6867
/**
6968
* @return array<string, mixed>
7069
*/
71-
#[Pure]
70+
#[\JetBrains\PhpStorm\Pure]
7271
public function getRequestOptions(): array
7372
{
7473
return $this->mockResponse->getRequestOptions();

0 commit comments

Comments
 (0)