-
Notifications
You must be signed in to change notification settings - Fork 2
File
Pieter Hordijk edited this page Dec 31, 2018
·
3 revisions
- Image
- Type
Validates the input file (string
of SVG file path) to contain only valid SVG attributes.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Svg\ValidAttributes;
(new ValidAttributes())->validate('/path/to/an/svg/file.svg');
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.MimeType
when the validated file does not have an SVG mime type -
File.Image.Type.Svg.ValidAttributes
when the validated file does not contain valid XML -
File.Image.Type.Svg.ValidAttributes
when the validated file contains invalid SVG attributes
Validates the input file (string
of SVG file path) to contain only valid SVG attributes.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Svg\ValidElements;
(new ValidElements())->validate('/path/to/an/svg/file.svg');
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.MimeType
when the validated file does not have an SVG mime type -
File.Image.Type.Svg.ValidElements
when the validated file does not contain valid XML -
File.Image.Type.Svg.ValidElements
when the validated file contains invalid SVG elements
Validates the input file (string
of BMP file path) to be a valid BMP file.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Bmp;
(new Bmp())->validate('/path/to/an/bmp/file.bmp
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.Image.Type.Bmp
when the validated file is not a BMP file
Validates the input file (string
of GIF file path) to be a valid GIF file.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Gif;
(new Gif())->validate('/path/to/a/gif/file.gif');
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.MimeType
when the validated file does not have a GIF mime type -
File.Image.Type.Gif
when the validated file is not a valid GIF file
Validates the input file (string
of JPEG file path) to be a valid JPEG file.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Jpeg;
(new Jpeg())->validate('/path/to/a/jpg/file.jpg');
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.MimeType
when the validated file does not have a JPEG mime type -
File.Image.Type.Jpeg
when the validated file is not a valid JPEG file
Validates the input file (string
of PNG file path) to be a valid PNG file.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Png;
(new Png())->validate('/path/to/a/png/file.png');
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.MimeType
when the validated file does not have a PNG mime type -
File.Image.Type.Png
when the validated file is not a valid PNG file
Validates the input file (string
of SVG file path) to be a valid SVG file.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\File\Image\Type\Svg;
(new Svg())->validate('/path/to/an/svg/file.svg');
-
Type.String
when the input valid is not a string -
FileSystem.File
when the validated file does not exist -
File.MimeType
when the validated file does not have an SVG mime type -
File.Image.Type.Svg.ValidAttributes
when the validated file does not contain valid XML -
File.Image.Type.Svg.ValidAttributes
when the validated file contains invalid SVG attributes -
File.Image.Type.Svg.ValidElements
when the validated file does not contain valid XML -
File.Image.Type.Svg.ValidElements
when the validated file contains invalid SVG elements