Fix correct typo in variable and directory name in DependencySaver#131
Fix correct typo in variable and directory name in DependencySaver#131koriym merged 1 commit intoray-di:1.xfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideCorrects 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 fixclassDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughA typo in the directory path name is corrected in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
$qualiferto$qualifierthroughout 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
📒 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
/qualifierinstead of/qualifer, ensuring the application creates files in the correct location. Since qualifier files are recreated on each deploy, existing stalequaliferdirectories will not cause issues.
|
Thank you for the contribution! Released in 1.13.1 🎉 |
qualiferディレクトリとqualifierディレクトリができている。Summary by Sourcery
Bug Fixes:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.