for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Http\Controllers;
use App\Events\Obyx;
use App\Models\Logo;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\File;
class SubmitController extends Controller
{
public function index()
//Zeige Submit View
return view('submit.index');
}
public function logo_index()
//Zeige View zum Einsenden eines Logos
return view('submit.logo.index');
public function logo_add(Request $request)
$this->validate($request, [
'file' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'logoname' => 'required',
]);
$file = $request->file('file');
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$extorig = $file->getExtension();
$imageName = \Storage::putFile('logos', new UploadedFile($file->path(), $file->getClientOriginalName()));
//dd($file);
$l = new Logo();
$l->extension = \Storage::mimeType($imageName);
$l->filename = str_replace($extorig, '', $imageName);
$l->title = $request->get('logoname');
$l->user_id = \Auth::id();
$l->save();
event(new Obyx('logo-add', \Auth::id()));
return redirect()->route('submit.logo.success');
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.