Completed
Push — master ( 76c71b...91372c )
by dima
05:24
created
app/SeedInterface.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  */
10 10
 interface SeedInterface
11 11
 {
12
-	static public function build($id = 1);
12
+    static public function build($id = 1);
13 13
 	
14
-	static public function reset();
14
+    static public function reset();
15 15
 }
Please login to merge, or discard this patch.
app/Controllers/IndexController.php 3 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@  discard block
 block discarded – undo
17 17
 	/**
18 18
 	 * IndexController, constructed by container
19 19
 	 *
20
-	 * @param Twig_Environment $twig
21 20
 	 */
22 21
 	public function __construct( UserList $userListModule) {
23 22
 
@@ -28,7 +27,7 @@  discard block
 block discarded – undo
28 27
 	 * Return index page (/)
29 28
 	 *
30 29
 	 * @param array $args
31
-	 * @return Response
30
+	 * @return \Symfony\Component\HttpFoundation\Response
32 31
 	 */
33 32
 	public function get($args) {
34 33
 		return $this->render('pages/index.html.twig', [
Please login to merge, or discard this patch.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -6,34 +6,34 @@
 block discarded – undo
6 6
 
7 7
 class IndexController extends BaseController {
8 8
 	
9
-	/**
10
-	 *
11
-	 * @var \Models\User\UserRepository $UserRepository
12
-	 */
13
-	protected $UserRepository;
14
-
15
-	protected $userListModule;
16
-
17
-	/**
18
-	 * IndexController, constructed by container
19
-	 *
20
-	 * @param Twig_Environment $twig
21
-	 */
22
-	public function __construct( UserList $userListModule) {
23
-
24
-		$this->userListModule = $userListModule;
25
-	}
26
-
27
-	/**
28
-	 * Return index page (/)
29
-	 *
30
-	 * @param array $args
31
-	 * @return Response
32
-	 */
33
-	public function get($args) {
34
-		return $this->render('pages/index.html.twig', [
35
-				"content" => $this->userListModule->process($args),
36
-		]);
37
-	}
9
+    /**
10
+     *
11
+     * @var \Models\User\UserRepository $UserRepository
12
+     */
13
+    protected $UserRepository;
14
+
15
+    protected $userListModule;
16
+
17
+    /**
18
+     * IndexController, constructed by container
19
+     *
20
+     * @param Twig_Environment $twig
21
+     */
22
+    public function __construct( UserList $userListModule) {
23
+
24
+        $this->userListModule = $userListModule;
25
+    }
26
+
27
+    /**
28
+     * Return index page (/)
29
+     *
30
+     * @param array $args
31
+     * @return Response
32
+     */
33
+    public function get($args) {
34
+        return $this->render('pages/index.html.twig', [
35
+                "content" => $this->userListModule->process($args),
36
+        ]);
37
+    }
38 38
 
39 39
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 	 *
20 20
 	 * @param Twig_Environment $twig
21 21
 	 */
22
-	public function __construct( UserList $userListModule) {
22
+	public function __construct(UserList $userListModule) {
23 23
 
24 24
 		$this->userListModule = $userListModule;
25 25
 	}
Please login to merge, or discard this patch.
app/Controllers/ModuleController.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -9,6 +9,9 @@
 block discarded – undo
9 9
  */
10 10
 class ModuleController extends BaseController {
11 11
 	
12
+	/**
13
+	 * @param string $view
14
+	 */
12 15
 	protected function render($view, array $data = array()) {
13 16
 		
14 17
 		$ref = new \ReflectionClass($this);
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@
 block discarded – undo
9 9
  */
10 10
 class ModuleController extends BaseController {
11 11
 	
12
-	protected function render($view, array $data = array()) {
12
+    protected function render($view, array $data = array()) {
13 13
 		
14
-		$ref = new \ReflectionClass($this);
14
+        $ref = new \ReflectionClass($this);
15 15
 		
16
-		$tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR .'tpl';
16
+        $tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR .'tpl';
17 17
 		
18
-		$twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl));
18
+        $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl));
19 19
 
20
-		return $twig->render($view . '.twig',$data);
21
-	}
20
+        return $twig->render($view . '.twig',$data);
21
+    }
22 22
 
23 23
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@
 block discarded – undo
13 13
 		
14 14
 		$ref = new \ReflectionClass($this);
15 15
 		
16
-		$tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR .'tpl';
16
+		$tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR . 'tpl';
17 17
 		
18 18
 		$twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl));
19 19
 
20
-		return $twig->render($view . '.twig',$data);
20
+		return $twig->render($view . '.twig', $data);
21 21
 	}
22 22
 
23 23
 }
Please login to merge, or discard this patch.
packages/core/src/Modules/UserList/UserList.php 3 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Core\Modules\UserList;
3 3
 
4
-use Frameworkless\Controllers;
4
+use Frameworkless\Controllers;
5 5
 use Donquixote\Cellbrush\Table\Table;
6 6
 
7 7
 /**
Please login to merge, or discard this patch.
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -12,76 +12,76 @@
 block discarded – undo
12 12
 class UserList extends Controllers\ModuleController implements Controllers\ModuleInterface
13 13
 {
14 14
 
15
-	/**
16
-	 *
17
-	 * @var \Core\Models\User\UserRepository 
18
-	 */
19
-	protected $userRepository;
20
-
21
-	function __construct(\Core\Models\User\UserRepository $userRepository)
22
-	{
23
-		$this->userRepository = $userRepository;
24
-	}
25
-
26
-	public function process($args = [])
27
-	{
28
-
29
-		$this->logger->debug('UserList start');
30
-
31
-		if ($args['fn'] == 'add') {
32
-			$this->add();
33
-		}
34
-
35
-		$Users = $this->userRepository->findMany();
36
-
37
-		$table	 = Table::create();
38
-		$table->addColNames([0, 1, 2]);
39
-		$table->addClass('table table-striped');
40
-		$table->thead()
41
-				->addRowName('head row')
42
-				->th('head row', 0, 'Id')
43
-				->th('head row', 1, 'Имя')
44
-				->th('head row', 2, 'Email');
45
-		$i		 = 0;
46
-		foreach ($Users as $User) {
47
-			$table->addRow($i)->tdMultiple([
48
-				$User->getId(),
49
-				$User->getName(),
50
-				$User->getEmail()]);
51
-			$i++;
52
-		}
53
-
54
-		return $this->render('default', [
55
-					'table' => $table->render()
56
-		]);
57
-	}
58
-
59
-	protected function add()
60
-	{
61
-
62
-		try {
63
-
64
-			$User = $this->userRepository->build();
65
-			$User->setEmail('[email protected]');
66
-
67
-			if (!$this->UserRepository->save($User)) {
68
-				throw new Exception('User not save');
69
-			} else {
70
-				$this->logger->info("Пользователь успешно сохранен!");
71
-			}
72
-		} catch(\Frameworkless\Exceptions\ValidationException $ex) {
73
-
74
-			foreach ($ex->getFailures() as $failure) {
75
-				$this->logger->error("Property " . $failure->getPropertyPath() . ": " . $failure->getMessage() . "\n");
76
-			}
77
-
78
-			$this->logger->info("Произошла ошибка при сохранении пользователя");
79
-		} catch(\Exception $ex) {
80
-
81
-			$this->logger->error("system error:" . $ex->getMessage());
82
-
83
-			$this->logger->info("Произошла ошибка при сохранении пользователя");
84
-		}
85
-
86
-	}
15
+    /**
16
+     *
17
+     * @var \Core\Models\User\UserRepository 
18
+     */
19
+    protected $userRepository;
20
+
21
+    function __construct(\Core\Models\User\UserRepository $userRepository)
22
+    {
23
+        $this->userRepository = $userRepository;
24
+    }
25
+
26
+    public function process($args = [])
27
+    {
28
+
29
+        $this->logger->debug('UserList start');
30
+
31
+        if ($args['fn'] == 'add') {
32
+            $this->add();
33
+        }
34
+
35
+        $Users = $this->userRepository->findMany();
36
+
37
+        $table	 = Table::create();
38
+        $table->addColNames([0, 1, 2]);
39
+        $table->addClass('table table-striped');
40
+        $table->thead()
41
+                ->addRowName('head row')
42
+                ->th('head row', 0, 'Id')
43
+                ->th('head row', 1, 'Имя')
44
+                ->th('head row', 2, 'Email');
45
+        $i		 = 0;
46
+        foreach ($Users as $User) {
47
+            $table->addRow($i)->tdMultiple([
48
+                $User->getId(),
49
+                $User->getName(),
50
+                $User->getEmail()]);
51
+            $i++;
52
+        }
53
+
54
+        return $this->render('default', [
55
+                    'table' => $table->render()
56
+        ]);
57
+    }
58
+
59
+    protected function add()
60
+    {
61
+
62
+        try {
63
+
64
+            $User = $this->userRepository->build();
65
+            $User->setEmail('[email protected]');
66
+
67
+            if (!$this->UserRepository->save($User)) {
68
+                throw new Exception('User not save');
69
+            } else {
70
+                $this->logger->info("Пользователь успешно сохранен!");
71
+            }
72
+        } catch(\Frameworkless\Exceptions\ValidationException $ex) {
73
+
74
+            foreach ($ex->getFailures() as $failure) {
75
+                $this->logger->error("Property " . $failure->getPropertyPath() . ": " . $failure->getMessage() . "\n");
76
+            }
77
+
78
+            $this->logger->info("Произошла ошибка при сохранении пользователя");
79
+        } catch(\Exception $ex) {
80
+
81
+            $this->logger->error("system error:" . $ex->getMessage());
82
+
83
+            $this->logger->info("Произошла ошибка при сохранении пользователя");
84
+        }
85
+
86
+    }
87 87
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 		$Users = $this->userRepository->findMany();
36 36
 
37
-		$table	 = Table::create();
37
+		$table = Table::create();
38 38
 		$table->addColNames([0, 1, 2]);
39 39
 		$table->addClass('table table-striped');
40 40
 		$table->thead()
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 				->th('head row', 0, 'Id')
43 43
 				->th('head row', 1, 'Имя')
44 44
 				->th('head row', 2, 'Email');
45
-		$i		 = 0;
45
+		$i = 0;
46 46
 		foreach ($Users as $User) {
47 47
 			$table->addRow($i)->tdMultiple([
48 48
 				$User->getId(),
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 			} else {
70 70
 				$this->logger->info("Пользователь успешно сохранен!");
71 71
 			}
72
-		} catch(\Frameworkless\Exceptions\ValidationException $ex) {
72
+		} catch (\Frameworkless\Exceptions\ValidationException $ex) {
73 73
 
74 74
 			foreach ($ex->getFailures() as $failure) {
75 75
 				$this->logger->error("Property " . $failure->getPropertyPath() . ": " . $failure->getMessage() . "\n");
76 76
 			}
77 77
 
78 78
 			$this->logger->info("Произошла ошибка при сохранении пользователя");
79
-		} catch(\Exception $ex) {
79
+		} catch (\Exception $ex) {
80 80
 
81 81
 			$this->logger->error("system error:" . $ex->getMessage());
82 82
 
Please login to merge, or discard this patch.
app/Controllers/ModuleInterface.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
  */
9 9
 interface ModuleInterface {
10 10
 	
11
-	public function process();
11
+    public function process();
12 12
 	
13 13
 }
Please login to merge, or discard this patch.
app/Controllers/BaseController.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -12,38 +12,38 @@
 block discarded – undo
12 12
  */
13 13
 abstract class BaseController implements \Psr\Log\LoggerAwareInterface, PageInterface {
14 14
 	
15
-	/**
16
-	 * @var Twig_Environment
17
-	 */
18
-	protected $twig;	
15
+    /**
16
+     * @var Twig_Environment
17
+     */
18
+    protected $twig;	
19 19
 	
20
-	/**
21
-	 *
22
-	 * @var StandardDebugBar
23
-	 */
24
-	protected $debugbar;
20
+    /**
21
+     *
22
+     * @var StandardDebugBar
23
+     */
24
+    protected $debugbar;
25 25
 		
26
-	use \Psr\Log\LoggerAwareTrait;
26
+    use \Psr\Log\LoggerAwareTrait;
27 27
 
28
-	protected function render($view,array $data = []){
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));
36
-	}
35
+        return new Response($this->twig->render($view,$data));
36
+    }
37 37
 	
38
-	public function setTwig(Twig_Environment $twig) {
39
-		$this->twig = $twig;
40
-		return $this;
41
-	}
38
+    public function setTwig(Twig_Environment $twig) {
39
+        $this->twig = $twig;
40
+        return $this;
41
+    }
42 42
 
43
-	public function setDebugbar(StandardDebugBar $debugbar) {
44
-		$this->debugbar = $debugbar;
45
-		return $this;
46
-	}
43
+    public function setDebugbar(StandardDebugBar $debugbar) {
44
+        $this->debugbar = $debugbar;
45
+        return $this;
46
+    }
47 47
 
48 48
 
49 49
 	
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 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
 		
32 32
 		$data["debugbar_Head"] = $debugbarRenderer->renderHead();
33 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) {
Please login to merge, or discard this patch.
app/Controllers/PageInterface.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
  */
14 14
 interface PageInterface {
15 15
 	
16
-	public function setTwig(Twig_Environment $twig);
16
+    public function setTwig(Twig_Environment $twig);
17 17
 	
18
-	public  function setDebugbar(StandardDebugBar $debugbar);
18
+    public  function setDebugbar(StandardDebugBar $debugbar);
19 19
 	
20 20
 }
Please login to merge, or discard this patch.
app/Exceptions/ValidationException.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,17 +9,17 @@
 block discarded – undo
9 9
  */
10 10
 class ValidationException extends \Exception {
11 11
 
12
-	private $failures;
12
+    private $failures;
13 13
 
14
-	public function __construct($failures, $message = "", $code = 0, $previous = null) {
14
+    public function __construct($failures, $message = "", $code = 0, $previous = null) {
15 15
 		
16
-		parent::__construct($message, $code, $previous);
16
+        parent::__construct($message, $code, $previous);
17 17
 		
18
-		$this->failures = $failures;
19
-	}
18
+        $this->failures = $failures;
19
+    }
20 20
 
21
-	function getFailures() {
22
-		return $this->failures;
23
-	}
21
+    function getFailures() {
22
+        return $this->failures;
23
+    }
24 24
 
25 25
 }
Please login to merge, or discard this patch.