@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | use \Psr\Log\LoggerAwareTrait; |
| 27 | 27 | |
| 28 | - protected function render($view, array $data = []){
|
|
| 28 | + protected function render($view, array $data = []) {
|
|
| 29 | 29 | |
| 30 | 30 | $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar");
|
| 31 | 31 | |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | return new Response($this->twig->render($view, $data)); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function setTwig(Twig_Environment $twig){
|
|
| 38 | + public function setTwig(Twig_Environment $twig) {
|
|
| 39 | 39 | $this->twig = $twig; |
| 40 | 40 | return $this; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - public function setDebugbar(StandardDebugBar $debugbar){
|
|
| 43 | + public function setDebugbar(StandardDebugBar $debugbar) {
|
|
| 44 | 44 | $this->debugbar = $debugbar; |
| 45 | 45 | return $this; |
| 46 | 46 | } |
@@ -27,21 +27,21 @@ |
||
| 27 | 27 | |
| 28 | 28 | protected function render($view, array $data = []){
|
| 29 | 29 | |
| 30 | - $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar");
|
|
| 30 | + $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar");
|
|
| 31 | 31 | |
| 32 | - $data["debugbar_Head"] = $debugbarRenderer->renderHead(); |
|
| 33 | - $data["debugbar_Body"] = $debugbarRenderer->render(); |
|
| 32 | + $data["debugbar_Head"] = $debugbarRenderer->renderHead(); |
|
| 33 | + $data["debugbar_Body"] = $debugbarRenderer->render(); |
|
| 34 | 34 | |
| 35 | - return $this->twig->render($view, $data); |
|
| 35 | + return $this->twig->render($view, $data); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function setTwig(Twig_Environment $twig){
|
| 39 | - $this->twig = $twig; |
|
| 40 | - return $this; |
|
| 39 | + $this->twig = $twig; |
|
| 40 | + return $this; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function setDebugbar(StandardDebugBar $debugbar){
|
| 44 | - $this->debugbar = $debugbar; |
|
| 45 | - return $this; |
|
| 44 | + $this->debugbar = $debugbar; |
|
| 45 | + return $this; |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | * |
| 10 | 10 | * @author d.lanec |
| 11 | 11 | */ |
| 12 | -interface PageInterface{
|
|
| 12 | +interface PageInterface {
|
|
| 13 | 13 | |
| 14 | 14 | public function setTwig(Twig_Environment $twig); |
| 15 | 15 | |
@@ -12,12 +12,12 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function __construct($failures, $message = "", $code = 0, $previous = null){ |
| 14 | 14 | |
| 15 | - parent::__construct($message, $code, $previous); |
|
| 15 | + parent::__construct($message, $code, $previous); |
|
| 16 | 16 | |
| 17 | - $this->failures = $failures; |
|
| 17 | + $this->failures = $failures; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | function getFailures(){ |
| 21 | - return $this->failures; |
|
| 21 | + return $this->failures; |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | * |
| 7 | 7 | * @author Dmitriy |
| 8 | 8 | */ |
| 9 | -class ValidationException extends \Exception{ |
|
| 9 | +class ValidationException extends \Exception { |
|
| 10 | 10 | |
| 11 | 11 | private $failures; |
| 12 | 12 | |
| 13 | - public function __construct($failures, $message = "", $code = 0, $previous = null){ |
|
| 13 | + public function __construct($failures, $message = "", $code = 0, $previous = null) { |
|
| 14 | 14 | |
| 15 | 15 | parent::__construct($message, $code, $previous); |
| 16 | 16 | |
| 17 | 17 | $this->failures = $failures; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - function getFailures(){ |
|
| 20 | + function getFailures() { |
|
| 21 | 21 | return $this->failures; |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Dmitriy |
| 10 | 10 | */ |
| 11 | -interface CrudInterface{ |
|
| 11 | +interface CrudInterface { |
|
| 12 | 12 | |
| 13 | 13 | public function findById($id); |
| 14 | 14 | |
@@ -16,25 +16,25 @@ |
||
| 16 | 16 | class SeedResetCommand extends Command{ |
| 17 | 17 | |
| 18 | 18 | protected function configure(){ |
| 19 | - $this->setName('seed:reset') |
|
| 20 | - ->setDescription('Reset all seeds data') |
|
| 21 | - ->setDefinition( |
|
| 22 | - new InputDefinition(array( |
|
| 23 | - new InputOption('class', 'c', InputOption::VALUE_REQUIRED) |
|
| 24 | - )) |
|
| 25 | - ); |
|
| 19 | + $this->setName('seed:reset') |
|
| 20 | + ->setDescription('Reset all seeds data') |
|
| 21 | + ->setDefinition( |
|
| 22 | + new InputDefinition(array( |
|
| 23 | + new InputOption('class', 'c', InputOption::VALUE_REQUIRED) |
|
| 24 | + )) |
|
| 25 | + ); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | protected function execute(InputInterface $input, OutputInterface $output){ |
| 29 | 29 | |
| 30 | - if(!$class = $input->getOption('class')){ |
|
| 31 | - $output->writeln("Class Model not set"); |
|
| 32 | - return; |
|
| 33 | - } |
|
| 30 | + if(!$class = $input->getOption('class')){ |
|
| 31 | + $output->writeln("Class Model not set"); |
|
| 32 | + return; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - if($class::reset()){ |
|
| 36 | - $output->writeln(sprintf("Seed %s reset success!", $class)); |
|
| 37 | - } else |
|
| 38 | - $output->writeln("Command seed:reset fail to execute!"); |
|
| 35 | + if($class::reset()){ |
|
| 36 | + $output->writeln(sprintf("Seed %s reset success!", $class)); |
|
| 37 | + } else |
|
| 38 | + $output->writeln("Command seed:reset fail to execute!"); |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | * |
| 14 | 14 | * @author Dmitriy |
| 15 | 15 | */ |
| 16 | -class SeedResetCommand extends Command{ |
|
| 16 | +class SeedResetCommand extends Command { |
|
| 17 | 17 | |
| 18 | - protected function configure(){ |
|
| 18 | + protected function configure() { |
|
| 19 | 19 | $this->setName('seed:reset') |
| 20 | 20 | ->setDescription('Reset all seeds data') |
| 21 | 21 | ->setDefinition( |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | ); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - protected function execute(InputInterface $input, OutputInterface $output){ |
|
| 28 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 29 | 29 | |
| 30 | - if(!$class = $input->getOption('class')){ |
|
| 30 | + if (!$class = $input->getOption('class')) { |
|
| 31 | 31 | $output->writeln("Class Model not set"); |
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if($class::reset()){ |
|
| 35 | + if ($class::reset()) { |
|
| 36 | 36 | $output->writeln(sprintf("Seed %s reset success!", $class)); |
| 37 | 37 | } else |
| 38 | 38 | $output->writeln("Command seed:reset fail to execute!"); |
@@ -34,7 +34,8 @@ |
||
| 34 | 34 | |
| 35 | 35 | if($class::reset()){ |
| 36 | 36 | $output->writeln(sprintf("Seed %s reset success!", $class)); |
| 37 | - } else |
|
| 38 | - $output->writeln("Command seed:reset fail to execute!"); |
|
| 37 | + } else { |
|
| 38 | + $output->writeln("Command seed:reset fail to execute!"); |
|
| 39 | + } |
|
| 39 | 40 | } |
| 40 | 41 | } |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | class InfoCommand extends Command{ |
| 14 | 14 | |
| 15 | 15 | protected function configure(){ |
| 16 | - $this->setName('info') |
|
| 17 | - ->setDescription('Outputs \'Info about command\''); |
|
| 16 | + $this->setName('info') |
|
| 17 | + ->setDescription('Outputs \'Info about command\''); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | protected function execute(InputInterface $input, OutputInterface $output){ |
| 21 | - $output->writeln('This is frameworkless console'); |
|
| 21 | + $output->writeln('This is frameworkless console'); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -10,14 +10,14 @@ |
||
| 10 | 10 | * |
| 11 | 11 | * @author Dmitriy |
| 12 | 12 | */ |
| 13 | -class InfoCommand extends Command{ |
|
| 13 | +class InfoCommand extends Command { |
|
| 14 | 14 | |
| 15 | - protected function configure(){ |
|
| 15 | + protected function configure() { |
|
| 16 | 16 | $this->setName('info') |
| 17 | 17 | ->setDescription('Outputs \'Info about command\''); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - protected function execute(InputInterface $input, OutputInterface $output){ |
|
| 20 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 21 | 21 | $output->writeln('This is frameworkless console'); |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -13,28 +13,28 @@ |
||
| 13 | 13 | class InstallPackagesCommand extends Command{ |
| 14 | 14 | |
| 15 | 15 | protected function configure(){ |
| 16 | - $this->setName('packages:install') |
|
| 17 | - ->setDescription('Install packages migration and assets'); |
|
| 16 | + $this->setName('packages:install') |
|
| 17 | + ->setDescription('Install packages migration and assets'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | protected function execute(InputInterface $input, OutputInterface $output){ |
| 21 | - $finder = \Symfony\Component\Finder\Finder::create(); |
|
| 21 | + $finder = \Symfony\Component\Finder\Finder::create(); |
|
| 22 | 22 | |
| 23 | - $root_path = __DIR__ . "../../../.."; |
|
| 23 | + $root_path = __DIR__ . "../../../.."; |
|
| 24 | 24 | |
| 25 | - $iterator = $finder |
|
| 26 | - ->files() |
|
| 27 | - ->in($root_path . "/vendor/*/*/db"); |
|
| 25 | + $iterator = $finder |
|
| 26 | + ->files() |
|
| 27 | + ->in($root_path . "/vendor/*/*/db"); |
|
| 28 | 28 | |
| 29 | - foreach($iterator as $file){ |
|
| 29 | + foreach($iterator as $file){ |
|
| 30 | 30 | |
| 31 | - if(!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())){ |
|
| 32 | - $output->writeln(sprintf("error copy migration %s...", $file->getRelativePathname())); |
|
| 33 | - } else{ |
|
| 34 | - $output->writeln(sprintf("copy migration %s", $file->getRelativePathname())); |
|
| 35 | - } |
|
| 36 | - } |
|
| 31 | + if(!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())){ |
|
| 32 | + $output->writeln(sprintf("error copy migration %s...", $file->getRelativePathname())); |
|
| 33 | + } else{ |
|
| 34 | + $output->writeln(sprintf("copy migration %s", $file->getRelativePathname())); |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - $output->writeln("completed!"); |
|
| 38 | + $output->writeln("completed!"); |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -10,14 +10,14 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * @author Dmitriy |
| 12 | 12 | */ |
| 13 | -class InstallPackagesCommand extends Command{ |
|
| 13 | +class InstallPackagesCommand extends Command { |
|
| 14 | 14 | |
| 15 | - protected function configure(){ |
|
| 15 | + protected function configure() { |
|
| 16 | 16 | $this->setName('packages:install') |
| 17 | 17 | ->setDescription('Install packages migration and assets'); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - protected function execute(InputInterface $input, OutputInterface $output){ |
|
| 20 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 21 | 21 | $finder = \Symfony\Component\Finder\Finder::create(); |
| 22 | 22 | |
| 23 | 23 | $root_path = __DIR__ . "../../../.."; |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | ->files() |
| 27 | 27 | ->in($root_path . "/vendor/*/*/db"); |
| 28 | 28 | |
| 29 | - foreach($iterator as $file){ |
|
| 29 | + foreach ($iterator as $file) { |
|
| 30 | 30 | |
| 31 | - if(!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())){ |
|
| 31 | + if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
|
| 32 | 32 | $output->writeln(sprintf("error copy migration %s...", $file->getRelativePathname())); |
| 33 | - } else{ |
|
| 33 | + } else { |
|
| 34 | 34 | $output->writeln(sprintf("copy migration %s", $file->getRelativePathname())); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -16,25 +16,25 @@ |
||
| 16 | 16 | class SeedBuildCommand extends Command{ |
| 17 | 17 | |
| 18 | 18 | protected function configure(){ |
| 19 | - $this->setName('seed:build') |
|
| 20 | - ->setDescription('Create seeds data') |
|
| 21 | - ->setDefinition( |
|
| 22 | - new InputDefinition(array( |
|
| 23 | - new InputOption('class', 'c', InputOption::VALUE_REQUIRED), |
|
| 24 | - new InputOption('amount', 'a', InputOption::VALUE_OPTIONAL) |
|
| 25 | - )) |
|
| 26 | - ); |
|
| 19 | + $this->setName('seed:build') |
|
| 20 | + ->setDescription('Create seeds data') |
|
| 21 | + ->setDefinition( |
|
| 22 | + new InputDefinition(array( |
|
| 23 | + new InputOption('class', 'c', InputOption::VALUE_REQUIRED), |
|
| 24 | + new InputOption('amount', 'a', InputOption::VALUE_OPTIONAL) |
|
| 25 | + )) |
|
| 26 | + ); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | protected function execute(InputInterface $input, OutputInterface $output){ |
| 30 | 30 | |
| 31 | - if(!$class = $input->getOption('class')){ |
|
| 32 | - $output->writeln("Class Model not set"); |
|
| 33 | - return; |
|
| 34 | - } |
|
| 31 | + if(!$class = $input->getOption('class')){ |
|
| 32 | + $output->writeln("Class Model not set"); |
|
| 33 | + return; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - $number = $input->getOption('amount'); |
|
| 37 | - $class::build($number > 1 ? $number : 1); |
|
| 38 | - $output->writeln(sprintf("Seed %s amount %s create success!", $class, $number)); |
|
| 36 | + $number = $input->getOption('amount'); |
|
| 37 | + $class::build($number > 1 ? $number : 1); |
|
| 38 | + $output->writeln(sprintf("Seed %s amount %s create success!", $class, $number)); |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | * |
| 14 | 14 | * @author Dmitriy |
| 15 | 15 | */ |
| 16 | -class SeedBuildCommand extends Command{ |
|
| 16 | +class SeedBuildCommand extends Command { |
|
| 17 | 17 | |
| 18 | - protected function configure(){ |
|
| 18 | + protected function configure() { |
|
| 19 | 19 | $this->setName('seed:build') |
| 20 | 20 | ->setDescription('Create seeds data') |
| 21 | 21 | ->setDefinition( |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | ); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - protected function execute(InputInterface $input, OutputInterface $output){ |
|
| 29 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 30 | 30 | |
| 31 | - if(!$class = $input->getOption('class')){ |
|
| 31 | + if (!$class = $input->getOption('class')) { |
|
| 32 | 32 | $output->writeln("Class Model not set"); |
| 33 | 33 | return; |
| 34 | 34 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * |
| 7 | 7 | * @author d.lanec |
| 8 | 8 | */ |
| 9 | -interface ModuleInterface{
|
|
| 9 | +interface ModuleInterface {
|
|
| 10 | 10 | |
| 11 | 11 | public function process(); |
| 12 | 12 | |