Skip to content

Commit 69dc3b0

Browse files
committed
switch docblock to fluent interface
1 parent 3dd9fab commit 69dc3b0

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/Plugins/DocBlock.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function register($class)
4949
$this->mapRepository($name, $class);
5050
}
5151
}
52+
return $this;
5253
}
5354

5455
public function migrate()
@@ -116,6 +117,8 @@ public function migrate()
116117
$space->addIndex(['id']);
117118
}
118119
}
120+
121+
return $this;
119122
}
120123

121124
private $underscores = [];

tests/DockBlockTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ public function test()
1212
$mapper = $this->createMapper();
1313
$this->clean($mapper);
1414

15-
$orm = $mapper->addPlugin(Sequence::class);
16-
$orm = $mapper->addPlugin(DocBlock::class);
17-
18-
$orm->register('Entities\\Post');
19-
$orm->register('Entities\\Person');
20-
$orm->register('Repositories\\Post');
21-
22-
$orm->migrate();
15+
$sequence = $mapper->addPlugin(Sequence::class);
16+
$mapper->addPlugin(DocBlock::class)
17+
->register('Entities\\Post')
18+
->register('Entities\\Person')
19+
->register('Repositories\\Post')
20+
->migrate();
2321

2422
$nekufa = $mapper->create('person', [
2523
'name' => 'Dmitry.Krokhin'

0 commit comments

Comments
 (0)