| @@ 123-133 (lines=11) @@ | ||
| 120 | * @param string $prefix |
|
| 121 | * @param BasicFormatter $formatter |
|
| 122 | */ |
|
| 123 | private function scopeFile($path, $prefix, BasicFormatter $formatter) |
|
| 124 | { |
|
| 125 | $fileContent = file_get_contents($path); |
|
| 126 | try { |
|
| 127 | $scoppedContent = $this->scoper->addNamespacePrefix($fileContent, $prefix); |
|
| 128 | $this->filesystem->dumpFile($path, $scoppedContent); |
|
| 129 | $formatter->outputSuccess($path); |
|
| 130 | } catch (ParsingException $exception) { |
|
| 131 | $formatter->outputFail($path); |
|
| 132 | } |
|
| 133 | } |
|
| 134 | } |
|
| 135 | ||
| @@ 115-129 (lines=15) @@ | ||
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| 115 | private function scopeFile(string $path, string $prefix, ConsoleLogger $logger) |
|
| 116 | { |
|
| 117 | $fileContent = file_get_contents($path); |
|
| 118 | ||
| 119 | try { |
|
| 120 | $scoppedContent = $this->scoper->scope($fileContent, $prefix); |
|
| 121 | ||
| 122 | $this->fileSystem->dumpFile($path, $scoppedContent); |
|
| 123 | ||
| 124 | $logger->outputSuccess($path); |
|
| 125 | } catch (ParsingException $exception) { |
|
| 126 | //TODO: display error in verbose mode |
|
| 127 | $logger->outputFail($path); |
|
| 128 | } |
|
| 129 | } |
|
| 130 | } |
|
| 131 | ||