Passed
Pull Request — master (#63)
by
unknown
02:12
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/ResourceField.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
 
56 56
     public function getCMSFields()
57 57
     {
58
-        $this->beforeUpdateCMSFields(function (FieldList $fields) {
58
+        $this->beforeUpdateCMSFields(function(FieldList $fields) {
59 59
             $originalTitle = ReadonlyField::create('Name', i18n::_t(
60
-                __CLASS__ . '.ORIGINAL_TITLE',
60
+                __CLASS__.'.ORIGINAL_TITLE',
61 61
                 'Original title'
62 62
             ))->setDescription(i18n::_t(
63
-                __CLASS__ . '.ORIGINAL_TITLE_DESCRIPTION',
63
+                __CLASS__.'.ORIGINAL_TITLE_DESCRIPTION',
64 64
                 'Title of this field as provided by the CKAN resource'
65 65
             ));
66 66
             $fields->replaceField('Name', $originalTitle);
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
             $fields->dataFieldByName('ReadableName')
70 70
                 ->setAttribute('placeholder', $this->Name);
71 71
             $orderField = NumericField::create('Order')
72
-                ->setTitle(i18n::_t(__CLASS__ . '.ORDER_LABEL', 'Presented order'))
72
+                ->setTitle(i18n::_t(__CLASS__.'.ORDER_LABEL', 'Presented order'))
73 73
                 ->setDescription(i18n::_t(
74
-                    __CLASS__ . '.ORDER_DENOMINATOR',
74
+                    __CLASS__.'.ORDER_DENOMINATOR',
75 75
                     'of {count} fields',
76 76
                     ['count' => static::get()->filter('ResourceID', $this->ResourceID)->count()]
77 77
                 ))
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $duplicates = $fields->dataFieldByName('RemoveDuplicates')
86 86
                 ->addExtraClass('visibility-options__option');
87 87
 
88
-            $fields->removeByName(['ShowInSummaryView', 'ShowInDetailView', 'RemoveDuplicates',]);
88
+            $fields->removeByName(['ShowInSummaryView', 'ShowInDetailView', 'RemoveDuplicates', ]);
89 89
             $visibilityOptions = FieldGroup::create('Visibility', [$summary, $detail, $duplicates])
90 90
                 ->addExtraClass('visibility-options');
91 91
             $fields->insertBefore($visibilityOptions, 'Order');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 'DisplayConditions',
97 97
                 ResultConditionsField::create(
98 98
                     'DisplayConditions',
99
-                    i18n::_t(__CLASS__ . '.RESULT_CONDITIONS', 'Result conditions')
99
+                    i18n::_t(__CLASS__.'.RESULT_CONDITIONS', 'Result conditions')
100 100
                 )
101 101
             );
102 102
         });
Please login to merge, or discard this patch.
src/Page/CKANRegistryPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function getCMSFields()
45 45
     {
46
-        $this->beforeUpdateCMSFields(function (FieldList $fields) {
46
+        $this->beforeUpdateCMSFields(function(FieldList $fields) {
47 47
             $resource = $this->DataResource();
48 48
             $fields->addFieldToTab('Root.Data', ResourceLocatorField::create('DataResource'));
49 49
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $fields = parent::getSettingsFields();
78 78
 
79 79
         $fields->addFieldsToTab('Root.Settings', [
80
-            TextField::create('ItemsPerPage', _t(__CLASS__ . '.ITEMS_PER_PAGE', 'Items per page')),
80
+            TextField::create('ItemsPerPage', _t(__CLASS__.'.ITEMS_PER_PAGE', 'Items per page')),
81 81
         ]);
82 82
 
83 83
         return $fields;
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.