Programming Language PHP

Namespace Plank\Mediable\Helpers

Class File

Total Examples 2

2 code examples of PHP Plank\Mediable\Helpers\File extracted from open source projects

Was this example useful?
0
                                                    /**
     * Generate the model's filename.
     */
    private function generateFilename(): string
    {
        if ($this->filename) {
            return $this->filename;
        }

        if ($this->hashFilename) {
            return $this->generateHash();
        }

        return File::sanitizeFileName($this->source->filename());
    }
                                            
Was this example useful?
0
                                                    /**
     * Calculate the file size in human readable byte notation.
     * @param  int $precision (_optional_) Number of decimal places to include
     */
    public function readableSize(int $precision = 1): string
    {
        return File::readableSize($this->size, $precision);
    }
                                            
File's Other Methods