ReviewOS

also looking at this

meemalabs/meema-client-php

Video Functionalities

#69
Merged glennmichael123 wants to merge video-functionalities into main
4 files +190 -32
src/Traits/UrlResponse.phpadded+46-0
Changes to src/Traits/UrlResponse.php
@@ -0,0 +1,46 @@
1<?php
2
3namespace Meema\MeemaClient\Traits;
4
5use GuzzleHttp\Psr7\Utils;
6
7trait UrlResponse
8{
9 /**
10 * Convert all parameters to string url.
11 *
12 * @return string
13 */
14 public function toUrl()
15 {
16 $queryParams = '';
17
18 $index = 0;
19
20 foreach ($this->args as $key => $param) {
21 $separator = '?';
22
23 if ($index) {
24 $separator = '&';
25 }
26
27 $queryParams .= "{$separator}{$key}={$param}";
28
29 $index++;
30 }
31
32 return "https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}";
33 }
34
35 /**
36 * Convert all parameters to string url.
37 *
38 * @return string
39 */
40 public function toBuffer()
41 {
42 $path = $this->toUrl();
43
44 return Utils::streamFor($path);
45 }
46}