Skip to content

Commit

Permalink
codestyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyingmana committed Jun 15, 2020
1 parent 486ba40 commit 156de31
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public function deploy()
*/
protected function beforeDeploy()
{

}

/**
Expand All @@ -123,7 +122,6 @@ protected function beforeDeploy()
*/
protected function afterDeploy()
{

}

/**
Expand All @@ -150,7 +148,6 @@ public function clean()
*/
protected function beforeClean()
{

}

/**
Expand All @@ -160,7 +157,6 @@ protected function beforeClean()
*/
protected function afterClean()
{

}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/MagentoHackathon/Composer/Magento/Deploystrategy/Move.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function transfer($item, $subDestPath)
*/
protected function afterDeploy()
{
if(is_dir($this->sourceDir)) {
if (is_dir($this->sourceDir)) {
$this->removeDir($this->sourceDir);
}
}
Expand All @@ -50,7 +50,7 @@ private function removeDir($path)
);
foreach ($iterator as $fileInfo) {
$filename = $fileInfo->getFilename();
if($filename != '..' || $filename != '.') {
if ($filename != '..' || $filename != '.') {
$removeAction = ($fileInfo->isDir() ? 'rmdir' : 'unlink');
try {
$removeAction($fileInfo->getRealPath());
Expand All @@ -60,11 +60,9 @@ private function removeDir($path)
} else {
throw new Exception(sprintf('%s could not be removed.', $fileInfo->getRealPath()));
}

}
}
}
rmdir($path);
}

}
12 changes: 6 additions & 6 deletions src/MagentoHackathon/Composer/Magento/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,20 @@ public function onPackageUpdate(PackageEvent $event)
$rule = $event->getOperation()->getReason();
if ($rule instanceof Rule) {
if ($event->getOperation()->getJobType() === 'update') {
if ($rule->getJob() && $rule->getJob()['packageName'] === 'magento-hackathon/magento-composer-installer') {
if (
$rule->getJob()
&& $rule->getJob()['packageName'] === 'magento-hackathon/magento-composer-installer') {
throw new \Exception(
'Dont update the "magento-hackathon/magento-composer-installer" with active plugins.' . PHP_EOL .
'Dont update the "magento-hackathon/magento-composer-installer" with active plugins.'
. PHP_EOL .
'Consult the documentation on how to update the Installer' . PHP_EOL .
'https://github.com/Cotya/magento-composer-installer#update-the-installer' . PHP_EOL
);
}
}
} else {

}

}

/**
* test configured repositories and give message about adding recommended ones
*/
Expand Down
1 change: 0 additions & 1 deletion src/MagentoHackathon/Composer/Magento/ProjectConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,5 +518,4 @@ public function setNoDevMode()
{
$this->isDevMode = false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,5 @@ public function testDeployOfEarlierInstalledPackages()
} catch (\Exception $e) {
$this->assertContains('Dont update the', $e->getMessage());
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getTestDeployStrategyFiletype($isDir = false)

return self::TEST_FILETYPE_FILE;
}

public function testCopyDirToDirOfSameName()
{
$sourceRoot = 'root';
Expand Down Expand Up @@ -53,7 +53,7 @@ public function testCopyDirToDirOfSameName()
public function testWildcardCopyToExistingDir()
{
$sourceContents = "app/code/test.php";

//create target directory before
$this->mkdir(sprintf('%s/app/code', $this->destDir));
$this->mkdir(sprintf('%s/app/code', $this->sourceDir));
Expand All @@ -72,7 +72,6 @@ public function testWildcardCopyToExistingDir()
$this->strategy->deploy();

$this->assertFileNotExists(sprintf('%s/app/app/code/test.php', $this->destDir));

}

public function testDeployedFilesAreStored()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ public function testListenThrowsExceptionIfArgument2NotCallable()
public function testAddListener()
{
$this->eventManager->listen('some-event', function () {

});
$this->eventManager->listen('some-event', function () {

});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@

class GlobalPluginTest extends AbstractTest
{

protected static $processLogCounter = 1;

protected function setUp()
{

}

protected function tearDown()
{

}

protected function prepareCleanDirectories()
Expand All @@ -40,7 +38,7 @@ public function testGlobalInstall()
$process->run();
$this->assertProcess($process);
}

public function testGlobalUpdate()
{
$this->markTestSkipped('This has not been implemented yet.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public function testFindAllPackages()
$this->repository->add($package);
$this->assertCount(1, $this->repository->findAll());
$this->assertSame(array($package), $this->repository->findAll());

}

public function tearDown()
Expand Down

0 comments on commit 156de31

Please sign in to comment.