Skip to content

Fix correct typo in variable and directory name in DependencySaver#131

Merged
koriym merged 1 commit intoray-di:1.xfrom
apple-x-co:typo-qualifier
Dec 4, 2025
Merged

Fix correct typo in variable and directory name in DependencySaver#131
koriym merged 1 commit intoray-di:1.xfrom
apple-x-co:typo-qualifier

Conversation

@apple-x-co
Copy link
Contributor

@apple-x-co apple-x-co commented Dec 4, 2025

qualifer ディレクトリと qualifier ディレクトリができている。

cd $DOCUMENT_ROOT/var/tmp/prod-html-app/di
ls -1
...
...
...
_bindings.log
_compile.log
_module.txt
compiled
qualifer
qualifier

Summary by Sourcery

Bug Fixes:

  • Correct the output directory name for qualifier data to prevent writing to a misspelled path.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected a directory path misspelling that was causing path resolution errors in qualifier functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 4, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Corrects a typo in the directory path used when saving qualifiers in DependencySaver so that files are written under the intended 'qualifier' directory instead of the misspelled 'qualifer' directory.

Class diagram for DependencySaver qualifier directory fix

classDiagram
    class DependencySaver {
        - string scriptDir
        + __invoke(dependencyIndex string, code Code) void
        - saveQualifier(qualifer IpQualifier) void
    }

    class IpQualifier {
        + param ReflectionParameter
    }

    class ReflectionParameter {
        + getDeclaringClass() ReflectionClass
    }

    class ReflectionClass

    class Code

    DependencySaver --> IpQualifier : uses in saveQualifier
    IpQualifier --> ReflectionParameter : has param
    ReflectionParameter --> ReflectionClass : returns from getDeclaringClass
Loading

File-Level Changes

Change Details Files
Fix directory name typo used when creating and writing qualifier data so it targets the correct folder.
  • Update the hard-coded directory path from a misspelled folder name to the correct 'qualifier' directory
  • Preserve existing logic that ensures the directory exists before use and subsequent reflection handling of the qualifier parameter
src-deprecated/DependencySaver.php

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

A typo in the directory path name is corrected in DependencySaver::saveQualifier from /qualifer to /qualifier. The qualifier object remains unchanged with all logic preserved and no public API modifications.

Changes

Cohort / File(s) Summary
Typo correction
src-deprecated/DependencySaver.php
Fixed directory path typo: /qualifer/qualifier in the qualifier path construction

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A typo caught, a path made right,
/qualifer/qualifier shines bright,
One keystroke fixed, the bug takes flight,
Hopping through code with pure delight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing a typo in the DependencySaver file that corrects '/qualifer' to '/qualifier' in the directory name.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5ea4814) to head (9bd1b4c).
⚠️ Report is 2 commits behind head on 1.x.

Additional details and impacted files
@@             Coverage Diff             @@
##                 1.x      #131   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity        93        93           
===========================================
  Files             11        11           
  Lines            232       232           
===========================================
  Hits             232       232           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src-deprecated/DependencySaver.php (1)

46-62: Optional: Consider renaming the parameter for consistency.

The parameter name $qualifer (line 46) still contains the typo, while the local path variable is now correctly spelled as $qualifier (line 48). This creates a naming inconsistency within the method.

Since this class is deprecated, this is a low-priority refactor, but renaming the parameter from $qualifer to $qualifier throughout the method (lines 50, 59, 60, 62) would improve readability.

Example refactor:

-private function saveQualifier(IpQualifier $qualifer): void
+private function saveQualifier(IpQualifier $qualifier): void
 {
-    $qualifier = $this->scriptDir . '/qualifier';
-    ! file_exists($qualifier) && ! @mkdir($qualifier) && ! is_dir($qualifier);
-    $class = $qualifer->param->getDeclaringClass();
+    $qualifierPath = $this->scriptDir . '/qualifier';
+    ! file_exists($qualifierPath) && ! @mkdir($qualifierPath) && ! is_dir($qualifierPath);
+    $class = $qualifier->param->getDeclaringClass();
     if (! $class instanceof ReflectionClass) {
         throw new LogicException(); // @codeCoverageIgnore
     }

     $fileName = sprintf(
         ScriptInjector::QUALIFIER,
         $this->scriptDir,
         str_replace('\\', '_', $class->name),
-        $qualifer->param->getDeclaringFunction()->name,
-        $qualifer->param->name
+        $qualifier->param->getDeclaringFunction()->name,
+        $qualifier->param->name
     );
-    ($this->filePutContents)($fileName, serialize($qualifer->qualifier));
+    ($this->filePutContents)($fileName, serialize($qualifier->qualifier));
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ea4814 and 9bd1b4c.

📒 Files selected for processing (1)
  • src-deprecated/DependencySaver.php (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: koriym
Repo: ray-di/Ray.Compiler PR: 114
File: src/ScriptInjector.php:53-53
Timestamp: 2024-11-27T01:38:28.626Z
Learning: In this project, it's acceptable that files in the 'qualifier' directory are recreated on each deploy, so updating the 'QUALIFIER' constant in `src/ScriptInjector.php` without modifying dependent code is acceptable.
📚 Learning: 2024-11-27T01:38:28.626Z
Learnt from: koriym
Repo: ray-di/Ray.Compiler PR: 114
File: src/ScriptInjector.php:53-53
Timestamp: 2024-11-27T01:38:28.626Z
Learning: In this project, it's acceptable that files in the 'qualifier' directory are recreated on each deploy, so updating the 'QUALIFIER' constant in `src/ScriptInjector.php` without modifying dependent code is acceptable.

Applied to files:

  • src-deprecated/DependencySaver.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (1)
src-deprecated/DependencySaver.php (1)

48-48: Directory path corrected to use proper spelling.

The directory path now correctly uses /qualifier instead of /qualifer, ensuring the application creates files in the correct location. Since qualifier files are recreated on each deploy, existing stale qualifer directories will not cause issues.

@koriym koriym merged commit d5452da into ray-di:1.x Dec 4, 2025
21 checks passed
@apple-x-co apple-x-co deleted the typo-qualifier branch December 4, 2025 08:39
@koriym
Copy link
Member

koriym commented Dec 4, 2025

Thank you for the contribution! Released in 1.13.1 🎉

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.

2 participants