# metricool/2.1.1/app/Features/UserSettings/Rules/FirstDayOfWeekRule.php

Metricool – Social media and site statistics, version 2.1.1. 22 lines.

- Page: https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Features/UserSettings/Rules/FirstDayOfWeekRule.php
- Raw: https://pluginprobe.com/plugins/metricool/2.1.1/raw/app/Features/UserSettings/Rules/FirstDayOfWeekRule.php
- Modified: 2026-08-20T14:08:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/metricool/2.1.1/code/app/Features/UserSettings/Rules/FirstDayOfWeekRule.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Metricool\Features\UserSettings\Rules;

use Metricool\Support\Validation\Rules\AbstractRule;

class FirstDayOfWeekRule extends AbstractRule
{
    /**
     * Checks if the value is a valid first day of the week (1 or 7)
     * @inheritDoc
     */
    public function validate(string $field, $value, array $data): void
    {
        if ($value !== '1' && $value !== '7') {
            $this->fail(esc_html__('Please enter a valid day of the week (1 or 7)', 'metricool'));
        }
    }
}

```
