| @@ -18,7 +18,7 @@ discard block | ||
| 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 | ||
| 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')))) { | 
| @@ -65,10 +65,10 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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; | 
| @@ -56,8 +56,8 @@ | ||
| 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 | } | 
| @@ -78,8 +78,8 @@ | ||
| 78 | 78 | public static function getSelectTypes() | 
| 79 | 79 |      { | 
| 80 | 80 | return [ | 
| 81 | - ['value' => self::SELECT_TYPE_ALL, 'title' => _t(__CLASS__ . '.SELECT_ALL', 'Select from all options')], | |
| 82 | - ['value' => self::SELECT_TYPE_CUSTOM, 'title' => _t(__CLASS__ . '.SELECT_CUSTOM', 'Manually add options')], | |
| 81 | + ['value' => self::SELECT_TYPE_ALL, 'title' => _t(__CLASS__.'.SELECT_ALL', 'Select from all options')], | |
| 82 | + ['value' => self::SELECT_TYPE_CUSTOM, 'title' => _t(__CLASS__.'.SELECT_CUSTOM', 'Manually add options')], | |
| 83 | 83 | ]; | 
| 84 | 84 | } | 
| 85 | 85 | |
| @@ -45,7 +45,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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; | 
| @@ -54,10 +54,10 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | }); | 
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | |
| 26 | 26 | public function getCMSFields() | 
| 27 | 27 |      { | 
| 28 | -        $this->beforeUpdateCMSFields(function (FieldList $fields) { | |
| 28 | +        $this->beforeUpdateCMSFields(function(FieldList $fields) { | |
| 29 | 29 |              $fields->addFieldToTab('Root.Main', PresentedOptionsField::create( | 
| 30 | 30 | 'Options', | 
| 31 | 31 | $this->FilterFor, | 
| 32 | - _t(__CLASS__ . '.OPTIONS', 'Presented options') | |
| 32 | + _t(__CLASS__.'.OPTIONS', 'Presented options') | |
| 33 | 33 | )); | 
| 34 | 34 | }); | 
| 35 | 35 | |
| @@ -60,7 +60,7 @@ discard block | ||
| 60 | 60 | |
| 61 | 61 | public function getCMSFields() | 
| 62 | 62 |      { | 
| 63 | -        $this->beforeUpdateCMSFields(function (FieldList $fields) { | |
| 63 | +        $this->beforeUpdateCMSFields(function(FieldList $fields) { | |
| 64 | 64 |              $fields->removeByName('FilterFields'); | 
| 65 | 65 | |
| 66 | 66 |              $allColumnsField = $fields->dataFieldByName('AllColumns'); | 
| @@ -81,7 +81,7 @@ discard block | ||
| 81 | 81 | |
| 82 | 82 | $columnSources = CompositeField::create($allColumnsField, $filterFields); | 
| 83 | 83 | $columnSources | 
| 84 | - ->setTitle(_t(__CLASS__ . '.COLUMNS_SOURCES', 'Columns source(s)')) | |
| 84 | + ->setTitle(_t(__CLASS__.'.COLUMNS_SOURCES', 'Columns source(s)')) | |
| 85 | 85 |                  ->addExtraClass('ckan-columns__sources'); | 
| 86 | 86 |              $fields->addFieldToTab('Root.Main', $columnSources); | 
| 87 | 87 | |
| @@ -131,7 +131,7 @@ discard block | ||
| 131 | 131 | return DBField::create_Field( | 
| 132 | 132 | 'HTMLFragment', | 
| 133 | 133 | '<span class="ckan-columns--all-columns">' | 
| 134 | - . _t(__CLASS__ . '.ALL_COLUMNS', 'All columns') | |
| 134 | + . _t(__CLASS__.'.ALL_COLUMNS', 'All columns') | |
| 135 | 135 | . '</span>' | 
| 136 | 136 | ); | 
| 137 | 137 | } | 
| @@ -147,7 +147,7 @@ discard block | ||
| 147 | 147 | return DBField::create_Field( | 
| 148 | 148 | 'HTMLFragment', | 
| 149 | 149 | '<span class="ckan-columns--multiple">' | 
| 150 | - . _t(__CLASS__ . '.MULTIPLE_COLUMNS', 'Multiple columns') | |
| 150 | + . _t(__CLASS__.'.MULTIPLE_COLUMNS', 'Multiple columns') | |
| 151 | 151 | . '</span>' | 
| 152 | 152 | ); | 
| 153 | 153 | } |