‪TYPO3CMS  ‪main
AbstractLinktype.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
25 abstract class ‪AbstractLinktype implements ‪LinktypeInterface
26 {
32  protected array ‪$errorParams = [];
33 
34  protected string ‪$identifier = '';
35 
36  public function ‪getIdentifier(): string
37  {
38  return ‪$this->identifier;
39  }
40 
45  public function ‪setAdditionalConfig(array $config): void
46  {
47  // do nothing by default
48  }
49 
58  public function ‪fetchType(array $value, string $type, string $key): string
59  {
60  if (($value['type'] ?? false) == $key) {
61  $type = $value['type'];
62  }
63  return $type;
64  }
65 
71  protected function ‪setErrorParams($value)
72  {
73  $this->errorParams = $value;
74  }
75 
81  public function ‪getErrorParams(): array
82  {
83  return ‪$this->errorParams;
84  }
85 
92  public function ‪getBrokenUrl(array $row): string
93  {
94  return $row['url'];
95  }
96 
98  {
99  return ‪$GLOBALS['LANG'];
100  }
101 }
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\fetchType
‪string fetchType(array $value, string $type, string $key)
Definition: AbstractLinktype.php:58
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\$identifier
‪string $identifier
Definition: AbstractLinktype.php:34
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\$errorParams
‪array $errorParams
Definition: AbstractLinktype.php:32
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getBrokenUrl
‪string getBrokenUrl(array $row)
Definition: AbstractLinktype.php:92
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype
Definition: AbstractLinktype.php:26
‪TYPO3\CMS\Linkvalidator\Linktype\LinktypeInterface
Definition: LinktypeInterface.php:26
‪TYPO3\CMS\Linkvalidator\Linktype
Definition: AbstractLinktype.php:18
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\setErrorParams
‪setErrorParams($value)
Definition: AbstractLinktype.php:71
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\setAdditionalConfig
‪setAdditionalConfig(array $config)
Definition: AbstractLinktype.php:45
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getErrorParams
‪array getErrorParams()
Definition: AbstractLinktype.php:81
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getIdentifier
‪getIdentifier()
Definition: AbstractLinktype.php:36
‪TYPO3\CMS\Linkvalidator\Linktype\AbstractLinktype\getLanguageService
‪getLanguageService()
Definition: AbstractLinktype.php:97