Completed
Push — work-fleets ( 8d34ed...b1376e )
by SuperNova.WS
06:48
created
classes/V2Fleet/V2FleetModel.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
       )
80 80
     );
81 81
 
82
-    $this->accessors->setAccessor('location', P_CONTAINER_GET, function (V2FleetContainer $that) {
82
+    $this->accessors->setAccessor('location', P_CONTAINER_GET, function(V2FleetContainer $that) {
83 83
       if (is_null($location = $that->getDirect('location'))) {
84 84
         $location = new V2Location(LOC_FLEET);
85 85
         $that->setDirect('location', $location);
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
       return $location;
89 89
     });
90 90
 
91
-    $this->accessors->setAccessor('dbId', P_CONTAINER_SET, function (V2FleetContainer $that, $value) {
91
+    $this->accessors->setAccessor('dbId', P_CONTAINER_SET, function(V2FleetContainer $that, $value) {
92 92
       $that->setDirect('dbId', $value);
93 93
       $that->location->setLocationId($value);
94 94
     });
95 95
 
96
-    $this->accessors->setAccessor('ownerId', P_CONTAINER_SET, function (V2FleetContainer $that, $value) {
96
+    $this->accessors->setAccessor('ownerId', P_CONTAINER_SET, function(V2FleetContainer $that, $value) {
97 97
       $that->setDirect('ownerId', $value);
98 98
       $that->location->setLocationPlayerId($value);
99 99
     });
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     $this->accessors->setAccessor('vectorArrive', P_CONTAINER_EXPORT, array($this, 'exportVector'));
105 105
 
106 106
 
107
-    $this->accessors->setAccessor('units', P_CONTAINER_GET, function (V2FleetContainer $that) {
107
+    $this->accessors->setAccessor('units', P_CONTAINER_GET, function(V2FleetContainer $that) {
108 108
       if (is_null($units = $that->getDirect('units'))) {
109 109
         $units = new V2UnitList();
110 110
         $that->setDirect('units', $units);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
       return $units;
114 114
     });
115 115
 
116
-    $this->accessors->setAccessor('isReturning', P_CONTAINER_GET, function (V2FleetContainer $that) {
116
+    $this->accessors->setAccessor('isReturning', P_CONTAINER_GET, function(V2FleetContainer $that) {
117 117
       return $that->status == FLEET_FLAG_RETURNING;
118 118
     });
119 119
 
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
   public function importVector(V2FleetContainer $that, $propertyName, $fieldName) {
123 123
     $prefix = $propertyName == 'vectorDeparture' ? 'fleet_start_' : 'fleet_end_';
124 124
     $that->$propertyName = new Vector(
125
-      $that->row[$prefix . 'galaxy'],
126
-      $that->row[$prefix . 'system'],
127
-      $that->row[$prefix . 'planet'],
128
-      $that->row[$prefix . 'type']
125
+      $that->row[$prefix.'galaxy'],
126
+      $that->row[$prefix.'system'],
127
+      $that->row[$prefix.'planet'],
128
+      $that->row[$prefix.'type']
129 129
     );
130 130
   }
131 131
 
132 132
   public function exportVector(V2FleetContainer $that, $propertyName, $fieldName) {
133 133
     $prefix = $propertyName == 'vectorDeparture' ? 'fleet_start_' : 'fleet_end_';
134
-    $that->row[$prefix . 'galaxy'] = $that->$propertyName->galaxy;
135
-    $that->row[$prefix . 'system'] = $that->$propertyName->system;
136
-    $that->row[$prefix . 'planet'] = $that->$propertyName->planet;
137
-    $that->row[$prefix . 'type'] = $that->$propertyName->type;
134
+    $that->row[$prefix.'galaxy'] = $that->$propertyName->galaxy;
135
+    $that->row[$prefix.'system'] = $that->$propertyName->system;
136
+    $that->row[$prefix.'planet'] = $that->$propertyName->planet;
137
+    $that->row[$prefix.'type'] = $that->$propertyName->type;
138 138
   }
139 139
 
140 140
   /**
Please login to merge, or discard this patch.
classes/Common/Accessors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     if (empty($callable)) {
37 37
       return;
38 38
     } elseif (!is_callable($callable)) {
39
-      throw new \Exception('Error assigning callable in ' . get_called_class() . '::setAccessor()! Callable typed [' . $accessor . '] is not a callable or not accessible in the scope');
39
+      throw new \Exception('Error assigning callable in '.get_called_class().'::setAccessor()! Callable typed ['.$accessor.'] is not a callable or not accessible in the scope');
40 40
     }
41 41
 
42 42
     // Converting method array-callable to closure
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
    */
81 81
   public function invokeAccessor($varName, $accessor, $params) {
82 82
     if (!$this->haveAccessor($varName, $accessor)) {
83
-      throw new \Exception("No [{$accessor}] accessor found for variable [{$varName}] on " . get_called_class() . "::" . __METHOD__);
83
+      throw new \Exception("No [{$accessor}] accessor found for variable [{$varName}] on ".get_called_class()."::".__METHOD__);
84 84
     }
85 85
 
86 86
     return call_user_func_array($this->getAccessor($varName, $accessor), $params);
Please login to merge, or discard this patch.