1 | <?php |
||
35 | class FileUtilityProcessDataHook implements ExtendedFileUtilityProcessDataHookInterface |
||
36 | { |
||
37 | /** |
||
38 | * @var Configuration |
||
39 | */ |
||
40 | private $configuration; |
||
41 | |||
42 | /** |
||
43 | * @var ImagePurgeService |
||
44 | */ |
||
45 | private $imagePurgeService; |
||
46 | |||
47 | /** |
||
48 | * @param Configuration $configuration |
||
49 | * @param ImagePurgeService $imagePurgeService |
||
50 | */ |
||
51 | 9 | public function __construct(Configuration $configuration = null, ImagePurgeService $imagePurgeService = null) |
|
62 | |||
63 | /** |
||
64 | * @param string $action |
||
65 | * @param array $cmdArr |
||
66 | * @param array $result |
||
67 | * @param ExtendedFileUtility $parentObject |
||
68 | * @return void |
||
69 | * @see \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::processData |
||
70 | */ |
||
71 | 2 | public function processData_postProcessAction($action, array $cmdArr, array $result, ExtendedFileUtility $parentObject) |
|
78 | |||
79 | /** |
||
80 | * @param File $file |
||
81 | * @return string |
||
82 | */ |
||
83 | 2 | protected function buildImgUrl(File $file) |
|
87 | |||
88 | /** |
||
89 | * @param array $result |
||
90 | * @return File|null |
||
91 | */ |
||
92 | 3 | protected function getFile(array $result) |
|
99 | |||
100 | /** |
||
101 | * We must purge the imgix-cache, when: |
||
102 | * - editor has updated an existing image (by uploading and overwriting an existing image) |
||
103 | * - editor has replaced an existing image |
||
104 | * |
||
105 | * @param string $action |
||
106 | * @param File|null $file |
||
107 | * @return boolean |
||
108 | */ |
||
109 | 5 | protected function isPurgingOfImgixCacheRequired($action, File $file = null) |
|
123 | } |
||
124 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: