Skip to content

Commit e8d2a7a

Browse files
authored
废弃 imi-macro,移出主仓库 (#598)
1 parent cd937b1 commit e8d2a7a

37 files changed

+11
-615
lines changed

.github/workflows/phpstan.yml

-5
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,6 @@ jobs:
141141
run: |
142142
docker exec ${ENV_SERVICE} ./dev/phpstan.sh workerman-gateway
143143
144-
- name: Analyse macro
145-
if: ${{ env.test_prepared && always() }}
146-
run: |
147-
docker exec ${ENV_SERVICE} ./dev/phpstan.sh macro
148-
149144
- name: Analyse phar
150145
if: ${{ env.test_prepared && always() }}
151146
run: |

.github/workflows/rector.yml

-5
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,3 @@ jobs:
140140
if: ${{ env.test_prepared && always() }}
141141
run: |
142142
docker exec -w /imi/src/Components/workerman-gateway ${ENV_SERVICE} /imi/vendor/bin/rector process --dry-run
143-
144-
- name: Analyse macro
145-
if: ${{ env.test_prepared && always() }}
146-
run: |
147-
docker exec -w /imi/src/Components/macro ${ENV_SERVICE} /imi/vendor/bin/rector process --dry-run

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ composer.lock
1212
/split-repository/vendor
1313
/.vscode
1414
*.pid
15-
*.macro.php
1615
/.phpbench
1716
/node_modules
1817
/tests/clover.xml

.php-cs-fixer.php

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
->setFinder(
133133
PhpCsFixer\Finder::create()
134134
->in(__DIR__)
135-
->notName('*.macro.php')
136135
->notPath('src/Components/swoole/src/Util/Coroutine.typed.php') // 兼容 Swoole 5.0,需要 PHP >= 8.0
137136
->notPath('src/Components/hprose/src/Imi-Server-Hprose/Server.php') // bug: https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/6534
138137
->notPath('src/Components/grpc/example/grpc')

dev/phpstan.sh

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ components=(
2525
"swoole-tracker"
2626
"workerman"
2727
"workerman-gateway"
28-
"macro"
2928
)
3029

3130
analyze_component() {

dev/rector.sh

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ components=(
2525
"swoole-tracker"
2626
"workerman"
2727
"workerman-gateway"
28-
"macro"
2928
)
3029

3130
analyze_component() {

doc/SUMMARY.md

-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@
210210
* [定时器](components/timer/index.md)
211211
* [异步执行](components/async/index.md)
212212
* [雪花算法发号器](components/snowflake.md)
213-
* [宏定义](components/macro.md)
214213
* [Phar打包器](components/phar/index.md)
215214
* [imi 组件列表一览](components/list.md)
216215
* [PostgreSQL](components/db/pgsql.md)

doc/base/version/2.1-3.0.md

+4
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919
* `Imi\AMQP\Annotation\Connection` 注解类的连接配置全部废弃,只保留 `poolName`
2020

2121
* 废弃 `Imi\AMQP\Swoole\AMQPSwooleConnection` 客户端类
22+
23+
### imi-macro
24+
25+
废弃并移出主仓库,代码仓库:<https://github.com/imiphp/imi-macro>

doc/components/macro.md

-118
This file was deleted.

doc/components/phar/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ vendor/bin/imi-phar build xxx
4949

5050
// 参与打包的文件
5151
// 可选值:
52-
// - '*'自动包含根目录下的 *.php、*.macro 文件。(默认)
52+
// - '*'自动包含根目录下的 *.php 文件。(默认)
5353
// - 空数组不包含任何文件。
5454
// - 定义数组并填入文件名(仅限于当前目录下的文件)。
5555
'files' => '*',
@@ -225,7 +225,7 @@ return [
225225
### 内置过滤器(vendor)
226226

227227
```php
228-
->notName(['/LICENSE|.*\\.md|.*\\.dist|Makefile/', '*.macro.php'])
228+
->notName(['/LICENSE|.*\\.md|.*\\.dist|Makefile/'])
229229
->exclude([
230230
'doc',
231231
'test',

phpstan-baseline/baseline-jwt.neon

-50
Original file line numberDiff line numberDiff line change
@@ -60,56 +60,6 @@ parameters:
6060
count: 1
6161
path: ../src/Components/jwt/src/Bean/JWT.php
6262

63-
-
64-
message: "#^Call to an undefined method Lcobucci\\\\JWT\\\\Builder\\:\\:sign\\(\\)\\.$#"
65-
count: 1
66-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
67-
68-
-
69-
message: "#^Call to an undefined method Lcobucci\\\\JWT\\\\Token\\:\\:validate\\(\\)\\.$#"
70-
count: 1
71-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
72-
73-
-
74-
message: "#^Call to an undefined method Lcobucci\\\\JWT\\\\Token\\:\\:verify\\(\\)\\.$#"
75-
count: 1
76-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
77-
78-
-
79-
message: "#^Call to method setAudience\\(\\) on an unknown class Lcobucci\\\\JWT\\\\ValidationData\\.$#"
80-
count: 1
81-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
82-
83-
-
84-
message: "#^Call to method setId\\(\\) on an unknown class Lcobucci\\\\JWT\\\\ValidationData\\.$#"
85-
count: 1
86-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
87-
88-
-
89-
message: "#^Call to method setIssuer\\(\\) on an unknown class Lcobucci\\\\JWT\\\\ValidationData\\.$#"
90-
count: 1
91-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
92-
93-
-
94-
message: "#^Call to method setSubject\\(\\) on an unknown class Lcobucci\\\\JWT\\\\ValidationData\\.$#"
95-
count: 1
96-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
97-
98-
-
99-
message: "#^Cannot instantiate interface Lcobucci\\\\JWT\\\\Builder\\.$#"
100-
count: 1
101-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
102-
103-
-
104-
message: "#^Cannot instantiate interface Lcobucci\\\\JWT\\\\Parser\\.$#"
105-
count: 2
106-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
107-
108-
-
109-
message: "#^Instantiated class Lcobucci\\\\JWT\\\\ValidationData not found\\.$#"
110-
count: 1
111-
path: ../src/Components/jwt/src/Bean/JWT.php.macro.php
112-
11363
-
11464
message: "#^Call to an undefined method Lcobucci\\\\JWT\\\\Token\\:\\:claims\\(\\)\\.$#"
11565
count: 1

phpstan-baseline/baseline-macro.neon

-2
This file was deleted.

split-repository/release.php

-3
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ function getBranch(): string
167167
'src/Components/roadrunner' => [
168168
'git@github.com:imiphp/imi-roadrunner',
169169
],
170-
'src/Components/macro' => [
171-
'git@github.com:imiphp/imi-macro',
172-
],
173170
'src/Components/phar' => [
174171
'git@github.com:imiphp/imi-phar',
175172
],

split-repository/split.php

-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ function saveConfig(): void
186186
'src/Components/roadrunner' => [
187187
'git@github.com:imiphp/imi-roadrunner',
188188
],
189-
'src/Components/macro' => [
190-
'git@github.com:imiphp/imi-macro',
191-
],
192189
'src/Components/phar' => [
193190
'git@github.com:imiphp/imi-phar',
194191
],

src/Bean/AnnotationParser.php

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
# macro
4-
53
declare(strict_types=1);
64

75
namespace Imi\Bean;
@@ -123,7 +121,6 @@ public function execParse(string $className): void
123121
public function parseClass(\ReflectionClass $ref): void
124122
{
125123
$annotations = $this->getReader()->getClassAnnotations($ref);
126-
# if PHP_VERSION_ID >= 80000
127124
if (
128125
\PHP_VERSION_ID >= 80000
129126
&& $phpAnnotations = $this->getPHPClassAnnotations($ref))
@@ -137,7 +134,6 @@ public function parseClass(\ReflectionClass $ref): void
137134
$annotations = $phpAnnotations;
138135
}
139136
}
140-
# endif
141137
foreach ($annotations as $i => $annotation)
142138
{
143139
if (!$annotation instanceof \Imi\Bean\Annotation\Base)

src/Components/jwt/composer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"Imi\\JWT\\Test\\": "tests/"
1818
},
1919
"files": [
20-
"../../../vendor/autoload.php",
21-
"../macro/vendor/autoload.php"
20+
"../../../vendor/autoload.php"
2221
]
2322
},
2423
"scripts": {},

src/Components/jwt/src/Bean/JWT.php

-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
# macro
4-
53
declare(strict_types=1);
64

75
namespace Imi\JWT\Bean;
@@ -344,16 +342,6 @@ public function validate(?string $name, Token $token): void
344342

345343
public function getJwtPackageVersion(): int
346344
{
347-
# if 0
348345
return class_exists(\Lcobucci\JWT\Token\Parser::class) ? 4 : 3;
349-
350-
# endif
351-
# if class_exists(\Lcobucci\JWT\Token\Parser::class)
352-
// @phpstan-ignore-next-line
353-
return 4;
354-
355-
# else
356-
return 3;
357-
# endif
358346
}
359347
}

src/Components/macro/.gitattributes

-10
This file was deleted.

src/Components/macro/.gitignore

-4
This file was deleted.

0 commit comments

Comments
 (0)