for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jobtech\LaravelChunky\Support;
use Illuminate\Support\Str;
class MergeFilesystem extends FileSystem
{
/** {@inheritdoc} */
public function disk($disk = null): ?string
if (! empty($disk) && is_string($disk)) {
$this->disk = $disk;
}
return $this->disk;
public function folder($folder = null): ?string
if (! empty($folder) && is_string($folder)) {
$this->folder = $folder;
return $this->folder;
/**
* @param string $path
* @return string
*/
public function destinationPath(string $path): string
if (Str::startsWith($path, $this->folder())) {
return $path;
return $this->folder.$path;
* Write the origin stream into destination.
*
* @param string $destination
* @param resource|null $origin
* @param array $options
* @throws \Illuminate\Contracts\Filesystem\FileExistsException
public function store(string $destination, $origin, $options = []): string
if ($this->filesystem()->disk($this->disk)->put($destination, $origin, $options)) {
return $destination;
return false;
return false
false
string
public function createTemporaryChunk($origin)
$origin
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function createTemporaryChunk(/** @scrutinizer ignore-unused */ $origin)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->filesystem()->disk();
* @return bool
public function exists(string $path): bool
return $this->filesystem()->disk($this->disk)->exists($path);