Fixed some inspection issues.

This commit is contained in:
Jan Böhmer 2019-03-20 22:53:06 +01:00
parent 782e2b7fdf
commit 0f3ba9b6a8
19 changed files with 109 additions and 139 deletions

View file

@ -53,6 +53,6 @@ class DebugController extends AbstractController
$this->addFlash('testkjfd', 'Blabla. This message type should be not know to template!');
return $this->render("base.html.twig");
return $this->render('base.html.twig');
}
}

View file

@ -34,14 +34,7 @@
namespace App\Controller;
use App\Entity\Attachment;
use App\Entity\AttachmentType;
use App\Entity\Category;
use App\Entity\Part;
use App\Entity\StructuralDBElement;
use Shivas\VersioningBundle\Service\VersionManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class HomepageController extends AbstractController

View file

@ -37,10 +37,7 @@ use App\Entity\Category;
use App\Entity\Part;
use App\Form\PartType;
use App\Services\AttachmentFilenameService;
use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
@ -61,8 +58,8 @@ class PartController extends AbstractController
return $this->render('Parts/show_part_info.html.twig',
[
"part" => $part,
"main_image" => $attachmentFilenameService->attachmentPathToAbsolutePath($filename)
'part' => $part,
'main_image' => $attachmentFilenameService->attachmentPathToAbsolutePath($filename)
]
);
}
@ -88,8 +85,8 @@ class PartController extends AbstractController
return $this->render('Parts/edit_part_info.html.twig',
[
"part" => $part,
"form" => $form->createView(),
'part' => $part,
'form' => $form->createView(),
]);
}
@ -123,8 +120,8 @@ class PartController extends AbstractController
return $this->render('Parts/new_part.html.twig',
[
"part" => $new_part,
"form" => $form->createView()
'part' => $new_part,
'form' => $form->createView()
]);
}
@ -136,7 +133,7 @@ class PartController extends AbstractController
{
/** @var Part $new_part */
$new_part = clone($part);
$new_part = clone $part;
$this->denyAccessUnlessGranted('create', $new_part);
@ -154,8 +151,8 @@ class PartController extends AbstractController
return $this->render('Parts/new_part.html.twig',
[
"part" => $new_part,
"form" => $form->createView()
'part' => $new_part,
'form' => $form->createView()
]);
}

View file

@ -33,14 +33,7 @@ namespace App\Controller;
use App\DataTables\PartsDataTable;
use App\Entity\Part;
use Omines\DataTablesBundle\Adapter\ArrayAdapter;
use Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter;
use Omines\DataTablesBundle\Column\TextColumn;
use Omines\DataTablesBundle\Controller\DataTablesTrait;
use Omines\DataTablesBundle\DataTable;
use Omines\DataTablesBundle\DataTableFactory;
use Omines\DataTablesBundle\DataTableRendererInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;

View file

@ -56,17 +56,17 @@ class UserController extends AbstractController
public function userInfo(?User $user, Packages $packages)
{
//If no user id was passed, then we show info about the current user
if($user == null) {
if($user === null) {
$user = $this->getUser();
} else {
//Else we must check, if the current user is allowed to access $user
$this->denyAccessUnlessGranted('read', $user);
}
if($this->getParameter("use_gravatar")) {
if($this->getParameter('use_gravatar')) {
$avatar = $this->getGravatar($user->getEmail(), 200, 'identicon');
} else {
$avatar = $packages->getUrl("/img/default_avatar.png");
$avatar = $packages->getUrl('/img/default_avatar.png');
}
@ -140,7 +140,7 @@ class UserController extends AbstractController
*****************************/
return $this->render('Users/user_settings.html.twig', [
"settings_form" => $form->createView(),
'settings_form' => $form->createView(),
'pw_form' => $pw_form->createView()
]);
}