Skip to content

Commit

Permalink
More CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck committed Feb 28, 2019
1 parent 21f5c11 commit 5a89236
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/ChecksLaravelVersionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@

trait ChecksLaravelVersionTrait
{

public $installed_file_path = __DIR__ . '/../vendor/composer/installed.json';
public $installed_file_path = __DIR__.'/../vendor/composer/installed.json';
public $current_release = '5.8';

private function getFrameworkVersion()
{
$contents = file_get_contents($this->installed_file_path);
$parsed_data = json_decode($contents, true);
$just_laravel = array_filter($parsed_data, function ($val) {
if ("laravel/framework" === $val['name'] || "laravel/lumen-framework" === $val['name']) {
if ('laravel/framework' === $val['name'] || 'laravel/lumen-framework' === $val['name']) {
return true;
}
});
$laravelVersion = array_map(function ($val) {
return $val['version'];
}, array_values($just_laravel))[0];

return $laravelVersion;
}

Expand All @@ -33,9 +33,11 @@ private function getApplicationStub()
$version = $this->current_release;
}
$compared_versions = version_compare('5.8', $version);
// If comparison is Less Than, or Equal To, provide the 5.8 stub.
if ($compared_versions === -1 || $compared_versions === 0) {
return new Application58Stub;
}

return new ApplicationStub;
}
}

0 comments on commit 5a89236

Please sign in to comment.