-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathInvalidSettingValueException.php
49 lines (42 loc) · 1.19 KB
/
InvalidSettingValueException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Matomo - Open source web analytics
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
* @copyright (c) 2016 Joubert RedRat
* @author Joubert RedRat <[email protected]>
* @license MIT
* @category Matomo_Plugins
* @package ProtectTrackID
*/
declare(strict_types=1);
namespace Piwik\Plugins\ProtectTrackID;
use InvalidArgumentException;
class InvalidSettingValueException extends InvalidArgumentException
{
public static function handleBase(string $baseGot): self
{
return new self(sprintf(
'Invalid value on base, was filled %1$s.',
$baseGot
));
}
public static function handleSalt(string $saltGot): self
{
return new self(sprintf(
'Invalid value on salt, was filled %1$s.',
$saltGot
));
}
public static function handleLenght(int $lengthMinExpected, int $lengthMaxExpected, int $lengthGot): self
{
return new self(sprintf(
'Invalid value on length, expected between %1$d and %2$d, was filled %3$d.',
$lengthMinExpected,
$lengthMaxExpected,
$lengthGot
));
}
}