Skip to content

Commit f713865

Browse files
committed
Added missing return types
1 parent 5e5adf4 commit f713865

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/FabianBeiner/Todoist/TodoistLabelsTrait.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait TodoistLabelsTrait
2424
*
2525
* @return array|bool An array containing all user labels, or false on failure.
2626
*/
27-
public function getAllLabels()
27+
public function getAllLabels(): bool|array
2828
{
2929
/** @var object $result Result of the GET request. */
3030
$result = $this->get('labels');
@@ -45,14 +45,14 @@ public function getAllLabels()
4545
*
4646
* @return array|bool An array containing the values of the new label, or false on failure.
4747
*/
48-
public function createLabel(string $labelName, array $optionalParameters = [])
48+
public function createLabel(string $labelName, array $optionalParameters = []): bool|array
4949
{
5050
if ( ! strlen($labelName)) {
5151
return false;
5252
}
5353

5454
// Only allow valid optional parameters.
55-
$validParameters = [
55+
$validParameters = [
5656
'order',
5757
'color',
5858
'is_favorite',
@@ -77,7 +77,7 @@ public function createLabel(string $labelName, array $optionalParameters = [])
7777
*
7878
* @return array|bool An array containing the label data related to the given id, or false on failure.
7979
*/
80-
public function getLabel(string $labelId)
80+
public function getLabel(string $labelId): bool|array
8181
{
8282
if ( ! $this->validateId($labelId)) {
8383
return false;
@@ -101,14 +101,14 @@ public function getLabel(string $labelId)
101101
*
102102
* @return array|bool True on success, false on failure.
103103
*/
104-
public function updateLabel(string $labelId, array $optionalParameters = [])
104+
public function updateLabel(string $labelId, array $optionalParameters = []): bool|array
105105
{
106106
if ( ! $this->validateId($labelId)) {
107107
return false;
108108
}
109109

110110
// Only allow valid optional parameters.
111-
$validParameters = [
111+
$validParameters = [
112112
'name',
113113
'order',
114114
'color',
@@ -153,7 +153,7 @@ public function deleteLabel(string $labelId): bool
153153
*
154154
* @return array|bool An array containing all shared labels, or false on failure.
155155
*/
156-
public function getAllSharedLabels()
156+
public function getAllSharedLabels(): bool|array
157157
{
158158
/** @var object $result Result of the GET request. */
159159
$result = $this->get('labels/shared');

0 commit comments

Comments
 (0)