Skip to content

Commit 5a1c62e

Browse files
committed
refactor: drop phpstan
- move flow-php/types phpstan extension to standalone package
1 parent e466b8a commit 5a1c62e

115 files changed

Lines changed: 553 additions & 681 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ component_management:
207207
name: bridge-phpunit-telemetry
208208
paths:
209209
- src/bridge/phpunit/telemetry/**
210+
- component_id: bridge-phpstan-types
211+
name: bridge-phpstan-types
212+
paths:
213+
- src/bridge/phpstan/types/**
210214
- component_id: bridge-postgresql-valinor
211215
name: bridge-postgresql-valinor
212216
paths:

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ updates:
3737
schedule:
3838
interval: "daily"
3939

40-
- package-ecosystem: "composer"
41-
directory: "/tools/phpstan"
42-
schedule:
43-
interval: "daily"
44-
4540
- package-ecosystem: "composer"
4641
directory: "/tools/phpunit"
4742
schedule:

.github/workflows/baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
6363

6464
- name: Set up QEMU
65-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
65+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
6666

6767
- name: Login to GitHub Container Registry
6868
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0

.github/workflows/job-static-analyze.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,8 @@ jobs:
2828
dependencies: "${{ matrix.dependencies }}"
2929
coverage: "none"
3030

31-
- name: "Create cache directories"
32-
run: |
33-
mkdir -p var/phpstan/cache
34-
35-
- name: "Cache phpstan results"
36-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
37-
with:
38-
path: "var/phpstan/cache"
39-
key: "php-${{ matrix.php-version }}-cache-phpstan-${{ github.run_id }}"
40-
restore-keys: |
41-
php-${{ matrix.php-version }}-cache-phpstan-
42-
4331
- name: "Static Analyze (Mago)"
44-
run: "just analyze-mago"
32+
run: "just analyze"
4533

4634
- name: "Install actionlint + zizmor"
4735
env:
@@ -54,6 +42,3 @@ jobs:
5442
5543
- name: "Lint"
5644
run: "just lint"
57-
58-
- name: "Static Analyze"
59-
run: "just analyze --error-format=github"

.github/workflows/monorepo-split.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ jobs:
8989
split_repository: 'monolog-telemetry-bridge'
9090
- local_path: 'src/bridge/openapi/specification'
9191
split_repository: 'openapi-specification-bridge'
92+
- local_path: 'src/bridge/phpstan/types'
93+
split_repository: 'phpstan-types-bridge'
9294
- local_path: 'src/bridge/postgresql/valinor'
9395
split_repository: 'postgresql-valinor-bridge'
9496
- local_path: 'src/bridge/psr3/telemetry'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
6868

6969
- name: Set up QEMU
70-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
70+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
7171

7272
- name: Login to GitHub Container Registry
7373
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0

Justfile

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -54,62 +54,9 @@ lint-actions:
5454
zizmor --offline .github/workflows || rc=$?
5555
exit $rc
5656
57-
# Run static analysis (PHPStan).
57+
# Run static analysis (Mago). Paths come from `[source]` in mago.toml; `bin` and `web/landing` are analyzer-excluded.
5858
analyze *args:
59-
tools/phpstan/vendor/bin/phpstan analyze -c phpstan.neon --memory-limit=-1 {{args}}
60-
61-
# Run Mago static analyzer, scoped to packages we've finished migrating (add package paths below).
62-
analyze-mago *args:
63-
tools/mago/vendor/bin/mago analyze {{args}} \
64-
src/lib/types \
65-
src/lib/telemetry \
66-
src/lib/postgresql \
67-
src/lib/filesystem \
68-
src/lib/array-dot \
69-
src/lib/azure-sdk \
70-
src/lib/doctrine-dbal-bulk \
71-
src/lib/snappy \
72-
src/lib/parquet \
73-
src/core/etl \
74-
src/lib/parquet-viewer \
75-
src/bridge/openapi/specification \
76-
src/bridge/psr3/telemetry \
77-
src/bridge/symfony/http-foundation-telemetry \
78-
src/bridge/telemetry/otlp \
79-
src/bridge/filesystem/async-aws \
80-
src/bridge/filesystem/azure \
81-
src/bridge/monolog/http \
82-
src/bridge/monolog/telemetry \
83-
src/bridge/phpunit/postgresql \
84-
src/bridge/phpunit/telemetry \
85-
src/bridge/postgresql/valinor \
86-
src/bridge/psr18/telemetry \
87-
src/bridge/psr7/telemetry \
88-
src/bridge/symfony/filesystem-bundle \
89-
src/bridge/symfony/filesystem-cache \
90-
src/bridge/symfony/http-foundation \
91-
src/bridge/symfony/postgresql-bundle \
92-
src/bridge/symfony/postgresql-cache \
93-
src/bridge/symfony/postgresql-messenger \
94-
src/bridge/symfony/postgresql-session \
95-
src/bridge/symfony/telemetry-bundle \
96-
src/adapter/etl-adapter-chartjs \
97-
src/adapter/etl-adapter-csv \
98-
src/adapter/etl-adapter-doctrine \
99-
src/adapter/etl-adapter-excel \
100-
src/adapter/etl-adapter-http \
101-
src/adapter/etl-adapter-json \
102-
src/adapter/etl-adapter-parquet \
103-
src/adapter/etl-adapter-text \
104-
src/adapter/etl-adapter-xml \
105-
src/adapter/etl-adapter-avro \
106-
src/adapter/etl-adapter-elasticsearch \
107-
src/adapter/etl-adapter-google-sheet \
108-
src/adapter/etl-adapter-logger \
109-
src/adapter/etl-adapter-postgresql \
110-
src/cli \
111-
src/extension/arrow-ext \
112-
src/extension/pg-query-ext
59+
tools/mago/vendor/bin/mago analyze {{args}}
11360

11461
# Auto-fix code style (Mago format + lint --fix) and GitHub Actions findings (zizmor --fix).
11562
fix:

bin/docs.php

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

3737
$application = new Application('Flow-PHP - Documentation');
3838

39-
$application->add(new class extends Command {
39+
$application->addCommand(new class extends Command {
4040
public function configure(): void
4141
{
4242
$this
@@ -90,7 +90,10 @@ public function execute(InputInterface $input, OutputInterface $output): int
9090
__DIR__ . '/../src/bridge/telemetry/otlp/src/Flow/Bridge/Telemetry/OTLP/DSL/functions.php',
9191
];
9292

93-
$extractor = new FunctionsExtractor($input->getOption('repository-root-path'), new FunctionCollector());
93+
$extractor = new FunctionsExtractor(
94+
(string) $input->getOption('repository-root-path'),
95+
new FunctionCollector(),
96+
);
9497

9598
$normalizedFunctions = [];
9699

@@ -113,7 +116,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
113116
}
114117
});
115118

116-
$application->add(new class extends Command {
119+
$application->addCommand(new class extends Command {
117120
public function configure(): void
118121
{
119122
$this

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"nyholm/psr7": "^1.8",
6161
"php-http/curl-client": "^2.2",
6262
"php-http/mock-client": "^1.5",
63+
"phpstan/phpstan": "^2.1",
6364
"ramsey/uuid": "^4.5",
6465
"symfony/cache": "^6.4 || ^7.4 || ^8.0",
6566
"symfony/dotenv": "^6.4 || ^7.4 || ^8.0",
@@ -103,6 +104,7 @@
103104
"flow-php/openapi-specification-bridge": "self.version",
104105
"flow-php/parquet": "self.version",
105106
"flow-php/parquet-viewer": "self.version",
107+
"flow-php/phpstan-types-bridge": "self.version",
106108
"flow-php/postgresql": "self.version",
107109
"flow-php/postgresql-valinor-bridge": "self.version",
108110
"flow-php/psr3-telemetry-bridge": "self.version",
@@ -149,6 +151,7 @@
149151
"src/bridge/monolog/http/src/Flow",
150152
"src/bridge/monolog/telemetry/src/Flow",
151153
"src/bridge/openapi/specification/src/Flow",
154+
"src/bridge/phpstan/types/src/Flow",
152155
"src/bridge/postgresql/valinor/src/Flow",
153156
"src/bridge/psr3/telemetry/src/Flow",
154157
"src/bridge/psr7/telemetry/src/Flow",
@@ -266,6 +269,7 @@
266269
"src/bridge/monolog/http/tests/Flow",
267270
"src/bridge/monolog/telemetry/tests/Flow",
268271
"src/bridge/openapi/specification/tests/Flow",
272+
"src/bridge/phpstan/types/tests/Flow",
269273
"src/bridge/postgresql/valinor/tests/Flow",
270274
"src/bridge/psr3/telemetry/tests/Flow",
271275
"src/bridge/psr7/telemetry/tests/Flow",
@@ -331,7 +335,6 @@
331335
"composer install --working-dir=./tools/infection",
332336
"composer install --working-dir=./tools/mago",
333337
"composer install --working-dir=./tools/monorepo",
334-
"composer install --working-dir=./tools/phpstan",
335338
"composer install --working-dir=./tools/phpunit",
336339
"composer install --working-dir=./tools/phpdocumentor"
337340
],
@@ -341,7 +344,6 @@
341344
"composer update --working-dir=./tools/infection",
342345
"composer update --working-dir=./tools/mago",
343346
"composer update --working-dir=./tools/monorepo",
344-
"composer update --working-dir=./tools/phpstan",
345347
"composer update --working-dir=./tools/phpunit",
346348
"composer update --working-dir=./tools/phpdocumentor"
347349
]

composer.lock

Lines changed: 65 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)