original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Creates a file specification from a plain settings array . The settings context is taken into consideration to generate paths relative to the settings .