Implement lint
This commit is contained in:
+9
-9
@@ -6,8 +6,8 @@ use Franzz\Objects\Db;
|
||||
|
||||
class Map extends PhpObject {
|
||||
|
||||
const MAP_TABLE = 'maps';
|
||||
const MAPPING_TABLE = 'mappings';
|
||||
public const MAP_TABLE = 'maps';
|
||||
public const MAPPING_TABLE = 'mappings';
|
||||
|
||||
private Db $oDb;
|
||||
private $asMaps;
|
||||
@@ -15,11 +15,11 @@ class Map extends PhpObject {
|
||||
public function __construct(Db &$oDb) {
|
||||
parent::__construct(__CLASS__);
|
||||
$this->oDb = &$oDb;
|
||||
$this->asMaps = array();
|
||||
$this->asMaps = [];
|
||||
}
|
||||
|
||||
private function setMaps() {
|
||||
$asMaps = $this->oDb->selectRows(array('from'=>self::MAP_TABLE));
|
||||
$asMaps = $this->oDb->selectRows(['from'=>self::MAP_TABLE]);
|
||||
foreach($asMaps as $asMap) $this->asMaps[$asMap['codename']] = $asMap;
|
||||
}
|
||||
|
||||
@@ -30,15 +30,15 @@ class Map extends PhpObject {
|
||||
|
||||
public function getProjectMaps($iProjectId) {
|
||||
$asMappings = $this->oDb->selectRows(
|
||||
array(
|
||||
'select' => array(Db::getId(self::MAP_TABLE), 'default_map'),
|
||||
[
|
||||
'select' => [Db::getId(self::MAP_TABLE), 'default_map'],
|
||||
'from' => self::MAPPING_TABLE,
|
||||
'constraint'=> array("IFNULL(id_project, {$iProjectId})" => $iProjectId)
|
||||
),
|
||||
'constraint'=> ["IFNULL(id_project, {$iProjectId})" => $iProjectId]
|
||||
],
|
||||
Db::getId(self::MAP_TABLE)
|
||||
);
|
||||
|
||||
$asProjectMaps = array();
|
||||
$asProjectMaps = [];
|
||||
foreach($this->getMaps() as $asMap) {
|
||||
if(array_key_exists($asMap['id_map'], $asMappings)) {
|
||||
$asMap['default_map'] = $asMappings[$asMap['id_map']];
|
||||
|
||||
Reference in New Issue
Block a user