diff --git a/src/Endpoints/Page.php b/src/Endpoints/Page.php index 959a236..75b4749 100644 --- a/src/Endpoints/Page.php +++ b/src/Endpoints/Page.php @@ -12,7 +12,6 @@ */ class Page extends Endpoint { - /** * @var ?string */ @@ -25,12 +24,12 @@ public function __construct(Notion $notion, string $pageId) } /** - * Retrieve a page property item - * + * Retrieve a page property item. + * * @url https://api.notion.com/{version}/pages/{page_id}/properties/{property_id} [get] * * @reference https://developers.notion.com/reference/retrieve-a-page-property. - * + * * @param string $propertyId * @return Page * @@ -40,7 +39,7 @@ public function __construct(Notion $notion, string $pageId) public function property(string $propertyId): Property { $response = $this->get( - $this->url(Endpoint::PAGES . '/' . $this->pageId . '/' . 'properties' . '/' . urlencode($propertyId)) + $this->url(Endpoint::PAGES.'/'.$this->pageId.'/'.'properties'.'/'.urlencode($propertyId)) ); return Property::fromResponse( diff --git a/src/Macros/PestHttpRecorder.php b/src/Macros/PestHttpRecorder.php index f4452e7..cdc5266 100644 --- a/src/Macros/PestHttpRecorder.php +++ b/src/Macros/PestHttpRecorder.php @@ -14,7 +14,7 @@ class PestHttpRecorder public static function register() { Http::macro('recordAndFakeLater', function (array|string $urls = ['*']) { - if (!is_array($urls)) { + if (! is_array($urls)) { $urls = [$urls]; } @@ -73,7 +73,9 @@ public function handle(Request $request) $payload = ($method === 'get') ? ($urlInfo['query'] ?? null) : $request->body(); $queryName = array_pop($this->requestNames) ?? ($payload ? hash('adler32', $payload) : ''); - if ($queryName != '') $queryName = '_' . $queryName; + if ($queryName != '') { + $queryName = '_'.$queryName; + } $fileName = "{$method}_{$name}{$queryName}.json"; $directoryPath = "tests/{$this->snapshotDirectory}"; @@ -82,7 +84,7 @@ public function handle(Request $request) // filter out Notion API Token Header $header = Arr::except($header, ['Authorization']); - if ($forceRecording || !File::exists($filePath)) { + if ($forceRecording || ! File::exists($filePath)) { File::makeDirectory($directoryPath, 0744, true, true); $client = new Client(); diff --git a/src/Notion.php b/src/Notion.php index e4ad88b..8082671 100644 --- a/src/Notion.php +++ b/src/Notion.php @@ -238,7 +238,7 @@ public function getConnection(): ?PendingRequest */ public function checkValidVersion(string $version): void { - if (!$this->validVersions->contains($version)) { + if (! $this->validVersions->contains($version)) { throw HandlingException::instance('Invalid version for Notion-API endpoint', ['invalidVersion' => $version]); } } diff --git a/tests/RecordedEndpointPageTest.php b/tests/RecordedEndpointPageTest.php index cc07b3e..d869661 100644 --- a/tests/RecordedEndpointPageTest.php +++ b/tests/RecordedEndpointPageTest.php @@ -1,11 +1,6 @@ httpRecorder->nameForNextRequest('database-for-properties'); $databaseStructure = \Notion::databases()->find('cdd4befe814144f7b1eecb9c123bd4fb'); @@ -26,8 +20,9 @@ foreach ($propertyKeys as $propertyKey) { try { - - if ($propertyKey == 'Rollup' || $propertyKey == 'Person' || $propertyKey == 'Name') continue; + if ($propertyKey == 'Rollup' || $propertyKey == 'Person' || $propertyKey == 'Name') { + continue; + } $id = $databaseStructure->getProperty($propertyKey)->getId(); $property = \Notion::page('f1884dca3885460e93f52bf4da7cce8e')->property($id);