@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ) |
20 | 20 | { |
21 | 21 | if (!is_dir($configDir)) { |
22 | - throw new NotFoundException('Configuration dir not found: ' . $configDir); |
|
22 | + throw new NotFoundException('Configuration dir not found: '.$configDir); |
|
23 | 23 | } |
24 | 24 | $this->config = $configDir; |
25 | 25 | |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | |
29 | 29 | public function load() |
30 | 30 | { |
31 | - self::addCommandDir('Magium\Cli\Command', __DIR__ . '/Command'); |
|
31 | + self::addCommandDir('Magium\Cli\Command', __DIR__.'/Command'); |
|
32 | 32 | |
33 | 33 | foreach (self::$dirs as $namespace => $dir) { |
34 | - $files = glob($dir . '/*.php'); |
|
34 | + $files = glob($dir.'/*.php'); |
|
35 | 35 | |
36 | 36 | foreach ($files as $file) { |
37 | 37 | $class = substr(basename($file), 0, -4); |
38 | - $className = $namespace . '\\' . $class; |
|
38 | + $className = $namespace.'\\'.$class; |
|
39 | 39 | if (class_exists($className)) { |
40 | 40 | $reflection = new \ReflectionClass($className); |
41 | 41 | if (!$reflection->isInstantiable()) { |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | |
35 | 35 | protected function execute(InputInterface $input, OutputInterface $output) |
36 | 36 | { |
37 | - if (!file_exists($this->path . '/magium.json')) { |
|
37 | + if (!file_exists($this->path.'/magium.json')) { |
|
38 | 38 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
39 | 39 | } |
40 | 40 | $reader = new \Zend\Config\Reader\Json(); |
41 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
41 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
42 | 42 | |
43 | 43 | $class = $input->getArgument('class'); |
44 | 44 | $property = $input->getArgument('property'); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $config->magium = []; |
52 | 52 | } |
53 | 53 | if (!class_exists($class)) { |
54 | - throw new NotFoundException('Could not find class: ' . $class . '. You might need to escape blackslashes (\\\\)'); |
|
54 | + throw new NotFoundException('Could not find class: '.$class.'. You might need to escape blackslashes (\\\\)'); |
|
55 | 55 | } |
56 | 56 | $class = strtolower($class); |
57 | 57 | $s = $config->magium; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $s[$class]->$property = $value; |
63 | 63 | |
64 | 64 | $writer = new Json(); |
65 | - $writer->toFile($this->path . '/magium.json', $config); |
|
65 | + $writer->toFile($this->path.'/magium.json', $config); |
|
66 | 66 | $output->writeln(sprintf('Wrote value %s for "%s:%s" to %s/magium.json', $value, $class, $property, $this->path)); |
67 | 67 | } |
68 | 68 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $collector = new DefaultPropertyCollector(); |
38 | 38 | $class = $input->getArgument('class'); |
39 | 39 | if (!class_exists($class)) { |
40 | - throw new NotFoundException('Could not find the class: ' . $class); |
|
40 | + throw new NotFoundException('Could not find the class: '.$class); |
|
41 | 41 | } |
42 | 42 | if (!is_subclass_of($class, 'Magium\AbstractConfigurableElement')) { |
43 | 43 | throw new \InvalidArgumentException('Class must be a sub-class of Magium\AbstractConfigurableElement'); |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | foreach ($print as $property) { |
59 | 59 | $output->writeln(''); |
60 | 60 | $output->writeln($property->getName()); |
61 | - $output->writeln("\tDefault Value: " . $property->getDefaultValue()); |
|
61 | + $output->writeln("\tDefault Value: ".$property->getDefaultValue()); |
|
62 | 62 | if ($property->getDescription()) { |
63 | - $output->writeln("\t" . $property->getDescription()); |
|
63 | + $output->writeln("\t".$property->getDescription()); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function configure() |
22 | 22 | { |
23 | - $this->setName('api:' . $this->getApiName()); |
|
23 | + $this->setName('api:'.$this->getApiName()); |
|
24 | 24 | $this->setDescription($this->getApiDescription()); |
25 | 25 | } |
26 | 26 |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | |
32 | 32 | protected function execute(InputInterface $input, OutputInterface $output) |
33 | 33 | { |
34 | - if (!file_exists($this->path . '/magium.json')) { |
|
34 | + if (!file_exists($this->path.'/magium.json')) { |
|
35 | 35 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
36 | 36 | } |
37 | 37 | $reader = new \Zend\Config\Reader\Json(); |
38 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
38 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
39 | 39 | |
40 | 40 | $name = $input->getArgument('name'); |
41 | 41 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | $writer = new Json(); |
47 | - $writer->toFile($this->path . '/magium.json', $config); |
|
47 | + $writer->toFile($this->path.'/magium.json', $config); |
|
48 | 48 | $output->writeln(sprintf('Removed value for "%s" in %s/magium.json', $name, $this->path)); |
49 | 49 | } |
50 | 50 |
@@ -32,22 +32,22 @@ |
||
32 | 32 | { |
33 | 33 | $path = $this->path; |
34 | 34 | if ($path && $path[0] != '/' && $path[1] != ':') { |
35 | - $path = getcwd() . '/' . $path; |
|
35 | + $path = getcwd().'/'.$path; |
|
36 | 36 | } |
37 | 37 | $calcPath = $path; |
38 | 38 | $path = realpath($path); |
39 | 39 | if ($path === false) { |
40 | - throw new NotFoundException('Path not found: ' . $calcPath); |
|
40 | + throw new NotFoundException('Path not found: '.$calcPath); |
|
41 | 41 | } |
42 | 42 | if (!is_writable($path)) { |
43 | - throw new NotAccessibleException('Could not write to path: ' . $calcPath); |
|
43 | + throw new NotAccessibleException('Could not write to path: '.$calcPath); |
|
44 | 44 | } |
45 | - $fullPath = $path . '/magium.json'; |
|
45 | + $fullPath = $path.'/magium.json'; |
|
46 | 46 | if (file_exists($fullPath)) { |
47 | - throw new ExistsException('The file exists already. Will not overwrite: ' . $fullPath); |
|
47 | + throw new ExistsException('The file exists already. Will not overwrite: '.$fullPath); |
|
48 | 48 | } |
49 | 49 | file_put_contents($fullPath, '{}'); |
50 | - $output->writeln('Created empty JSON configuration file: ' . realpath($fullPath)); |
|
50 | + $output->writeln('Created empty JSON configuration file: '.realpath($fullPath)); |
|
51 | 51 | |
52 | 52 | } |
53 | 53 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | public static function addDirectory($dir, $namespace) |
18 | 18 | { |
19 | 19 | if ($dir != realpath($dir)) { |
20 | - throw new InvalidConfigurationException('Path not found. Please ensure that you pass the realpath() in: ' . $dir); |
|
20 | + throw new InvalidConfigurationException('Path not found. Please ensure that you pass the realpath() in: '.$dir); |
|
21 | 21 | } |
22 | 22 | self::$dirs[$dir] = $namespace; |
23 | 23 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'Set if you want the namespace output escaped (useful for copy and paste)' |
76 | 76 | ); |
77 | 77 | |
78 | - self::addDirectory(realpath(__DIR__ . '/../..'), 'Magium'); |
|
78 | + self::addDirectory(realpath(__DIR__.'/../..'), 'Magium'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | protected function execute(InputInterface $input, OutputInterface $output) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | sort($paths); |
100 | 100 | $filter = $input->getArgument('filter'); |
101 | - if (count($paths) > 0 ) { |
|
101 | + if (count($paths) > 0) { |
|
102 | 102 | $output->writeln('Classes found: '); |
103 | 103 | $escape = $input->getOption('escape'); |
104 | 104 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $path = str_replace('\\', '\\\\', $path); |
108 | 108 | } |
109 | 109 | if ($filter && stripos($path, $filter) !== false) { |
110 | - $output->writeln("\t" . $path); |
|
110 | + $output->writeln("\t".$path); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | } else { |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | |
33 | 33 | protected function execute(InputInterface $input, OutputInterface $output) |
34 | 34 | { |
35 | - if (!file_exists($this->path . '/magium.json')) { |
|
35 | + if (!file_exists($this->path.'/magium.json')) { |
|
36 | 36 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
37 | 37 | } |
38 | 38 | $reader = new \Zend\Config\Reader\Json(); |
39 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
39 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
40 | 40 | |
41 | 41 | $name = strtolower($input->getArgument('class')); |
42 | 42 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | $writer = new Json(); |
64 | - $writer->toFile($this->path . '/magium.json', $config); |
|
64 | + $writer->toFile($this->path.'/magium.json', $config); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | protected function execute(InputInterface $input, OutputInterface $output) |
35 | 35 | { |
36 | - if (!file_exists($this->path . '/magium.json')) { |
|
36 | + if (!file_exists($this->path.'/magium.json')) { |
|
37 | 37 | throw new NotFoundException('Configuration file not found. Please execute magium:init.'); |
38 | 38 | } |
39 | 39 | $reader = new \Zend\Config\Reader\Json(); |
40 | - $config = new Config($reader->fromFile($this->path . '/magium.json'), true); |
|
40 | + $config = new Config($reader->fromFile($this->path.'/magium.json'), true); |
|
41 | 41 | |
42 | 42 | $name = $input->getArgument('name'); |
43 | 43 | $value = $input->getArgument('value'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $config->config->$name = $value; |
53 | 53 | |
54 | 54 | $writer = new Json(); |
55 | - $writer->toFile($this->path . '/magium.json', $config); |
|
55 | + $writer->toFile($this->path.'/magium.json', $config); |
|
56 | 56 | $output->writeln(sprintf('Wrote value for "%s" to %s/magium.json', $name, $this->path)); |
57 | 57 | } |
58 | 58 |