Your project should not use invalid parameter and return typehints 5
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint
- * @param ChartExpression|array|scalar $valueToEncode
- * @param array<string, ChartExpression> $expressions
- *
- * @return array|scalar
- */
- protected function enqueueExpressions(mixed $valueToEncode, array &$expressions): mixed
- {
- if ($valueToEncode instanceof ChartExpression) {
- $key = $valueToEncode->getMagicKey();
- $expressions[$key] = $valueToEncode;
- /**
- * Encode the given option or array to JSON.
- *
- * Returns an empty string if the name or the data are empty.
- */
- protected function jsonEncode(ChartOption|array $data, string $name = ''): string
- {
- if ($data instanceof ChartOption) {
- $name = $data->getName();
- $data = $data->getData();
- }
- */
- public function __construct(private readonly string $name)
- {
- }
- public function __call(string $name, array $value): self
- {
- $this->data[$name] = $value[0];
- return $this;
- }
- public static function instance(string $name): self
- {
- return new self($name);
- }
- public function merge(array $data): self
- {
- $this->data = \array_merge_recursive($this->data, $data);
- return $this;
- }
- /**
- * The Highcharts bundle.
- */
- class HighchartsBundle extends AbstractBundle
- {
- #[\Override]
- public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
- {
- $container->services()
- ->set('twig.extension.highcharts', HighchartsExtension::class)
- ->tag('twig.extension');
Your project should use return types 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint
- * @param ChartExpression|array|scalar $valueToEncode
- * @param array<string, ChartExpression> $expressions
- *
- * @return array|scalar
- */
- protected function enqueueExpressions(mixed $valueToEncode, array &$expressions): mixed
- {
- if ($valueToEncode instanceof ChartExpression) {
- $key = $valueToEncode->getMagicKey();
- $expressions[$key] = $valueToEncode;
- public function count(): int
- {
- return \count($this->data);
- }
- public function getData(): array
- {
- return $this->data;
- }
- public function getName(): string