You are here

abstract class FileLoader in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/dependency-injection/Loader/FileLoader.php \Symfony\Component\DependencyInjection\Loader\FileLoader
  2. 8 vendor/symfony/validator/Mapping/Loader/FileLoader.php \Symfony\Component\Validator\Mapping\Loader\FileLoader
  3. 8 vendor/symfony/serializer/Mapping/Loader/FileLoader.php \Symfony\Component\Serializer\Mapping\Loader\FileLoader
Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Mapping/Loader/FileLoader.php \Symfony\Component\Validator\Mapping\Loader\FileLoader

Base loader for loading validation metadata from a file.

@author Bernhard Schussek <bschussek@gmail.com>

Hierarchy

Expanded class hierarchy of FileLoader

See also

YamlFileLoader

XmlFileLoader

1 string reference to 'FileLoader'
CrossCheckTest::testCrossCheck in vendor/symfony/dependency-injection/Tests/CrossCheckTest.php
@dataProvider crossCheckLoadersDumpers

File

vendor/symfony/validator/Mapping/Loader/FileLoader.php, line 24

Namespace

Symfony\Component\Validator\Mapping\Loader
View source
abstract class FileLoader extends AbstractLoader {

  /**
   * The file to load.
   *
   * @var string
   */
  protected $file;

  /**
   * 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($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));
    }
    $this->file = $file;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractLoader::$namespaces protected property
AbstractLoader::addNamespaceAlias protected function Adds a namespace alias.
AbstractLoader::DEFAULT_NAMESPACE constant The namespace to load constraints from by default.
AbstractLoader::newConstraint protected function Creates a new constraint instance for the given constraint name.
FileLoader::$file protected property The file to load.
FileLoader::__construct public function Creates a new loader.
LoaderInterface::loadClassMetadata public function Loads validation metadata into a {@link ClassMetadata} instance. 10