Skip to content

Commit

Permalink
Update docs for new ORM 3.0 SetParametersArrayToCollectionRector rule
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelthole committed Jul 10, 2024
1 parent 9dfa2e3 commit 220fe57
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 19 Rules Overview
# 20 Rules Overview

## AddReturnDocBlockToCollectionPropertyGetterByToManyAnnotationRector

Expand Down Expand Up @@ -382,6 +382,23 @@ Replace `Doctrine\ORM\Event\LifecycleEventArgs` with specific event classes base

<br>

## SetParametersArrayToCollectionRector

Change the argument type for setParameters from array to ArrayCollection and Parameter calls

- class: [`Rector\Doctrine\Orm30\Rector\MethodCall\SetParametersArrayToCollectionRector`](../rules/Orm30/Rector/MethodCall/SetParametersArrayToCollectionRector.php)

```diff
-$entityManager->createQueryBuilder()->setParameters([
- 'foo' => 'bar'
-]);
+$entityManager->createQueryBuilder()->setParameters(new \Doctrine\Common\Collections\ArrayCollection([
+ new \Doctrine\ORM\Query\Parameter('foo', 'bar')
+]));
```

<br>

## TypedPropertyFromColumnTypeRector

Complete `@var` annotations or types based on @ORM\Column
Expand Down

0 comments on commit 220fe57

Please sign in to comment.