Skip to content

Commit

Permalink
UHF-10891: phpstan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Oct 25, 2024
1 parent 1af52b1 commit ae40232
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Drush/Commands/TransliterateFilesCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\TranslatableInterface;
use Drupal\Core\File\Event\FileUploadSanitizeNameEvent;
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\FileSystemInterface;
Expand Down Expand Up @@ -86,14 +87,15 @@ private function processEntityType(string $entityType, array $fields) : void {
$conditionGroup
->condition($name, '/sites/default/files%', 'LIKE');
$query->exists($name)
->condition($conditionGroup)
->accessCheck(FALSE);
->condition($conditionGroup);
$query->accessCheck(FALSE);
$ids = $query->execute();

foreach ($ids as $id) {
$entity = $this->entityTypeManager->getStorage($entityType)
->load($id);

assert($entity instanceof TranslatableInterface);
foreach ($entity->getTranslationLanguages() as $language) {
$this->processFieldLinks($entity->getTranslation($language->getId()), $name);
}
Expand All @@ -112,7 +114,7 @@ private function processEntityType(string $entityType, array $fields) : void {
*/
private function remoteFileExists(string $url) : bool {
try {
$this->httpClient->head($url);
$this->httpClient->request('HEAD', $url);

return TRUE;
}
Expand Down

0 comments on commit ae40232

Please sign in to comment.