@@ -39,8 +39,8 @@ class Database extends Endpoint
3939 /**
4040 * Database constructor.
4141 *
42- * @param string $databaseId
43- * @param Notion $notion
42+ * @param string $databaseId
43+ * @param Notion $notion
4444 *
4545 * @throws \FiveamCode\LaravelNotionApi\Exceptions\HandlingException
4646 * @throws \FiveamCode\LaravelNotionApi\Exceptions\LaravelNotionAPIException
@@ -64,24 +64,25 @@ public function query(): PageCollection
6464 {
6565 $ response = $ this
6666 ->post (
67- $ this ->url (Endpoint::DATABASES . "/ {$ this ->databaseId }/query " ),
67+ $ this ->url (Endpoint::DATABASES . "/ {$ this ->databaseId }/query " ),
6868 $ this ->getPostData ()
6969 )
7070 ->json ();
7171
7272 return new PageCollection ($ response );
7373 }
7474
75- public function getPostData ():array {
75+ public function getPostData (): array
76+ {
7677 $ postData = [];
7778
7879 if ($ this ->sorts ->isNotEmpty ()) {
7980 $ postData ['sorts ' ] = Sorting::sortQuery ($ this ->sorts );
8081 }
8182
82- if ($ this ->filter !== null && !is_null ($ this ->filterBag )) {
83+ if ($ this ->filter !== null && ! is_null ($ this ->filterBag )) {
8384 throw new HandlingException ('Please provide either a filter bag or a single filter. ' );
84- } elseif ($ this ->filter !== null || !is_null ($ this ->filterBag )) {
85+ } elseif ($ this ->filter !== null || ! is_null ($ this ->filterBag )) {
8586 $ postData ['filter ' ] = $ this ->filterData ;
8687 }
8788
@@ -101,11 +102,10 @@ public function getPostData():array {
101102 * @return Database $this
102103 *
103104 * @throws HandlingException
104- *
105105 */
106106 public function filterBy (Collection |Filter |FilterBag $ filter ): Database
107107 {
108- if ($ filter instanceof Collection) {
108+ if ($ filter instanceof Collection) {
109109 return $ this ->filterByCollection ($ filter );
110110 }
111111 if ($ filter instanceof FilterBag) {
@@ -119,8 +119,9 @@ public function filterBy(Collection|Filter|FilterBag $filter): Database
119119 }
120120
121121 /**
122- * @param Filter $filter
122+ * @param Filter $filter
123123 * @return $this
124+ *
124125 * @throws HandlingException
125126 */
126127 public function filterBySingleFilter (Filter $ filter ): Database
@@ -132,7 +133,7 @@ public function filterBySingleFilter(Filter $filter): Database
132133 }
133134
134135 /**
135- * @param FilterBag $filterBag
136+ * @param FilterBag $filterBag
136137 * @return Database $this
137138 */
138139 public function filterByBag (FilterBag $ filterBag ): Database
@@ -144,18 +145,19 @@ public function filterByBag(FilterBag $filterBag): Database
144145 }
145146
146147 /**
147- * @param Collection $filterCollection
148+ * @param Collection $filterCollection
148149 * @return Database $this
149150 */
150- public function filterByCollection (Collection $ filterCollection ): Database {
151+ public function filterByCollection (Collection $ filterCollection ): Database
152+ {
151153 $ filterBag = new FilterBag (Operators::OR );
152154 $ filterBag ->addFilters ($ filterCollection );
153155
154156 return $ this ->filterByBag ($ filterBag );
155157 }
156158
157159 /**
158- * @param Collection|Sorting $sorts
160+ * @param Collection|Sorting $sorts
159161 * @return Database $this
160162 *
161163 * @throws HandlingException
@@ -178,7 +180,7 @@ public function sortBy(Sorting|Collection $sorts): Database
178180 }
179181
180182 /**
181- * @param EntityCollection $entityCollection
183+ * @param EntityCollection $entityCollection
182184 * @return $this
183185 */
184186 public function offsetByResponse (EntityCollection $ entityCollection ): Database
0 commit comments