Skip to content

chore: add composer dependecy age#70

Merged
konradmichalik merged 4 commits intomainfrom
add-composer-dependecy-age
Sep 7, 2025
Merged

chore: add composer dependecy age#70
konradmichalik merged 4 commits intomainfrom
add-composer-dependecy-age

Conversation

@konradmichalik
Copy link
Copy Markdown
Contributor

@konradmichalik konradmichalik commented Sep 7, 2025

Summary by CodeRabbit

  • Chores

    • Added a development dependency to analyze dependency freshness and enabled its plugin.
    • Updated .gitignore to exclude a new cache file.
  • Tests

    • Simplified tests to use public APIs directly, removing reflection-based access.
    • No changes to runtime behavior or user-facing functionality.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Sep 7, 2025

Walkthrough

Adds a dev tool (composer-dependency-age) and ignores its cache file. Test suite updates remove Reflection visibility overrides, implying several validator properties/methods are now public (e.g., logger, resetState, keyData, analyzeHtmlStructure, extractPlaceholders). No functional production logic is shown changed beyond these visibility adjustments.

Changes

Cohort / File(s) Summary
VCS ignore
./.gitignore
Adds root-level ignore entry for ".dependency-age.cache".
Composer tooling
./composer.json
Adds dev dependency konradmichalik/composer-dependency-age@dev-main and whitelists it under config.allow-plugins.
Tests: validator internals now publicly accessible
tests/src/Validator/AbstractValidatorTest.php, tests/src/Validator/DuplicateValuesValidatorTest.php, tests/src/Validator/EncodingValidatorTest.php, tests/src/Validator/HtmlTagValidatorTest.php, tests/src/Validator/MismatchValidatorTest.php, tests/src/Validator/PlaceholderConsistencyValidatorTest.php, tests/src/Validator/KeyNamingConventionValidatorTest.php
Removes Reflection setAccessible(true) calls. Tests now access/invoke members directly. Reported public members include: AbstractValidator::$logger, AbstractValidator::resetState(), HtmlTagValidator::analyzeHtmlStructure(), HtmlTagValidator::$keyData, HtmlTagValidator::resetState(), MismatchValidator::$keyArray, MismatchValidator::$issues, MismatchValidator::resetState(), PlaceholderConsistencyValidator::$keyData, PlaceholderConsistencyValidator::extractPlaceholders(), PlaceholderConsistencyValidator::resetState(), PlaceholderConsistencyValidator::findPlaceholderInconsistencies().
Tests: reflection removed without explicit src visibility note
tests/src/Validator/KeyDepthValidatorTest.php
Deletes setAccessible(true) before invoking a previously non-public method; test now invokes it directly via Reflection without bypassing visibility.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A rabbit taps a tiny key, click-clack—no peeks inside!
The doors swing open, tests now hop with honest pride.
A cache burrow hidden, Composer checks its age,
While validators wave—now center stage.
Ears up, code neat, reflections set aside.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-composer-dependecy-age

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
Copy Markdown

@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)
composer.json (1)

33-35: Avoid a floating dev branch for reproducibility.

Using "dev-main" can introduce nondeterministic CI runs. Prefer a tagged release or pin to a commit to lock builds.

Example change (replace with the actual commit/tag when available):

-        "konradmichalik/composer-dependency-age": "dev-main",
+        "konradmichalik/composer-dependency-age": "dev-main#<commit-sha>",

Optional: add prefer-stable to nudge the solver toward stable versions:

"config": {
  "allow-plugins": {
    "ergebnis/composer-normalize": true,
    "konradmichalik/composer-dependency-age": true
  },
  "sort-packages": true,
  "prefer-stable": true
}

Also consider a script alias so the tool is easy to run locally/CI (adjust command as needed):

"scripts": {
  "sca:deps": "composer dependency-age",
  "sca": ["@sca:php", "@sca:deps"]
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 428440f and 394528d.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • .gitignore (1 hunks)
  • composer.json (2 hunks)
  • tests/src/Validator/AbstractValidatorTest.php (0 hunks)
  • tests/src/Validator/DuplicateValuesValidatorTest.php (0 hunks)
  • tests/src/Validator/EncodingValidatorTest.php (0 hunks)
  • tests/src/Validator/HtmlTagValidatorTest.php (0 hunks)
  • tests/src/Validator/KeyDepthValidatorTest.php (0 hunks)
  • tests/src/Validator/KeyNamingConventionValidatorTest.php (0 hunks)
  • tests/src/Validator/MismatchValidatorTest.php (0 hunks)
  • tests/src/Validator/PlaceholderConsistencyValidatorTest.php (0 hunks)
💤 Files with no reviewable changes (8)
  • tests/src/Validator/DuplicateValuesValidatorTest.php
  • tests/src/Validator/KeyDepthValidatorTest.php
  • tests/src/Validator/EncodingValidatorTest.php
  • tests/src/Validator/HtmlTagValidatorTest.php
  • tests/src/Validator/KeyNamingConventionValidatorTest.php
  • tests/src/Validator/AbstractValidatorTest.php
  • tests/src/Validator/PlaceholderConsistencyValidatorTest.php
  • tests/src/Validator/MismatchValidatorTest.php
🔇 Additional comments (2)
composer.json (1)

56-58: Allow-plugins entry looks correct.

Scoped to the root package; consumers of this plugin won’t inherit it. No concerns.

.gitignore (1)

3-3: LGTM — cache file is correctly ignored at repo root.

Nothing else needed.

@konradmichalik konradmichalik merged commit 86cc50c into main Sep 7, 2025
26 checks passed
@konradmichalik konradmichalik deleted the add-composer-dependecy-age branch September 7, 2025 13:16
@coderabbitai coderabbitai bot mentioned this pull request Oct 19, 2025
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.

1 participant