KamranAhmed\Smasher\Path::saveFileContent PHP Method

saveFileContent() public method

Writes content to the specified path
public saveFileContent ( $content ) : integer
$content
return integer
    public function saveFileContent($content)
    {
        if (!file_exists(dirname($this->path))) {
            mkdir(dirname($this->path), 0777, true);
        } elseif (is_dir($this->path)) {
            throw new InvalidPathException("You can only write content to file");
        }
        return file_put_contents($this->path, $content);
    }