1 | <?php |
||
39 | class FacebookResumableUploader |
||
40 | { |
||
41 | /** |
||
42 | * @var FacebookApp |
||
43 | */ |
||
44 | protected $app; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $accessToken; |
||
50 | |||
51 | /** |
||
52 | * @var FacebookClient The Facebook client service. |
||
53 | */ |
||
54 | protected $client; |
||
55 | |||
56 | /** |
||
57 | * @var string Graph version to use for this request. |
||
58 | */ |
||
59 | protected $graphVersion; |
||
60 | |||
61 | /** |
||
62 | * @param FacebookApp $app |
||
63 | * @param FacebookClient $client |
||
64 | * @param AccessToken|string|null $accessToken |
||
65 | * @param string $graphVersion |
||
66 | */ |
||
67 | public function __construct(FacebookApp $app, FacebookClient $client, $accessToken, $graphVersion) |
||
74 | |||
75 | /** |
||
76 | * Upload by chunks - start phase |
||
77 | * |
||
78 | * @param string $endpoint |
||
79 | * @param FacebookFile $file |
||
80 | * |
||
81 | * @return FacebookTransferChunk |
||
82 | * |
||
83 | * @throws FacebookSDKException |
||
84 | */ |
||
85 | public function start($endpoint, FacebookFile $file) |
||
95 | |||
96 | /** |
||
97 | * Upload by chunks - transfer phase |
||
98 | * |
||
99 | * @param string $endpoint |
||
100 | * @param FacebookTransferChunk $chunk |
||
101 | * @param boolean $allowToThrow |
||
102 | * |
||
103 | * @return FacebookTransferChunk |
||
104 | * |
||
105 | * @throws FacebookResponseException |
||
106 | */ |
||
107 | public function transfer($endpoint, FacebookTransferChunk $chunk, $allowToThrow = false) |
||
130 | |||
131 | /** |
||
132 | * Upload by chunks - finish phase |
||
133 | * |
||
134 | * @param string $endpoint |
||
135 | * @param string $uploadSessionId |
||
136 | * @param array $metadata The metadata associated with the file. |
||
137 | * |
||
138 | * @return boolean |
||
139 | * |
||
140 | * @throws FacebookSDKException |
||
141 | */ |
||
142 | public function finish($endpoint, $uploadSessionId, $metadata = []) |
||
152 | |||
153 | /** |
||
154 | * Helper to make a FacebookRequest and send it. |
||
155 | * |
||
156 | * @param string $endpoint The endpoint to POST to. |
||
157 | * @param array $params The params to send with the request. |
||
158 | * |
||
159 | * @return array |
||
160 | */ |
||
161 | private function sendUploadRequest($endpoint, $params = []) |
||
167 | } |
||
168 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.