From 4ccec8eddc3a6b57835b156e0fbf45f2bdb5bd70 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Tue, 5 May 2020 09:47:29 +1200 Subject: [PATCH 1/2] Removal an empty if condition block --- src/Extensions/FileFormFactoryTaxonomyExtension.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Extensions/FileFormFactoryTaxonomyExtension.php b/src/Extensions/FileFormFactoryTaxonomyExtension.php index 54a60b5..599dc28 100644 --- a/src/Extensions/FileFormFactoryTaxonomyExtension.php +++ b/src/Extensions/FileFormFactoryTaxonomyExtension.php @@ -38,9 +38,6 @@ public function updateFormFields(FieldList $fields, $controller, $formName, $con $record = $context['Record']; if (!is_a($record, Folder::class)) { - if ($formName === 'fileEditForm') { - } - $tags = TreeMultiselectField::create( 'Tags', _t(self::class . '.Tags', 'Tags'), From 877a72a59e7fa917aa3f8a998cdd3376f8c977d4 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Tue, 5 May 2020 09:51:25 +1200 Subject: [PATCH 2/2] Apply CS --- src/Extensions/DataObjectTaxonomiesDataExtension.php | 9 +-------- src/Forms/FieldsProvider.php | 3 --- src/Models/TaxonomyTerm.php | 2 +- src/Tasks/RemoveOrphanedTagRelationObjectsTask.php | 1 - tests/TaxonomyTermTest.php | 2 -- 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/Extensions/DataObjectTaxonomiesDataExtension.php b/src/Extensions/DataObjectTaxonomiesDataExtension.php index 6321615..bd8eef8 100644 --- a/src/Extensions/DataObjectTaxonomiesDataExtension.php +++ b/src/Extensions/DataObjectTaxonomiesDataExtension.php @@ -8,18 +8,11 @@ use Chrometoaster\AdvancedTaxonomies\Validators\TaxonomyRulesValidator; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\GridField\GridField; -use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter; -use SilverStripe\Forms\GridField\GridFieldAddNewButton; -use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor; -use SilverStripe\Forms\GridField\GridFieldDataColumns; -use SilverStripe\Forms\GridField\GridFieldEditButton; -use SilverStripe\Forms\GridField\GridFieldFilterHeader; use SilverStripe\Forms\LiteralField; use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataList; use SilverStripe\ORM\FieldType\DBField; use SilverStripe\ORM\FieldType\DBHTMLText; -use SilverStripe\Versioned\GridFieldArchiveAction; /** * Class DataObjectTaxonomiesDataExtension @@ -70,7 +63,7 @@ public function updateCMSFields(FieldList $fields) $gridFieldConfig = FieldsProvider::getTaggingGridFieldConfig( $searchList, - ['getAllRequiredTypesNames' => 'Requires'] + ['getAllRequiredTypesNames' => 'Requires'] ); $fields->findOrMakeTab('Root.Tags', _t(self::class . '.TagsTabTitle', 'Tags')); diff --git a/src/Forms/FieldsProvider.php b/src/Forms/FieldsProvider.php index 974d9d5..96cfbc4 100644 --- a/src/Forms/FieldsProvider.php +++ b/src/Forms/FieldsProvider.php @@ -3,9 +3,6 @@ namespace Chrometoaster\AdvancedTaxonomies\Forms; use Chrometoaster\AdvancedTaxonomies\Models\TaxonomyTerm; -use Chrometoaster\AdvancedTaxonomies\Forms\GridFieldAddTagsAutocompleter; -use Chrometoaster\AdvancedTaxonomies\Forms\GridFieldInfoLink; -use Chrometoaster\AdvancedTaxonomies\Forms\GridFieldOrderableRows; use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter; use SilverStripe\Forms\GridField\GridFieldAddNewButton; use SilverStripe\Forms\GridField\GridFieldConfig; diff --git a/src/Models/TaxonomyTerm.php b/src/Models/TaxonomyTerm.php index 0a649b5..a49a989 100644 --- a/src/Models/TaxonomyTerm.php +++ b/src/Models/TaxonomyTerm.php @@ -36,8 +36,8 @@ use SilverStripe\Security\Permission; use SilverStripe\Security\PermissionProvider; use SilverStripe\Versioned\GridFieldArchiveAction; -use SilverStripe\View\ViewableData; use SilverStripe\View\ArrayData; +use SilverStripe\View\ViewableData; use UndefinedOffset\SortableGridField\Forms\GridFieldSortableRows; /** diff --git a/src/Tasks/RemoveOrphanedTagRelationObjectsTask.php b/src/Tasks/RemoveOrphanedTagRelationObjectsTask.php index 3bf1296..917accb 100644 --- a/src/Tasks/RemoveOrphanedTagRelationObjectsTask.php +++ b/src/Tasks/RemoveOrphanedTagRelationObjectsTask.php @@ -8,7 +8,6 @@ use SilverStripe\Control\HTTPRequest; use SilverStripe\Core\ClassInfo; use SilverStripe\Dev\BuildTask; -use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObjectSchema; use SilverStripe\ORM\DB; diff --git a/tests/TaxonomyTermTest.php b/tests/TaxonomyTermTest.php index b789792..926a26e 100644 --- a/tests/TaxonomyTermTest.php +++ b/tests/TaxonomyTermTest.php @@ -6,7 +6,6 @@ use Chrometoaster\AdvancedTaxonomies\Tests\Models\OwnerObject; use Chrometoaster\AdvancedTaxonomies\Validators\TaxonomyRulesValidator; use SilverStripe\Dev\SapphireTest; -use SilverStripe\ORM\ManyManyThroughList; use SilverStripe\ORM\ValidationException; use SilverStripe\Versioned\Versioned; @@ -587,5 +586,4 @@ public function testTaggedObjectsCollectionMechanism() 'tagForTaggedObjects should show one tagged objects after a tag removal' ); } - }