Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update extend-product-page.md #1791

Open
wants to merge 1 commit into
base: 8.x
Choose a base branch
from
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
Loading