Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien MALOT committed Nov 26, 2015
1 parent 4d555ee commit 1adcc0e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
7 changes: 7 additions & 0 deletions lib/Cerbere/Action/ActionInterface.php
Expand Up @@ -23,6 +23,7 @@

use Cerbere\Event\DispatcherAwareInterface;
use Cerbere\Model\Project;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
* Interface ActionInterface
Expand All @@ -46,4 +47,10 @@ public function prepare();
* @return array
*/
public function process(array $projects, $options = array());

/**
* @param \Symfony\Component\EventDispatcher\EventSubscriberInterface $listener
* @return void
*/
public function addLoggerListener(EventSubscriberInterface $listener);
}
7 changes: 6 additions & 1 deletion lib/Cerbere/Action/Hacked.php
Expand Up @@ -39,6 +39,11 @@
*/
class Hacked implements ActionInterface
{
/**
* @var EventDispatcherInterface
*/
protected $dispatcher;

/**
* @inheritDoc
*/
Expand All @@ -48,7 +53,7 @@ public function getCode()
}

/**
* @param EventSubscriberInterface $listener
* @inheritDoc
*/
public function addLoggerListener(EventSubscriberInterface $listener)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Cerbere/Action/Update.php
Expand Up @@ -58,7 +58,7 @@ public function __construct()
}

/**
* @param EventSubscriberInterface $listener
* @inheritDoc
*/
public function addLoggerListener(EventSubscriberInterface $listener)
{
Expand Down
8 changes: 4 additions & 4 deletions lib/Cerbere/Model/Hacked/HackedProjectWebDownloader.php
Expand Up @@ -42,7 +42,7 @@ protected function getTempDirectory($namespace = null)
$dir .= DIRECTORY_SEPARATOR . preg_replace('/[^0-9A-Z\-_]/i', '', $namespace);
}

@mkdir($dir, 0775, true);
mkdir($dir, 0775, true);

return $dir;
}
Expand All @@ -60,7 +60,7 @@ protected function getDestination()
$dir = $this->getTempDirectory() . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $name;

// Build the destination folder tree if it doesn't already exists.
@mkdir($dir, 0775, true);
mkdir($dir, 0775, true);

return $dir . DIRECTORY_SEPARATOR . $version;
}
Expand Down Expand Up @@ -97,7 +97,7 @@ public function downloadFile()
protected function removeDir($path)
{
if (is_file($path) || is_link($path)) {
@unlink($path);
unlink($path);
} elseif (is_dir($path)) {
$d = dir($path);

Expand All @@ -110,7 +110,7 @@ protected function removeDir($path)
}

$d->close();
@rmdir($path);
rmdir($path);
}
}
}
4 changes: 2 additions & 2 deletions lib/Cerbere/Model/Hacked/HackedProjectWebFilesDownloader.php
Expand Up @@ -48,7 +48,7 @@ public function downloadFile()
}

// Build the destination folder tree if it doesn't already exists.
@mkdir($destination, 0775, true);
mkdir($destination, 0775, true);

if (!($local_file = $this->getFile($release_url))) {
return false;
Expand Down Expand Up @@ -92,7 +92,7 @@ protected function getFile($url)
$local = $cache_directory . DIRECTORY_SEPARATOR . basename($parsed_url['path']);

if (!file_exists($cache_directory)) {
@mkdir($cache_directory, 0775, true);
mkdir($cache_directory, 0775, true);
}

// Todo: use guzzle.
Expand Down

0 comments on commit 1adcc0e

Please sign in to comment.