original_string: public static function fromArrayAndSettings($cfg, $settings) {
          $directorySpecification = new self($cfg, $settings->getDirectory());
          $directorySpecification->set("source", $settings->getPath($directorySpecification->getSource()));
          $directorySpecification->set("baseTarget", $settings->getOptional("target", null));
  
          if (!is_dir($directorySpecification->getSource()))
              throw new DirectorySpecificationException("directory \"{$directorySpecification->getSource()}\" does not exist");
  
          return $directorySpecification;
      }
code: public static function fromArrayAndSettings($cfg, $settings) {
          $directorySpecification = new self($cfg, $settings->getDirectory());
          $directorySpecification->set("source", $settings->getPath($directorySpecification->getSource()));
          $directorySpecification->set("baseTarget", $settings->getOptional("target", null));
  
          if (!is_dir($directorySpecification->getSource()))
              throw new DirectorySpecificationException("directory \"{$directorySpecification->getSource()}\" does not exist");
  
          return $directorySpecification;
      }
code_tokens: public static function fromArrayAndSettings ( $ cfg , $ settings ) { $ directorySpecification = new self ( $ cfg , $ settings -> getDirectory ( ) ) ; $ directorySpecification -> set ( "source" , $ settings -> getPath ( $ directorySpecification -> getSource ( ) ) ) ; $ directorySpecification -> set ( "baseTarget" , $ settings -> getOptional ( "target" , null ) ) ; if ( ! is_dir ( $ directorySpecification -> getSource ( ) ) ) throw new DirectorySpecificationException ( "directory \"{$directorySpecification->getSource()}\" does not exist" ) ; return $ directorySpecification ; }
docstring: Creates a directory 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
  @return DirectorySpecification
docstring_tokens: Creates a directory specification from a plain settings array . The settings context is taken into consideration to generate paths relative to the settings .