Skip to content

Commit de33320

Browse files
committed
minor #2484 [TwigComponent] Use promoted properties in code sample (tacman)
This PR was merged into the 2.x branch. Discussion ---------- [TwigComponent] Use promoted properties in code sample just looks a bit more modern | Q | A | ------------- | --- | Bug fix? | no | License | MIT Just a tiny tweak to the docs Commits ------- fa4e36a use promoted properties
2 parents 865f61a + fa4e36a commit de33320

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/TwigComponent/doc/index.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,8 @@ normal. This example assumes you have a ``Product`` Doctrine entity and
405405
#[AsTwigComponent]
406406
class FeaturedProducts
407407
{
408-
private ProductRepository $productRepository;
409-
410-
public function __construct(ProductRepository $productRepository)
408+
public function __construct(private ProductRepository $productRepository)
411409
{
412-
$this->productRepository = $productRepository;
413410
}
414411

415412
public function getProducts(): array

0 commit comments

Comments
 (0)