| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 20 |
| CRAP Score | 1 |
| Changes | 2 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 25 | public function register() |
||
| 26 | { |
||
| 27 | 37 | $this->getContainer()->share(Config::class, function () { |
|
| 28 | 37 | $framework = $this->getContainer()->get(Framework::class); |
|
| 29 | 37 | $fs = $this->getContainer()->get(Filesystem::class); |
|
| 30 | 37 | $converter = $this->getContainer()->get(Converter::class); |
|
| 31 | 37 | return new Config($framework, $fs, $converter); |
|
| 32 | 22 | }); |
|
| 33 | |||
| 34 | 22 | $this->getContainer()->share(Converter::class, function () { |
|
| 35 | 22 | return new Converter(); |
|
| 36 | 22 | }); |
|
| 37 | |||
| 38 | 22 | $this->getContainer()->share(Dispatcher::class, function () { |
|
| 39 | 1 | $client = $this->getContainer()->get(Client::class); |
|
| 40 | 1 | return new Dispatcher($client); |
|
| 41 | 22 | }); |
|
| 42 | |||
| 43 | 37 | $this->getContainer()->share(Framework::class, function () { |
|
| 44 | 37 | return new Framework($this->getContainer(), dirname(dirname(__DIR__))); |
|
|
|
|||
| 45 | 22 | }); |
|
| 46 | |||
| 47 | 22 | $this->getContainer()->share(Http::class, function () { |
|
| 48 | 1 | return new Http($this->getContainer()->get(Application::class)); |
|
| 49 | 22 | }); |
|
| 50 | 22 | } |
|
| 51 | } |
||
| 52 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.