diff --git a/src/Extensions/SearchServiceExtension.php b/src/Extensions/SearchServiceExtension.php index 849d9e8..eadfea3 100644 --- a/src/Extensions/SearchServiceExtension.php +++ b/src/Extensions/SearchServiceExtension.php @@ -41,7 +41,7 @@ class SearchServiceExtension extends DataExtension 'SearchIndexed' => 'Datetime', ]; - private static $defaults = [ + private static array $defaults = [ 'ShowInSearch' => true, ]; @@ -65,8 +65,14 @@ public function updateCMSFields(FieldList $fields): void return; } - $showInSearchField = CheckboxField::create("ShowInSearch", _t(self::class . '.ShowInSearch', 'Show in search?')); - $searchIndexedField = ReadonlyField::create('SearchIndexed', _t(self::class . '.LastIndexed', 'Last indexed in search')); + $showInSearchField = CheckboxField::create( + 'ShowInSearch', + _t(self::class . '.ShowInSearch', 'Show in search?') + ); + $searchIndexedField = ReadonlyField::create( + 'SearchIndexed', + _t(self::class . '.LastIndexed', 'Last indexed in search') + ); if ($fields->hasTabSet()) { $fields->addFieldToTab('Root.Main', $showInSearchField); diff --git a/tests/Extensions/SearchFormFactoryExtensionTest.php b/tests/Extensions/SearchFormFactoryExtensionTest.php index b5c412e..ffd1288 100644 --- a/tests/Extensions/SearchFormFactoryExtensionTest.php +++ b/tests/Extensions/SearchFormFactoryExtensionTest.php @@ -2,19 +2,19 @@ namespace SilverStripe\SearchService\Tests\Extensions; -use SilverStripe\Forms\Form; use SilverStripe\Assets\File; use SilverStripe\Assets\Image; -use SilverStripe\Forms\TabSet; -use SilverStripe\Forms\FieldList; -use SilverStripe\Dev\SapphireTest; use SilverStripe\Core\Config\Config; +use SilverStripe\Dev\SapphireTest; +use SilverStripe\Forms\FieldList; +use SilverStripe\Forms\Form; +use SilverStripe\Forms\TabSet; use SilverStripe\SearchService\Extensions\SearchFormFactoryExtension; class SearchFormFactoryExtensionTest extends SapphireTest { - protected static $fixture_file = [ + protected static $fixture_file = [ // phpcs:ignore '../fixtures.yml', '../pages.yml', ];