@@ -26,7 +26,7 @@ trait TodoistSectionsTrait
2626 *
2727 * @return array|bool An array containing all user sections, or false on failure.
2828 */
29- public function getAllSections (?string $ projectId = null )
29+ public function getAllSections (?string $ projectId = null ): bool | array
3030 {
3131 if ( ! $ this ->validateId ($ projectId )) {
3232 /** @var object $result Result of the GET request. */
@@ -53,14 +53,14 @@ public function getAllSections(?string $projectId = null)
5353 *
5454 * @return array|bool An array containing the values of the new section, or false on failure.
5555 */
56- public function createSection (string $ sectionName , string $ projectId , array $ optionalParameters = [])
56+ public function createSection (string $ sectionName , string $ projectId , array $ optionalParameters = []): bool | array
5757 {
5858 if ( ! strlen ($ sectionName ) || ! $ this ->validateId ($ projectId )) {
5959 return false ;
6060 }
6161
6262 // Only allow valid optional parameters.
63- $ validParameters = [
63+ $ validParameters = [
6464 'order ' ,
6565 ];
6666 $ filteredParameters = array_intersect_key ($ optionalParameters , array_flip ($ validParameters ));
@@ -85,7 +85,7 @@ public function createSection(string $sectionName, string $projectId, array $opt
8585 *
8686 * @return array|bool An array containing the section data related to the given id, or false on failure.
8787 */
88- public function getSection (string $ sectionId )
88+ public function getSection (string $ sectionId ): bool | array
8989 {
9090 if ( ! $ this ->validateId ($ sectionId )) {
9191 return false ;
@@ -108,7 +108,7 @@ public function getSection(string $sectionId)
108108 *
109109 * @return array|bool True on success, false on failure.
110110 */
111- public function updateSection (string $ sectionId , string $ newSectionName )
111+ public function updateSection (string $ sectionId , string $ newSectionName ): bool | array
112112 {
113113 if ( ! strlen ($ newSectionName ) || ! $ this ->validateId ($ sectionId )) {
114114 return false ;
0 commit comments