public function extractPath($path)
    {
        if ($path && method_exists($this, 'setPath')) {
            $this->setPath($path);
        }

        if (!$path && method_exists($this, 'getPath')) {
            $path = $this->getPath();
        }

        if (!$path) {
            throw new InvalidArgumentException('Missing path argument.');
        }

        return $path;
    }
public function extractPath($path)
    {
        if ($path && method_exists($this, 'setPath')) {
            $this->setPath($path);
        }

        if (!$path && method_exists($this, 'getPath')) {
            $path = $this->getPath();
        }

        if (!$path) {
            throw new InvalidArgumentException('Missing path argument.');
        }

        return $path;
    }
public function extractPath ( $ path ) { if ( $ path && method_exists ( $ this , 'setPath' ) ) { $ this -> setPath ( $ path ) ; } if ( ! $ path && method_exists ( $ this , 'getPath' ) ) { $ path = $ this -> getPath ( ) ; } if ( ! $ path ) { throw new InvalidArgumentException ( 'Missing path argument.' ) ; } return $ path ; }
Return path and set it or get it from the instance.

@param string $path

@throws \InvalidArgumentException

@return string
Return path and set it or get it from the instance .