Skip to content

Commit 39067ea

Browse files
committed
Fix code style
1 parent 7c412fe commit 39067ea

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/Phug/Tester/Cli.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(string $vendor)
3636
$this->vendor = $vendor;
3737
}
3838

39-
public function getVendorScript(string $script) : string
39+
public function getVendorScript(string $script): string
4040
{
4141
return realpath($this->vendor."/$script");
4242
}
@@ -48,7 +48,7 @@ public function getVendorScript(string $script) : string
4848
*
4949
* @return bool
5050
*/
51-
protected function runPhpunit(array $arguments) : bool
51+
protected function runPhpunit(array $arguments): bool
5252
{
5353
if (!$this->command) {
5454
$this->command = new Command();
@@ -64,7 +64,7 @@ protected function runPhpunit(array $arguments) : bool
6464
*
6565
* @return bool
6666
*/
67-
protected function exec(array $arguments) : bool
67+
protected function exec(array $arguments): bool
6868
{
6969
$phpunit = $this->getVendorScript('phpunit/phpunit/phpunit');
7070
$phpunitArguments = [$phpunit];
@@ -128,7 +128,7 @@ protected function exec(array $arguments) : bool
128128
*
129129
* @return bool
130130
*/
131-
public function run(array $arguments, $exit = true) : bool
131+
public function run(array $arguments, $exit = true): bool
132132
{
133133
$result = $this->exec($arguments);
134134

src/Phug/Tester/Coverage.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Coverage
7171
*/
7272
protected $tree = [];
7373

74-
public static function get() : self
74+
public static function get(): self
7575
{
7676
if (!static::$singleton) {
7777
static::$singleton = new static();
@@ -85,7 +85,7 @@ public static function reset()
8585
static::$singleton = null;
8686
}
8787

88-
public static function getStatus(int $covered, int $total) : string
88+
public static function getStatus(int $covered, int $total): string
8989
{
9090
if ($covered / max(1, $total) >= 0.9) {
9191
return 'success';
@@ -158,7 +158,7 @@ public function initializeCache()
158158
/**
159159
* @return bool
160160
*/
161-
public function isCoverageAllowedToStop() : bool
161+
public function isCoverageAllowedToStop(): bool
162162
{
163163
return $this->coverageStoppingAllowed;
164164
}
@@ -173,7 +173,7 @@ public function disallowCoverageStopping()
173173
$this->coverageStoppingAllowed = false;
174174
}
175175

176-
protected function getPaths() : array
176+
protected function getPaths(): array
177177
{
178178
return $this->renderer->getOption('paths');
179179
}
@@ -199,12 +199,12 @@ public function storeCoverage(array $data)
199199
/**
200200
* @return array
201201
*/
202-
public function getLastCoverageData() : array
202+
public function getLastCoverageData(): array
203203
{
204204
return $this->lastCoverageData;
205205
}
206206

207-
protected function getCoverageData() : array
207+
protected function getCoverageData(): array
208208
{
209209
if (xdebug_code_coverage_started()) {
210210
$data = xdebug_get_code_coverage();
@@ -223,7 +223,7 @@ protected function getCoverageData() : array
223223
// @codeCoverageIgnoreEnd
224224
}
225225

226-
private function getLocationPath(string $path) : string
226+
private function getLocationPath(string $path): string
227227
{
228228
foreach ($this->getPaths() as $base) {
229229
$realBase = realpath($base);
@@ -244,7 +244,7 @@ private function getLocationPath(string $path) : string
244244
// @codeCoverageIgnoreEnd
245245
}
246246

247-
protected function getTemplateFile(string $file, array $vars) : string
247+
protected function getTemplateFile(string $file, array $vars): string
248248
{
249249
$__php = file_get_contents(__DIR__."/../../template/$file");
250250
extract($vars);
@@ -254,7 +254,7 @@ protected function getTemplateFile(string $file, array $vars) : string
254254
return ob_get_clean();
255255
}
256256

257-
protected function writeFile(string $path, string $contents) : bool
257+
protected function writeFile(string $path, string $contents): bool
258258
{
259259
$base = dirname($path);
260260
if (!is_dir($base)) {
@@ -294,7 +294,7 @@ protected function listNodes(SplObjectStorage $list, ElementInterface $element)
294294
}
295295
}
296296

297-
protected function countFileNodes(string $file) : int
297+
protected function countFileNodes(string $file): int
298298
{
299299
$document = $this->renderer->getCompiler()->compileFileIntoElement($file);
300300
$list = new SplObjectStorage();
@@ -480,7 +480,7 @@ public function dumpCoverage(bool $output = false, string $directory = null)
480480
/**
481481
* @return Renderer
482482
*/
483-
public function createRenderer($renderer, array $options = []) : Renderer
483+
public function createRenderer($renderer, array $options = []): Renderer
484484
{
485485
if (is_string($renderer)) {
486486
$renderer = new $renderer($options);
@@ -500,7 +500,7 @@ public function setThreshold($threshold)
500500
$this->threshold = floatval($threshold);
501501
}
502502

503-
public function isThresholdReached() : bool
503+
public function isThresholdReached(): bool
504504
{
505505
if ($this->threshold) {
506506
echo "\nOverall coverage is {$this->lastCoverageRate}%.\n";

src/Phug/Tester/TestCaseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ trait TestCaseTrait
2020
*
2121
* @return string
2222
*/
23-
protected function renderFile($file, $locals = [], $options = null) : string
23+
protected function renderFile($file, $locals = [], $options = null): string
2424
{
2525
if ($options) {
2626
$this->renderer->setOptions($options);

0 commit comments

Comments
 (0)