.. 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): bool
       {
           $isValidUrl = false;
           // TODO: Implement checkLink() method.
           return $isValidUrl;
       }

       public function getErrorMessage($errorParams): string
       {
           $lang = $this->getLanguageService();
           return match ($errorParams['errno'] ?? 0) {
               404 => $lang->sL('LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.report.pagenotfound404'),
               // fall back to generic error message
               default => sprintf(
                   $lang->sL('LLL:EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf:list.report.externalerror'),
                   $errorParams['errno'],
               ),
           };
       }
   }
   