Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #17

Merged
merged 1 commit into from
Jan 2, 2018
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
2 changes: 1 addition & 1 deletion src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Pool implements ArrayAccess
/** @var \Spatie\Async\ParallelProcess[] */
protected $failed = [];

/** @var \Spatie\Async\ParallelProcess[] */
/** @var \Spatie\Async\ParallelProcess[] */
protected $timeouts = [];

protected $results = [];
Expand Down
12 changes: 6 additions & 6 deletions src/PoolDebugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class PoolDebugger
{
public static function statusForPool(Pool $pool): string
{
return self::summaryForPool($pool) . "\n"
. self::statusForFailed($pool);
return self::summaryForPool($pool)."\n"
.self::statusForFailed($pool);
}

public static function summaryForPool(Pool $pool): string
Expand All @@ -18,9 +18,9 @@ public static function summaryForPool(Pool $pool): string
$failed = $pool->getFailed();
$timeouts = $pool->getTimeouts();

return 'finished: ' . count($finished)
. ' - failed: ' . count($failed)
. ' - timeouts: ' . count($timeouts);
return 'finished: '.count($finished)
.' - failed: '.count($failed)
.' - timeouts: '.count($timeouts);
}

public static function statusForFailed(Pool $pool): string
Expand All @@ -33,7 +33,7 @@ public static function statusForFailed(Pool $pool): string
$output = $process->getErrorOutput();

if ($output instanceof SerializableException) {
$output = get_class($output->asThrowable()) . ' ' . $output->asThrowable()->getMessage();
$output = get_class($output->asThrowable()).' '.$output->asThrowable()->getMessage();
}

$status .= "{$process->getId()} failed with {$output}\n\n";
Expand Down
4 changes: 2 additions & 2 deletions tests/PoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function it_can_run_processes_in_parallel()

$executionTime = $endTime - $startTime;

$this->assertLessThan(0.2, $executionTime, "Execution time was {$executionTime}, expected less than 0.2.\n" . PoolDebugger::statusForPool($pool));
$this->assertLessThan(0.2, $executionTime, "Execution time was {$executionTime}, expected less than 0.2.\n".PoolDebugger::statusForPool($pool));
}

/** @test */
Expand Down Expand Up @@ -115,7 +115,7 @@ public function it_can_handle_a_maximum_of_concurrent_processes()

$executionTime = $endTime - $startTime;

$this->assertGreaterThanOrEqual(2, $executionTime, "Execution time was {$executionTime}, expected more than 2.\n" . PoolDebugger::statusForPool($pool));
$this->assertGreaterThanOrEqual(2, $executionTime, "Execution time was {$executionTime}, expected more than 2.\n".PoolDebugger::statusForPool($pool));
$this->assertCount(3, $pool->getFinished(), PoolDebugger::statusForPool($pool));
}

Expand Down