Fix deprecation errors

Created on 7 July 2023, over 1 year ago
Updated 17 November 2023, about 1 year ago

Problem/Motivation

There are a LOT of deprecation errors, when analyzing the module using phpstan, which should be fixed:

------ -------------------------------------------------------------------------------------------------- 
  Line   markdown.module
 ------ --------------------------------------------------------------------------------------------------
  52     Call to an undefined method Drupal\markdown\Util\FilterFormatAwareInterface::getConfiguration().
  54     Call to an undefined method Drupal\markdown\Util\FilterFormatAwareInterface::getPluginId().
 ------ --------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------
  Line   src/Annotation/ComposerPackage.php
 ------ -----------------------------------------------------------------------------------------
  34     Call to deprecated method getInstalledVersion() of class Drupal\markdown\Util\Composer:
         in markdown:8.x-2.0 and is removed from markdown:4.0.0.
           No replacement.
  34     Call to deprecated method getVersionFromClass() of class Drupal\markdown\Util\Composer:
         in markdown:8.x-2.0 and is removed from markdown:4.0.0.
           No replacement.
  34     Call to method getInstalledVersion() of deprecated class Drupal\markdown\Util\Composer:
         in markdown:8.x-2.0 and is removed from markdown:4.0.0.
           Use \Composer\InstalledVersions instead.
  34     Call to method getVersionFromClass() of deprecated class Drupal\markdown\Util\Composer:
         in markdown:8.x-2.0 and is removed from markdown:4.0.0.
           Use \Composer\InstalledVersions instead.
 ------ -----------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Annotation/Identifier.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------
  20     PHPDoc tag @property has invalid value (string camelCase): Unexpected token "camelCase", expected variable at offset 83 on line 4
  20     PHPDoc tag @property has invalid value (string css): Unexpected token "css", expected variable at offset 113 on line 5
  20     PHPDoc tag @property has invalid value (string snakeCase): Unexpected token "snakeCase", expected variable at offset 137 on line 6
  20     PHPDoc tag @property has invalid value (string value): Unexpected token "value", expected variable at offset 167 on line 7
 ------ ------------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Annotation/InstallableLibrary.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------
  499    Call to deprecated constant REQUEST_TIME: Deprecated in drupal:8.3.0 and is removed from drupal:11.0.0. Use \Drupal::time()->getRequestTime();
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------
  Line   src/Annotation/InstallablePluginTrait.php (in context of class Drupal\markdown\Annotation\InstallableLibrary)
 ------ ---------------------------------------------------------------------------------------------------------------
  213    Call to an undefined method Drupal\markdown\Annotation\InstallableLibrary::getInstalledLibrary().
  213    Call to an undefined method Drupal\markdown\Annotation\InstallableLibrary::getPreferredLibrary().
  215    Access to an undefined property Drupal\markdown\Annotation\InstallableLibrary::$libraries.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
 ------ ---------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------
  Line   src/Annotation/InstallableRequirement.php
 ------ ------------------------------------------------------------
  135    Variable $filterManager in PHPDoc tag @var does not exist.
 ------ ------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------
  Line   src/BcSupport/SubformState.php
 ------ -------------------------------------------------------------------------------------------------------------------------
  16     Class Drupal\markdown\BcSupport\SubformState extends deprecated class Drupal\markdown\BcSupport\FormStateDecoratorBase:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Core\Form\FormStateDecoratorBase instead.
 ------ -------------------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------- 
  Line   src/Commands/MarkdownCommands.php
 ------ ---------------------------------------------------------------------
  192    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  201    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  213    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  231    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  235    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  239    Anonymous function has an unused use $package.
  260    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  268    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  273    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  280    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  284    Function drush_set_error not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ---------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Exception/MarkdownFileNotExistsException.php
 ------ --------------------------------------------------------------------------------------------------------------------------------------
  11     Class Drupal\markdown\Exception\MarkdownFileNotExistsException extends deprecated class Drupal\markdown\Exception\MarkdownException:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\markdown\Exception\MarkdownExceptionInterface instead.
  17     Call to method __construct() of deprecated class Exception:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\markdown\Exception\MarkdownExceptionInterface instead.
 ------ --------------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Exception/MarkdownUrlNotExistsException.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------
  11     Class Drupal\markdown\Exception\MarkdownUrlNotExistsException extends deprecated class Drupal\markdown\Exception\MarkdownException:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\markdown\Exception\MarkdownExceptionInterface instead.
  17     Call to method __construct() of deprecated class Exception:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\markdown\Exception\MarkdownExceptionInterface instead.
 ------ -------------------------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------
  Line   src/Form/ParserConfigurationForm.php
 ------ ---------------------------------------------------------------------------------------------------------------------
  554    Variable $defaultValue in isset() always exists and is always null.
  561    Access to an undefined property Drupal\filter\FilterPluginCollection|Drupal\filter\Plugin\FilterInterface::$status.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
  739    Call to an undefined method Drupal\markdown\Plugin\Markdown\ExtensibleParserInterface::submitConfigurationForm().
 ------ ---------------------------------------------------------------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------------------------------
  Line   src/Form/SubformState.php
 ------ ----------------------------------------------------------------------------------------------------------
  13     Class Drupal\markdown\Form\SubformState extends deprecated class Drupal\markdown\BcSupport\SubformState:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Core\Form\SubformState instead.
  62     Call to method createForSubform() of deprecated class Drupal\markdown\BcSupport\SubformState:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Core\Form\SubformState instead.
 ------ ----------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Form/SubformStateInterface.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------
  10     Interface Drupal\markdown\Form\SubformStateInterface extends deprecated interface Drupal\markdown\BcSupport\SubformStateInterface:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Core\Form\SubformStateInterface instead.
 ------ ------------------------------------------------------------------------------------------------------------------------------------ 

 ------ ----------------------------------------------------------------
  Line   src/Markdown.php
 ------ ----------------------------------------------------------------
  153    Call to an undefined method GuzzleHttp\ClientInterface::get().
 ------ ----------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Filter/FilterMarkdown.php
 ------ ---------------------------------------------------------------------------------------------------------------------
  458    Access to an undefined property Drupal\filter\FilterPluginCollection|Drupal\filter\Plugin\FilterInterface::$status.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
 ------ ---------------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/AnnotatedPluginInterface.php
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------
  17     Interface Drupal\markdown\Plugin\Markdown\AnnotatedPluginInterface extends deprecated interface Drupal\markdown\BcSupport\ConfigurableInterface:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Component\Plugin\ConfigurableInterface instead.
 ------ --------------------------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/BaseExtension.php
 ------ -------------------------------------------------------------------------------------------------------
  53     Call to an undefined method Drupal\markdown\Plugin\Markdown\SettingsInterface::getPluginDefinition().
 ------ -------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/BaseParser.php
 ------ -------------------------------------------------------------------------------------------------------
  69     Call to an undefined method Drupal\markdown\Plugin\Markdown\SettingsInterface::getPluginDefinition().
 ------ -------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/BaseExtension.php
 ------ ------------------------------------------------------------------------------------------------------------------------
  23     Parameter $environment of method Drupal\markdown\Plugin\Markdown\CommonMark\BaseExtension::register() has invalid type
         League\CommonMark\Environment\ConfigurableEnvironmentInterface.
  36     Call to method addExtension() on an unknown class League\CommonMark\Environment\ConfigurableEnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ------------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/Markdown/CommonMark/CommonMark.php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  86     Property Drupal\markdown\Plugin\Markdown\CommonMark\CommonMark::$converter has unknown class ColinODell\CommonMark\CommonMarkConverter as its type.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  93     Property Drupal\markdown\Plugin\Markdown\CommonMark\CommonMark::$environment has unknown class League\CommonMark\Environment\ConfigurableEnvironmentInterface as its  
         type.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  138    Method Drupal\markdown\Plugin\Markdown\CommonMark\CommonMark::converterClass() has invalid return type ColinODell\CommonMark\CommonMarkConverter.
  161    Method Drupal\markdown\Plugin\Markdown\CommonMark\CommonMark::environmentClass() has invalid return type League\CommonMark\Environment\Environment.
  183    Call to method convertToHtml() on an unknown class ColinODell\CommonMark\CommonMarkConverter.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  304    Method Drupal\markdown\Plugin\Markdown\CommonMark\CommonMark::converter() has invalid return type ColinODell\CommonMark\CommonMarkConverter.
  437    Call to deprecated method setConfig() of class League\CommonMark\ConfigurableEnvironmentInterface:
         in 1.6 and will be removed in 2.0; use mergeConfig() instead
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/CommonMarkGfm.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------
  42     Method Drupal\markdown\Plugin\Markdown\CommonMark\CommonMarkGfm::converterClass() has invalid return type ColinODell\CommonMark\CommonMarkConverter.
  54     PHPDoc tag @var for variable $environment contains unknown class League\CommonMark\Environment\Environment.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  55     Call to static method createGFMEnvironment() on an unknown class League\CommonMark\Environment\Environment.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/Extension/ExternalLinkExtension.php
 ------ ------------------------------------------------------------------------------------------------------------------------------------------
  194    Parameter $environment of method Drupal\markdown\Plugin\Markdown\CommonMark\Extension\ExternalLinkExtension::register() has invalid type
         League\CommonMark\Environment\ConfigurableEnvironmentInterface.
  200    Call to method addInlineRenderer() on an unknown class League\CommonMark\Environment\ConfigurableEnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ------------------------------------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/Extension/ExternalLinkRenderer.php
 ------ --------------------------------------------------------------------------------------------------------------------------------------------
  18     Property Drupal\markdown\Plugin\Markdown\CommonMark\Extension\ExternalLinkRenderer::$environment has unknown class
         League\CommonMark\Environment\EnvironmentInterface as its type.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  27     Parameter $environment of method Drupal\markdown\Plugin\Markdown\CommonMark\Extension\ExternalLinkRenderer::__construct() has invalid type
         League\CommonMark\Environment\EnvironmentInterface.
  44     Call to method getConfig() on an unknown class League\CommonMark\Environment\EnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  45     Call to method getConfig() on an unknown class League\CommonMark\Environment\EnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  46     Call to method getConfig() on an unknown class League\CommonMark\Environment\EnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ --------------------------------------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/Extension/FootnoteExtension.php
 ------ ------------------------------------------------------------------------------------------------
  202    Variable $form_state in PHPDoc tag @var does not match any variable in the foreach loop: $name
 ------ ------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/Extension/HeadingPermalinkExtension.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------------
  54     Fetching deprecated class constant DEFAULT_INNER_CONTENTS of class League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkRenderer.
 ------ -------------------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/Extension/MentionExtension.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------
  44     Parameter $environment of method Drupal\markdown\Plugin\Markdown\CommonMark\Extension\MentionExtension::register() has invalid type
         League\CommonMark\Environment\ConfigurableEnvironmentInterface.
 ------ -------------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/Extension/StrikethroughExtension.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------------
  79     Parameter $environment of method Drupal\markdown\Plugin\Markdown\CommonMark\Extension\StrikethroughExtension::register() has invalid type
         League\CommonMark\Environment\ConfigurableEnvironmentInterface.
  82     Call to method addInlineParser() on an unknown class League\CommonMark\Environment\ConfigurableEnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  84     Call to method addInlineRenderer() on an unknown class League\CommonMark\Environment\ConfigurableEnvironmentInterface.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ -------------------------------------------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/CommonMark/ExtensionInterface.php
 ------ -----------------------------------------------------------------------------------------------------------------------------
  20     Parameter $environment of method Drupal\markdown\Plugin\Markdown\CommonMark\ExtensionInterface::register() has invalid type
         League\CommonMark\Environment\ConfigurableEnvironmentInterface.
 ------ -----------------------------------------------------------------------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------      
  Line   src/Plugin/Markdown/ExtensibleParserInterface.php
 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------      
  10     Interface Drupal\markdown\Plugin\Markdown\ExtensibleParserInterface extends deprecated interface Drupal\markdown\BcSupport\ObjectWithPluginCollectionInterface:       
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Core\Plugin\ObjectWithPluginCollectionInterface instead.
 ------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------      

 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------  
  Line   src/Plugin/Markdown/InstallablePluginBase.php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------  
  32     Usage of deprecated trait Drupal\markdown\BcSupport\PluginDependencyTrait in class Drupal\markdown\Plugin\Markdown\InstallablePluginBase:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use \Drupal\Core\Plugin\PluginDependencyTrait instead.
  46     Method Drupal\markdown\Plugin\Markdown\InstallablePluginBase::buildLibrary() should return Drupal\Component\Render\MarkupInterface but return statement is missing.   
  84     Call to an undefined static method static(Drupal\markdown\Plugin\Markdown\InstallablePluginBase)::defaultSettings().
  251    Binary operation ".=" between Drupal\Core\Annotation\Translation and non-falsy-string results in an error.
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------  

 ------ -------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/Parsedown/Parsedown.php
 ------ -------------------------------------------------------------------------------------------------------------------
  60     Property Drupal\markdown\Plugin\Markdown\Parsedown\Parsedown::$parsedown has unknown class Parsedown as its type.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  174    Call to method text() on an unknown class Parsedown.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  183    Method Drupal\markdown\Plugin\Markdown\Parsedown\Parsedown::getParsedown() has invalid return type Parsedown.
 ------ -------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------
  Line   src/Plugin/Markdown/Pecl/Cmark.php
 ------ ---------------------------------------------------------------------
  38     Function CommonMark\Parse not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  39     Function CommonMark\Render\HTML not found.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
 ------ ---------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------
  Line   src/Plugin/Markdown/PhpMarkdown/PhpMarkdown.php
 ------ --------------------------------------------------------------------------------------------------------------------------------
  49     Property Drupal\markdown\Plugin\Markdown\PhpMarkdown\PhpMarkdown::$phpMarkdown has unknown class Michelf\Markdown as its type.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  150    Call to method transform() on an unknown class Michelf\Markdown.
         πŸ’‘ Learn more at https://phpstan.org/user-guide/discovering-symbols
  175    Method Drupal\markdown\Plugin\Markdown\PhpMarkdown\PhpMarkdown::getPhpMarkdown() has invalid return type Michelf\Markdown.
 ------ --------------------------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------
  Line   src/Plugin/Validation/Constraint/ExistsValidator.php
 ------ --------------------------------------------------------------------------------------
  26     Access to an undefined property Symfony\Component\Validator\Constraint::$message.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
 ------ --------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------
  Line   src/PluginManager/AllowedHtmlManager.php
 ------ --------------------------------------------------------------------------------------------------------
  269    Access to an undefined property Drupal\filter\Plugin\FilterInterface::$status.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
  451    Access to deprecated property $requiresFilter of class Drupal\markdown\Annotation\MarkdownAllowedHtml:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use the "requirements" properties instead.
  457    Access to deprecated property $requiresFilter of class Drupal\markdown\Annotation\MarkdownAllowedHtml:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use the "requirements" properties instead.
 ------ --------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------
  Line   src/PluginManager/ExtensionManager.php
 ------ ------------------------------------------------------------------------------------------------
  141    Access to deprecated property $requires of class Drupal\markdown\Annotation\MarkdownExtension:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use the "requirements" property instead.
  147    Access to deprecated property $requires of class Drupal\markdown\Annotation\MarkdownExtension:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use the "requirements" property instead.
 ------ ------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/PluginManager/InstallablePluginManager.php
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  285    Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT  
         instead.
         πŸ’‘ Change record: https://www.drupal.org/node/3151009
  402    Undefined variable: $e
  402    Variable $e in isset() is never defined.
  465    Call to deprecated method convertInstalledToLibraries() of class Drupal\markdown\PluginManager\InstallablePluginManager:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           There is no replacement.
  548    Access to deprecated property $versionConstraint of class Drupal\markdown\Annotation\InstallableLibrary:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use the "requirements" property instead.
  552    Access to deprecated property $versionConstraint of class Drupal\markdown\Annotation\InstallableLibrary:
         in markdown:8.x-2.0 and is removed from markdown:3.0.0.
           Use the "requirements" property instead.
  611    Access to an undefined property object::$value.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
  614    Access to an undefined property object::$value.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
  616    Call to deprecated method getVersionFromClass() of class Drupal\markdown\Util\Composer:
         in markdown:8.x-2.0 and is removed from markdown:4.0.0.
           No replacement.
  616    Call to method getVersionFromClass() of deprecated class Drupal\markdown\Util\Composer:
         in markdown:8.x-2.0 and is removed from markdown:4.0.0.
           Use \Composer\InstalledVersions instead.
  617    Access to an undefined property object::$value.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
  622    Call to an undefined method object::validate().
  635    Access to an undefined property object::$value.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------
  Line   src/Render/ParsedMarkdown.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------
  111    Call to deprecated constant REQUEST_TIME: Deprecated in drupal:8.3.0 and is removed from drupal:11.0.0. Use \Drupal::time()->getRequestTime();
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------
  Line   src/Traits/NormalizeTrait.php (in context of class Drupal\markdown\PluginManager\InstallablePluginManager)
 ------ ------------------------------------------------------------------------------------------------------------
  88     Undefined variable: $e
  88     Variable $e in isset() is never defined.
 ------ ------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------
  Line   src/Twig/Extension.php
 ------ -------------------------------------------------------------------------------------------------------
  10     Class Drupal\markdown\Twig\Extension extends deprecated class Twig_Extension:
         since Twig 2.7, use "Twig\Extension\AbstractExtension" instead
  10     Class Drupal\markdown\Twig\Extension implements class Twig_Extension_GlobalsInterface.
  10     Class Drupal\markdown\Twig\Extension implements deprecated interface Twig_Extension_GlobalsInterface:
         since Twig 2.7, use "Twig\Extension\GlobalsInterface" instead
  47     Instantiation of deprecated class Twig_SimpleFilter:
         since Twig 2.7, use "Twig\TwigFilter" instead
  56     Instantiation of deprecated class Twig_SimpleFunction:
         since Twig 2.7, use "Twig\TwigFunction" instead
 ------ -------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------
  Line   src/Twig/Node.php
 ------ -------------------------------------------------------------------------------------------------------------------
  10     Class Drupal\markdown\Twig\Node extends deprecated class Twig_Node:
         since Twig 2.7, use "Twig\Node\Node" instead
  22     Parameter $value of method Drupal\markdown\Twig\Node::__construct() has typehint with deprecated class Twig_Node:
         since Twig 2.7, use "Twig\Node\Node" instead
  23     Call to method __construct() of deprecated class Twig\Node\Node:
         since Twig 2.7, use "Twig\Node\Node" instead
 ------ -------------------------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------
  Line   src/Twig/TokenParser.php
 ------ ---------------------------------------------------------------------------------------
  11     Class Drupal\markdown\Twig\TokenParser extends deprecated class Twig_TokenParser:
         since Twig 2.7, use "Twig\TokenParser\AbstractTokenParser" instead
  33     Fetching class constant BLOCK_END_TYPE of deprecated class Twig_Token:
         since Twig 2.7, use "Twig\Token" instead
  34     Parameter $token of anonymous function has typehint with deprecated class Twig_Token:
         since Twig 2.7, use "Twig\Token" instead
  37     Fetching class constant BLOCK_END_TYPE of deprecated class Twig_Token:
         since Twig 2.7, use "Twig\Token" instead
 ------ ---------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------
  Line   src/Util/FilterHtml.php
 ------ --------------------------------------------------------------------------------------
  174    Access to an undefined property DOMNode::$name.
         πŸ’‘ Learn more: https://phpstan.org/blog/solving-phpstan-access-to-undefined-property
 ------ --------------------------------------------------------------------------------------

 -- ----------------------------------------------------------------------------------------------------------------------------------
     Error
 -- ----------------------------------------------------------------------------------------------------------------------------------
     Ignored error pattern #cache tag might be unclear and does not contain the cache key in it.# was not matched in reported errors.
     Ignored error pattern #^Class .* extends @internal class# was not matched in reported errors.
 -- ----------------------------------------------------------------------------------------------------------------------------------

(a few of these will be false positives, but most are correct)

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Grevil
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States TolstoyDotCom L.A.

    I'm not familiar with the module but I'll try to take care of some of those tomorrow. Anyone else can go ahead if they want.

  • πŸ‡ΊπŸ‡ΈUnited States TolstoyDotCom L.A.

    This seems like it would be better handled by the person who wrote the @todo notes on the classes. A lot of the issues are version related.

    In Drupal\markdown\Plugin\Markdown\CommonMark\CommonMark::getEnvironment, instead of creating the Environment at the beginning, create the array used for the environment and then pass that array to the constructor for the environment.
    That's because of this note in the CommonMark library: "@deprecated Environment::mergeConfig() is deprecated since league/commonmark v2.0 and will be removed in v3.0. Configuration should be set when instantiating the environment instead."

    Drupal\markdown\Commands\MarkdownCommands calls drush_set_error. For Drush 9, that should be throw new \Exception (https://weitzman.github.io/blog/port-to-drush9).
    If earlier versions of Drush are to be supported, then those calls could be replaced with $this->handleError() which would call drush_set_error if it's defined, or throw an exception otherwise.

    The warning about the call to $this->httpClient->get($url) in Drupal\markdown\Markdown is a false positive, that's a magic method.

  • πŸ‡©πŸ‡ͺGermany Grevil

    @TolstoyDotCom, thanks for taking a shot! I'd say we could also just simply fix most deprecation errors in this issue and create a follow-up issue with the rest! Mainly, the Twig and Drush depredations need a fix.
    Also:

    • The Commonmark depredations will probably be fixed in ✨ Add support for Commonmark v2 Needs review
    • I'd say it's ok to not support Drush <= 8 anymore, hence it is pretty dated, but that should be decided by a maintainer.
  • πŸ‡ΊπŸ‡ΈUnited States markdorison

    I'd say it's ok to not support Drush <= 8 anymore, hence it is pretty dated, but that should be decided by a maintainer.

    Personally, I am comfortable dropping support for Drush 10 and below.

Production build 0.71.5 2024