Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
WeakPassword
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 of
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace App\Identity\Domain\Exceptions;
6
7use InvalidArgumentException;
8
9/**
10 * Extends InvalidArgumentException so the controllers' existing
11 * `catch (InvalidArgumentException) → 400` covers a weak password unchanged.
12 */
13final class WeakPassword extends InvalidArgumentException
14{
15    public static function of(string $reason): self
16    {
17        return new self($reason);
18    }
19}