| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | class CachesClearedEvent extends AbstractEvent implements ProvidesExampleProperties |
||
| 28 | { |
||
| 29 | /** |
||
| 30 | * @label Event/TYPO3:cache_cleared.marker.cache_command |
||
| 31 | * @marker |
||
| 32 | * |
||
| 33 | * @var string |
||
| 34 | */ |
||
| 35 | protected $cacheCommand; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @label Event/TYPO3:cache_cleared.marker.page_uid |
||
| 39 | * @marker |
||
| 40 | * |
||
| 41 | * @var int |
||
| 42 | */ |
||
| 43 | protected $pageUid; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param array $parameters |
||
| 47 | */ |
||
| 48 | public function run(array $parameters) |
||
| 49 | { |
||
| 50 | $this->cacheCommand = $parameters['cacheCmd']; |
||
| 51 | |||
| 52 | if (empty($this->cacheCommand)) { |
||
| 53 | $this->cancelDispatch(); |
||
| 54 | } |
||
| 55 | |||
| 56 | if (MathUtility::canBeInterpretedAsInteger($this->cacheCommand)) { |
||
| 57 | $this->pageUid = (int)$this->cacheCommand; |
||
| 58 | $this->cacheCommand = 'page'; |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return array |
||
| 64 | */ |
||
| 65 | public function getExampleProperties(): array |
||
| 70 | ]; |
||
| 71 | } |
||
| 73 |