Skip to content
Snippets Groups Projects
Commit 875315fc authored by Daniel Hürtgen's avatar Daniel Hürtgen
Browse files

Merge branch 'feature/refactor-code' into 'develop'

Feature/refactor code

See merge request !30
parents 4b195f1a 3d36a8fa
Branches
Tags
2 merge requests!37Release 0.4.0,!30Feature/refactor code
Pipeline #86 failed with stage
in 1 minute and 27 seconds
......@@ -3,9 +3,9 @@
namespace Higidi\ComposerPhpCSStandardsPlugin;
use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Installer\BinaryInstaller;
use Composer\Installer\LibraryInstaller;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Util\Filesystem;
......@@ -42,9 +42,8 @@ class Installer extends LibraryInstaller
*/
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$isInstalled = parent::isInstalled($repo, $package);
if (!$isInstalled) {
return $isInstalled;
if (!parent::isInstalled($repo, $package)) {
return false;
}
$sourceStandards = $this->getSourceStandards($package);
$destinationStandards = $this->getDestinationStandards($repo);
......@@ -53,12 +52,11 @@ class Installer extends LibraryInstaller
if (!$destinationStandards->hasStandard($sourceStandard)
|| !$this->compareStandards($sourceStandard, $destinationStandards->getStandard($sourceStandard))
) {
$isInstalled = false;
break;
return false;
}
}
return $isInstalled;
return true;
}
/**
......@@ -79,7 +77,6 @@ class Installer extends LibraryInstaller
$this->installStandards($repo, $target, $initial ? false : true);
}
/**
* {@inheritDoc}
*/
......
......@@ -80,12 +80,10 @@ class Standards implements \Iterator
*/
protected function getStandardName($standard) {
if ($standard instanceof Standard) {
$standard = $standard->getName();
} else {
$standard = (string)$standard;
return $standard->getName();
}
return $standard;
return (string)$standard;
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment