Remove unused dev dependencies and untrack the PHPUnit result cache #63
Labels
No labels
bug
duplicate
enhancement
good first issue
help wanted
question
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/incr#63
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Leftovers found while surveying the repo after v0.4.0. All verified unused; none touch Laravel core behaviour.
.phpunit.result.cacheis tracked despite being gitignoredThe file is committed and listed in
.gitignore:14. It was committed before the ignore rule existed, so git keeps tracking it and it churns on every test run.The
.gitignoreentry is already correct and needs no change.Three unused dev dependencies
mockery/mockerytests/. The suite uses factories and real HTTP calls.fakerphp/fakerfaker/fake()usage.TrackerFactoryreturns fixed values.laravel/saildocker/dev/compose and thedev-*shell helpers, not Sail.Checked for transitive dependents:
laravel/framework,ramsey/collection,livewire/livewireand others listfakerandmockery, but all asrequire-dev, which Composer does not install transitively.laravel/sailhas no dependents at all. Removing these three removes them outright.docker/dev/podman-sail-alias.shis unreferencedA shell script defining
docker/docker-composealiases and asail()function. Not sourced byshell.nix, and not mentioned in the README or CONTRIBUTING — both document thedev-*helpers instead.Note it does not use the
laravel/sailpackage; it wrapspodman-composedirectly. The two are independently unused.Explicitly out of scope
config/mail.php,config/queue.php,config/filesystems.phpandconfig/services.phphave zero references in application code, but Laravel may resolve them internally during boot —QUEUE_CONNECTION=databaseandCACHE_STORE=databaseare both set. Removing them needs the app booted and the suite run with each one gone, the wayconfig/auth.phpwas verified in #53. Not part of this ticket.Acceptance criteria
.phpunit.result.cacheuntracked and no longer in the repositorymockery/mockery,fakerphp/fakerandlaravel/sailremoved fromcomposer.json,composer.lockupdateddocker/dev/podman-sail-alias.shremovedcomposer installsucceeds from a cleanvendor/Correction:
.phpunit.result.cachewas never trackedThe ticket claims it is "committed and listed in
.gitignore:14". That is wrong — I misread my own check when writing this.Verified now:
It is correctly ignored and has never been in the repository. Nothing to do, and that acceptance criterion is void.
Added to scope
config/app.php:85has'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), and.env.examplesetsAPP_FAKER_LOCALE=en_US. Both are dead oncefakerphp/fakeris removed, so they go with it.Revised acceptance criteria
— never tracked; no action.phpunit.result.cacheuntrackedmockery/mockery,fakerphp/fakerandlaravel/sailremoved fromcomposer.json,composer.lockupdatedfaker_localeremoved fromconfig/app.php;APP_FAKER_LOCALEremoved from.envand.env.exampledocker/dev/podman-sail-alias.shremovedcomposer installsucceeds from a cleanvendor/Correction:
mockery/mockerycannot be removedRemoving it broke all 17 tests with
Class "Mockery" not found.Laravel's testing layer needs it.
RefreshDatabaseruns migrations throughPendingCommand, which imports Mockery atvendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:18and callsMockery::mock()at line 550. Every test usingRefreshDatabasedepends on it.The framework declares Mockery under its own
require-dev, which Composer does not install transitively — so the application has to declare it itself. That is exactly what this project was doing, correctly, before I removed it.My reasoning was wrong. I checked whether our code referenced Mockery, found nothing, and treated that as sufficient. The coupling is inside vendor code at runtime, invisible to a grep of
app/andtests/— and PHPStan reported 0 errors throughout, so static analysis could not see it either. Only running the suite caught it.Restored via
composer require --dev mockery/mockery:^1.6.fakerphp/faker— verified removable, properly this timeFactory::withFaker()(Factory.php:1061) guards withclass_exists(Generator::class)and returns null when Faker is absent.TrackerFactoryuses fixed values and never touches$this->faker, so factories work without it.Consistent with the failure output: all 17 errors named Mockery, none named Faker.
laravel/sail— removableNo dependents in
composer.lock.docker/dev/podman-sail-alias.shwrapspodman-composedirectly and does not use the package; both are independently unused.Final scope
Removed:
fakerphp/faker,laravel/sail,docker/dev/podman-sail-alias.sh,faker_localefromconfig/app.php,APP_FAKER_LOCALEfrom.envand.env.example.Kept:
mockery/mockery— required by the framework's testing layer.No action:
.phpunit.result.cachewas never tracked.Lesson
"Not referenced in our code" is not evidence a dependency is unused. Framework internals can require a package the application never names. The check that mattered was running the suite with it gone.
Done —
181e0cbRemoved:
fakerphp/faker,laravel/sail,docker/dev/podman-sail-alias.sh, thefaker_localekey inconfig/app.php, andAPP_FAKER_LOCALEfrom.envand.env.example.require-devis now seven packages, all verified in use.Kept:
mockery/mockery— see the correction above. Removing it broke all 17 tests; Laravel'sRefreshDatabaseruns migrations throughPendingCommand, which uses Mockery directly.No action:
.phpunit.result.cachewas never tracked.Gates
PHPUnit 17 tests · PHPStan 0 errors (level 7) · Pint 26 files · app serving 200.
Final acceptance criteria
— never tracked.phpunit.result.cacheuntrackedfakerphp/fakerandlaravel/sailremoved;composer.lockupdatedmockery/mockeryretained — required by the framework's testing layerfaker_localeandAPP_FAKER_LOCALEremoveddocker/dev/podman-sail-alias.shremoved