for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\MediaLibrary\Helpers;
class RemoteFile
{
/**
* The relative path to the file.
*
* @var string
*/
protected $key;
* The disk the file exists on.
protected $disk;
* Constructor method.
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct($key, $disk)
$this->key = $key;
$this->disk = $disk;
}
* Get the key.
* @return string
public function getKey(): string
return $this->key;
* Get the disk.
public function getDisk(): string
return $this->disk;
* Get the filename (including extension).
public function getFilename()
return basename($this->key);
* Get the name (excluding extension).
public function getName()
return pathinfo($this->getFilename(), PATHINFO_FILENAME);
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.