Skip to content

Commit

Permalink
Merge pull request #3 from makewebau/analysis-qg1pNb
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
AndrewFeeney authored Jun 23, 2017
2 parents 8336444 + bb7e308 commit ff7ab86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/PluginFileParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getPluginName($filename)

public function getPluginAttribute($filename, $attribute)
{
$versionLine = array_filter($this->getPluginData($filename), function($line) use ($attribute) {
$versionLine = array_filter($this->getPluginData($filename), function ($line) use ($attribute) {
return $this->stringContains($line, $attribute.':');
});

Expand All @@ -33,8 +33,9 @@ public function getPluginData($filename)
/**
* Determine if a given string contains a given substring.
*
* @param string $haystack
* @param string|array $needles
* @param string $haystack
* @param string|array $needles
*
* @return bool
*/
public function stringContains($haystack, $needles)
Expand All @@ -44,6 +45,7 @@ public function stringContains($haystack, $needles)
return true;
}
}

return false;
}
}
16 changes: 8 additions & 8 deletions src/Shipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class Shipper

public function __construct()
{
$this->fileManager = new FileManager;
$this->pluginFileParser = new PluginFileParser;
$this->zipper = new Zipper;
$this->fileManager = new FileManager();
$this->pluginFileParser = new PluginFileParser();
$this->zipper = new Zipper();
}

/**
Expand Down Expand Up @@ -69,7 +69,7 @@ public function ship($dir)

// Remove studio.json file if it exists
if (file_exists($finalDestination.'/studio.json')) {
$this->output('Removing file: '. $finalDestination . '/studio.json');
$this->output('Removing file: '.$finalDestination.'/studio.json');
unlink($finalDestination.'/studio.json');
}

Expand All @@ -80,11 +80,11 @@ public function ship($dir)

// Delete skipped files
$this->output('Deleting files named in .shipignore file');
foreach($this->getSkippedFiles() as $filename) {
foreach ($this->getSkippedFiles() as $filename) {
if (empty($filename)) {
continue;
}
$path = $finalDestination . '/' . $filename;
$path = $finalDestination.'/'.$filename;
$this->output('Deleting: '.$path);
echo shell_exec("rm -Rf $path");
}
Expand Down Expand Up @@ -153,10 +153,10 @@ protected function pluginFilePath()

protected function output($string, $lineBreak = true, $colorCode = '37')
{
echo("\033[{$colorCode}m$string\033[0m");
echo "\033[{$colorCode}m$string\033[0m";

if ($lineBreak) {
echo("\n");
echo "\n";
}
}

Expand Down

0 comments on commit ff7ab86

Please sign in to comment.