Skip to content

Commit afd4a52

Browse files
Merge pull request #337 from creative-commoners/pulls/3.0/remove-self
ENH Use class name instead of self
2 parents 8f5778a + cfcd454 commit afd4a52

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/PageTypes/DatedUpdateHolder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public static function AllUpdates(
152152
// Try running query inside try/catch block to handle any invalid date format
153153
$items->dataQuery()->execute();
154154
} catch (DatabaseException $e) {
155-
self::handleInvalidDateFormat($e);
155+
DatedUpdateHolder::handleInvalidDateFormat($e);
156156
// Ensure invalid SQL does not get run again
157157
$items = $className::get()->limit(null);
158158
}
@@ -213,7 +213,7 @@ public static function ExtractMonths(
213213
])
214214
->execute();
215215
} catch (DatabaseException $e) {
216-
self::handleInvalidDateFormat($e);
216+
DatedUpdateHolder::handleInvalidDateFormat($e);
217217
}
218218

219219
$years = [];

src/PageTypes/DatedUpdateHolderController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function parseParams($produceErrorMessages = true)
177177
}
178178
} catch (InvalidArgumentException $e) {
179179
if ($produceErrorMessages) {
180-
$this->getRequest()->getSession()->set(self::TEMP_FORM_MESSAGE, _t(
180+
$this->getRequest()->getSession()->set(DatedUpdateHolderController::TEMP_FORM_MESSAGE, _t(
181181
__CLASS__ . '.InvalidDateFormat',
182182
'Dates must be in "y-MM-dd" format.'
183183
));
@@ -200,7 +200,7 @@ public function parseParams($produceErrorMessages = true)
200200
list($to, $from) = [$from, $to];
201201

202202
if ($produceErrorMessages) {
203-
$this->getRequest()->getSession()->set(self::TEMP_FORM_MESSAGE, _t(
203+
$this->getRequest()->getSession()->set(DatedUpdateHolderController::TEMP_FORM_MESSAGE, _t(
204204
__CLASS__ . '.FilterAppliedMessage',
205205
'Filter has been applied with the dates reversed.'
206206
));
@@ -210,7 +210,7 @@ public function parseParams($produceErrorMessages = true)
210210
// Notify the user that filtering by single date is taking place.
211211
if (isset($from) && !isset($to)) {
212212
if ($produceErrorMessages) {
213-
$this->getRequest()->getSession()->set(self::TEMP_FORM_MESSAGE, _t(
213+
$this->getRequest()->getSession()->set(DatedUpdateHolderController::TEMP_FORM_MESSAGE, _t(
214214
__CLASS__ . '.DateRangeFilterMessage',
215215
'Filtered by a single date.'
216216
));
@@ -347,9 +347,9 @@ public function DateRangeForm()
347347
$form->setFormMethod('get');
348348

349349
// Add any locally stored form messages before returning
350-
if ($formMessage = $this->getRequest()->getSession()->get(self::TEMP_FORM_MESSAGE)) {
350+
if ($formMessage = $this->getRequest()->getSession()->get(DatedUpdateHolderController::TEMP_FORM_MESSAGE)) {
351351
$form->setMessage($formMessage, ValidationResult::TYPE_WARNING);
352-
$this->getRequest()->getSession()->clear(self::TEMP_FORM_MESSAGE);
352+
$this->getRequest()->getSession()->clear(DatedUpdateHolderController::TEMP_FORM_MESSAGE);
353353
}
354354

355355
return $form;

0 commit comments

Comments
 (0)