CryptoParamsTraitV2.php 505 B

12345678910111213141516171819
  1. <?php
  2. namespace Aws\S3\Crypto;
  3. use Aws\Crypto\MaterialsProviderInterfaceV2;
  4. trait CryptoParamsTraitV2
  5. {
  6. use CryptoParamsTrait;
  7. protected function getMaterialsProvider(array $args)
  8. {
  9. if ($args['@MaterialsProvider'] instanceof MaterialsProviderInterfaceV2) {
  10. return $args['@MaterialsProvider'];
  11. }
  12. throw new \InvalidArgumentException('An instance of MaterialsProviderInterfaceV2'
  13. . ' must be passed in the "MaterialsProvider" field.');
  14. }
  15. }