-
-
Save pionl/01c40225ceeed8b136306fdd96b5dabd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @link https://laravel.com/docs/10.x/container#binding-primitives | |
// FROM | |
$container = new \Illuminate\Container\Container(); | |
$container->singleton(FileProcessor::class, function (Container $container) { | |
return new FileProcessor( | |
$container->make(Filesystem::class), | |
$container->make(FileDiffFactory::class), | |
$container->tagged(Sniff::class), | |
); | |
}); | |
// TO | |
$container->singleton(FileProcessor::class, FileProcessor::class); | |
$container->when(FileProcessor::class) | |
->needs('$sniffs') | |
->giveTagged(Sniff::class); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment