src/TwitterOAuth.php
private function mediaInitParameters(array $parameters)
    {
        $allowed_keys = ['media_type', 'additional_owners', 'media_category', 'shared'];
        $base = [
            'command' => 'INIT',
            'total_bytes' => filesize($parameters['media'])
        ];
        $allowed_parameters = array_intersect_key($parameters, array_flip($allowed_keys));
        return array_merge($base, $allowed_parameters);
    }
private function mediaInitParameters(array $parameters)
    {
        $allowed_keys = ['media_type', 'additional_owners', 'media_category', 'shared'];
        $base = [
            'command' => 'INIT',
            'total_bytes' => filesize($parameters['media'])
        ];
        $allowed_parameters = array_intersect_key($parameters, array_flip($allowed_keys));
        return array_merge($base, $allowed_parameters);
    }
private function mediaInitParameters ( array $ parameters ) { $ allowed_keys = [ 'media_type' , 'additional_owners' , 'media_category' , 'shared' ] ; $ base = [ 'command' => 'INIT' , 'total_bytes' => filesize ( $ parameters [ 'media' ] ) ] ; $ allowed_parameters = array_intersect_key ( $ parameters , array_flip ( $ allowed_keys ) ) ; return array_merge ( $ base , $ allowed_parameters ) ; }
Private method to get params for upload media chunked init.
Twitter docs: https://dev.twitter.com/rest/reference/post/media/upload-init.html

@param array  $parameters

@return array
Private method to get params for upload media chunked init . Twitter docs : https : // dev . twitter . com / rest / reference / post / media / upload - init . html