Datastore/src/Connection/Grpc.php
private function readOptions(array $readOptions)
    {
        if (isset($readOptions['readConsistency'])) {
            switch ($readOptions['readConsistency']) {
                case 'STRONG':
                    $readOptions['readConsistency'] = ReadConsistency::STRONG;
                    break;

                case 'EVENTUAL':
                    $readOptions['readConsistency'] = ReadConsistency::EVENTUAL;
                    break;

                default:
                    //@codeCoverageIgnoreStart
                    throw new \InvalidArgumentException('Invalid value for Read Consistency.');
                    break;
                    //@codeCoverageIgnoreEnd
            }
        }

        return $this->serializer->decodeMessage(
            new ReadOptions,
            $readOptions
        );
    }
private function readOptions(array $readOptions)
    {
        if (isset($readOptions['readConsistency'])) {
            switch ($readOptions['readConsistency']) {
                case 'STRONG':
                    $readOptions['readConsistency'] = ReadConsistency::STRONG;
                    break;

                case 'EVENTUAL':
                    $readOptions['readConsistency'] = ReadConsistency::EVENTUAL;
                    break;

                default:
                    //@codeCoverageIgnoreStart
                    throw new \InvalidArgumentException('Invalid value for Read Consistency.');
                    break;
                    //@codeCoverageIgnoreEnd
            }
        }

        return $this->serializer->decodeMessage(
            new ReadOptions,
            $readOptions
        );
    }
private function readOptions ( array $ readOptions ) { if ( isset ( $ readOptions [ 'readConsistency' ] ) ) { switch ( $ readOptions [ 'readConsistency' ] ) { case 'STRONG' : $ readOptions [ 'readConsistency' ] = ReadConsistency :: STRONG ; break ; case 'EVENTUAL' : $ readOptions [ 'readConsistency' ] = ReadConsistency :: EVENTUAL ; break ; default : //@codeCoverageIgnoreStart throw new \ InvalidArgumentException ( 'Invalid value for Read Consistency.' ) ; break ; //@codeCoverageIgnoreEnd } } return $ this -> serializer -> decodeMessage ( new ReadOptions , $ readOptions ) ; }
Convert read options into an API-compatible value.

@param array $readOptions The input readOptions data.
@return array
Convert read options into an API - compatible value .