Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelthole committed Jul 1, 2024
1 parent 27a4889 commit e4ed6cc
Showing 1 changed file with 1 addition and 55 deletions.
56 changes: 1 addition & 55 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 20 Rules Overview
# 18 Rules Overview

## AddReturnDocBlockToCollectionPropertyGetterByToManyAttributeRector

Expand Down Expand Up @@ -183,34 +183,6 @@ Improve @var, `@param` and `@return` types for Doctrine collections to make them

<br>

## InitializeDefaultEntityCollectionRector

Initialize collection property in Entity constructor

- class: [`Rector\Doctrine\CodeQuality\Rector\Class_\InitializeDefaultEntityCollectionRector`](../rules/CodeQuality/Rector/Class_/InitializeDefaultEntityCollectionRector.php)

```diff
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
class SomeClass
{
/**
* @ORM\OneToMany(targetEntity="MarketingEvent")
*/
private $marketingEvents = [];
+
+ public function __construct()
+ {
+ $this->marketingEvents = new ArrayCollection();
+ }
}
```

<br>

## IterateToToIterableRector

Change `iterate()` => `toIterable()`
Expand Down Expand Up @@ -402,32 +374,6 @@ Complete `@var` annotations or types based on @ORM\Column

<br>

## TypedPropertyFromDoctrineCollectionRector

Add typed property based on Doctrine collection

- class: [`Rector\Doctrine\CodeQuality\Rector\Property\TypedPropertyFromDoctrineCollectionRector`](../rules/CodeQuality/Rector/Property/TypedPropertyFromDoctrineCollectionRector.php)

```diff
use Doctrine\ORM\Mapping as ORM;
use App\Entity\TrainingTerm;

/**
* @ORM\Entity
*/
class DoctrineCollection
{
/**
* @ORM\OneToMany(targetEntity="App\Entity\TrainingTerm", mappedBy="training")
* @var TrainingTerm[]|Collection
*/
- private $trainingTerms;
+ private \Doctrine\Common\Collections\Collection $trainingTerms;
}
```

<br>

## TypedPropertyFromToManyRelationTypeRector

Complete `@var` annotations or types based on @ORM\*toMany annotations or attributes
Expand Down

0 comments on commit e4ed6cc

Please sign in to comment.