FeaturePhp/Specification/FileSpecification.php
public static function fromArrayAndSettings($cfg, $settings, $artifact = null) {
        $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact);
        $fileSpecification->set("relativeSource", $fileSpecification->getSource());
        $fileSpecification->set("source", $settings->getPath($fileSpecification->getSource()));
        $fileSpecification->set("target", fphp\Helper\Path::join(
            $settings->getOptional("target", null), $fileSpecification->getTarget()));

        if (!file_exists($fileSpecification->getSource()))
            throw new FileSpecificationException("file \"{$fileSpecification->getSource()}\" does not exist");

        return $fileSpecification;
    }
public static function fromArrayAndSettings($cfg, $settings, $artifact = null) {
        $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact);
        $fileSpecification->set("relativeSource", $fileSpecification->getSource());
        $fileSpecification->set("source", $settings->getPath($fileSpecification->getSource()));
        $fileSpecification->set("target", fphp\Helper\Path::join(
            $settings->getOptional("target", null), $fileSpecification->getTarget()));

        if (!file_exists($fileSpecification->getSource()))
            throw new FileSpecificationException("file \"{$fileSpecification->getSource()}\" does not exist");

        return $fileSpecification;
    }
public static function fromArrayAndSettings ( $ cfg , $ settings , $ artifact = null ) { $ fileSpecification = new static ( $ cfg , $ settings -> getDirectory ( ) , $ artifact ) ; $ fileSpecification -> set ( "relativeSource" , $ fileSpecification -> getSource ( ) ) ; $ fileSpecification -> set ( "source" , $ settings -> getPath ( $ fileSpecification -> getSource ( ) ) ) ; $ fileSpecification -> set ( "target" , fphp \ Helper \ Path :: join ( $ settings -> getOptional ( "target" , null ) , $ fileSpecification -> getTarget ( ) ) ) ; if ( ! file_exists ( $ fileSpecification -> getSource ( ) ) ) throw new FileSpecificationException ( "file \"{$fileSpecification->getSource()}\" does not exist" ) ; return $ fileSpecification ; }
Creates a file specification from a plain settings array.
The settings context is taken into consideration to generate paths
relative to the settings.
@param array $cfg a plain settings array
@param \FeaturePhp\Settings $settings the settings context
@param \FeaturePhp\Artifact\Artifact $artifact
@return FileSpecification
Creates a file specification from a plain settings array . The settings context is taken into consideration to generate paths relative to the settings .