src/DataType/FilePath.php 1 location
|
@@ 9-18 (lines=10) @@
|
| 6 |
|
use Selami\Entity\Interfaces\DataTypeInterface; |
| 7 |
|
use InvalidArgumentException; |
| 8 |
|
|
| 9 |
|
class FilePath extends DataTypeAbstract implements DataTypeInterface |
| 10 |
|
{ |
| 11 |
|
use DataTypeRegexTrait; |
| 12 |
|
const DATA_FORMAT_ERROR = 'Assertion failed for value "%s" for "%s" : INVALID_TYPE'; |
| 13 |
|
protected $regex = '#^[a-zA-Z0-9/._-]+$#'; |
| 14 |
|
protected $sanitizeFlags = FILTER_SANITIZE_URL; |
| 15 |
|
protected static $defaults = [ |
| 16 |
|
'default' => null |
| 17 |
|
]; |
| 18 |
|
} |
| 19 |
|
|
src/DataType/Slug.php 1 location
|
@@ 8-17 (lines=10) @@
|
| 5 |
|
|
| 6 |
|
use Selami\Entity\Interfaces\DataTypeInterface; |
| 7 |
|
|
| 8 |
|
class Slug extends DataTypeAbstract implements DataTypeInterface |
| 9 |
|
{ |
| 10 |
|
use DataTypeRegexTrait; |
| 11 |
|
const DATA_FORMAT_ERROR = 'Assertion failed for value "%s" for "%s" : INVALID_TYPE'; |
| 12 |
|
protected $regex = '/^[a-z0-9](-?[a-z0-9]+)*$/i'; |
| 13 |
|
protected $sanitizeFlags = FILTER_SANITIZE_URL; |
| 14 |
|
protected static $defaults = [ |
| 15 |
|
'default' => null |
| 16 |
|
]; |
| 17 |
|
} |
| 18 |
|
|