Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions modules/sample-modules/extend-product-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ final class ProductFormModifier
/**
* @var FormBuilderModifier
*/
private $formBuilderModifier;
private FormBuilderModifier $formBuilderModifier;

/**
* @param FormBuilderModifier $formBuilderModifier
Expand All @@ -182,7 +182,6 @@ final class ProductFormModifier
int $productId,
FormBuilderInterface $productFormBuilder
): void {

$seoTabFormBuilder = $productFormBuilder->get('seo');
$this->formBuilderModifier->addAfter(
$seoTabFormBuilder, // the tab
Expand Down Expand Up @@ -515,7 +514,7 @@ Finally, add this `CustomTabType` to the `$productFormBuilder` variable in your

```php
/**
* @param int|null $productId
* @param int $productId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's something fishy in this example, $productId is casted as an integer, but in the function it's used as a ProductId value object:

$idValue = $productId ? $productId->getValue() : null;

* @param FormBuilderInterface $productFormBuilder
*/
public function modify(
Expand Down