diff --git a/PHPCI/Plugin/Util/ComposerPluginInformation.php b/PHPCI/Plugin/Util/ComposerPluginInformation.php index 0ce76e6f..c870514e 100644 --- a/PHPCI/Plugin/Util/ComposerPluginInformation.php +++ b/PHPCI/Plugin/Util/ComposerPluginInformation.php @@ -23,8 +23,7 @@ class ComposerPluginInformation implements InstalledPluginInformation { if (file_exists($filePath)) { $installed = json_decode(file_get_contents($filePath)); - } - else { + } else { $installed = array(); } return new self($installed); @@ -60,12 +59,12 @@ class ComposerPluginInformation implements InstalledPluginInformation */ public function getPluginClasses() { - return array_map( - function($plugin) { - return $plugin->class; - }, - $this->getInstalledPlugins() - ); + return array_map( + function ($plugin) { + return $plugin->class; + }, + $this->getInstalledPlugins() + ); } protected function loadPluginInfo() @@ -74,7 +73,7 @@ class ComposerPluginInformation implements InstalledPluginInformation return; } $this->pluginInfo = array(); - foreach($this->composerPackages as $package) { + foreach ($this->composerPackages as $package) { $this->addPluginsFromPackage($package); } } @@ -89,8 +88,7 @@ class ComposerPluginInformation implements InstalledPluginInformation if (isset($phpciData->pluginNamespace)) { $rootNamespace = $phpciData->pluginNamespace; - } - else { + } else { $rootNamespace = ""; } @@ -112,9 +110,9 @@ class ComposerPluginInformation implements InstalledPluginInformation protected function addPlugins( array $plugins, $sourcePackageName, - $rootNamespace = "") - { - foreach($plugins as $plugin) { + $rootNamespace = "" + ) { + foreach ($plugins as $plugin) { if (!isset($plugin->class)) { continue; } @@ -130,8 +128,8 @@ class ComposerPluginInformation implements InstalledPluginInformation protected function addPlugin( $plugin, $sourcePackageName, - $rootNamespace = "") - { + $rootNamespace = "" + ) { $newPlugin = clone $plugin; $newPlugin->class = $rootNamespace . $newPlugin->class; @@ -144,4 +142,4 @@ class ComposerPluginInformation implements InstalledPluginInformation $this->pluginInfo[] = $newPlugin; } -} \ No newline at end of file +} diff --git a/PHPCI/Plugin/Util/Executor.php b/PHPCI/Plugin/Util/Executor.php index ceb1de55..39a5d35e 100644 --- a/PHPCI/Plugin/Util/Executor.php +++ b/PHPCI/Plugin/Util/Executor.php @@ -17,7 +17,7 @@ class Executor */ protected $pluginFactory; - function __construct(Factory $pluginFactory,BuildLogger $logger) + public function __construct(Factory $pluginFactory, BuildLogger $logger) { $this->pluginFactory = $pluginFactory; $this->logger = $logger; @@ -78,8 +78,7 @@ class Executor $class = str_replace('_', ' ', $plugin); $class = ucwords($class); $class = 'PHPCI\\Plugin\\' . str_replace(' ', '', $class); - } - else { + } else { $class = $plugin; } @@ -105,4 +104,4 @@ class Executor return $rtn; } -} \ No newline at end of file +} diff --git a/PHPCI/Plugin/Util/Factory.php b/PHPCI/Plugin/Util/Factory.php index 0e526023..781b6d5a 100644 --- a/PHPCI/Plugin/Util/Factory.php +++ b/PHPCI/Plugin/Util/Factory.php @@ -29,7 +29,7 @@ class Factory { $self = $this; $this->registerResource( - function() use ($self) { + function () use ($self) { return $self->getLastOptions(); }, 'options', @@ -37,7 +37,8 @@ class Factory { ); } - public function getLastOptions() { + public function getLastOptions() + { return $this->currentPluginOptions; } @@ -66,7 +67,7 @@ class Factory { if ($constructor) { $argsToUse = array(); - foreach($constructor->getParameters() as $param) { + foreach ($constructor->getParameters() as $param) { $argsToUse = $this->addArgFromParam($argsToUse, $param); } $plugin = $reflectedPlugin->newInstanceArgs($argsToUse); @@ -84,11 +85,11 @@ class Factory { * @throws \InvalidArgumentException * @internal param mixed $resource */ - public function registerResource($loader, - $name = null, - $type = null - ) - { + public function registerResource( + $loader, + $name = null, + $type = null + ) { if ($name === null && $type === null) { throw new \InvalidArgumentException( "Type or Name must be specified" @@ -138,9 +139,9 @@ class Factory { $class = $param->getClass(); if ($class) { return $class->getName(); - } elseif($param->isArray()) { + } elseif ($param->isArray()) { return self::TYPE_ARRAY; - } elseif($param->isCallable()) { + } elseif ($param->isCallable()) { return self::TYPE_CALLABLE; } else { return null; @@ -165,4 +166,4 @@ class Factory { return $existingArgs; } -} \ No newline at end of file +} diff --git a/PHPCI/Plugin/Util/FilesPluginInformation.php b/PHPCI/Plugin/Util/FilesPluginInformation.php index 3d8b6f47..8366c4cb 100644 --- a/PHPCI/Plugin/Util/FilesPluginInformation.php +++ b/PHPCI/Plugin/Util/FilesPluginInformation.php @@ -26,7 +26,7 @@ class FilesPluginInformation implements InstalledPluginInformation return new self(new \DirectoryIterator($dirPath)); } - function __construct(\Iterator $files) + public function __construct(\Iterator $files) { $this->files = $files; } @@ -55,17 +55,17 @@ class FilesPluginInformation implements InstalledPluginInformation public function getPluginClasses() { return array_map( - function($plugin) { + function ($plugin) { return $plugin->class; - }, - $this->getInstalledPlugins() - ); + }, + $this->getInstalledPlugins() + ); } protected function loadPluginInfo() { $this->pluginInfo = array(); - foreach($this->files as $fileInfo) { + foreach ($this->files as $fileInfo) { if ($fileInfo instanceof \SplFileInfo) { if ($fileInfo->isFile()) { $this->addPluginFromFile($fileInfo); @@ -101,5 +101,4 @@ class FilesPluginInformation implements InstalledPluginInformation return $namespace . '\\' . $className; } - -} \ No newline at end of file +} diff --git a/PHPCI/Plugin/Util/InstalledPluginInformation.php b/PHPCI/Plugin/Util/InstalledPluginInformation.php index f63c432a..133b8de8 100644 --- a/PHPCI/Plugin/Util/InstalledPluginInformation.php +++ b/PHPCI/Plugin/Util/InstalledPluginInformation.php @@ -20,4 +20,4 @@ interface InstalledPluginInformation * @return string[] */ public function getPluginClasses(); -} \ No newline at end of file +} diff --git a/PHPCI/Plugin/Util/PluginInformationCollection.php b/PHPCI/Plugin/Util/PluginInformationCollection.php index 23245a8d..9017ba72 100644 --- a/PHPCI/Plugin/Util/PluginInformationCollection.php +++ b/PHPCI/Plugin/Util/PluginInformationCollection.php @@ -24,7 +24,7 @@ class PluginInformationCollection implements InstalledPluginInformation public function getInstalledPlugins() { $arr = array(); - foreach($this->pluginInformations as $single) { + foreach ($this->pluginInformations as $single) { $arr = array_merge($arr, $single->getInstalledPlugins()); } return $arr; @@ -39,10 +39,10 @@ class PluginInformationCollection implements InstalledPluginInformation public function getPluginClasses() { $arr = array(); - foreach($this->pluginInformations as $single) { + foreach ($this->pluginInformations as $single) { $arr = array_merge($arr, $single->getPluginClasses()); } return $arr; } -} \ No newline at end of file +}