Skip to content

Commit

Permalink
Fix PHP 7.4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Jul 1, 2021
1 parent ec86a69 commit 43f0075
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/SyncResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ public function __construct(string $title, int $syncState)

public function getStateIcon(): string
{
return match ($this->syncState) {
SyncResultState::Pending => '🚧',
SyncResultState::Published => '',
SyncResultState::Trashed => '🗑',
};
switch ($this->syncState) {
case SyncResultState::Pending: return '🚧';
case SyncResultState::Published: return '';
case SyncResultState::Trashed: return '🗑';
default: return '';
}
}
}
2 changes: 1 addition & 1 deletion src/Syncable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private function __construct(string $bearParentTag, string $collection, string $
$this->taxonomyField = $statamicTaxonomyField;
}

public static function fromConfig(string $bearParentTag, array $statamicProperties): static
public static function fromConfig(string $bearParentTag, array $statamicProperties): self
{
throw_unless($bearParentTag, Exception::class, 'BearHub: Configuration error with syncables - Bear Parent Tag');
throw_unless(isset($statamicProperties['collection']), Exception::class, 'BearHub: Configuration error with syncables - Statamic Collection');
Expand Down

0 comments on commit 43f0075

Please sign in to comment.