.. Generated by https://github.com/TYPO3-Documentation/t3docs-codesnippets
.. Extracted from EXT:examples/Classes/LinkValidator/LinkType/ExampleLinkType.php

.. code-block:: php
   :caption: EXT:examples/Classes/LinkValidator/LinkType/ExampleLinkType.php

   <?php

   /*
    * This file is part of the TYPO3 CMS project. [...]
    */ 

   namespace T3docs\Examples\LinkValidator\LinkType;

   use TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype;

   /**
    * This class provides Check Example Links plugin implementation
    */
   class ExampleLinkType extends AbstractLinktype
   {
       protected string $identifier = 'example';

       public function checkLink($url, $softRefEntry, $reference)
       {
           $isValidUrl = false;
           // TODO: Implement checkLink() method.
           return $isValidUrl;
       }

       public function getErrorMessage($errorParams)
       {
           $lang = $this->getLanguageService();
           return match ($errorParams['errno'] ?? 0) {
               404 => $lang->getLL('list.report.pagenotfound404'),
               // fall back to generic error message
               default => sprintf($lang->getLL('list.report.externalerror'), $errorParams['errno']),
           };
       }
   }
   