Skip to content

Commit 0de825d

Browse files
committed
Rename vars and function
1 parent 70f315d commit 0de825d

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

api.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -458,36 +458,36 @@ public function jsonSerialize()
458458
class ReflectedDatabase implements \JsonSerializable
459459
{
460460
private $name;
461-
private $tables;
461+
private $tableNames;
462462

463-
public function __construct(String $name, array $tables)
463+
public function __construct(String $name, array $tableNames)
464464
{
465465
$this->name = $name;
466-
$this->tables = [];
467-
foreach ($tables as $table) {
468-
$this->tables[$table] = true;
466+
$this->tableNames = [];
467+
foreach ($tableNames as $tableName) {
468+
$this->tableNames[$tableName] = true;
469469
}
470470
}
471471

472472
public static function fromReflection(GenericReflection $reflection): ReflectedDatabase
473473
{
474474
$name = $reflection->getDatabaseName();
475-
$tables = [];
475+
$tableNames = [];
476476
foreach ($reflection->getTables() as $table) {
477477
$tableName = $table['TABLE_NAME'];
478478
if (in_array($tableName, $reflection->getIgnoredTables())) {
479479
continue;
480480
}
481-
$tables[$tableName] = true;
481+
$tableNames[$tableName] = true;
482482
}
483-
return new ReflectedDatabase($name, array_keys($tables));
483+
return new ReflectedDatabase($name, array_keys($tableNames));
484484
}
485485

486486
public static function fromJson( /* object */$json): ReflectedDatabase
487487
{
488488
$name = $json->name;
489-
$tables = $json->tables;
490-
return new ReflectedDatabase($name, $tables);
489+
$tableNames = $json->tables;
490+
return new ReflectedDatabase($name, $tableNames);
491491
}
492492

493493
public function getName(): String
@@ -497,19 +497,19 @@ public function getName(): String
497497

498498
public function exists(String $tableName): bool
499499
{
500-
return isset($this->tables[$tableName]);
500+
return isset($this->tableNames[$tableName]);
501501
}
502502

503-
public function getTables(): array
503+
public function getTableNames(): array
504504
{
505-
return array_keys($this->tables);
505+
return array_keys($this->tableNames);
506506
}
507507

508508
public function serialize()
509509
{
510510
return [
511511
'name' => $this->name,
512-
'tables' => array_keys($this->tables),
512+
'tables' => array_keys($this->tableNames),
513513
];
514514
}
515515

@@ -861,7 +861,7 @@ public function getTable(String $tableName): ReflectedTable
861861

862862
public function getTableNames(): array
863863
{
864-
return $this->database->getTables();
864+
return $this->database->getTableNames();
865865
}
866866

867867
public function getDatabaseName(): String

src/Tqdev/PhpCrudApi/Column/Reflection/ReflectedDatabase.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@
66
class ReflectedDatabase implements \JsonSerializable
77
{
88
private $name;
9-
private $tables;
9+
private $tableNames;
1010

11-
public function __construct(String $name, array $tables)
11+
public function __construct(String $name, array $tableNames)
1212
{
1313
$this->name = $name;
14-
$this->tables = [];
15-
foreach ($tables as $table) {
16-
$this->tables[$table] = true;
14+
$this->tableNames = [];
15+
foreach ($tableNames as $tableName) {
16+
$this->tableNames[$tableName] = true;
1717
}
1818
}
1919

2020
public static function fromReflection(GenericReflection $reflection): ReflectedDatabase
2121
{
2222
$name = $reflection->getDatabaseName();
23-
$tables = [];
23+
$tableNames = [];
2424
foreach ($reflection->getTables() as $table) {
2525
$tableName = $table['TABLE_NAME'];
2626
if (in_array($tableName, $reflection->getIgnoredTables())) {
2727
continue;
2828
}
29-
$tables[$tableName] = true;
29+
$tableNames[$tableName] = true;
3030
}
31-
return new ReflectedDatabase($name, array_keys($tables));
31+
return new ReflectedDatabase($name, array_keys($tableNames));
3232
}
3333

3434
public static function fromJson( /* object */$json): ReflectedDatabase
3535
{
3636
$name = $json->name;
37-
$tables = $json->tables;
38-
return new ReflectedDatabase($name, $tables);
37+
$tableNames = $json->tables;
38+
return new ReflectedDatabase($name, $tableNames);
3939
}
4040

4141
public function getName(): String
@@ -45,19 +45,19 @@ public function getName(): String
4545

4646
public function exists(String $tableName): bool
4747
{
48-
return isset($this->tables[$tableName]);
48+
return isset($this->tableNames[$tableName]);
4949
}
5050

51-
public function getTables(): array
51+
public function getTableNames(): array
5252
{
53-
return array_keys($this->tables);
53+
return array_keys($this->tableNames);
5454
}
5555

5656
public function serialize()
5757
{
5858
return [
5959
'name' => $this->name,
60-
'tables' => array_keys($this->tables),
60+
'tables' => array_keys($this->tableNames),
6161
];
6262
}
6363

src/Tqdev/PhpCrudApi/Column/ReflectionService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getTable(String $tableName): ReflectedTable
7474

7575
public function getTableNames(): array
7676
{
77-
return $this->database->getTables();
77+
return $this->database->getTableNames();
7878
}
7979

8080
public function getDatabaseName(): String

0 commit comments

Comments
 (0)