| 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 | * @param array|string $images |
||
| 39 | 6 | * @return $this |
|
| 40 | */ |
||
| 41 | 6 | public function withImage($images){ |
|
| 47 | |||
| 48 | /** |
||
| 49 | 5 | * Get Twitter status update content. |
|
| 50 | * |
||
| 51 | 5 | * @return string |
|
| 52 | */ |
||
| 53 | public function getContent() |
||
| 57 | |||
| 58 | 3 | /** |
|
| 59 | * Get Twitter images list. |
||
| 60 | 3 | * |
|
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getImages() |
||
| 67 | 4 | ||
| 68 | /** |
||
| 69 | * Return Twitter status update api endpoint. |
||
| 70 | 4 | * @return string |
|
| 71 | 4 | */ |
|
| 72 | public function getApiEndpoint() |
||
| 76 | |||
| 77 | 4 | /** |
|
| 78 | * Build Twitter request body. |
||
| 79 | * @return array |
||
| 80 | */ |
||
| 81 | public function getRequestBody() |
||
| 93 | } |
||
| 94 |
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.