Various code cleanup.

This commit is contained in:
James Cole
2021-05-24 08:50:17 +02:00
parent 3ec9753808
commit 815fd5ff6b
135 changed files with 643 additions and 582 deletions

View File

@@ -38,7 +38,7 @@ class IsDateOrTime implements Rule
/**
* Get the validation error message.
*
* @return string|array
* @return string
* @codeCoverageIgnore
*/
public function message()

View File

@@ -63,10 +63,10 @@ class ValidRecurrenceRepetitionType implements Rule
if (in_array(substr($value, 0, 6), ['yearly', 'weekly'])) {
return true;
}
if (0 === strpos($value, 'monthly')) {
if (str_starts_with($value, 'monthly')) {
return true;
}
if (0 === strpos($value, 'ndom')) {
if (str_starts_with($value, 'ndom')) {
return true;
}

View File

@@ -62,23 +62,23 @@ class ValidRecurrenceRepetitionValue implements Rule
return true;
}
if (0 === strpos($value, 'monthly')) {
if (str_starts_with($value, 'monthly')) {
return $this->validateMonthly($value);
}
// Value is like: ndom,3,7
// nth x-day of the month.
if (0 === strpos($value, 'ndom')) {
if (str_starts_with($value, 'ndom')) {
return $this->validateNdom($value);
}
// Value is like: weekly,7
if (0 === strpos($value, 'weekly')) {
if (str_starts_with($value, 'weekly')) {
return $this->validateWeekly($value);
}
// Value is like: yearly,2018-01-01
if (0 === strpos($value, 'yearly')) {
if (str_starts_with($value, 'yearly')) {
return $this->validateYearly($value);
}