Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
amolswnz committed Apr 29, 2024
1 parent 6b5b1a7 commit 71187de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 9 additions & 3 deletions src/Extensions/SearchServiceExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SearchServiceExtension extends DataExtension
'SearchIndexed' => 'Datetime',
];

private static $defaults = [
private static array $defaults = [
'ShowInSearch' => true,
];

Expand All @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions tests/Extensions/SearchFormFactoryExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
Expand Down

0 comments on commit 71187de

Please sign in to comment.