refactor: use identical over equal with same type

This commit is contained in:
HDVinnie
2020-02-16 21:04:19 -05:00
parent 9cf874de7a
commit 29cd6e8eb6
20 changed files with 59 additions and 59 deletions
+2 -2
View File
@@ -176,13 +176,13 @@ class UserController extends Controller
// Avatar
$max_upload = config('image.max_upload_size');
if ($request->hasFile('image') && $request->file('image')->getError() == 0) {
if ($request->hasFile('image') && $request->file('image')->getError() === 0) {
$image = $request->file('image');
if (in_array($image->getClientOriginalExtension(), ['jpg', 'JPG', 'jpeg', 'bmp', 'png', 'PNG', 'tiff', 'gif']) && preg_match('#image/*#', $image->getMimeType())) {
if ($max_upload >= $image->getSize()) {
$filename = $user->username.'.'.$image->getClientOriginalExtension();
$path = public_path('/files/img/'.$filename);
if ($image->getClientOriginalExtension() != 'gif') {
if ($image->getClientOriginalExtension() !== 'gif') {
Image::make($image->getRealPath())->fit(150, 150)->encode('png', 100)->save($path);
} else {
$v = validator($request->all(), [