Skip to content

Commit 9ba841d

Browse files
committed
WIP: fixed coding style & more
1 parent 1396099 commit 9ba841d

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/LeanMapper/DefaultMapper.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,7 @@ public function getRelationshipTable($sourceTable, $targetTable)
9494
*/
9595
public function getRelationshipColumn($sourceTable, $targetTable/*, $relationshipName = null*/)
9696
{
97-
$relationshipName = NULL;
98-
99-
if (func_num_args() === 3) {
100-
$relationshipName = func_get_arg(2);
101-
}
102-
97+
$relationshipName = (func_num_args() === 3) ? func_get_arg(2) : null;
10398
return (isset($relationshipName) ? $relationshipName : $targetTable) . '_' . $this->getPrimaryKey($targetTable);
10499
}
105100

src/LeanMapper/IMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getRelationshipTable($sourceTable, $targetTable);
8888
*
8989
* @param string $sourceTable
9090
* @param string $targetTable
91-
* @param string|NULL $relationshipName
91+
* @param string|null $relationshipName
9292
* @return string
9393
*/
9494
public function getRelationshipColumn($sourceTable, $targetTable/*, $relationshipName = null*/);

tests/LeanMapper/PrimaryEqualsForeign.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ class Mapper extends DefaultMapper
7272

7373

7474

75-
public function getRelationshipColumn($sourceTable, $targetTable, $relationshipName = null)
75+
public function getRelationshipColumn($sourceTable, $targetTable/*, $relationshipName = null*/)
7676
{
7777
if ($sourceTable === 'authorcontract' and $targetTable === 'authordetail') {
7878
return 'author_id';
7979
}
8080
if ($sourceTable === 'authordetail' and $targetTable === 'author') {
8181
return 'author_id';
8282
}
83+
$relationshipName = (func_num_args() === 3) ? func_get_arg(2) : null;
8384
return parent::getRelationshipColumn($sourceTable, $targetTable, $relationshipName);
8485
}
8586

0 commit comments

Comments
 (0)