Esempio n. 1
0
 /**
  * constructor
  *
  * @param mixed $arg1
  * @param mixed $arg2
  *
  * @throws IOException
  * @throws NullPointerException
  */
 public function __construct($arg1 = null, $arg2 = null)
 {
     if (self::$separator === null || self::$pathSeparator === null) {
         $fs = FileSystem::getFileSystem();
         self::$separator = $fs->getSeparator();
         self::$pathSeparator = $fs->getPathSeparator();
     }
     /* simulate signature identified constructors */
     if ($arg1 instanceof PhingFile && is_string($arg2)) {
         $this->_constructFileParentStringChild($arg1, $arg2);
     } elseif (is_string($arg1) && $arg2 === null) {
         $this->_constructPathname($arg1);
     } elseif (is_string($arg1) && is_string($arg2)) {
         $this->_constructStringParentStringChild($arg1, $arg2);
     } else {
         if ($arg1 === null) {
             throw new NullPointerException("Argument1 to function must not be null");
         }
         $this->path = (string) $arg1;
         $this->prefixLength = (int) $arg2;
     }
 }