Completed
Push — master ( 1046fe...dee123 )
by dima
02:31
created
app/Controllers/ModuleController.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
  */
9 9
 abstract class ModuleController extends BaseController implements \Frameworkless\ModuleInterface{
10 10
 
11
+    /**
12
+     * @param string $view
13
+     */
11 14
     protected function render($view, array $data = array()){
12 15
 
13 16
 	$ref = new \ReflectionClass($this);
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 
11 11
     protected function render($view, array $data = array()){
12 12
 
13
-	$ref = new \ReflectionClass($this);
13
+    $ref = new \ReflectionClass($this);
14 14
 
15
-	$tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR . 'tpl';
15
+    $tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR . 'tpl';
16 16
 
17
-	$twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl));
17
+    $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl));
18 18
 
19
-	return $twig->render($view . '.twig', $data);
19
+    return $twig->render($view . '.twig', $data);
20 20
     }
21 21
 
22 22
     abstract public function process();
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function setParams(array $params = array()){
31 31
 
32
-	foreach($params as $param => $value){
33
-	    if((new \ReflectionClass($this))->hasProperty($param) === false)
34
-		throw new \Exception(sprintf("param '%s' not found in module '%s'", $param, self::class));
32
+    foreach($params as $param => $value){
33
+        if((new \ReflectionClass($this))->hasProperty($param) === false)
34
+        throw new \Exception(sprintf("param '%s' not found in module '%s'", $param, self::class));
35 35
 
36
-	    $this->{$param} = $value;
37
-	}
38
-	return $this;
36
+        $this->{$param} = $value;
37
+    }
38
+    return $this;
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
  *
7 7
  * @author d.lanec
8 8
  */
9
-abstract class ModuleController extends BaseController implements \Frameworkless\ModuleInterface{
9
+abstract class ModuleController extends BaseController implements \Frameworkless\ModuleInterface {
10 10
 
11
-    protected function render($view, array $data = array()){
11
+    protected function render($view, array $data = array()) {
12 12
 
13 13
 	$ref = new \ReflectionClass($this);
14 14
 
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
      * @return $this
28 28
      * @throws \Exception
29 29
      */
30
-    public function setParams(array $params = array()){
30
+    public function setParams(array $params = array()) {
31 31
 
32
-	foreach($params as $param => $value){
33
-	    if((new \ReflectionClass($this))->hasProperty($param) === false)
32
+	foreach ($params as $param => $value) {
33
+	    if ((new \ReflectionClass($this))->hasProperty($param) === false)
34 34
 		throw new \Exception(sprintf("param '%s' not found in module '%s'", $param, self::class));
35 35
 
36 36
 	    $this->{$param} = $value;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
     public function setParams(array $params = array()){
31 31
 
32 32
 	foreach($params as $param => $value){
33
-	    if((new \ReflectionClass($this))->hasProperty($param) === false)
34
-		throw new \Exception(sprintf("param '%s' not found in module '%s'", $param, self::class));
33
+	    if((new \ReflectionClass($this))->hasProperty($param) === false) {
34
+	    		throw new \Exception(sprintf("param '%s' not found in module '%s'", $param, self::class));
35
+	    }
35 36
 
36 37
 	    $this->{$param} = $value;
37 38
 	}
Please login to merge, or discard this patch.
app/ValidatorTrait.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,15 +23,15 @@
 block discarded – undo
23 23
     protected $validator;
24 24
 
25 25
     function __construct(){
26
-	$this->validator = new RecursiveValidator(
27
-		new ExecutionContextFactory(new IdentityTranslator()), new LazyLoadingMetadataFactory(new StaticMethodLoader()), new ConstraintValidatorFactory()
28
-	);
26
+    $this->validator = new RecursiveValidator(
27
+        new ExecutionContextFactory(new IdentityTranslator()), new LazyLoadingMetadataFactory(new StaticMethodLoader()), new ConstraintValidatorFactory()
28
+    );
29 29
     }
30 30
 
31 31
     public function preSave(\Propel\Runtime\Connection\ConnectionInterface $con = null){
32
-	if(!$result = $this->validate($this->validator)){
33
-	    throw new ValidationException($this->getValidationFailures(), "Validation error");
34
-	}
35
-	return $result;
32
+    if(!$result = $this->validate($this->validator)){
33
+        throw new ValidationException($this->getValidationFailures(), "Validation error");
34
+    }
35
+    return $result;
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  *
15 15
  * @author Dmitriy
16 16
  */
17
-trait ValidatorTrait{
17
+trait ValidatorTrait {
18 18
 
19 19
     /**
20 20
      * Symfony\Component\Validator\Validator\RecursiveValidator
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
      */
23 23
     protected $validator;
24 24
 
25
-    function __construct(){
25
+    function __construct() {
26 26
 	$this->validator = new RecursiveValidator(
27 27
 		new ExecutionContextFactory(new IdentityTranslator()), new LazyLoadingMetadataFactory(new StaticMethodLoader()), new ConstraintValidatorFactory()
28 28
 	);
29 29
     }
30 30
 
31
-    public function preSave(\Propel\Runtime\Connection\ConnectionInterface $con = null){
32
-	if(!$result = $this->validate($this->validator)){
31
+    public function preSave(\Propel\Runtime\Connection\ConnectionInterface $con = null) {
32
+	if (!$result = $this->validate($this->validator)) {
33 33
 	    throw new ValidationException($this->getValidationFailures(), "Validation error");
34 34
 	}
35 35
 	return $result;
Please login to merge, or discard this patch.
app/Controllers/BaseController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@
 block discarded – undo
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 new Response($this->twig->render($view, $data));
35
+    return new Response($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
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Controllers/IndexController.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
      */
15 15
     public function get($args){
16 16
 
17
-	$result = \App::getModule(UserList::class, [
18
-		    "limit" => 50
19
-	]);
17
+    $result = \App::getModule(UserList::class, [
18
+            "limit" => 50
19
+    ]);
20 20
 
21
-	return $this->render('pages/index.html.twig', [
22
-		    "content" => $result,
23
-	]);
21
+    return $this->render('pages/index.html.twig', [
22
+            "content" => $result,
23
+    ]);
24 24
     }
25 25
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Core\Modules\UserList\UserList;
5 5
 use Symfony\Component\HttpFoundation\Response;
6 6
 
7
-class IndexController extends BaseController{
7
+class IndexController extends BaseController {
8 8
 
9 9
     /**
10 10
      * Return index page (/)
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      * @param array $args
13 13
      * @return Response
14 14
      */
15
-    public function get($args){
15
+    public function get($args) {
16 16
 
17 17
 	$result = \App::getModule(UserList::class, [
18 18
 		    "limit" => 50
Please login to merge, or discard this patch.
app/Controllers/PageInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Exceptions/ValidationException.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
app/CrudInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  *
9 9
  * @author Dmitriy
10 10
  */
11
-interface CrudInterface{
11
+interface CrudInterface {
12 12
 
13 13
     public function findById($id);
14 14
 
Please login to merge, or discard this patch.
app/Console/Commands/SeedResetCommand.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -16,25 +16,25 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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!");
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
app/Console/Commands/InfoCommand.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.