Fixed coding style.

This commit is contained in:
Jan Böhmer 2020-04-10 13:05:08 +02:00
parent a5e1f02d27
commit ae75e6844f
41 changed files with 147 additions and 163 deletions

View file

@ -222,7 +222,7 @@ abstract class BaseAdminController extends AbstractController
protected function _new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AbstractNamedDBElement $entity = null)
{
$master_picture_backup = null;
if ($entity === null) {
if (null === $entity) {
/** @var AbstractStructuralDBElement|User $new_entity */
$new_entity = new $this->entity_class();
} else {

View file

@ -45,6 +45,7 @@ namespace App\Controller;
use App\DataTables\LogDataTable;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer;
use App\Entity\Parts\Part;
use App\Entity\Parts\PartLot;
use App\Entity\Parts\Storelocation;
@ -52,7 +53,6 @@ use App\Entity\Parts\Supplier;
use App\Entity\PriceInformations\Orderdetail;
use App\Exceptions\AttachmentDownloadException;
use App\Form\Part\PartBaseType;
use App\Services\Attachments\AttachmentManager;
use App\Services\Attachments\AttachmentSubmitHandler;
use App\Services\Attachments\PartPreviewGenerator;
use App\Services\LogSystem\EventCommentHelper;
@ -62,7 +62,6 @@ use App\Services\Parameters\ParameterExtractor;
use App\Services\PricedetailHelper;
use Doctrine\ORM\EntityManagerInterface;
use Omines\DataTablesBundle\DataTableFactory;
use App\Entity\Parts\Manufacturer;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
@ -256,7 +255,7 @@ class PartController extends AbstractController
}
$store_id = $request->get('storelocation', null);
$storelocation = $store_id ? $em->find(Storelocation::class, $store_id): null;
$storelocation = $store_id ? $em->find(Storelocation::class, $store_id) : null;
if (null !== $storelocation && $new_part->getPartLots()->isEmpty()) {
$partLot = new PartLot();
$partLot->setStorageLocation($storelocation);
@ -265,14 +264,13 @@ class PartController extends AbstractController
}
$supplier_id = $request->get('supplier', null);
$supplier = $supplier_id ? $em->find(Supplier::class, $supplier_id): null;
$supplier = $supplier_id ? $em->find(Supplier::class, $supplier_id) : null;
if (null !== $supplier && $new_part->getOrderdetails()->isEmpty()) {
$orderdetail = new Orderdetail();
$orderdetail->setSupplier($supplier);
$new_part->addOrderdetail($orderdetail);
}
$form = $this->createForm(PartBaseType::class, $new_part);
$form->handleRequest($request);

View file

@ -46,7 +46,6 @@ use App\Services\Attachments\BuiltinAttachmentsFinder;
use App\Services\TagFinder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@ -62,8 +61,6 @@ class TypeaheadController extends AbstractController
/**
* @Route("/builtInResources/search/{query}", name="typeahead_builtInRessources", requirements={"query"= ".+"})
*
* @param string $query
* @param BuiltinAttachmentsFinder $finder
* @return JsonResponse
*/
public function builtInResources(string $query, BuiltinAttachmentsFinder $finder)

View file

@ -56,7 +56,6 @@ use Doctrine\ORM\EntityManagerInterface;
use InvalidArgumentException;
use Omines\DataTablesBundle\DataTableFactory;
use Symfony\Component\Asset\Packages;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@ -194,7 +193,6 @@ class UserController extends AdminPages\BaseAdminController
return $table->getResponse();
}
if ($this->getParameter('use_gravatar')) {
$avatar = $this->getGravatar($user->getEmail(), 200, 'identicon');
} else {