for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebDevEtc\BlogEtc\Requests\Traits;
use Illuminate\Http\UploadedFile;
trait HasImageUploadTrait
{
/**
* @param $size
*
* @return UploadedFile|null
*/
public function get_image_file($size)
if ($this->file($size)) {
file()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
if ($this->/** @scrutinizer ignore-call */ file($size)) {
return $this->file($size);
}
// not found? lets cycle through all the images and see if anything was submitted, and use that instead
foreach (config('blogetc.image_sizes') as $image_size_name => $image_size_info) {
if ($this->file($image_size_name)) {
return $this->file($image_size_name);