Skip to content

Commit

Permalink
minor #2484 [TwigComponent] Use promoted properties in code sample (t…
Browse files Browse the repository at this point in the history
…acman)

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
  • Loading branch information
javiereguiluz committed Jan 8, 2025
2 parents 865f61a + fa4e36a commit de33320
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/TwigComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,8 @@ normal. This example assumes you have a ``Product`` Doctrine entity and
#[AsTwigComponent]
class FeaturedProducts
{
private ProductRepository $productRepository;

public function __construct(ProductRepository $productRepository)
public function __construct(private ProductRepository $productRepository)
{
$this->productRepository = $productRepository;
}

public function getProducts(): array
Expand Down

0 comments on commit de33320

Please sign in to comment.