Skip to content

Commit 51cb90c

Browse files
committed
Code styling
1 parent 239e1f8 commit 51cb90c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/Actions/InjectStructuredDataAction.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Justbetter\StatamicStructuredData\Actions;
44

5-
use Illuminate\Http\Request;
65
use Justbetter\StatamicStructuredData\Services\StructuredDataService;
76
use Statamic\Entries\Entry;
87
use Statamic\Facades\Entry as EntryFacade;
@@ -14,12 +13,7 @@
1413

1514
class InjectStructuredDataAction
1615
{
17-
protected $structuredDataService;
18-
19-
public function __construct(StructuredDataService $structuredDataService)
20-
{
21-
$this->structuredDataService = $structuredDataService;
22-
}
16+
public function __construct(protected StructuredDataService $structuredDataService) {}
2317

2418
public function execute(): ?string
2519
{
@@ -38,7 +32,7 @@ public function execute(): ?string
3832
return null;
3933
}
4034

41-
protected function handleEntry($entry): ?string
35+
protected function handleEntry(Entry|Page $entry): ?string
4236
{
4337
if ($entry instanceof Page) {
4438
$entry = $entry->entry();
@@ -53,7 +47,7 @@ protected function handleEntry($entry): ?string
5347
return $this->handleScripts($entry);
5448
}
5549

56-
protected function handleTaxonomy($term): ?string
50+
protected function handleTaxonomy(LocalizedTerm $term): ?string
5751
{
5852
$enabledTaxonomies = config('justbetter.structured-data.taxonomies', []);
5953

@@ -64,7 +58,7 @@ protected function handleTaxonomy($term): ?string
6458
return $this->handleScripts($term);
6559
}
6660

67-
protected function handleScripts($item): ?string
61+
protected function handleScripts(mixed $item): ?string
6862
{
6963
$scripts = $this->structuredDataService->getJsonLdScripts($item);
7064

0 commit comments

Comments
 (0)