@@ -5,8 +5,9 @@ discard block |
||
| 5 | 5 | private static $initialized = false; |
| 6 | 6 | private function __construct() {} |
| 7 | 7 | private static function initialize() { |
| 8 | - if (self::$initialized) |
|
| 9 | - return; |
|
| 8 | + if (self::$initialized) { |
|
| 9 | + return; |
|
| 10 | + } |
|
| 10 | 11 | self::$stack = []; |
| 11 | 12 | self::$initialized = true; |
| 12 | 13 | } |
@@ -44,8 +45,9 @@ discard block |
||
| 44 | 45 | self::$stack[] = $debugInfo; |
| 45 | 46 | } |
| 46 | 47 | public static function pop() { |
| 47 | - if(count(self::$stack)>0) |
|
| 48 | - self::$stack = array_shift(self::$stack); |
|
| 48 | + if(count(self::$stack)>0) { |
|
| 49 | + self::$stack = array_shift(self::$stack); |
|
| 50 | + } |
|
| 49 | 51 | } |
| 50 | 52 | public static function emptyStack() { |
| 51 | 53 | self::$stack = []; |
@@ -23,12 +23,14 @@ discard block |
||
| 23 | 23 | public function import( $_path, $_type = "misc" ) { |
| 24 | 24 | $data = file_get_contents($_path); |
| 25 | 25 | $data = json_decode($data); |
| 26 | - if($data === NULL) |
|
| 27 | - Debug::log("Error processing [$_path]"); |
|
| 28 | - if( $_type == "connection" ) |
|
| 29 | - $this->overlayConnection($data); |
|
| 30 | - else |
|
| 31 | - $this->overlayMisc($data); |
|
| 26 | + if($data === NULL) { |
|
| 27 | + Debug::log("Error processing [$_path]"); |
|
| 28 | + } |
|
| 29 | + if( $_type == "connection" ) { |
|
| 30 | + $this->overlayConnection($data); |
|
| 31 | + } else { |
|
| 32 | + $this->overlayMisc($data); |
|
| 33 | + } |
|
| 32 | 34 | } |
| 33 | 35 | protected function overlayConnection( $_data ) { |
| 34 | 36 | $this->connection = $this->obj2array($_data); |
@@ -48,8 +50,9 @@ discard block |
||
| 48 | 50 | return $return; |
| 49 | 51 | } |
| 50 | 52 | protected function importObject( $_object ) { |
| 51 | - foreach (get_object_vars($_object) as $key => $value) |
|
| 52 | - $this->$key = $value; |
|
| 53 | + foreach (get_object_vars($_object) as $key => $value) { |
|
| 54 | + $this->$key = $value; |
|
| 55 | + } |
|
| 53 | 56 | } |
| 54 | 57 | } |
| 55 | 58 | ?> |
@@ -12,9 +12,10 @@ |
||
| 12 | 12 | Debug::push(); |
| 13 | 13 | $this->connection["$_name"] = $_connection; |
| 14 | 14 | $this->currentConnection = $_connection; |
| 15 | - foreach ($this->modules as &$module) |
|
| 16 | - if(isset($module->currentConnection)) |
|
| 15 | + foreach ($this->modules as &$module) { |
|
| 16 | + if(isset($module->currentConnection)) |
|
| 17 | 17 | $module->addConnection($_name, $_connection); |
| 18 | + } |
|
| 18 | 19 | Debug::pop(); |
| 19 | 20 | } |
| 20 | 21 | public function setConnection( $_name ) { |