| 1 | <?php |
||
| 7 | class TwitterStatusUpdate |
||
| 8 | { |
||
| 9 | /** @var string */ |
||
| 10 | protected $content; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | private $images; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | public $imageIds; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | private $apiEndpoint = 'statuses/update'; |
||
| 26 | |||
| 27 | /* |
||
| 28 | 7 | * @param string $content |
|
| 29 | */ |
||
| 30 | 7 | public function __construct($content) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Set Twitter media files. |
||
| 37 | * |
||
| 38 | * @return $this |
||
| 39 | 6 | */ |
|
| 40 | public function withImage($images){ |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get Twitter status update content. |
||
| 49 | 5 | * |
|
| 50 | * @return string |
||
| 51 | 5 | */ |
|
| 52 | public function getContent() |
||
| 56 | |||
| 57 | /** |
||
| 58 | 3 | * Get Twitter images list. |
|
| 59 | * |
||
| 60 | 3 | * @return string |
|
| 61 | */ |
||
| 62 | public function getImages() |
||
| 66 | |||
| 67 | 4 | /** |
|
| 68 | * Return Twitter status update api endpoint. |
||
| 69 | * @return string |
||
| 70 | 4 | */ |
|
| 71 | 4 | public function getApiEndpoint() |
|
| 75 | 2 | ||
| 76 | /** |
||
| 77 | 4 | * Build Twitter request body. |
|
| 78 | * @return array |
||
| 79 | */ |
||
| 80 | public function getRequestBody() |
||
| 92 | } |
||
| 93 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.