src/VCR/Request.php
public static function fromArray(array $request)
    {
        $requestObject = new Request(
            $request['method'],
            $request['url'],
            isset($request['headers']) ? $request['headers'] : array()
        );

        if (!empty($request['post_fields']) && is_array($request['post_fields'])) {
            $requestObject->setPostFields($request['post_fields']);
        }

        if (!empty($request['post_files']) && is_array($request['post_files'])) {
            foreach ($request['post_files'] as $file) {
                $requestObject->addPostFile($file);
            }
        }

        if (!empty($request['body'])) {
            $requestObject->setBody((string)$request['body']);
        }

        return $requestObject;
    }
public static function fromArray(array $request)
    {
        $requestObject = new Request(
            $request['method'],
            $request['url'],
            isset($request['headers']) ? $request['headers'] : array()
        );

        if (!empty($request['post_fields']) && is_array($request['post_fields'])) {
            $requestObject->setPostFields($request['post_fields']);
        }

        if (!empty($request['post_files']) && is_array($request['post_files'])) {
            foreach ($request['post_files'] as $file) {
                $requestObject->addPostFile($file);
            }
        }

        if (!empty($request['body'])) {
            $requestObject->setBody((string)$request['body']);
        }

        return $requestObject;
    }
public static function fromArray ( array $ request ) { $ requestObject = new Request ( $ request [ 'method' ] , $ request [ 'url' ] , isset ( $ request [ 'headers' ] ) ? $ request [ 'headers' ] : array ( ) ) ; if ( ! empty ( $ request [ 'post_fields' ] ) && is_array ( $ request [ 'post_fields' ] ) ) { $ requestObject -> setPostFields ( $ request [ 'post_fields' ] ) ; } if ( ! empty ( $ request [ 'post_files' ] ) && is_array ( $ request [ 'post_files' ] ) ) { foreach ( $ request [ 'post_files' ] as $ file ) { $ requestObject -> addPostFile ( $ file ) ; } } if ( ! empty ( $ request [ 'body' ] ) ) { $ requestObject -> setBody ( ( string ) $ request [ 'body' ] ) ; } return $ requestObject ; }
Creates a new Request from a specified array.

@param  array $request Request represented as an array.

@return Request A new Request from specified array.
Creates a new Request from a specified array .