Skip to content

Commit 080bb78

Browse files
authored
Removed reflection property from Selection class
1 parent 903a25a commit 080bb78

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/Selection.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ abstract class Selection implements \CoolBeans\Contract\Selection
1010

1111
protected const ROW_CLASS = \CoolBeans\Bean::class;
1212

13-
protected \ReflectionClass $reflection;
14-
1513
final public function __construct(
1614
protected \Nette\Database\Table\Selection $selection,
1715
)
1816
{
19-
$this->reflection = new \ReflectionClass(static::class);
20-
2117
if (\CoolBeans\Config::$validateTableName) {
2218
$this->validateTableName();
2319
}
@@ -221,8 +217,9 @@ final protected static function createRow(?\Nette\Database\Table\ActiveRow $row)
221217
*/
222218
protected function validateTableName() : void
223219
{
220+
$reflection = new \ReflectionClass(static::class);
224221
$tableName = $this->getTableName();
225-
$className = \substr($this->reflection->getShortName(), 0, -9);
222+
$className = \substr($reflection->getShortName(), 0, -9);
226223
$sepIndex = \Nette\Utils\Strings::indexOf($tableName, '.');
227224

228225
if (\is_int($sepIndex)) {

0 commit comments

Comments
 (0)