Skip to content

Commit 674be75

Browse files
committed
CS + set phpcs encoding for multibyte strings
1 parent 2049730 commit 674be75

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
},
6060
"scripts" : {
6161
"cs" : [
62-
"phpcs src --standard=PSR2",
63-
"phpcs test --standard=PSR2"
62+
"phpcs src --standard=PSR2 --encoding=UTF-8",
63+
"phpcs test --standard=PSR2 --encoding=UTF-8"
6464
]
6565
}
6666
}

src/ResultRenderer/ResultsRenderer.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ public function render(
113113

114114
foreach ($successes as $success) {
115115
$output->writeLine($this->center($this->style(str_repeat(' ', $longest), ['bg_green'])));
116-
$output->writeLine($this->center($this->style(\mb_str_pad($success, $longest), ['bg_green', 'white', 'bold'])));
116+
$output->writeLine(
117+
$this->center($this->style(mb_str_pad($success, $longest), ['bg_green', 'white', 'bold']))
118+
);
117119
$output->writeLine($this->center($this->style(str_repeat(' ', $longest), ['bg_green'])));
118120
$output->emptyLine();
119121
}
@@ -152,7 +154,9 @@ private function renderErrorInformation(
152154
$this->fullWidthBlock($output, 'Your solution was unsuccessful!', ['white', 'bg_red', 'bold']);
153155
$output->emptyLine();
154156

155-
$output->writeLine($this->center(sprintf(" Your solution to %s didn't pass. Try again!", $exercise->getName())));
157+
$output->writeLine(
158+
$this->center(sprintf(" Your solution to %s didn't pass. Try again!", $exercise->getName()))
159+
);
156160
$output->emptyLine();
157161
$output->emptyLine();
158162
}

test/ExerciseRunner/CgiRunnerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public function testVerifyReturnsSuccessIfPostSolutionOutputMatchesUserOutput()
131131

132132
$this->assertInstanceOf(
133133
CgiResult::class,
134-
$res = $this->runner->verify(new Input('app', ['program' => realpath(__DIR__ . '/../res/cgi/post-solution.php')]))
134+
$res = $this->runner->verify(
135+
new Input('app', ['program' => realpath(__DIR__ . '/../res/cgi/post-solution.php')])
136+
)
135137
);
136138

137139
$this->assertTrue($res->isSuccessful());

0 commit comments

Comments
 (0)