Passed
Pull Request — master (#64)
by Robbie
03:35
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.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@
 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
             $fields->push(ListboxField::create(
59 59
                 'FilterFields',
60
-                _t(__CLASS__ . '.COLUMNS_TO_SEARCH', 'Columns to search'),
60
+                _t(__CLASS__.'.COLUMNS_TO_SEARCH', 'Columns to search'),
61 61
                 $this->FilterFor()->Fields()->map('ID', 'ReadableName')
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  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
             $originalTitle = ReadonlyField::create('Name', _t(
59
-                __CLASS__ . '.ORIGINAL_TITLE',
59
+                __CLASS__.'.ORIGINAL_TITLE',
60 60
                 'Original title'
61 61
             ))->setDescription(_t(
62
-                __CLASS__ . '.ORIGINAL_TITLE_DESCRIPTION',
62
+                __CLASS__.'.ORIGINAL_TITLE_DESCRIPTION',
63 63
                 'Title of this field as provided by the CKAN resource'
64 64
             ));
65 65
             $fields->replaceField('Name', $originalTitle);
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
             $fields->dataFieldByName('ReadableName')
69 69
                 ->setAttribute('placeholder', $this->Name);
70 70
             $orderField = NumericField::create('Order')
71
-                ->setTitle(_t(__CLASS__ . '.ORDER_LABEL', 'Presented order'))
71
+                ->setTitle(_t(__CLASS__.'.ORDER_LABEL', 'Presented order'))
72 72
                 ->setDescription(_t(
73
-                    __CLASS__ . '.ORDER_DENOMINATOR',
73
+                    __CLASS__.'.ORDER_DENOMINATOR',
74 74
                     'of {count} fields',
75 75
                     ['count' => static::get()->filter('ResourceID', $this->ResourceID)->count()]
76 76
                 ))
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             $duplicates = $fields->dataFieldByName('RemoveDuplicates')
85 85
                 ->addExtraClass('visibility-options__option');
86 86
 
87
-            $fields->removeByName(['ShowInSummaryView', 'ShowInDetailView', 'RemoveDuplicates',]);
87
+            $fields->removeByName(['ShowInSummaryView', 'ShowInDetailView', 'RemoveDuplicates', ]);
88 88
             $visibilityOptions = FieldGroup::create('Visibility', [$summary, $detail, $duplicates])
89 89
                 ->addExtraClass('visibility-options');
90 90
             $fields->insertBefore($visibilityOptions, 'Order');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 'DisplayConditions',
96 96
                 ResultConditionsField::create(
97 97
                     'DisplayConditions',
98
-                    _t(__CLASS__ . '.RESULT_CONDITIONS', 'Result conditions')
98
+                    _t(__CLASS__.'.RESULT_CONDITIONS', 'Result conditions')
99 99
                 )
100 100
             );
101 101
         });
Please login to merge, or discard this patch.
src/Page/CKANRegistryPage.php 1 patch
Spacing   +4 added lines, -4 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,8 +71,8 @@  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
                         $editable = array_flip(['ShowInSummaryView', 'ShowInDetailView']);
78 78
                         $component->setDisplayFields(array_diff_key($columns, $editable));
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $fields = parent::getSettingsFields();
108 108
 
109 109
         $fields->addFieldsToTab('Root.Settings', [
110
-            TextField::create('ItemsPerPage', _t(__CLASS__ . '.ITEMS_PER_PAGE', 'Items per page')),
110
+            TextField::create('ItemsPerPage', _t(__CLASS__.'.ITEMS_PER_PAGE', 'Items per page')),
111 111
         ]);
112 112
 
113 113
         return $fields;
Please login to merge, or discard this patch.