diff --git a/src/Command/Generate/PluginCommand.php b/src/Command/Generate/PluginCommand.php index 33bdc1c..e25ff08 100644 --- a/src/Command/Generate/PluginCommand.php +++ b/src/Command/Generate/PluginCommand.php @@ -20,7 +20,6 @@ use WP\Console\Utils\Site; use Webmozart\PathUtil\Path; - class PluginCommand extends Command { use ConfirmationTrait; diff --git a/src/Core/Generator/Generator.php b/src/Core/Generator/Generator.php index 2533ba1..85f7780 100644 --- a/src/Core/Generator/Generator.php +++ b/src/Core/Generator/Generator.php @@ -72,7 +72,7 @@ protected function renderFile( $flag = null ) { if (!is_dir(dirname($target))) { - if(!mkdir(dirname($target), 0777, true)){ + if (!mkdir(dirname($target), 0777, true)) { throw new \InvalidArgumentException( sprintf( 'Path "%s" is invalid. You need to provide a valid path.', diff --git a/src/Generator/PluginGenerator.php b/src/Generator/PluginGenerator.php index e2b3b76..f6ae3f5 100644 --- a/src/Generator/PluginGenerator.php +++ b/src/Generator/PluginGenerator.php @@ -17,13 +17,13 @@ class PluginGenerator extends Generator { /** - * @param Site $site - * @param string $plugin - * @param string $machineName - * @param string $dir - * @param string $description - * @param string $author - * @param string $authorUrl + * @param Site $site + * @param string $plugin + * @param string $machineName + * @param string $dir + * @param string $description + * @param string $author + * @param string $authorUrl * @param boolean $test */ public function generate( @@ -117,7 +117,7 @@ public function generate( ); } - if($uninstall) { + if ($uninstall) { $this->renderFile( 'plugin/uninstall.php.twig', $dir. '/uninstall.php', diff --git a/src/Generator/ThemeGenerator.php b/src/Generator/ThemeGenerator.php index 82b8022..1ed485d 100644 --- a/src/Generator/ThemeGenerator.php +++ b/src/Generator/ThemeGenerator.php @@ -18,15 +18,15 @@ class ThemeGenerator extends Generator { /** - * @param Site $site - * @param string $Theme - * @param string $machineName - * @param string $dir - * @param string $description - * @param string $author - * @param string $authorUrl - * @param array $template_files - * @param string $screenshot + * @param Site $site + * @param string $Theme + * @param string $machineName + * @param string $dir + * @param string $description + * @param string $author + * @param string $authorUrl + * @param array $template_files + * @param string $screenshot * @param boolean $test */ public function generate( diff --git a/src/Utils/Validator.php b/src/Utils/Validator.php index 0a1b2cc..1995d11 100644 --- a/src/Utils/Validator.php +++ b/src/Utils/Validator.php @@ -104,11 +104,10 @@ public function validateMachineName($machine_name) public function validatePluginPath($pluginPath, $create = false) { - if (strlen($pluginPath) > 1 && $pluginPath[strlen($pluginPath)-1] == "/") { $pluginPath = substr($pluginPath, 0, -1); } - + if (is_dir($pluginPath)) { return $pluginPath; }