Passed
Pull Request — master (#91)
by Robbie
02:50
created
src/Forms/ResourceLocatorField.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 
66 66
         // Set a default description
67 67
         $this->setDescription(_t(
68
-            __CLASS__ . '.DESCRIPTION',
68
+            __CLASS__.'.DESCRIPTION',
69 69
             'Connect to a data source from {site}. Once added and saved you can configure the appearance and add search'
70 70
             . ' filters.',
71
-            [ 'site' => $this->getSiteName() ]
71
+            ['site' => $this->getSiteName()]
72 72
         ));
73 73
 
74 74
         $this->addExtraClass('ckan-resource-locator__container');
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $resource = $dataObject->{$this->name};
145 145
 
146 146
         if (!$resource || !$resource instanceof DataObjectInterface) {
147
-            throw new InvalidArgumentException('Could not determine where to save the value of ' . __CLASS__);
147
+            throw new InvalidArgumentException('Could not determine where to save the value of '.__CLASS__);
148 148
         }
149 149
 
150 150
         // Pull the value that'll be null or an associative array of our specification
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     {
192 192
         // Allow empty site names
193 193
         if ($this->siteName === null) {
194
-            return _t(__CLASS__ . '.GENERIC_SITE_NAME', 'a CKAN website');
194
+            return _t(__CLASS__.'.GENERIC_SITE_NAME', 'a CKAN website');
195 195
         }
196 196
 
197 197
         return $this->siteName;
Please login to merge, or discard this patch.
src/Forms/ResultConditionsField.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@
 block discarded – undo
56 56
     public static function getMatchOptions()
57 57
     {
58 58
         return [
59
-            ['value' => self::MATCH_TYPE_MUST, 'title' => _t(__CLASS__ . '.MUST_MATCH', 'Must match')],
60
-            ['value' => self::MATCH_TYPE_MUST_NOT, 'title' => _t(__CLASS__ . '.MUST_NOT_MATCH', 'Must not match')],
59
+            ['value' => self::MATCH_TYPE_MUST, 'title' => _t(__CLASS__.'.MUST_MATCH', 'Must match')],
60
+            ['value' => self::MATCH_TYPE_MUST_NOT, 'title' => _t(__CLASS__.'.MUST_NOT_MATCH', 'Must not match')],
61 61
         ];
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
src/Model/ResourceFilter/Dropdown.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
 
25 25
     public function getCMSFields()
26 26
     {
27
-        $this->beforeUpdateCMSFields(function (FieldList $fields) {
27
+        $this->beforeUpdateCMSFields(function(FieldList $fields) {
28 28
             $fields->push(TextField::create(
29 29
                 'Options',
30
-                _t(__CLASS__ . '.OPTIONS', 'Dropdown options')
30
+                _t(__CLASS__.'.OPTIONS', 'Dropdown options')
31 31
             ));
32 32
         });
33 33
 
Please login to merge, or discard this patch.
src/Model/ResourceField.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function getCMSFields()
56 56
     {
57
-        $this->beforeUpdateCMSFields(function (FieldList $fields) {
57
+        $this->beforeUpdateCMSFields(function(FieldList $fields) {
58 58
             $originalLabel = ReadonlyField::create('OriginalLabel')
59 59
                 ->setDescription(_t(
60
-                    __CLASS__ . '.ORIGINAL_LABEL_DESCRIPTION',
60
+                    __CLASS__.'.ORIGINAL_LABEL_DESCRIPTION',
61 61
                     'Title of this field as provided by the CKAN resource'
62 62
                 ));
63 63
             // See https://github.com/silverstripe/silverstripe-framework/issues/8696
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
             $fields->removeByName('Type');
74 74
 
75 75
             $positionField = NumericField::create('Position')
76
-                ->setTitle(_t(__CLASS__ . '.ORDER_LABEL', 'Presented order'))
76
+                ->setTitle(_t(__CLASS__.'.ORDER_LABEL', 'Presented order'))
77 77
                 ->setDescription(_t(
78
-                    __CLASS__ . '.ORDER_DENOMINATOR',
78
+                    __CLASS__.'.ORDER_DENOMINATOR',
79 79
                     'of {count} fields',
80 80
                     ['count' => static::get()->filter('ResourceID', $this->ResourceID)->count()]
81 81
                 ))
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 ->addExtraClass('visibility-options__option');
91 91
 
92 92
             // Present the visibility fields in a group
93
-            $fields->removeByName(['ShowInSummaryView', 'ShowInDetailView', 'RemoveDuplicates',]);
93
+            $fields->removeByName(['ShowInSummaryView', 'ShowInDetailView', 'RemoveDuplicates', ]);
94 94
             $visibilityOptions = FieldGroup::create('Visibility', [$summary, $detail, $duplicates])
95 95
                 ->addExtraClass('visibility-options');
96 96
             $fields->insertBefore($visibilityOptions, 'Position');
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 'DisplayConditions',
102 102
                 ResultConditionsField::create(
103 103
                     'DisplayConditions',
104
-                    _t(__CLASS__ . '.RESULT_CONDITIONS', 'Result conditions')
104
+                    _t(__CLASS__.'.RESULT_CONDITIONS', 'Result conditions')
105 105
                 )
106 106
             );
107 107
         });
Please login to merge, or discard this patch.
src/Model/ResourceFilter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function getCMSFields()
62 62
     {
63
-        $this->beforeUpdateCMSFields(function (FieldList $fields) {
63
+        $this->beforeUpdateCMSFields(function(FieldList $fields) {
64 64
             $allColumnsField = $fields->dataFieldByName('AllColumns');
65 65
             $allColumnsField->addExtraClass('ckan-columns__all-columns');
66 66
             // See https://github.com/silverstripe/silverstripe-framework/issues/8696
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
             $columnSources = CompositeField::create($allColumnsField, $filterFields);
81 81
             $columnSources
82
-                ->setTitle(_t(__CLASS__ . '.COLUMNS_SOURCES', 'Columns source(s)'))
82
+                ->setTitle(_t(__CLASS__.'.COLUMNS_SOURCES', 'Columns source(s)'))
83 83
                 ->addExtraClass('ckan-columns__sources');
84 84
             $fields->push($columnSources);
85 85
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             return DBField::create_Field(
130 130
                 'HTMLFragment',
131 131
                 '<span class="ckan-columns--all-columns">'
132
-                . _t(__CLASS__ . '.ALL_COLUMNS', 'All columns')
132
+                . _t(__CLASS__.'.ALL_COLUMNS', 'All columns')
133 133
                 . '</span>'
134 134
             );
135 135
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         return DBField::create_Field(
146 146
             'HTMLFragment',
147 147
             '<span class="ckan-columns--multiple">'
148
-            . _t(__CLASS__ . '.MULTIPLE_COLUMNS', 'Multiple columns')
148
+            . _t(__CLASS__.'.MULTIPLE_COLUMNS', 'Multiple columns')
149 149
             . '</span>'
150 150
         );
151 151
     }
Please login to merge, or discard this patch.
src/Service/Client.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     use Injectable;
15 15
 
16 16
     private static $dependencies = [
17
-        'GuzzleClient' => '%$' . \GuzzleHttp\Client::class,
17
+        'GuzzleClient' => '%$'.\GuzzleHttp\Client::class,
18 18
     ];
19 19
 
20 20
     /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         $statusCode = $response->getStatusCode();
61 61
         if ($statusCode < 200 || $statusCode >= 300) {
62
-            throw new RuntimeException('CKAN API is not available. Error code ' . $statusCode);
62
+            throw new RuntimeException('CKAN API is not available. Error code '.$statusCode);
63 63
         }
64 64
 
65 65
         if (!count(preg_grep('#application/json#', $response->getHeader('Content-Type')))) {
Please login to merge, or discard this patch.
src/Service/ResourcePopulator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     use Injectable;
17 17
 
18 18
     private static $dependencies = [
19
-        'Client' => '%$' . ClientInterface::class,
19
+        'Client' => '%$'.ClientInterface::class,
20 20
     ];
21 21
 
22 22
     /**
Please login to merge, or discard this patch.
src/Page/CKANRegistryPage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function getCMSFields()
47 47
     {
48
-        $this->beforeUpdateCMSFields(function (FieldList $fields) {
48
+        $this->beforeUpdateCMSFields(function(FieldList $fields) {
49 49
             $resource = $this->DataResource();
50 50
             $fields->addFieldToTab('Root.Data', ResourceLocatorField::create('DataResource'));
51 51
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                 if ($resource->Name) {
63 63
                     $title = $resource->Name;
64 64
                     if ($resource->ResourceName) {
65
-                        $title .= ' / ' . $resource->ResourceName;
65
+                        $title .= ' / '.$resource->ResourceName;
66 66
                     }
67 67
                     $resourceFields->setTitle($title);
68 68
                 }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
                         $columns = $component->getDisplayFields($resourceFields);
81 81
 
82 82
                         // We only want to change the labels for the GridField view, not the model's edit form
83
-                        $columns['ShowInSummaryView'] = _t(__CLASS__ . '.IN_RESULTS', 'In Results');
84
-                        $columns['ShowInDetailView'] = _t(__CLASS__ . '.IN_DETAIL', 'In Detail');
83
+                        $columns['ShowInSummaryView'] = _t(__CLASS__.'.IN_RESULTS', 'In Results');
84
+                        $columns['ShowInDetailView'] = _t(__CLASS__.'.IN_DETAIL', 'In Detail');
85 85
 
86 86
                         // Abbreviate the position title
87
-                        $columns['Position'] = _t(__CLASS__ . '.POS', 'Pos.', 'Abbreviated version of position');
87
+                        $columns['Position'] = _t(__CLASS__.'.POS', 'Pos.', 'Abbreviated version of position');
88 88
 
89 89
                         $editable = array_flip(['ShowInSummaryView', 'ShowInDetailView']);
90 90
                         $component->setDisplayFields(array_diff_key($columns, $editable));
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $fields = parent::getSettingsFields();
120 120
 
121 121
         $fields->addFieldsToTab('Root.Settings', [
122
-            TextField::create('ItemsPerPage', _t(__CLASS__ . '.ITEMS_PER_PAGE', 'Items per page')),
122
+            TextField::create('ItemsPerPage', _t(__CLASS__.'.ITEMS_PER_PAGE', 'Items per page')),
123 123
         ]);
124 124
 
125 125
         return $fields;
Please login to merge, or discard this patch.