File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,20 @@ class DatabaseBuilder
16
16
*/
17
17
private array $ payload ;
18
18
19
+ /**
20
+ * @var Databases
21
+ */
22
+ private Databases $ databasesEndpoint ;
23
+
24
+
19
25
/**
20
26
* DatabaseBuilder constructor.
21
27
*
22
28
* @param Databases $databasesEndpoint
23
29
*/
24
- public function __construct (private Databases $ databasesEndpoint )
30
+ public function __construct (Databases $ databasesEndpoint )
25
31
{
32
+ $ this ->databasesEndpoint = $ databasesEndpoint ;
26
33
$ this ->payload = [
27
34
'is_inline ' => false ,
28
35
'parent ' => [],
@@ -43,7 +50,7 @@ public function __construct(private Databases $databasesEndpoint)
43
50
* @param string $pageId
44
51
* @return Database
45
52
*/
46
- public function createInPage ($ pageId ): Database
53
+ public function createInPage (string $ pageId ): Database
47
54
{
48
55
$ this ->payload ['parent ' ] = [
49
56
'type ' => 'page_id ' ,
@@ -219,7 +226,7 @@ public function scheme(callable $callback): DatabaseBuilder
219
226
* @param array|null $content
220
227
* @return DatabaseBuilder
221
228
*/
222
- public function addRaw (string $ title , string $ propertyType , array $ content = null ): DatabaseBuilder
229
+ public function addRaw (string $ title , string $ propertyType , ? array $ content = null ): DatabaseBuilder
223
230
{
224
231
$ this ->payload ['properties ' ][$ title ] = [];
225
232
$ this ->payload ['properties ' ][$ title ][$ propertyType ] = $ content ?? new \stdClass ();
Original file line number Diff line number Diff line change @@ -85,9 +85,8 @@ public function parent(NotionParent $parent): Page|Database|Block|NotionParent
85
85
return $ this ->notion ->block ($ parent ->getId ())->retrieve ();
86
86
case 'workspace ' :
87
87
return $ parent ;
88
- // throw new HandlingException('A Notion Workspace cannot be resolved by the Notion API.');
89
88
default :
90
- throw new HandlingException ('Unknown parent type while resolving the notion parent ' );
89
+ throw new HandlingException ('Unknown parent type while resolving the Notion parent ' );
91
90
}
92
91
}
93
92
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ protected function setResponseData(array $responseData): void
25
25
&& $ responseData ['object ' ] !== 'workspace '
26
26
&& $ responseData ['object ' ] !== 'block_id '
27
27
) {
28
- throw HandlingException::instance ('invalid json-array: the given object is not a valid parent ' );
28
+ throw HandlingException::instance ('Invalid JSON: The given object is not a valid parent ' );
29
29
}
30
30
31
31
$ this ->fillFromRaw ();
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ public static function register()
34
34
35
35
class HttpRecorder
36
36
{
37
- private $ snapshotDirectory = 'snapshots ' ;
37
+ private string $ snapshotDirectory = 'snapshots ' ;
38
38
39
- private $ usePrettyJson = true ;
39
+ private bool $ usePrettyJson = true ;
40
40
41
- private $ requestNames = [];
41
+ private array $ requestNames = [];
42
42
43
43
public function storeIn ($ directory )
44
44
{
You can’t perform that action at this time.
0 commit comments