Skip to content

Refactor repository path logic and add locally tracked method#16

Merged
roble merged 2 commits into
mainfrom
dev
Jun 6, 2026
Merged

Refactor repository path logic and add locally tracked method#16
roble merged 2 commits into
mainfrom
dev

Conversation

@roble

@roble roble commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors the logic for detecting locally managed packages in the installer. The main change is the extraction of path repository detection into a new, more general method, improving code clarity and maintainability.

Refactoring and logic improvement:

  • Extracted the logic for checking if a package is a path repository into a new method isLocallyTracked, which determines if a given install path is either a symlink or a git-tracked directory. The isPathRepository method now delegates to this new method for improved clarity and reusability.
  • Updated and clarified documentation for both methods to better explain the distinction between genuine path repositories and Packagist-installed modules, and to document why certain paths are protected from being overwritten.

Copilot AI review requested due to automatic review settings June 6, 2026 08:46
@roble roble merged commit 0c6003f into main Jun 6, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the installer’s “path repository” detection by extracting the install-path checks into a new helper method, aiming to more clearly distinguish locally managed module directories from normal Packagist-installed modules.

Changes:

  • Refactored isPathRepository() to delegate install-path checks to a new isLocallyTracked(string $path) helper.
  • Added/updated docblocks to clarify which install paths should be protected from being overwritten.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Installer.php
*/
protected function isLocallyTracked(string $path): bool
{
return is_link($path) || is_dir($path.'/.git');
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