path === null) { return ''; } // files/some/path -> some/path return preg_replace('/^files\//', '', pathinfo($this->path, PATHINFO_DIRNAME)); } /** * @param string $operator * @param string $checkValue * @param string $actualValue * @return bool */ protected function executeStringCheck($operator, $checkValue, $actualValue) { if ($operator === 'is' || $operator === '!is') { $checkValue = ltrim(rtrim($checkValue, '/'), '/'); } return parent::executeStringCheck($operator, $checkValue, $actualValue); } public function supportedEntities(): array { return [ File::class ]; } public function isAvailableForScope(int $scope): bool { return true; } }