mirror of
https://github.com/ivuorinen/branch-usage-checker.git
synced 2026-02-23 19:51:46 +00:00
* chore: remove unused code and dead files
Remove InspireCommand, GitHubApiBranch DTO, PackagistApiStatsPayload DTO,
and GitHubRestApi fetcher. Remove InspireCommand reference from config.
* chore(deps): remove unused composer dependencies
Remove guzzlehttp/guzzle, laravel-zero/phar-updater, and
nunomaduro/termwind. Clean up dead autoload entries and orphaned
allow-plugins configuration.
* feat: improve CheckCommand input handling and error reporting
Add vendor/package slash format support, input validation, HTTP error
handling, and concurrent stats fetching. Replace exit() calls with
return statements. Add 13 new test cases with Http::fake coverage.
* build: rebuild PHAR executable
* chore: add CLAUDE.md project instructions
* docs: add design for PHPCS + CaptainHook integration
* docs: add implementation plan for PHPCS + CaptainHook
* build(deps): add squizlabs/php_codesniffer
* build: add composer lint and format scripts
* build(deps): add captainhook and hook-installer
* build: configure CaptainHook pre-commit hook for PHPCS
* docs: add lint/format commands and hook info to CLAUDE.md
* build: add markdownlint-cli2 configuration
* build: add lint:md, lint:ec, lint:all, and format:md composer scripts
* build: add editorconfig and markdownlint to pre-commit hook
* docs: add new lint and format commands to CLAUDE.md
* chore: add missing gitignore patterns
* refactor: replace Http facade with injected HttpFactory
- Resolve HttpFactory via the container instead of using the Http facade
directly, improving testability and explicitness
- Simplify early-return logic in package metadata error handling
- Reformat long strings and closures for PSR-12 line length compliance
- Extract repeated stats URL prefix into variable in tests
* build: add Claude Code shared settings and skills
Add shared hooks (auto-format PHP on edit, block vendor/lock edits),
shared permissions for common dev commands, and two user-invocable
skills (/build-phar, /release-check).
* refactor: extract test constants to reduce duplication in CheckCommandTest
Replace 6 occurrences of the command string and 4 occurrences of the
stats URL with TEST_COMMAND and TEST_STATS_URL constants. Fixes
SonarCloud S1192 code smells and brings duplicated lines density
below the 3% threshold.
* refactor: extract resolveInput and fetchPackageMetadata from handle()
Reduce handle() from 8 return statements to 3 by extracting input
validation into resolveInput() and HTTP fetching into
fetchPackageMetadata(). Fixes SonarCloud S1142 (too many returns).
* fix: improve CheckCommand error handling, input normalization, and timeouts
- Return exit code 1 from catch block instead of silently succeeding
- Normalize vendor/package inputs to lowercase before validation
- Add 10-second HTTP timeouts to metadata fetch and pool requests
- Return false from outputSuggestions when no suggestions found
* test: stub HTTP in live-request tests and assert exception output
- Add Http::fake() to slash-format and two-argument tests to prevent
real Packagist requests during CI
- Assert exception message in try-block test and expect exit code 1
to match the updated catch behavior
* docs: fix command signature, remove stale Fetchers reference in CLAUDE.md
- Change {package} to {package?} and note vendor/package combined form
- Remove non-existent app/Fetchers/ directory reference
- Update HTTP dependency note to reflect HttpFactory injection
* fix: guard array_combine against mismatched Packagist stats
Add a length check before array_combine() so malformed stats
(different label/value counts) produce a warning and skip the
branch instead of throwing a ValueError.
* refactor: change outputSuggestions return type to void
No caller uses the return value. Replace bool return type with
void and remove the now-unnecessary return statements.
* fix: narrow Throwable catch to Exception, add docblocks, remove unused default
- Catch \Exception instead of \Throwable so programming errors (TypeError,
OutOfMemoryError) propagate instead of being silently displayed
- Add minimal PHPDoc summaries to all CheckCommand methods for coverage
- Remove unused default `= []` on outputSuggestions parameter
- Update test to expect TypeError propagation via ->throws()
* refactor: extract constants, fix dead store, deduplicate test setup
- Add TIMEOUT_SECONDS and PACKAGIST_URL constants in CheckCommand
- Replace inline timeout(10) and URL strings with constant references
- Fix dead store: $deletable[$k] = $values['Total'] → $deletable[] = $k
- Eliminate unused $keys intermediate variable in outputSuggestions()
- Standardize string formatting to use sprintf() consistently
- Add TEST_METADATA_URL constant and fakePackageResponses() helper in tests
- Refactor 6 tests to use shared helper, reducing Http::fake duplication
* docs: fix capitalization and remove stale GitHub reference in CLAUDE.md
* docs: add design for fixing SonarCloud duplication quality gate
* docs: add implementation plan for SonarCloud duplication fix
* refactor(tests): parameterize input-validation tests to fix duplication gate
* feat: add PHPMD linter and fix Codacy markdownlint config
Add PHPMD as a dev dependency with cleancode, codesize, unusedcode, and
naming rulesets. Integrate via composer lint:phpmd script, lint:all, and
CaptainHook pre-commit hook.
Split markdownlint config into .markdownlint.jsonc (rules) and
.markdownlint-cli2.jsonc (ignores only) so Codacy's plain markdownlint
can discover the shared rules file.
* fix: rename markdownlint config to .json and disable MD043
Rename .markdownlint.jsonc to .markdownlint.json so Codacy discovers
it at highest priority, and add required-headings: false to explicitly
disable MD043 which flags docs with varying heading structures.
* fix: guard against ConnectionException in pool responses and catch Throwable
Pool responses can be Throwable (e.g. ConnectionException) instead of
Response objects, causing crashes on ->failed(). Add instanceof guard,
widen catch to Throwable with TypeError re-throw, and extract loop into
collectBranchStats() to stay under cyclomatic complexity threshold.
62 lines
2.0 KiB
PHP
62 lines
2.0 KiB
PHP
<?php
|
|
|
|
return [
|
|
|
|
/**
|
|
* Default Command
|
|
*
|
|
* Laravel Zero will always run the command specified below when no command name is
|
|
* provided. Consider update the default command for single command applications.
|
|
* You cannot pass arguments to the default command because they are ignored.
|
|
*/
|
|
'default' => NunoMaduro\LaravelConsoleSummary\SummaryCommand::class,
|
|
|
|
/**
|
|
* Commands Paths
|
|
*
|
|
* This value determines the "paths" that should be loaded by the console's
|
|
* kernel. Foreach "path" present on the array provided below the kernel
|
|
* will extract all "Illuminate\Console\Command" based class commands.
|
|
*/
|
|
'paths' => [app_path('Commands')],
|
|
|
|
/**
|
|
* Added Commands
|
|
*
|
|
* You may want to include a single command class without having to load an
|
|
* entire folder. Here you can specify which commands should be added to
|
|
* your list of commands. The console's kernel will try to load them.
|
|
*/
|
|
'add' => [
|
|
// ..
|
|
],
|
|
|
|
/**
|
|
* Hidden Commands
|
|
*
|
|
* Your application commands will always be visible on the application list
|
|
* of commands. But you can still make them "hidden" specifying an array
|
|
* of commands below. All "hidden" commands can still be run/executed.
|
|
*/
|
|
'hidden' => [
|
|
NunoMaduro\LaravelConsoleSummary\SummaryCommand::class,
|
|
Symfony\Component\Console\Command\DumpCompletionCommand::class,
|
|
Symfony\Component\Console\Command\HelpCommand::class,
|
|
LaravelZero\Framework\Commands\StubPublishCommand::class,
|
|
],
|
|
|
|
/**
|
|
* Removed Commands
|
|
*
|
|
* Do you have a service provider that loads a list of commands that
|
|
* you don't need? No problem. Laravel Zero allows you to specify
|
|
* below a list of commands that you don't to see in your app.
|
|
*/
|
|
'remove' => [
|
|
Illuminate\Console\Scheduling\ScheduleRunCommand::class,
|
|
Illuminate\Console\Scheduling\ScheduleListCommand::class,
|
|
Illuminate\Console\Scheduling\ScheduleFinishCommand::class,
|
|
],
|
|
|
|
];
|