Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 2 | private function performAutoBinding(): void |
|
26 | { |
||
27 | 2 | collect(config('auto-binder.scan_folders', self::DEFAULT_SCAN_FOLDERS)) |
|
28 | 2 | ->pipe(function ($folders) { |
|
29 | 2 | $this->prepareNamespace(); |
|
30 | |||
31 | 2 | return $folders; |
|
32 | }) |
||
33 | 2 | ->each(fn (string $folder) => $this->getFolderFiles($folder) |
|
34 | 2 | ->each(function (SplFileInfo $file) use ($folder) { |
|
35 | 2 | $relativePath = $file->getRelativePathname(); |
|
36 | 2 | $filenameWithoutExtension = $file->getFilenameWithoutExtension(); |
|
37 | 2 | $filenameWithRelativePath = $this->cleanupFilename($relativePath); |
|
38 | |||
39 | 2 | $interface = $this->getInterface($folder, $filenameWithoutExtension); |
|
40 | 2 | $implementation = $this->getImplementation($folder, $filenameWithRelativePath); |
|
41 | |||
42 | 2 | $this->bind($interface, $implementation); |
|
43 | }) |
||
47 |