Skip to content

Commit 1e7c009

Browse files
committed
methods are always fluent
1 parent 05b683d commit 1e7c009

File tree

7 files changed

+5
-19
lines changed

7 files changed

+5
-19
lines changed

src/Maker/MakeEntity.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,6 @@ private function createClassManipulator(string $path, ConsoleStyle $io, bool $ov
807807
$manipulator = new ClassSourceManipulator(
808808
sourceCode: $this->fileManager->getFileContents($path),
809809
overwrite: $overwrite,
810-
fluentMutators: true,
811810
useAttributesForDoctrineMapping: true
812811
);
813812

src/Maker/MakeRegistrationForm.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
392392
$userManipulator = new ClassSourceManipulator(
393393
sourceCode: file_get_contents($classDetails->getPath()),
394394
overwrite: false,
395-
fluentMutators: true,
396395
useAttributesForDoctrineMapping: true
397396
);
398397
$userManipulator->setIo($io);

src/Maker/MakeResetPassword.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ private function generateRequestEntity(Generator $generator, ClassNameDetails $r
406406
$manipulator = new ClassSourceManipulator(
407407
sourceCode: $this->fileManager->getFileContents($requestEntityPath),
408408
overwrite: false,
409-
fluentMutators: true,
410409
useAttributesForDoctrineMapping: $useAttributesForDoctrineMapping
411410
);
412411

src/Maker/MakeUser.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
150150
$manipulator = new ClassSourceManipulator(
151151
sourceCode: $this->fileManager->getFileContents($classPath),
152152
overwrite: true,
153-
fluentMutators: true,
154153
useAttributesForDoctrineMapping: $useAttributesForDoctrineMapping
155154
);
156155

src/Test/MakerTestRunner.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ public function manipulateClass(string $filename, \Closure $callback): void
256256
$manipulator = new ClassSourceManipulator(
257257
sourceCode: $contents,
258258
overwrite: true,
259-
fluentMutators: true,
260259
useAttributesForDoctrineMapping: true
261260
);
262261
$callback($manipulator);

src/Util/ClassSourceManipulator.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,8 @@ final class ClassSourceManipulator
5959
public function __construct(
6060
private string $sourceCode,
6161
private bool $overwrite = false,
62-
private bool $fluentMutators = true,
6362
private bool $useAttributesForDoctrineMapping = true,
6463
) {
65-
if (false === $this->fluentMutators) {
66-
trigger_deprecation('symfony/maker-bundle', '0.0.0', 'Why is this false.');
67-
}
68-
6964
$this->lexer = new Lexer\Emulative([
7065
'usedAttributes' => [
7166
'comments',
@@ -1017,10 +1012,6 @@ private function addMethod(Node\Stmt\ClassMethod $methodNode): void
10171012

10181013
private function makeMethodFluent(Builder\Method $methodBuilder): void
10191014
{
1020-
if (!$this->fluentMutators) {
1021-
return;
1022-
}
1023-
10241015
$methodBuilder
10251016
->addStmt($this->createBlankLineNode(self::CONTEXT_CLASS_METHOD))
10261017
->addStmt(new Node\Stmt\Return_(new Node\Expr\Variable('this')));

tests/Util/ClassSourceManipulatorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function testAddEntityField(string $sourceFilename, string $propertyName,
225225

226226
private function runAddEntityFieldTests(string $source, string $propertyName, array $fieldOptions, string $expected): void
227227
{
228-
$manipulator = new ClassSourceManipulator($source, false, true, true);
228+
$manipulator = new ClassSourceManipulator($source, false,true);
229229
$manipulator->addEntityField($propertyName, $fieldOptions);
230230

231231
$this->assertSame($expected, $manipulator->getSourceCode());
@@ -304,7 +304,7 @@ public function testAddManyToOneRelation(string $sourceFilename, $expectedSource
304304

305305
public function runAddManyToOneRelationTests(string $source, string $expected, RelationManyToOne $manyToOne): void
306306
{
307-
$manipulator = new ClassSourceManipulator($source, false, true, true);
307+
$manipulator = new ClassSourceManipulator($source, false, true);
308308
$manipulator->addManyToOneRelation($manyToOne);
309309

310310
$this->assertSame($expected, $manipulator->getSourceCode());
@@ -402,7 +402,7 @@ public function testAddOneToManyRelation(string $sourceFilename, string $expecte
402402

403403
private function runAddOneToManyRelationTests(string $source, string $expected, RelationOneToMany $oneToMany): void
404404
{
405-
$manipulator = new ClassSourceManipulator($source, false, true, true);
405+
$manipulator = new ClassSourceManipulator($source, false, true);
406406
$manipulator->addOneToManyRelation($oneToMany);
407407

408408
$this->assertSame($expected, $manipulator->getSourceCode());
@@ -463,7 +463,7 @@ public function testAddManyToManyRelation(string $sourceFilename, $expectedSourc
463463

464464
private function runAddManyToManyRelationTest(string $source, string $expected, RelationManyToMany $manyToMany): void
465465
{
466-
$manipulator = new ClassSourceManipulator($source, false, true, true);
466+
$manipulator = new ClassSourceManipulator($source, false, true);
467467
$manipulator->addManyToManyRelation($manyToMany);
468468

469469
$this->assertSame($expected, $manipulator->getSourceCode());
@@ -522,7 +522,7 @@ public function testAddOneToOneRelation(string $sourceFilename, $expectedSourceF
522522

523523
private function runAddOneToOneRelation(string $source, string $expected, RelationOneToOne $oneToOne): void
524524
{
525-
$manipulator = new ClassSourceManipulator($source, false, true, true);
525+
$manipulator = new ClassSourceManipulator($source, false, true);
526526
$manipulator->addOneToOneRelation($oneToOne);
527527

528528
$this->assertSame($expected, $manipulator->getSourceCode());

0 commit comments

Comments
 (0)