Your project should not use invalid parameter and return typehints 5

More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint

  1. /**
  2. * Encode the given option or array to JSON.
  3. *
  4. * Returns an empty string if the name or the data are empty.
  5. */
  6. protected function jsonEncode(ChartOption|array $data, string $name = ''): string

    Method HighchartsBundle\Highcharts\AbstractChart::jsonEncode() has parameter $data with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  7. {
  8. if ($data instanceof ChartOption) {
  9. $name = $data->getName();
  10. $data = $data->getData();
  11. }
  1. * @param ChartExpression|array|scalar $valueToEncode
  2. * @param array<string, ChartExpression> $expressions
  3. *
  4. * @return array|scalar
  5. */
  6. protected function enqueueExpressions(mixed $valueToEncode, array &$expressions): mixed

    Method HighchartsBundle\Highcharts\AbstractChart::enqueueExpressions() has parameter $valueToEncode with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  7. {
  8. if ($valueToEncode instanceof ChartExpression) {
  9. $key = $valueToEncode->getMagicKey();
  10. $expressions[$key] = $valueToEncode;
  1. /**
  2. * The Highcharts bundle.
  3. */
  4. class HighchartsBundle extends AbstractBundle
  5. {
  6. #[\Override]

    Method HighchartsBundle\HighchartsBundle::loadExtension() has parameter $config with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  7. public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
  8. {
  9. $container->services()
  10. ->set('twig.extension.highcharts', HighchartsExtension::class)
  11. ->tag('twig.extension');
  1. */
  2. public function __construct(private readonly string $name)
  3. {
  4. }
  5. public function __call(string $name, array $value): self

    Method HighchartsBundle\Highcharts\ChartOption::__call() has parameter $value with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  6. {
  7. $this->data[$name] = $value[0];
  8. return $this;
  9. }
  1. public static function instance(string $name): self
  2. {
  3. return new self($name);
  4. }
  5. public function merge(array $data): self

    Method HighchartsBundle\Highcharts\ChartOption::merge() has parameter $data with no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  6. {
  7. $this->data = \array_merge_recursive($this->data, $data);
  8. return $this;
  9. }

Your project should use return types 2

More information: https://insight.symfony.com/what-we-analyse/php.missing_return_typehint

  1. * @param ChartExpression|array|scalar $valueToEncode
  2. * @param array<string, ChartExpression> $expressions
  3. *
  4. * @return array|scalar
  5. */
  6. protected function enqueueExpressions(mixed $valueToEncode, array &$expressions): mixed

    Method HighchartsBundle\Highcharts\AbstractChart::enqueueExpressions() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  7. {
  8. if ($valueToEncode instanceof ChartExpression) {
  9. $key = $valueToEncode->getMagicKey();
  10. $expressions[$key] = $valueToEncode;
  1. public function count(): int
  2. {
  3. return \count($this->data);
  4. }
  5. public function getData(): array

    Method HighchartsBundle\Highcharts\ChartOption::getData() return type has no value type specified in iterable type array.

    Time to fix: about 9 minutes
    Read doc Permalink
    Last edited by Laurent Muller
  6. {
  7. return $this->data;
  8. }
  9. public function getName(): string