classes/phing/tasks/ext/visualizer/VisualizerTask.php
protected function resolveDestination(string $buildfilePath, string $format, ?string $destination): string
    {
        $buildfileInfo = pathinfo($buildfilePath);

        // Fallback
        if (empty($destination)) {
            $destination = $buildfileInfo['dirname'];
        }

        // Adding filename if necessary
        if (is_dir($destination)) {
            $destination .= DIRECTORY_SEPARATOR . $buildfileInfo['filename'] . '.' . $format;
        }

        // Check if path is available
        if (!is_dir(dirname($destination))) {
            $message = "Directory '$destination' is invalid";
            $this->log($message, Project::MSG_ERR);
            throw new BuildException(sprintf($message, $destination));
        }

        return $destination;
    }
protected function resolveDestination(string $buildfilePath, string $format, ?string $destination): string
    {
        $buildfileInfo = pathinfo($buildfilePath);

        // Fallback
        if (empty($destination)) {
            $destination = $buildfileInfo['dirname'];
        }

        // Adding filename if necessary
        if (is_dir($destination)) {
            $destination .= DIRECTORY_SEPARATOR . $buildfileInfo['filename'] . '.' . $format;
        }

        // Check if path is available
        if (!is_dir(dirname($destination))) {
            $message = "Directory '$destination' is invalid";
            $this->log($message, Project::MSG_ERR);
            throw new BuildException(sprintf($message, $destination));
        }

        return $destination;
    }
protected function resolveDestination ( string $ buildfilePath , string $ format , ? string $ destination ) : string { $ buildfileInfo = pathinfo ( $ buildfilePath ) ; // Fallback if ( empty ( $ destination ) ) { $ destination = $ buildfileInfo [ 'dirname' ] ; } // Adding filename if necessary if ( is_dir ( $ destination ) ) { $ destination .= DIRECTORY_SEPARATOR . $ buildfileInfo [ 'filename' ] . '.' . $ format ; } // Check if path is available if ( ! is_dir ( dirname ( $ destination ) ) ) { $ message = "Directory '$destination' is invalid" ; $ this -> log ( $ message , Project :: MSG_ERR ) ; throw new BuildException ( sprintf ( $ message , $ destination ) ) ; } return $ destination ; }
Figure diagram's file path

@param string $buildfilePath Path to main buildfile
@param string $format Extension to use
@param null|string $destination Desired destination provided by user

@return string
Figure diagram s file path