Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Console/Command/InspectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ public function execute(IO $io): int
$symbolsRegistry = new SymbolsRegistry();
$fileContents = $config->getFilesWithContents()[$filePath][1];

$scoppedContents = $this->scopeFile($config, $symbolsRegistry, $filePath, $fileContents);
$scopedContents = $this->scopeFile($config, $symbolsRegistry, $filePath, $fileContents);

$this->printScoppedContents($io, $scoppedContents, $symbolsRegistry);
$this->printScopedContents($io, $scopedContents, $symbolsRegistry);

return ExitCode::SUCCESS;
}
Expand Down Expand Up @@ -206,19 +206,19 @@ private function scopeFile(
);
}

private function printScoppedContents(
private function printScopedContents(
IO $io,
string $scoppedContents,
string $scopedContents,
SymbolsRegistry $symbolsRegistry,
): void {
if ($io->isQuiet()) {
$io->writeln($scoppedContents, OutputInterface::VERBOSITY_QUIET);
$io->writeln($scopedContents, OutputInterface::VERBOSITY_QUIET);
} else {
$io->writeln([
'Scopped contents:',
'Scoped contents:',
'',
'<comment>"""</comment>',
$scoppedContents,
$scopedContents,
'<comment>"""</comment>',
]);

Expand Down
8 changes: 4 additions & 4 deletions src/Console/ConsoleScoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private function scopeFile(
$inputFilePath = $file->inputFilePath;

try {
$scoppedContent = $scoper->scope(
$scopedContent = $scoper->scope(
$inputFilePath,
$file->inputContents,
);
Expand All @@ -316,7 +316,7 @@ private function scopeFile(
$logger->outputWarnOfFailure($inputFilePath, $parsingException);

// Fallback on unchanged content
$scoppedContent = $file->inputContents;
$scopedContent = $file->inputContents;
} catch (Throwable $throwable) {
$exception = ParsingException::forFile(
$inputFilePath,
Expand All @@ -330,11 +330,11 @@ private function scopeFile(
$logger->outputWarnOfFailure($inputFilePath, $exception);

// Fallback on unchanged content
$scoppedContent = $file->inputContents;
$scopedContent = $file->inputContents;
}

$this->dumpFileWithPermissions(
$file->withScoppedContent($scoppedContent),
$file->withScopedContent($scopedContent),
);

if ($successfullyScoped) {
Expand Down
4 changes: 2 additions & 2 deletions src/Console/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public function __construct(
) {
}

public function withScoppedContent(string $scoppedContent): self
public function withScopedContent(string $scopedContent): self
{
return new self(
$this->inputFilePath,
$scoppedContent,
$scopedContent,
$this->outputFilePath,
);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/Console/Command/AddInspectCommandIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function setUp(): void
$this->appTester = AppTester::fromConsoleApp($application);
}

public function test_it_shows_the_scopped_content_of_the_file_given(): void
public function test_it_shows_the_scoped_content_of_the_file_given(): void
{
$input = [
'inspect',
Expand All @@ -65,7 +65,7 @@ public function test_it_shows_the_scopped_content_of_the_file_given(): void
OutputAssertions::assertSameOutput(
<<<'PHP'

Scopped contents:
Scoped contents:

"""
<?php
Expand Down Expand Up @@ -93,7 +93,7 @@ public function test_it_shows_the_scopped_content_of_the_file_given(): void
);
}

public function test_it_shows_the_raw_scopped_content_of_the_file_given_in_quiet_mode(): void
public function test_it_shows_the_raw_scoped_content_of_the_file_given_in_quiet_mode(): void
{
$input = [
'inspect',
Expand Down