-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CompileApp #423
CompileApp #423
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## 1.x #423 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 243 254 +11
===========================================
Files 54 55 +1
Lines 817 856 +39
===========================================
+ Hits 817 856 +39
☔ View full report in Codecov by Sentry. |
@NaokiTsuchiya Gentle reminder |
@coderabbitai review |
Actions performedReview triggered.
|
WalkthroughWalkthroughThe recent changes introduce updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- composer.json (2 hunks)
- src/Compiler/CompileApp.php (1 hunks)
- tests/CompileAppTest.php (1 hunks)
- tests/Fake/fake-min-app/composer.json (1 hunks)
- tests/Fake/fake-min-app/src/Module/App.php (1 hunks)
- tests/Fake/fake-min-app/src/Module/AppModule.php (1 hunks)
- tests/Fake/fake-min-app/src/Resource/Page/Index.php (1 hunks)
Files skipped from review due to trivial changes (1)
- tests/Fake/fake-min-app/composer.json
Additional context used
PHPStan
tests/CompileAppTest.php
13-13: Class BEAR\Package\CompileAppTest extends unknown class PHPUnit\Framework\TestCase.
18-18: Class Ray\Compiler\CompileInjector not found.
20-20: Call to an undefined method BEAR\Package\CompileAppTest::assertSame().
src/Compiler/CompileApp.php
45-45: Parameter $injector of method BEAR\Package\Compiler\CompileApp::compile() has invalid type Ray\Compiler\CompileInjector.
48-48: Class Doctrine\Common\Annotations\Reader not found.
49-49: Class Doctrine\Common\Annotations\Reader not found.
50-50: Class BEAR\Resource\NamedParameterInterface not found.
51-51: Class BEAR\Resource\NamedParameterInterface not found.
53-53: Class BEAR\Sunday\Extension\Application\AppInterface not found.
54-54: Class BEAR\Sunday\Extension\Application\AppInterface not found.
55-55: Class BEAR\AppMeta\AbstractAppMeta not found.
75-75: Parameter $namedParams of method BEAR\Package\Compiler\CompileApp::saveMeta() has invalid type BEAR\Resource\NamedParameterInterface.
93-93: Parameter $namedParameter of method BEAR\Package\Compiler\CompileApp::saveNamedParam() has invalid type BEAR\Resource\NamedParameterInterface.
108-108: Caught class BEAR\Resource\Exception\ParameterException not found.
116-116: Parameter $meta of method BEAR\Package\Compiler\CompileApp::compileExtraContexts() has invalid type BEAR\AppMeta\AbstractAppMeta.
118-118: Instantiated class Ray\PsrCacheModule\LocalCacheProvider not found.
120-120: Instantiated class BEAR\AppMeta\Meta not found.
121-121: Class BEAR\Sunday\Extension\Application\AppInterface not found.
Additional comments not posted (9)
tests/Fake/fake-min-app/src/Resource/Page/Index.php (2)
12-14
: Constructor uses PHP 8 promoted properties effectively.
15-18
: Ensure returning$this
fromonGet()
aligns with intended API design.tests/CompileAppTest.php (1)
18-18
:CompileInjector
class not found. Verify the correct namespace or existence of the class.Tools
PHPStan
18-18: Class Ray\Compiler\CompileInjector not found.
tests/Fake/fake-min-app/src/Module/AppModule.php (1)
22-25
: Proper use of dependency injection inconfigure()
method.tests/Fake/fake-min-app/src/Module/App.php (1)
19-26
: Effective use of PHP 8 promoted properties for dependency injection in the constructor.composer.json (2)
54-60
: Updated autoloading paths correctly reflect the new structure.
75-76
: Updated scripts to use local vendor binaries, aligning with best practices.src/Compiler/CompileApp.php (2)
75-91
: Correct filtering of methods starting with 'on' insaveMeta
.Tools
PHPStan
75-75: Parameter $namedParams of method BEAR\Package\Compiler\CompileApp::saveMeta() has invalid type BEAR\Resource\NamedParameterInterface.
93-113
: Proper handling of exceptions insaveNamedParam
.Tools
PHPStan
93-93: Parameter $namedParameter of method BEAR\Package\Compiler\CompileApp::saveNamedParam() has invalid type BEAR\Resource\NamedParameterInterface.
108-108: Caught class BEAR\Resource\Exception\ParameterException not found.
Compilerの代替です。Injectorを渡すと以下のコンパイルが行われます。
(アノテーションのキャッシュは行われません)
コンテキスト配列を渡すと他のコンテキストでもDI/AOPファイルの生成が行われます。
最初のヘルスチェックに一度だけ行う事を想定しています。
背景
Compilerはディプロイ前のCLIでの実行を想定して作成されました。
CompileApp
はCLIとともにwebでのヘルスチェックでも使えるように実行速度を求めてよりコンパクトになったものです。またPHP8アトリビュートの普及によりアノテーションのコンパイルも取り除かれています。