It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.
If you suppress an error, we recommend checking for the error condition explicitly:
// For example instead of@mkdir($dir);// Better useif(@mkdir($dir)===false){thrownew\RuntimeException('The directory '.$dir.' could not be created.');}
Loading history...
33
'Not passing a calculator is deprecated since 1.6. Argument will no longer be optional from 2.0.',
34
\E_USER_DEPRECATED
35
);
36
}
37
38
$this->calculator = $calculator;
39
}
40
41
public function getFunctions(): array
42
{
43
return [
44
new TwigFunction('sylius_order_items_subtotal', [$this, 'getSubtotal']),
45
];
46
}
47
48
public function getSubtotal(OrderInterface $order): int
If you suppress an error, we recommend checking for the error condition explicitly: