Your project must not contain invalid function or method calls
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- }
- public function offsetSet(mixed $offset, mixed $value): void
- {
- if (\is_object($value) && $value instanceof ContainerAware && null === $value->getContainer()) {
- $value->setContainer($this[ContainerInterface::class]);
- }
- $this->entries[$offset] = $value;
- }
Your project should not use invalid parameter and return typehints
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint
- /**
- * @var array<string, object|callable>
- */
- private array $entries = [];
- public function __construct(array $entries = [])
- {
- foreach ($entries as $offset => $value) {
- $this->offsetSet($offset, $value);
- }
- }
Your project should not contain unused code
- Read doc
- Productivity
- Minor
More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member
- * Determines if the given class is injectable.
- *
- * @param object $class
- * @return ($class is Container\ContainerAware ? true : false)
- */
- private function isInjectable(object $class): bool
- {
- return $class instanceof Container\ContainerAware && null === $class->getContainer();
- }
- }