Skip to content

Apply fixes from StyleCI #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Builder/DatabaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function createInPage($pageId): Database
{
$this->payload['parent'] = [
'type' => 'page_id',
'page_id' => $pageId
'page_id' => $pageId,
];

if ($this->payload['properties'] === []) {
Expand Down Expand Up @@ -66,6 +66,7 @@ public function inline(): DatabaseBuilder
public function addTitle($name = 'Name')
{
$this->add(PropertyBuilder::title($name));

return $this;
}

Expand All @@ -90,6 +91,7 @@ public function scheme(callable $callback): DatabaseBuilder
{
$builder = new DatabaseSchemeBuilder();
$callback($builder);

return $this->add($builder);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Builder/DatabaseSchemeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace FiveamCode\LaravelNotionApi\Builder;

use FiveamCode\LaravelNotionApi\Entities\Properties\Property;
use Illuminate\Support\Collection;

/**
Expand All @@ -20,6 +19,7 @@ public function __construct()
public function push(PropertyBuilder $builder): DatabaseSchemeBuilder
{
$this->properties->push($builder);

return $this;
}

Expand Down
9 changes: 4 additions & 5 deletions src/Builder/PropertyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/
class PropertyBuilder
{

public static function bulk(): DatabaseSchemeBuilder
{
return new DatabaseSchemeBuilder();
Expand Down Expand Up @@ -85,7 +84,7 @@ public static function relation(string $name, string $databaseId): PropertyBuild
public static function formula(string $name, string $expression)
{
return self::raw($name, Property::FORMULA, [
'expression' => $expression
'expression' => $expression,
]);
}

Expand All @@ -99,7 +98,7 @@ public static function rollupByName(string $name, string $rollupPropertyName, st
return self::raw($name, Property::ROLLUP, [
'relation_property_name' => $relationPropertyName,
'rollup_property_name' => $rollupPropertyName,
'function' => $function
'function' => $function,
]);
}

Expand All @@ -108,7 +107,7 @@ public static function rollupById(string $name, string $rollupPropertyId, string
return self::raw($name, Property::ROLLUP, [
'relation_property_id' => $relationPropertyId,
'rollup_property_id' => $rollupPropertyId,
'function' => $function
'function' => $function,
]);
}

Expand Down Expand Up @@ -164,7 +163,7 @@ private function __construct(private string $name, private array $payload)
public function getName(): string
{
if ($this->name == '') {
throw new HandlingException("Properties must have a name. No name given for the property structure:" . json_encode($this->payload));
throw new HandlingException('Properties must have a name. No name given for the property structure:'.json_encode($this->payload));
}

return $this->name;
Expand Down