Passed
Pull Request — master (#78)
by Robbie
02:37
created
src/Service/ResourceFieldPopulator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     use Injectable;
19 19
 
20 20
     private static $dependencies = [
21
-        'GuzzleClient' => '%$' . Client::class,
21
+        'GuzzleClient' => '%$'.Client::class,
22 22
     ];
23 23
 
24 24
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         $statusCode = $response->getStatusCode();
86 86
         if ($statusCode < 200 || $statusCode >= 300) {
87
-            throw new RuntimeException('CKAN API is not available. Error code ' . $statusCode);
87
+            throw new RuntimeException('CKAN API is not available. Error code '.$statusCode);
88 88
         }
89 89
 
90 90
         if (!count(preg_grep('#application/json#', $response->getHeader('Content-Type')))) {
Please login to merge, or discard this patch.
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/Page/CKANRegistryPage.php 1 patch
Spacing   +5 added lines, -5 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
 
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
                         $columns = $component->getDisplayFields($resourceFields);
72 72
 
73 73
                         // We only want to change the labels for the GridField view, not the model's edit form
74
-                        $columns['ShowInSummaryView'] = _t(__CLASS__ . '.IN_RESULTS', 'In Results');
75
-                        $columns['ShowInDetailView'] = _t(__CLASS__ . '.IN_DETAIL', 'In Detail');
74
+                        $columns['ShowInSummaryView'] = _t(__CLASS__.'.IN_RESULTS', 'In Results');
75
+                        $columns['ShowInDetailView'] = _t(__CLASS__.'.IN_DETAIL', 'In Detail');
76 76
 
77 77
                         // Abbreviate the position title
78
-                        $columns['Position'] = _t(__CLASS__ . '.POS', 'Pos.', 'Abbreviated version of position');
78
+                        $columns['Position'] = _t(__CLASS__.'.POS', 'Pos.', 'Abbreviated version of position');
79 79
 
80 80
                         $editable = array_flip(['ShowInSummaryView', 'ShowInDetailView']);
81 81
                         $component->setDisplayFields(array_diff_key($columns, $editable));
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $fields = parent::getSettingsFields();
111 111
 
112 112
         $fields->addFieldsToTab('Root.Settings', [
113
-            TextField::create('ItemsPerPage', _t(__CLASS__ . '.ITEMS_PER_PAGE', 'Items per page')),
113
+            TextField::create('ItemsPerPage', _t(__CLASS__.'.ITEMS_PER_PAGE', 'Items per page')),
114 114
         ]);
115 115
 
116 116
         return $fields;
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.