@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return bool |
39 | 39 | */ |
40 | 40 | public function isEmpty() { |
41 | - throw new \Exception(get_class() . '::isEmpty() not implemented - inherited from ContainerPlus'); |
|
41 | + throw new \Exception(get_class().'::isEmpty() not implemented - inherited from ContainerPlus'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return mixed |
48 | 48 | */ |
49 | 49 | public function clear() { |
50 | - throw new \Exception(get_class() . '::clear() not implemented - inherited from ContainerPlus'); |
|
50 | + throw new \Exception(get_class().'::clear() not implemented - inherited from ContainerPlus'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | ->setIdField($cModel->getIdFieldName()) |
14 | 14 | ->field('*') |
15 | 15 | ->from($cModel->getTableName()) |
16 | - ->where($cModel->getIdFieldName() . ' = "' . $dbId . '"'); |
|
16 | + ->where($cModel->getIdFieldName().' = "'.$dbId.'"'); |
|
17 | 17 | |
18 | 18 | return $stmt->selectRow(); |
19 | 19 | } |
@@ -129,7 +129,7 @@ |
||
129 | 129 | if (is_callable($callable)) { |
130 | 130 | $this->{$type}[$varName] = $callable; |
131 | 131 | } else { |
132 | - throw new Exception('Error assigning callable in ' . get_called_class() . '! Callable typed [' . $type . '] is not a callable or not accessible in the scope'); |
|
132 | + throw new Exception('Error assigning callable in '.get_called_class().'! Callable typed ['.$type.'] is not a callable or not accessible in the scope'); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 |
@@ -63,6 +63,10 @@ |
||
63 | 63 | */ |
64 | 64 | protected $accessors = array(); |
65 | 65 | |
66 | + /** |
|
67 | + * @param string $varName |
|
68 | + * @param string $type |
|
69 | + */ |
|
66 | 70 | protected function assignAccessor($varName, $type, $callable) { |
67 | 71 | if (empty($callable)) { |
68 | 72 | return; |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | * @property int|float|string $dbId EntityModel unique ID for entire entities' set |
9 | 9 | */ |
10 | -class EntityModel { |
|
10 | +class EntityModel { |
|
11 | 11 | /** |
12 | 12 | * Link to DB which used by this EntityModel |
13 | 13 | * |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (is_callable($callable)) { |
72 | 72 | $this->accessors[$varName][$type] = $callable; |
73 | 73 | } else { |
74 | - throw new \Exception('Error assigning callable in ' . get_called_class() . '! Callable typed [' . $type . '] is not a callable or not accessible in the scope'); |
|
74 | + throw new \Exception('Error assigning callable in '.get_called_class().'! Callable typed ['.$type.'] is not a callable or not accessible in the scope'); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 |
@@ -34,56 +34,56 @@ |
||
34 | 34 | $gc = $this; |
35 | 35 | |
36 | 36 | // Default db |
37 | - $gc->db = function ($c) { |
|
37 | + $gc->db = function($c) { |
|
38 | 38 | classSupernova::$db = $db = new \db_mysql($c); |
39 | 39 | $db->sn_db_connect(); |
40 | 40 | |
41 | 41 | return $db; |
42 | 42 | }; |
43 | 43 | |
44 | - $gc->debug = function ($c) { |
|
44 | + $gc->debug = function($c) { |
|
45 | 45 | return new \debug(); |
46 | 46 | }; |
47 | 47 | |
48 | - $gc->types = function ($c) { |
|
48 | + $gc->types = function($c) { |
|
49 | 49 | return new \Common\Types(); |
50 | 50 | }; |
51 | 51 | |
52 | - $gc->cache = function ($c) { |
|
52 | + $gc->cache = function($c) { |
|
53 | 53 | return new \classCache(classSupernova::$cache_prefix); |
54 | 54 | }; |
55 | 55 | |
56 | - $gc->config = function ($c) { |
|
56 | + $gc->config = function($c) { |
|
57 | 57 | return new \classConfig(classSupernova::$cache_prefix); |
58 | 58 | }; |
59 | 59 | |
60 | - $gc->localePlayer = function (GlobalContainer $c) { |
|
60 | + $gc->localePlayer = function(GlobalContainer $c) { |
|
61 | 61 | return new \classLocale($c->config->server_locale_log_usage); |
62 | 62 | }; |
63 | 63 | |
64 | - $gc->dbRowOperator = function ($c) { |
|
64 | + $gc->dbRowOperator = function($c) { |
|
65 | 65 | return new \DbRowDirectOperator($c); |
66 | 66 | }; |
67 | 67 | |
68 | - $gc->query = $gc->factory(function (GlobalContainer $c) { |
|
68 | + $gc->query = $gc->factory(function(GlobalContainer $c) { |
|
69 | 69 | return new \DbQueryConstructor($c->db); |
70 | 70 | }); |
71 | 71 | |
72 | - $gc->cacheOperator = function (GlobalContainer $gc) { |
|
72 | + $gc->cacheOperator = function(GlobalContainer $gc) { |
|
73 | 73 | return new \SnDbCachedOperator($gc); |
74 | 74 | }; |
75 | 75 | |
76 | 76 | $gc->snCacheClass = 'SnCache'; |
77 | - $gc->snCache = function (GlobalContainer $gc) { |
|
77 | + $gc->snCache = function(GlobalContainer $gc) { |
|
78 | 78 | return $gc->db->snCache; |
79 | 79 | }; |
80 | 80 | |
81 | 81 | $gc->buddyClass = 'Buddy\BuddyModel'; |
82 | - $gc->buddyModel = function (GlobalContainer $c) { |
|
82 | + $gc->buddyModel = function(GlobalContainer $c) { |
|
83 | 83 | return new $c->buddyClass($c); |
84 | 84 | }; |
85 | 85 | |
86 | - $gc->unitModel = function (GlobalContainer $c) { |
|
86 | + $gc->unitModel = function(GlobalContainer $c) { |
|
87 | 87 | return new \V2Unit\V2UnitModel($c); |
88 | 88 | }; |
89 | 89 | } |
@@ -36,14 +36,14 @@ |
||
36 | 36 | |
37 | 37 | $this->playerArray = $user; |
38 | 38 | |
39 | - $this->playerId = function (BuddyParams $cBuddy) { |
|
39 | + $this->playerId = function(BuddyParams $cBuddy) { |
|
40 | 40 | return $cBuddy->playerArray['id']; |
41 | 41 | }; |
42 | - $this->playerName = function (BuddyParams $cBuddy) { |
|
42 | + $this->playerName = function(BuddyParams $cBuddy) { |
|
43 | 43 | return $cBuddy->playerArray['username']; |
44 | 44 | }; |
45 | - $this->playerNameAndCoordinates = function (BuddyParams $cBuddy) { |
|
46 | - return "{$cBuddy->playerArray['username']} " . uni_render_coordinates($cBuddy->playerArray); |
|
45 | + $this->playerNameAndCoordinates = function(BuddyParams $cBuddy) { |
|
46 | + return "{$cBuddy->playerArray['username']} ".uni_render_coordinates($cBuddy->playerArray); |
|
47 | 47 | }; |
48 | 48 | } |
49 | 49 |