‪TYPO3CMS  ‪main
BrokenLinkAnalysisEvent.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 
20 use Psr\EventDispatcher\StoppableEventInterface;
21 
25 final class ‪BrokenLinkAnalysisEvent implements StoppableEventInterface
26 {
27  private bool ‪$isBroken = false;
28  private bool ‪$linkWasChecked = false;
29 
33  private string ‪$reason = '';
34 
35  public function ‪__construct(private readonly string $linkType, private readonly array $linkData) {}
36 
37  public function ‪isPropagationStopped(): bool
38  {
39  // prevent other listeners from being called if link has been checked
41  }
42 
47  public function ‪getLinkType(): string
48  {
49  return $this->linkType;
50  }
51 
55  public function ‪getLinkData(): array
56  {
57  return $this->linkData;
58  }
59 
60  public function ‪markAsCheckedLink(): void
61  {
62  $this->linkWasChecked = true;
63  }
64 
65  public function ‪markAsBrokenLink(string ‪$reason = ''): void
66  {
67  $this->isBroken = true;
68  $this->‪reason = ‪$reason;
69  }
70 
71  public function ‪isBrokenLink(): bool
72  {
73  return ‪$this->isBroken;
74  }
75 
76  public function ‪getReason(): string
77  {
78  return ‪$this->reason;
79  }
80 }
‪TYPO3\CMS\IndexedSearch\Type\reason
‪@ reason
Definition: IndexStatus.php:31
‪TYPO3\CMS\Core\Html\Event
Definition: BrokenLinkAnalysisEvent.php:18