Verified Commit f330fa37 authored by Dave Long's avatar Dave Long
Browse files

Issue #3425337 by mondrake: Fix root namespace classes DebugClassLoader...

Issue #3425337 by mondrake: Fix root namespace classes DebugClassLoader forward compatibility warnings
parent e7e4e0e7
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -19,10 +19,6 @@
%Method "Twig\\TokenParser\\TokenParserInterface::[^"]+" might add "[^"]+" as a native return type declaration in the future. Do the same in (child class|implementation) "[^"]+" now to avoid errors or add an explicit @return annotation to suppress this message%
%Method "WebDriver\\Service\\CurlServiceInterface::[^"]+" might add "[^"]+" as a native return type declaration in the future. Do the same in implementation "[^"]+" now to avoid errors or add an explicit @return annotation to suppress this message%

# Skip root namespace native DebugClassLoader forward compatibility warnings.
# These mostly refer to PHP native classes, could be fixed for PHP 8.1.
%Method "[^\\]+::\w+\(\)" might add "[^"]+" as a native return type declaration in the future. Do the same in (child class|implementation) "[^"]+" now to avoid errors or add an explicit @return annotation to suppress this message%

# The following deprecation is listed for Twig 2 compatibility when unit
# testing using \Symfony\Component\ErrorHandler\DebugClassLoader.
%The "Twig\\Environment::getTemplateClass\(\)" method is considered internal\. It may change without further notice\. You should not extend it from "Drupal\\Core\\Template\\TwigEnvironment"\.%
+46 −92
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ public function __construct(StaticReflectionParser $staticReflectionParser)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getName()
    public function getName(): string
    {
        return $this->staticReflectionParser->getClassName();
    }
@@ -56,8 +55,7 @@ public function getName()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getDocComment()
    public function getDocComment(): string|FALSE
    {
        return $this->staticReflectionParser->getDocComment();
    }
@@ -65,8 +63,7 @@ public function getDocComment()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getNamespaceName()
    public function getNamespaceName(): string
    {
        return $this->staticReflectionParser->getNamespaceName();
    }
@@ -94,8 +91,7 @@ public function hasClassAttribute(string $attribute)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getMethod($name)
    public function getMethod($name): \ReflectionMethod
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -103,8 +99,7 @@ public function getMethod($name)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getProperty($name)
    public function getProperty($name): \ReflectionProperty
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -120,8 +115,7 @@ public static function export($argument, $return = false)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getConstant($name)
    public function getConstant($name): mixed
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -129,8 +123,7 @@ public function getConstant($name)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getConstructor()
    public function getConstructor(): ?\ReflectionMethod
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -138,8 +131,7 @@ public function getConstructor()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getDefaultProperties()
    public function getDefaultProperties(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -147,8 +139,7 @@ public function getDefaultProperties()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getEndLine()
    public function getEndLine(): int|FALSE
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -156,8 +147,7 @@ public function getEndLine()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getExtension()
    public function getExtension(): ?\ReflectionExtension
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -165,8 +155,7 @@ public function getExtension()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getExtensionName()
    public function getExtensionName(): string|FALSE
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -174,8 +163,7 @@ public function getExtensionName()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getFileName()
    public function getFileName(): string|FALSE
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -183,8 +171,7 @@ public function getFileName()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getInterfaceNames()
    public function getInterfaceNames(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -192,8 +179,7 @@ public function getInterfaceNames()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getInterfaces()
    public function getInterfaces(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -201,8 +187,7 @@ public function getInterfaces()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getMethods($filter = null)
    public function getMethods($filter = null): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -210,8 +195,7 @@ public function getMethods($filter = null)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getModifiers()
    public function getModifiers(): int
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -219,8 +203,7 @@ public function getModifiers()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getParentClass()
    public function getParentClass(): \ReflectionClass|FALSE
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -228,8 +211,7 @@ public function getParentClass()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getProperties($filter = null)
    public function getProperties($filter = null): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -237,8 +219,7 @@ public function getProperties($filter = null)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getShortName()
    public function getShortName(): string
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -246,8 +227,7 @@ public function getShortName()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getStartLine()
    public function getStartLine(): int|FALSE
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -255,8 +235,7 @@ public function getStartLine()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getStaticProperties()
    public function getStaticProperties(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -264,8 +243,7 @@ public function getStaticProperties()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getStaticPropertyValue($name, $default = '')
    public function getStaticPropertyValue($name, $default = ''): mixed
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -273,8 +251,7 @@ public function getStaticPropertyValue($name, $default = '')
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getTraitAliases()
    public function getTraitAliases(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -282,8 +259,7 @@ public function getTraitAliases()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getTraitNames()
    public function getTraitNames(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -291,8 +267,7 @@ public function getTraitNames()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getTraits()
    public function getTraits(): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -300,8 +275,7 @@ public function getTraits()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function hasConstant($name)
    public function hasConstant($name): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -309,8 +283,7 @@ public function hasConstant($name)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function hasMethod($name)
    public function hasMethod($name): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -318,8 +291,7 @@ public function hasMethod($name)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function hasProperty($name)
    public function hasProperty($name): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -327,8 +299,7 @@ public function hasProperty($name)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function implementsInterface($interface)
    public function implementsInterface($interface): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -336,8 +307,7 @@ public function implementsInterface($interface)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function inNamespace()
    public function inNamespace(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -345,8 +315,7 @@ public function inNamespace()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isAbstract()
    public function isAbstract(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -354,8 +323,7 @@ public function isAbstract()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isCloneable()
    public function isCloneable(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -363,8 +331,7 @@ public function isCloneable()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isFinal()
    public function isFinal(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -372,8 +339,7 @@ public function isFinal()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isInstance($object)
    public function isInstance($object): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -381,8 +347,7 @@ public function isInstance($object)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isInstantiable()
    public function isInstantiable(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -390,8 +355,7 @@ public function isInstantiable()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isInterface()
    public function isInterface(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -399,8 +363,7 @@ public function isInterface()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isInternal()
    public function isInternal(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -408,8 +371,7 @@ public function isInternal()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isIterateable()
    public function isIterateable(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -417,8 +379,7 @@ public function isIterateable()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isSubclassOf($class)
    public function isSubclassOf($class): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -426,8 +387,7 @@ public function isSubclassOf($class)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isTrait()
    public function isTrait(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -435,8 +395,7 @@ public function isTrait()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function isUserDefined()
    public function isUserDefined(): bool
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -444,8 +403,7 @@ public function isUserDefined()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function newInstanceArgs(array $args = [])
    public function newInstanceArgs(array $args = []): ?object
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -453,8 +411,7 @@ public function newInstanceArgs(array $args = [])
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function newInstanceWithoutConstructor()
    public function newInstanceWithoutConstructor(): object
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -462,8 +419,7 @@ public function newInstanceWithoutConstructor()
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function setStaticPropertyValue($name, $value)
    public function setStaticPropertyValue($name, $value): void
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -471,8 +427,7 @@ public function setStaticPropertyValue($name, $value)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function getConstants(?int $filter = null)
    public function getConstants(?int $filter = null): array
    {
        throw new ReflectionException('Method not implemented');
    }
@@ -480,8 +435,7 @@ public function getConstants(?int $filter = null)
    /**
     * {@inheritDoc}
     */
    #[\ReturnTypeWillChange]
    public function newInstance(mixed ...$args)
    public function newInstance(mixed ...$args): object
    {
        throw new ReflectionException('Method not implemented');
    }
+1 −2
Original line number Diff line number Diff line
@@ -23,8 +23,7 @@ public function __construct($path, $regex) {
  /**
   * Implements \RegexIterator::accept().
   */
  #[\ReturnTypeWillChange]
  public function accept() {
  public function accept(): bool {
    /** @var \SplFileInfo $file_info */
    $file_info = $this->getInnerIterator()->current();
    return $file_info->isFile() && preg_match($this->getRegex(), $file_info->getFilename());
+2 −4
Original line number Diff line number Diff line
@@ -142,8 +142,7 @@ public function removeInstanceId($instance_id) {
    $this->remove($instance_id);
  }

  #[\ReturnTypeWillChange]
  public function getIterator() {
  public function getIterator(): \ArrayIterator {
    $instances = [];
    foreach ($this->getInstanceIds() as $instance_id) {
      $instances[$instance_id] = $this->get($instance_id);
@@ -154,8 +153,7 @@ public function getIterator() {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function count() {
  public function count(): int {
    return count($this->instanceIds);
  }

+2 −4
Original line number Diff line number Diff line
@@ -41,16 +41,14 @@ public function __toString() {
  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function count() {
  public function count(): int {
    return mb_strlen($this->string);
  }

  /**
   * {@inheritdoc}
   */
  #[\ReturnTypeWillChange]
  public function jsonSerialize() {
  public function jsonSerialize(): string {
    return $this->__toString();
  }

Loading