src/Sts/StsClient.php
public function createCredentials(Result $result)
    {
        if (!$result->hasKey('Credentials')) {
            throw new \InvalidArgumentException('Result contains no credentials');
        }

        $c = $result['Credentials'];

        return new Credentials(
            $c['AccessKeyId'],
            $c['SecretAccessKey'],
            isset($c['SessionToken']) ? $c['SessionToken'] : null,
            isset($c['Expiration']) && $c['Expiration'] instanceof \DateTimeInterface
                ? (int) $c['Expiration']->format('U')
                : null
        );
    }
public function createCredentials(Result $result)
    {
        if (!$result->hasKey('Credentials')) {
            throw new \InvalidArgumentException('Result contains no credentials');
        }

        $c = $result['Credentials'];

        return new Credentials(
            $c['AccessKeyId'],
            $c['SecretAccessKey'],
            isset($c['SessionToken']) ? $c['SessionToken'] : null,
            isset($c['Expiration']) && $c['Expiration'] instanceof \DateTimeInterface
                ? (int) $c['Expiration']->format('U')
                : null
        );
    }
public function createCredentials ( Result $ result ) { if ( ! $ result -> hasKey ( 'Credentials' ) ) { throw new \ InvalidArgumentException ( 'Result contains no credentials' ) ; } $ c = $ result [ 'Credentials' ] ; return new Credentials ( $ c [ 'AccessKeyId' ] , $ c [ 'SecretAccessKey' ] , isset ( $ c [ 'SessionToken' ] ) ? $ c [ 'SessionToken' ] : null , isset ( $ c [ 'Expiration' ] ) && $ c [ 'Expiration' ] instanceof \ DateTimeInterface ? ( int ) $ c [ 'Expiration' ] -> format ( 'U' ) : null ) ; }
Creates credentials from the result of an STS operations

@param Result $result Result of an STS operation

@return Credentials
@throws \InvalidArgumentException if the result contains no credentials
Creates credentials from the result of an STS operations