Skip to content

Commit 2badefd

Browse files
committed
removed usage of magic properties & Nette\Object methods
1 parent da21535 commit 2badefd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Database/Table/ActiveRow.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function ref($key, $throughColumn = NULL)
135135
{
136136
$row = $this->table->getReferencedTable($this, $key, $throughColumn);
137137
if ($row === FALSE) {
138-
throw new Nette\MemberAccessException("No reference found for \${$this->table->name}->ref($key).");
138+
throw new Nette\MemberAccessException("No reference found for \${$this->table->getName()}->ref($key).");
139139
}
140140

141141
return $row;
@@ -152,7 +152,7 @@ public function related($key, $throughColumn = NULL)
152152
{
153153
$groupedSelection = $this->table->getReferencingTable($key, $throughColumn, $this[$this->table->getPrimary()]);
154154
if (!$groupedSelection) {
155-
throw new Nette\MemberAccessException("No reference found for \${$this->table->name}->related($key).");
155+
throw new Nette\MemberAccessException("No reference found for \${$this->table->getName()}->related($key).");
156156
}
157157

158158
return $groupedSelection;

src/Database/Table/SqlBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ private function getConditionHash($condition, $parameters)
622622
{
623623
foreach ($parameters as & $parameter) {
624624
if ($parameter instanceof Selection) {
625-
$parameter = $this->getConditionHash($parameter->getSql(), $parameter->sqlBuilder->getParameters());
625+
$parameter = $this->getConditionHash($parameter->getSql(), $parameter->getSqlBuilder()->getParameters());
626626
} elseif ($parameter instanceof SqlLiteral) {
627627
$parameter = $this->getConditionHash($parameter->__toString(), $parameter->getParameters());
628628
} elseif (is_object($parameter) && method_exists($parameter, '__toString')) {

tests/Database/Table/SqlBuilder.tryDelimite().phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require __DIR__ . '/../connect.inc.php'; // create $connection
1111

1212

1313
$sqlBuilder = new Nette\Database\Table\SqlBuilder('book', $context);
14-
$tryDelimite = $sqlBuilder->getReflection()->getMethod('tryDelimite');
14+
$tryDelimite = (new ReflectionClass($sqlBuilder))->getMethod('tryDelimite');
1515
$tryDelimite->setAccessible(TRUE);
1616

1717
Assert::same(reformat('[hello]'), $tryDelimite->invoke($sqlBuilder, 'hello'));

tests/Database/Table/Table.cache.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ test(function () use ($context) {
115115
}
116116

117117
foreach ($relatedStack as $related) {
118-
$property = $related->getReflection()->getProperty('accessedColumns');
118+
$property = (new ReflectionClass($related))->getProperty('accessedColumns');
119119
$property->setAccessible(TRUE);
120120
// checks if instances have shared data of accessed columns
121121
Assert::same(['id', 'author_id'], array_keys((array) $property->getValue($related)));

0 commit comments

Comments
 (0)