PluginProbe
Metricool – Social media and site statistics / 2.1.1
Metricool – Social media and site statistics v2.1.1
2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
metricool / app / Features / UserSettings / Rules / FirstDayOfWeekRule.php

FirstDayOfWeekRule.php in Metricool – Social media and site statistics 2.1.1, at app/Features/UserSettings/Rules/FirstDayOfWeekRule.php

22 lines 531 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Metricool\Features\UserSettings\Rules;
6
7 use Metricool\Support\Validation\Rules\AbstractRule;
8
9 class FirstDayOfWeekRule extends AbstractRule
10 {
11 /**
12 * Checks if the value is a valid first day of the week (1 or 7)
13 * @inheritDoc
14 */
15 public function validate(string $field, $value, array $data): void
16 {
17 if ($value !== '1' && $value !== '7') {
18 $this->fail(esc_html__('Please enter a valid day of the week (1 or 7)', 'metricool'));
19 }
20 }
21 }
22