class FileLoader
Same name in this branch
- 11.1.x vendor/symfony/serializer/Mapping/Loader/FileLoader.php \Symfony\Component\Serializer\Mapping\Loader\FileLoader
- 11.1.x vendor/symfony/dependency-injection/Loader/FileLoader.php \Symfony\Component\DependencyInjection\Loader\FileLoader
Base loader for loading validation metadata from a file.
@author Bernhard Schussek <bschussek@gmail.com>
Hierarchy
- class \Symfony\Component\Validator\Mapping\Loader\AbstractLoader implements \Symfony\Component\Validator\Mapping\Loader\LoaderInterface
- class \Symfony\Component\Validator\Mapping\Loader\FileLoader extends \Symfony\Component\Validator\Mapping\Loader\AbstractLoader
Expanded class hierarchy of FileLoader
See also
File
-
vendor/
symfony/ validator/ Mapping/ Loader/ FileLoader.php, line 24
Namespace
Symfony\Component\Validator\Mapping\LoaderView source
abstract class FileLoader extends AbstractLoader {
/**
* Creates a new loader.
*
* @param string $file The mapping file to load
*
* @throws MappingException If the file does not exist or is not readable
*/
public function __construct(string $file) {
if (!is_file($file)) {
throw new MappingException(\sprintf('The mapping file "%s" does not exist.', $file));
}
if (!is_readable($file)) {
throw new MappingException(\sprintf('The mapping file "%s" is not readable.', $file));
}
if (!stream_is_local($this->file)) {
throw new MappingException(\sprintf('The mapping file "%s" is not a local file.', $file));
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
AbstractLoader::$namedArgumentsCache | private | property | ||
AbstractLoader::$namespaces | protected | property | ||
AbstractLoader::addNamespaceAlias | protected | function | Adds a namespace alias. | |
AbstractLoader::DEFAULT_NAMESPACE | public | constant | The namespace to load constraints from by default. | |
AbstractLoader::newConstraint | protected | function | Creates a new constraint instance for the given constraint name. | |
FileLoader::__construct | public | function | Creates a new loader. | 2 |
LoaderInterface::loadClassMetadata | public | function | Loads validation metadata into a {@link ClassMetadata} instance. | 6 |