1 | <?php |
||
22 | abstract class TransifexObject |
||
23 | { |
||
24 | /** |
||
25 | * Options for the Transifex object. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $options; |
||
30 | |||
31 | /** |
||
32 | * The HTTP client object to use in sending HTTP requests. |
||
33 | * |
||
34 | * @var ClientInterface |
||
35 | */ |
||
36 | protected $client; |
||
37 | |||
38 | /** |
||
39 | * @param array $options Transifex options array. |
||
40 | * @param ClientInterface $client The HTTP client object. |
||
41 | */ |
||
42 | 1 | public function __construct(array $options = [], ClientInterface $client = null) |
|
47 | |||
48 | /** |
||
49 | * Get the authentication credentials for the API request. |
||
50 | * |
||
51 | * @return array |
||
52 | * |
||
53 | * @throws \InvalidArgumentException if credentials are not set |
||
54 | */ |
||
55 | 69 | protected function getAuthData() : array |
|
67 | |||
68 | /** |
||
69 | * Get an option from the options store. |
||
70 | * |
||
71 | * @param string $key The name of the option to get. |
||
72 | * @param mixed $default The default value if the option is not set. |
||
73 | * |
||
74 | * @return mixed The option value. |
||
75 | */ |
||
76 | 1 | protected function getOption(string $key, $default = null) |
|
80 | |||
81 | /** |
||
82 | * Update an API endpoint with resource content. |
||
83 | * |
||
84 | * @param string $path API path |
||
85 | * @param string $content The content of the resource. This can either be a string of data or a file path. |
||
86 | * @param string $type The type of content in the $content variable. This should be either string or file. |
||
87 | * |
||
88 | * @return ResponseInterface |
||
89 | * |
||
90 | * @throws \InvalidArgumentException |
||
91 | */ |
||
92 | 7 | protected function updateResource(string $path, string $content, string $type) : ResponseInterface |
|
113 | } |
||
114 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..