<?php

declare(strict_types=1);

namespace PHPSTORM_META {

  expectedArguments(
    \Drupal\Core\File\FileSystemInterface::prepareDirectory(),
    1,
    \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY |
    \Drupal\Core\File\FileSystemInterface::MODIFY_PERMISSIONS
  );

  registerArgumentsSet('file_system_exists_behaviour',
    \Drupal\Core\File\FileSystemInterface::EXISTS_RENAME,
    \Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE,
    \Drupal\Core\File\FileSystemInterface::EXISTS_ERROR
  );

  expectedArguments(\Drupal\Core\File\FileSystemInterface::copy(), 2, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\Drupal\Core\File\FileSystemInterface::move(), 2, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\Drupal\Core\File\FileSystemInterface::saveData(), 2, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\Drupal\Core\File\FileSystemInterface::getDestinationFilename(), 1, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\Drupal\file\FileRepositoryInterface::file_copy(), 2, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\Drupal\file\FileRepositoryInterface::file_move(), 2, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\Drupal\file\FileRepositoryInterface::file_save_data(), 2, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\file_save_upload(), 4, argumentsSet('file_system_exists_behaviour'));
  expectedArguments(\system_retrieve_file(), 3, argumentsSet('file_system_exists_behaviour'));

}
