@@ -9,7 +9,6 @@ |
||
| 9 | 9 | /** |
| 10 | 10 | * Return index page (/) |
| 11 | 11 | * |
| 12 | - * @param array $args |
|
| 13 | 12 | * @return Response |
| 14 | 13 | */ |
| 15 | 14 | public function get(){ |
@@ -4,7 +4,7 @@ discard block |
||
| 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 |
||
| 12 | 12 | * @param array $args |
| 13 | 13 | * @return Response |
| 14 | 14 | */ |
| 15 | - public function get(){ |
|
| 15 | + public function get() { |
|
| 16 | 16 | |
| 17 | 17 | $result = \App::getModule(UserList::class, [ |
| 18 | 18 | "limit" => 50 |
@@ -7,11 +7,11 @@ discard block |
||
| 7 | 7 | private static $_instance = null; |
| 8 | 8 | |
| 9 | 9 | private function __construct(){ |
| 10 | - // приватный конструктор ограничивает реализацию getInstance () |
|
| 10 | + // приватный конструктор ограничивает реализацию getInstance () |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | protected function __clone(){ |
| 14 | - // ограничивает клонирование объекта |
|
| 14 | + // ограничивает клонирование объекта |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -21,28 +21,28 @@ discard block |
||
| 21 | 21 | * @return string |
| 22 | 22 | */ |
| 23 | 23 | public static function getModule($name, array $params = []){ |
| 24 | - $DI = self::getInstance()->load("DI"); |
|
| 25 | - $debugbar = $DI->get(DebugBar\StandardDebugBar::class); |
|
| 26 | - $debugbar['messages']->debug(sprintf('App::getModule %s, with params %s', $name, json_encode($params))); |
|
| 27 | - $debugbar['time']->startMeasure($name, 'Load module ' . $name); |
|
| 28 | - $module = $DI->get($name); |
|
| 29 | - $result = $module->setParams($params)->process(); |
|
| 30 | - $debugbar['time']->stopMeasure($name); |
|
| 31 | - return $result; |
|
| 24 | + $DI = self::getInstance()->load("DI"); |
|
| 25 | + $debugbar = $DI->get(DebugBar\StandardDebugBar::class); |
|
| 26 | + $debugbar['messages']->debug(sprintf('App::getModule %s, with params %s', $name, json_encode($params))); |
|
| 27 | + $debugbar['time']->startMeasure($name, 'Load module ' . $name); |
|
| 28 | + $module = $DI->get($name); |
|
| 29 | + $result = $module->setParams($params)->process(); |
|
| 30 | + $debugbar['time']->stopMeasure($name); |
|
| 31 | + return $result; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public static function getInstance(){ |
| 35 | - if(is_null(self::$_instance)){ |
|
| 36 | - self::$_instance = new self(); |
|
| 37 | - } |
|
| 38 | - return self::$_instance; |
|
| 35 | + if(is_null(self::$_instance)){ |
|
| 36 | + self::$_instance = new self(); |
|
| 37 | + } |
|
| 38 | + return self::$_instance; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function import($key, $value){ |
| 42 | - $this->settings[$key] = $value; |
|
| 42 | + $this->settings[$key] = $value; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function load($key){ |
| 46 | - return $this->settings[$key]; |
|
| 46 | + return $this->settings[$key]; |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class App{ |
|
| 3 | +class App { |
|
| 4 | 4 | |
| 5 | 5 | private $settings = array(); |
| 6 | 6 | |
| 7 | 7 | private static $_instance = null; |
| 8 | 8 | |
| 9 | - private function __construct(){ |
|
| 9 | + private function __construct() { |
|
| 10 | 10 | // приватный конструктор ограничивает реализацию getInstance () |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | - protected function __clone(){ |
|
| 13 | + protected function __clone() { |
|
| 14 | 14 | // ограничивает клонирование объекта |
| 15 | 15 | } |
| 16 | 16 | |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | * @param array $params |
| 21 | 21 | * @return string |
| 22 | 22 | */ |
| 23 | - public static function getModule($name, array $params = []){ |
|
| 24 | - $DI = self::getInstance()->load("DI"); |
|
| 25 | - $debugbar = $DI->get(DebugBar\StandardDebugBar::class); |
|
| 23 | + public static function getModule($name, array $params = []) { |
|
| 24 | + $DI = self::getInstance()->load("DI"); |
|
| 25 | + $debugbar = $DI->get(DebugBar\StandardDebugBar::class); |
|
| 26 | 26 | $debugbar['messages']->debug(sprintf('App::getModule %s, with params %s', $name, json_encode($params))); |
| 27 | 27 | $debugbar['time']->startMeasure($name, 'Load module ' . $name); |
| 28 | 28 | $module = $DI->get($name); |
@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | return $result; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public static function getInstance(){ |
|
| 35 | - if(is_null(self::$_instance)){ |
|
| 34 | + public static function getInstance() { |
|
| 35 | + if (is_null(self::$_instance)) { |
|
| 36 | 36 | self::$_instance = new self(); |
| 37 | 37 | } |
| 38 | 38 | return self::$_instance; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function import($key, $value){ |
|
| 41 | + public function import($key, $value) { |
|
| 42 | 42 | $this->settings[$key] = $value; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function load($key){ |
|
| 45 | + public function load($key) { |
|
| 46 | 46 | return $this->settings[$key]; |
| 47 | 47 | } |
| 48 | 48 | } |