Skip to content

Commit

Permalink
Fix whitespace and Code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mallardduck committed Feb 28, 2019
1 parent eb8ab4e commit 21f5c11
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 47 deletions.
54 changes: 27 additions & 27 deletions tests/ChecksLaravelVersionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@
trait ChecksLaravelVersionTrait
{

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

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']) {
return true;
}
});
$laravelVersion = array_map(function($val) {
return $val['version'];
}, array_values($just_laravel))[0];
return $laravelVersion;
}

function getApplicationStub()
{
$version = $this->getFrameworkVersion();
if ('dev-master' === $version) {
$version = $this->current_release;
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']) {
return true;
}
});
$laravelVersion = array_map(function ($val) {
return $val['version'];
}, array_values($just_laravel))[0];
return $laravelVersion;
}
$compared_versions = version_compare('5.8', $version);
if ( $compared_versions === -1 || $compared_versions === 0 ) {
return new Application58Stub;

private function getApplicationStub()
{
$version = $this->getFrameworkVersion();
if ('dev-master' === $version) {
$version = $this->current_release;
}
$compared_versions = version_compare('5.8', $version);
if ($compared_versions === -1 || $compared_versions === 0) {
return new Application58Stub;
}
return new ApplicationStub;
}
return new ApplicationStub;
}
}
39 changes: 19 additions & 20 deletions tests/Stubs/Application58Stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function runningInConsole()

public function runningUnitTests()
{
// TODO: Implement runningUnitTests() method.
// TODO: Implement runningUnitTests() method.
}

public function isDownForMaintenance()
Expand All @@ -84,7 +84,7 @@ public function registerDeferredProvider($provider, $service = null)

public function resolveProvider($provider)
{
//
//
}

public function boot()
Expand All @@ -104,32 +104,32 @@ public function booted($callback)

public function bootstrapWith(array $bootstrappers)
{
//
//
}

public function configurationIsCached()
{
//
//
}

public function detectEnvironment(\Closure $callback)
{
//
//
}

public function environmentFile()
{
//
//
}

public function environmentFilePath()
{
//
//
}

public function getCachedConfigPath()
{
//
//
}

public function getCachedServicesPath()
Expand All @@ -144,57 +144,56 @@ public function getCachedPackagesPath()

public function getCachedRoutesPath()
{
//
//
}

public function getLocale()
{
//
//
}

public function getNamespace()
{
//
//
}

public function getProviders($provider)
{
//
//
}

public function hasBeenBootstrapped()
{
//
//
}

public function loadDeferredProviders()
{
//
//
}

public function loadEnvironmentFrom($file)
{
//
//
}

public function routesAreCached()
{
//
//
}

public function setLocale($locale)
{
//
//
}

public function shouldSkipMiddleware()
{
//
//
}

public function terminate()
{
//
//
}

}

0 comments on commit 21f5c11

Please sign in to comment.