Skip to content

Merge 3.1.x into master - #638

Merged
armanist merged 2 commits into
masterfrom
3.1.x
Oct 29, 2026
Merged

armanist merged 2 commits into
masterfrom
3.1.x

Conversation

@armanist

@armanist armanist commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #633.

Summary by CodeRabbit

  • Refactor
    • Streamlined directory and file path resolution across environment setup, configuration, command-line tools, helper loading, and view caching. Existing paths and behavior remain unchanged.
  • Tests
    • Added coverage confirming view cache paths for applications with and without a matched module.

armanist and others added 2 commits October 29, 2026 17:10
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Issue/633 Reduce the repeated base directory lookups
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between f5090eb and 99e3baf.

Files selected for processing: 7
  • CHANGELOG.md
  • src/App/Stages/Boot/LoadHelpersStage.php
  • src/Config/Config.php
  • src/Console/Commands/EnvCommand.php
  • src/Environment/Environment.php
  • src/ResourceCache/ViewCache.php
  • tests/Unit/ResourceCache/ViewCacheTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Several methods reuse a captured base directory when building paths. LoadHelpersStage uses modules_dir() for module helper paths. ViewCache builds the same cache paths and adds tests for paths with and without a matched module.

Changes: Path Construction Cleanup

Layer / File(s) Summary
Reuse base directory paths
src/Console/Commands/EnvCommand.php, src/Environment/Environment.php, src/Config/Config.php, src/App/Stages/Boot/LoadHelpersStage.php, CHANGELOG.md
EnvCommand, Environment, and Config reuse a captured base directory to build paths. LoadHelpersStage uses modules_dir() to build the module helpers path.
Build and test view cache paths
src/ResourceCache/ViewCache.php, tests/Unit/ResourceCache/ViewCacheTest.php
ViewCache appends the lowercased module name to the views directory when a current module exists. Tests cover the cache path with and without a matched module.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Suggested reviewers: andrey-smaelov, hatik92

Merge Risk: Minimal · up to 99e3b

The PR preserves existing path behavior while reducing repeated lookups, and no merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check Inconclusive Issue #633 requires one base-directory lookup in EnvCommand::exec(), Environment, Config, and the related ViewCache path logic. The summary shows these local values and shows `LoadHelpersStage… Provide the results for the four required Composer checks, including the existing test suite.
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately states that the pull request merges 3.1.x into master. It does not describe the base-directory lookup changes, but it clearly reflects the pull request objective.
Out of Scope Changes check Passed The reported changes stay within issue #633. The ViewCache path refactor and its tests verify the same base-directory path reuse and unchanged path behavior. The changelog entry documents the implem…
Full details: Out of Scope Changes check

Explanation

The reported changes stay within issue #633. The ViewCache path refactor and its tests verify the same base-directory path reuse and unchanged path behavior. The changelog entry documents the implementation. No unrelated change is reported.

Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Linked Issues check

Explanation

Issue #633 requires one base-directory lookup in EnvCommand::exec(), Environment, Config, and the related ViewCache path logic. The summary shows these local values and shows LoadHelpersStage using modules_dir(). The added ViewCacheTest tests both module and non-module paths. The summary reports no results for composer test, composer cs:check, composer phpstan, or composer rector:check, so full acceptance cannot be confirmed.

Resolution

Provide the results for the four required Composer checks, including the existing test suite.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@armanist
armanist merged commit d6365e6 into master Oct 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce the repeated base directory lookups

1 participant