Fixed code style.

This commit is contained in:
Jan Böhmer 2020-08-21 21:36:22 +02:00
parent 2853e471c4
commit d0b1024d80
212 changed files with 495 additions and 1005 deletions

View file

@ -70,8 +70,6 @@ class AttachmentTypeController extends BaseAdminController
/** /**
* @Route("/{id}", name="attachment_type_delete", methods={"DELETE"}) * @Route("/{id}", name="attachment_type_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, AttachmentType $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, AttachmentType $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -81,8 +79,6 @@ class AttachmentTypeController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="attachment_type_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="attachment_type_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(AttachmentType $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(AttachmentType $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -93,8 +89,6 @@ class AttachmentTypeController extends BaseAdminController
* @Route("/new", name="attachment_type_new") * @Route("/new", name="attachment_type_new")
* @Route("/{id}/clone", name="attachment_type_clone") * @Route("/{id}/clone", name="attachment_type_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null): Response
{ {
@ -103,8 +97,6 @@ class AttachmentTypeController extends BaseAdminController
/** /**
* @Route("/export", name="attachment_type_export_all") * @Route("/export", name="attachment_type_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -113,8 +105,6 @@ class AttachmentTypeController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="attachment_type_export") * @Route("/{id}/export", name="attachment_type_export")
*
* @return Response
*/ */
public function exportEntity(AttachmentType $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(AttachmentType $entity, EntityExporter $exporter, Request $request): Response
{ {
@ -126,9 +116,11 @@ class AttachmentTypeController extends BaseAdminController
if ($entity instanceof AttachmentType) { if ($entity instanceof AttachmentType) {
if ($entity->getAttachmentsForType()->count() > 0) { if ($entity->getAttachmentsForType()->count() > 0) {
$this->addFlash('error', 'entity.delete.must_not_contain_attachments'); $this->addFlash('error', 'entity.delete.must_not_contain_attachments');
return false; return false;
} }
} }
return true; return true;
} }
} }

View file

@ -43,18 +43,13 @@ declare(strict_types=1);
namespace App\Controller\AdminPages; namespace App\Controller\AdminPages;
use App\DataTables\LogDataTable; use App\DataTables\LogDataTable;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\AbstractNamedDBElement; use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\Base\AbstractPartsContainingDBElement; use App\Entity\Base\AbstractPartsContainingDBElement;
use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Base\PartsContainingRepositoryInterface; use App\Entity\Base\PartsContainingRepositoryInterface;
use App\Entity\LabelSystem\LabelProfile; use App\Entity\LabelSystem\LabelProfile;
use App\Entity\PriceInformations\Currency;
use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use App\Events\SecurityEvent;
use App\Events\SecurityEvents;
use App\Exceptions\AttachmentDownloadException; use App\Exceptions\AttachmentDownloadException;
use App\Form\AdminPages\ImportType; use App\Form\AdminPages\ImportType;
use App\Form\AdminPages\MassCreationForm; use App\Form\AdminPages\MassCreationForm;
@ -156,12 +151,14 @@ abstract class BaseAdminController extends AbstractController
return $timeTravel_timestamp; return $timeTravel_timestamp;
} }
return null; return null;
} }
/** /**
* Perform some additional actions, when the form was valid, but before the entity is saved. * Perform some additional actions, when the form was valid, but before the entity is saved.
* @return bool Return true, to save entity normally, return false, to abort saving. *
* @return bool return true, to save entity normally, return false, to abort saving
*/ */
protected function additionalActionEdit(FormInterface $form, AbstractNamedDBElement $entity): bool protected function additionalActionEdit(FormInterface $form, AbstractNamedDBElement $entity): bool
{ {
@ -174,7 +171,6 @@ abstract class BaseAdminController extends AbstractController
$timeTravel_timestamp = $this->revertElementIfNeeded($entity, $timestamp); $timeTravel_timestamp = $this->revertElementIfNeeded($entity, $timestamp);
if ($this->isGranted('show_history', $entity)) { if ($this->isGranted('show_history', $entity)) {
$table = $this->dataTableFactory->createFromType( $table = $this->dataTableFactory->createFromType(
LogDataTable::class, LogDataTable::class,
@ -264,7 +260,6 @@ abstract class BaseAdminController extends AbstractController
/** @var AbstractPartsContainingRepository $repo */ /** @var AbstractPartsContainingRepository $repo */
$repo = $this->entityManager->getRepository($this->entity_class); $repo = $this->entityManager->getRepository($this->entity_class);
return $this->render($this->twig_template, [ return $this->render($this->twig_template, [
'entity' => $entity, 'entity' => $entity,
'form' => $form->createView(), 'form' => $form->createView(),
@ -279,7 +274,8 @@ abstract class BaseAdminController extends AbstractController
/** /**
* Perform some additional actions, when the form was valid, but before the entity is saved. * Perform some additional actions, when the form was valid, but before the entity is saved.
* @return bool Return true, to save entity normally, return false, to abort saving. *
* @return bool return true, to save entity normally, return false, to abort saving
*/ */
protected function additionalActionNew(FormInterface $form, AbstractNamedDBElement $entity): bool protected function additionalActionNew(FormInterface $form, AbstractNamedDBElement $entity): bool
{ {
@ -308,7 +304,6 @@ abstract class BaseAdminController extends AbstractController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
//Perform additional actions //Perform additional actions
if ($this->additionalActionNew($form, $new_entity)) { if ($this->additionalActionNew($form, $new_entity)) {
//Upload passed files //Upload passed files
@ -399,7 +394,6 @@ abstract class BaseAdminController extends AbstractController
$em->flush(); $em->flush();
} }
return $this->render($this->twig_template, [ return $this->render($this->twig_template, [
'entity' => $new_entity, 'entity' => $new_entity,
'form' => $form->createView(), 'form' => $form->createView(),
@ -411,7 +405,9 @@ abstract class BaseAdminController extends AbstractController
/** /**
* Performs checks if the element can be deleted safely. Otherwise an flash message is added. * Performs checks if the element can be deleted safely. Otherwise an flash message is added.
* @param AbstractNamedDBElement $entity The element that should be checked. *
* @param AbstractNamedDBElement $entity the element that should be checked
*
* @return bool True if the the element can be deleted, false if not * @return bool True if the the element can be deleted, false if not
*/ */
protected function deleteCheck(AbstractNamedDBElement $entity): bool protected function deleteCheck(AbstractNamedDBElement $entity): bool
@ -421,9 +417,11 @@ abstract class BaseAdminController extends AbstractController
$repo = $this->entityManager->getRepository($this->entity_class); $repo = $this->entityManager->getRepository($this->entity_class);
if ($repo->getPartsCount($entity) > 0) { if ($repo->getPartsCount($entity) > 0) {
$this->addFlash('error', 'entity.delete.must_not_contain_parts'); $this->addFlash('error', 'entity.delete.must_not_contain_parts');
return false; return false;
} }
} }
return true; return true;
} }
@ -474,12 +472,14 @@ abstract class BaseAdminController extends AbstractController
$entity = new $this->entity_class(); $entity = new $this->entity_class();
$this->denyAccessUnlessGranted('read', $entity); $this->denyAccessUnlessGranted('read', $entity);
$entities = $em->getRepository($this->entity_class)->findAll(); $entities = $em->getRepository($this->entity_class)->findAll();
return $exporter->exportEntityFromRequest($entities, $request); return $exporter->exportEntityFromRequest($entities, $request);
} }
protected function _exportEntity(AbstractNamedDBElement $entity, EntityExporter $exporter, Request $request): \Symfony\Component\HttpFoundation\Response protected function _exportEntity(AbstractNamedDBElement $entity, EntityExporter $exporter, Request $request): \Symfony\Component\HttpFoundation\Response
{ {
$this->denyAccessUnlessGranted('read', $entity); $this->denyAccessUnlessGranted('read', $entity);
return $exporter->exportEntityFromRequest($entity, $request); return $exporter->exportEntityFromRequest($entity, $request);
} }
} }

View file

@ -69,8 +69,6 @@ class CategoryController extends BaseAdminController
/** /**
* @Route("/{id}", name="category_delete", methods={"DELETE"}) * @Route("/{id}", name="category_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, Category $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, Category $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -80,8 +78,6 @@ class CategoryController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="category_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="category_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(Category $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(Category $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -92,8 +88,6 @@ class CategoryController extends BaseAdminController
* @Route("/new", name="category_new") * @Route("/new", name="category_new")
* @Route("/{id}/clone", name="category_clone") * @Route("/{id}/clone", name="category_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Category $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Category $entity = null): Response
{ {
@ -102,8 +96,6 @@ class CategoryController extends BaseAdminController
/** /**
* @Route("/export", name="category_export_all") * @Route("/export", name="category_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -112,8 +104,6 @@ class CategoryController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="category_export") * @Route("/{id}/export", name="category_export")
*
* @return Response
*/ */
public function exportEntity(Category $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Category $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -59,7 +59,6 @@ use App\Services\LogSystem\TimeTravel;
use App\Services\StructuralElementRecursionHelper; use App\Services\StructuralElementRecursionHelper;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Exchanger\Exception\ChainException; use Exchanger\Exception\ChainException;
use Exchanger\Exception\Exception;
use Exchanger\Exception\UnsupportedCurrencyPairException; use Exchanger\Exception\UnsupportedCurrencyPairException;
use Omines\DataTablesBundle\DataTableFactory; use Omines\DataTablesBundle\DataTableFactory;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@ -100,7 +99,6 @@ class CurrencyController extends BaseAdminController
LabelGenerator $labelGenerator, LabelGenerator $labelGenerator,
EntityManagerInterface $entityManager, EntityManagerInterface $entityManager,
ExchangeRateUpdater $exchangeRateUpdater ExchangeRateUpdater $exchangeRateUpdater
) { ) {
$this->exchangeRateUpdater = $exchangeRateUpdater; $this->exchangeRateUpdater = $exchangeRateUpdater;
@ -121,8 +119,6 @@ class CurrencyController extends BaseAdminController
/** /**
* @Route("/{id}", name="currency_delete", methods={"DELETE"}) * @Route("/{id}", name="currency_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, Currency $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, Currency $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -143,7 +139,7 @@ class CurrencyController extends BaseAdminController
$this->addFlash('info', 'currency.edit.exchange_rate_updated.success'); $this->addFlash('info', 'currency.edit.exchange_rate_updated.success');
} catch (ChainException $exception) { } catch (ChainException $exception) {
$exception = $exception->getExceptions()[0]; $exception = $exception->getExceptions()[0];
if ($exception instanceof UnsupportedCurrencyPairException || stripos($exception->getMessage(), "supported") !== false) { if ($exception instanceof UnsupportedCurrencyPairException || false !== stripos($exception->getMessage(), 'supported')) {
$this->addFlash('error', 'currency.edit.exchange_rate_update.unsupported_currency'); $this->addFlash('error', 'currency.edit.exchange_rate_update.unsupported_currency');
} else { } else {
$this->addFlash('error', 'currency.edit.exchange_rate_update.generic_error'); $this->addFlash('error', 'currency.edit.exchange_rate_update.generic_error');
@ -157,8 +153,6 @@ class CurrencyController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="currency_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="currency_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(Currency $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(Currency $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -169,8 +163,6 @@ class CurrencyController extends BaseAdminController
* @Route("/new", name="currency_new") * @Route("/new", name="currency_new")
* @Route("/{id}/clone", name="currency_clone") * @Route("/{id}/clone", name="currency_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Currency $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Currency $entity = null): Response
{ {
@ -179,8 +171,6 @@ class CurrencyController extends BaseAdminController
/** /**
* @Route("/export", name="currency_export_all") * @Route("/export", name="currency_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -189,8 +179,6 @@ class CurrencyController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="currency_export") * @Route("/{id}/export", name="currency_export")
*
* @return Response
*/ */
public function exportEntity(Currency $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Currency $entity, EntityExporter $exporter, Request $request): Response
{ {
@ -202,6 +190,7 @@ class CurrencyController extends BaseAdminController
if ($entity instanceof Currency) { if ($entity instanceof Currency) {
if ($entity->getPricedetails()->count() > 0) { if ($entity->getPricedetails()->count() > 0) {
$this->addFlash('error', 'entity.delete.must_not_contain_prices'); $this->addFlash('error', 'entity.delete.must_not_contain_prices');
return false; return false;
} }
} }

View file

@ -69,8 +69,6 @@ class DeviceController extends BaseAdminController
/** /**
* @Route("/{id}", name="device_delete", methods={"DELETE"}) * @Route("/{id}", name="device_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, Device $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, Device $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -80,8 +78,6 @@ class DeviceController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="device_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="device_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(Device $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(Device $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -92,8 +88,6 @@ class DeviceController extends BaseAdminController
* @Route("/new", name="device_new") * @Route("/new", name="device_new")
* @Route("/{id}/clone", name="device_clone") * @Route("/{id}/clone", name="device_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Device $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Device $entity = null): Response
{ {
@ -102,8 +96,6 @@ class DeviceController extends BaseAdminController
/** /**
* @Route("/export", name="device_export_all") * @Route("/export", name="device_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -112,8 +104,6 @@ class DeviceController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="device_export") * @Route("/{id}/export", name="device_export")
*
* @return Response
*/ */
public function exportEntity(Device $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Device $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -69,8 +69,6 @@ class FootprintController extends BaseAdminController
/** /**
* @Route("/{id}", name="footprint_delete", methods={"DELETE"}) * @Route("/{id}", name="footprint_delete", methods={"DELETE"})
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
*/ */
public function delete(Request $request, Footprint $entity, StructuralElementRecursionHelper $recursionHelper): \Symfony\Component\HttpFoundation\RedirectResponse public function delete(Request $request, Footprint $entity, StructuralElementRecursionHelper $recursionHelper): \Symfony\Component\HttpFoundation\RedirectResponse
{ {
@ -80,8 +78,6 @@ class FootprintController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="footprint_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="footprint_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(Footprint $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(Footprint $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -92,8 +88,6 @@ class FootprintController extends BaseAdminController
* @Route("/new", name="footprint_new") * @Route("/new", name="footprint_new")
* @Route("/{id}/clone", name="footprint_clone") * @Route("/{id}/clone", name="footprint_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Footprint $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Footprint $entity = null): Response
{ {
@ -102,8 +96,6 @@ class FootprintController extends BaseAdminController
/** /**
* @Route("/export", name="footprint_export_all") * @Route("/export", name="footprint_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -112,8 +104,6 @@ class FootprintController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="footprint_export") * @Route("/{id}/export", name="footprint_export")
*
* @return Response
*/ */
public function exportEntity(AttachmentType $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(AttachmentType $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -69,8 +69,6 @@ class LabelProfileController extends BaseAdminController
/** /**
* @Route("/{id}", name="label_profile_delete", methods={"DELETE"}) * @Route("/{id}", name="label_profile_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, LabelProfile $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, LabelProfile $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -80,8 +78,6 @@ class LabelProfileController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="label_profile_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="label_profile_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(LabelProfile $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(LabelProfile $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -92,8 +88,6 @@ class LabelProfileController extends BaseAdminController
* @Route("/new", name="label_profile_new") * @Route("/new", name="label_profile_new")
* @Route("/{id}/clone", name="label_profile_clone") * @Route("/{id}/clone", name="label_profile_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?AttachmentType $entity = null): Response
{ {
@ -102,8 +96,6 @@ class LabelProfileController extends BaseAdminController
/** /**
* @Route("/export", name="label_profile_export_all") * @Route("/export", name="label_profile_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -112,8 +104,6 @@ class LabelProfileController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="label_profile_export") * @Route("/{id}/export", name="label_profile_export")
*
* @return Response
*/ */
public function exportEntity(LabelProfile $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(LabelProfile $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -91,8 +91,6 @@ class ManufacturerController extends BaseAdminController
* @Route("/new", name="manufacturer_new") * @Route("/new", name="manufacturer_new")
* @Route("/{id}/clone", name="manufacturer_clone") * @Route("/{id}/clone", name="manufacturer_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Manufacturer $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Manufacturer $entity = null): Response
{ {
@ -101,8 +99,6 @@ class ManufacturerController extends BaseAdminController
/** /**
* @Route("/export", name="manufacturer_export_all") * @Route("/export", name="manufacturer_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -111,8 +107,6 @@ class ManufacturerController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="manufacturer_export") * @Route("/{id}/export", name="manufacturer_export")
*
* @return Response
*/ */
public function exportEntity(Manufacturer $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Manufacturer $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -92,8 +92,6 @@ class MeasurementUnitController extends BaseAdminController
* @Route("/new", name="measurement_unit_new") * @Route("/new", name="measurement_unit_new")
* @Route("/{id}/clone", name="measurement_unit_clone") * @Route("/{id}/clone", name="measurement_unit_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?MeasurementUnit $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?MeasurementUnit $entity = null): Response
{ {
@ -102,8 +100,6 @@ class MeasurementUnitController extends BaseAdminController
/** /**
* @Route("/export", name="measurement_unit_export_all") * @Route("/export", name="measurement_unit_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -112,8 +108,6 @@ class MeasurementUnitController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="measurement_unit_export") * @Route("/{id}/export", name="measurement_unit_export")
*
* @return Response
*/ */
public function exportEntity(AttachmentType $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(AttachmentType $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -90,8 +90,6 @@ class StorelocationController extends BaseAdminController
* @Route("/new", name="store_location_new") * @Route("/new", name="store_location_new")
* @Route("/{id}/clone", name="store_location_clone") * @Route("/{id}/clone", name="store_location_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Storelocation $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Storelocation $entity = null): Response
{ {
@ -100,8 +98,6 @@ class StorelocationController extends BaseAdminController
/** /**
* @Route("/export", name="store_location_export_all") * @Route("/export", name="store_location_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -110,8 +106,6 @@ class StorelocationController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="store_location_export") * @Route("/{id}/export", name="store_location_export")
*
* @return Response
*/ */
public function exportEntity(Storelocation $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Storelocation $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -91,8 +91,6 @@ class SupplierController extends BaseAdminController
* @Route("/new", name="supplier_new") * @Route("/new", name="supplier_new")
* @Route("/{id}/clone", name="supplier_clone") * @Route("/{id}/clone", name="supplier_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Supplier $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Supplier $entity = null): Response
{ {
@ -101,8 +99,6 @@ class SupplierController extends BaseAdminController
/** /**
* @Route("/export", name="supplier_export_all") * @Route("/export", name="supplier_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -111,8 +107,6 @@ class SupplierController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="supplier_export") * @Route("/{id}/export", name="supplier_export")
*
* @return Response
*/ */
public function exportEntity(Supplier $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Supplier $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -62,8 +62,6 @@ class AttachmentFileController extends AbstractController
* Download the selected attachment. * Download the selected attachment.
* *
* @Route("/attachment/{id}/download", name="attachment_download") * @Route("/attachment/{id}/download", name="attachment_download")
*
* @return BinaryFileResponse
*/ */
public function download(Attachment $attachment, AttachmentManager $helper): BinaryFileResponse public function download(Attachment $attachment, AttachmentManager $helper): BinaryFileResponse
{ {
@ -94,8 +92,6 @@ class AttachmentFileController extends AbstractController
* View the attachment. * View the attachment.
* *
* @Route("/attachment/{id}/view", name="attachment_view") * @Route("/attachment/{id}/view", name="attachment_view")
*
* @return BinaryFileResponse
*/ */
public function view(Attachment $attachment, AttachmentManager $helper): BinaryFileResponse public function view(Attachment $attachment, AttachmentManager $helper): BinaryFileResponse
{ {

View file

@ -72,8 +72,6 @@ class GroupController extends BaseAdminController
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="group_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="group_edit")
* @Route("/{id}/", requirements={"id"="\d+"}) * @Route("/{id}/", requirements={"id"="\d+"})
*
* @return Response
*/ */
public function edit(Group $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(Group $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -84,8 +82,6 @@ class GroupController extends BaseAdminController
* @Route("/new", name="group_new") * @Route("/new", name="group_new")
* @Route("/{id}/clone", name="group_clone") * @Route("/{id}/clone", name="group_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Group $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?Group $entity = null): Response
{ {
@ -94,8 +90,6 @@ class GroupController extends BaseAdminController
/** /**
* @Route("/{id}", name="group_delete", methods={"DELETE"}) * @Route("/{id}", name="group_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, Group $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, Group $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -104,8 +98,6 @@ class GroupController extends BaseAdminController
/** /**
* @Route("/export", name="group_export_all") * @Route("/export", name="group_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -114,8 +106,6 @@ class GroupController extends BaseAdminController
/** /**
* @Route("/{id}/export", name="group_export") * @Route("/{id}/export", name="group_export")
*
* @return Response
*/ */
public function exportEntity(Group $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Group $entity, EntityExporter $exporter, Request $request): Response
{ {
@ -127,6 +117,7 @@ class GroupController extends BaseAdminController
if ($entity instanceof Group) { if ($entity instanceof Group) {
if ($entity->getUsers()->count() > 0) { if ($entity->getUsers()->count() > 0) {
$this->addFlash('error', 'entity.delete.must_not_contain_users'); $this->addFlash('error', 'entity.delete.must_not_contain_users');
return false; return false;
} }
} }

View file

@ -81,8 +81,6 @@ class HomepageController extends AbstractController
/** /**
* @Route("/", name="homepage") * @Route("/", name="homepage")
*
* @return \Symfony\Component\HttpFoundation\Response
*/ */
public function homepage(Request $request, GitVersionInfo $versionInfo): Response public function homepage(Request $request, GitVersionInfo $versionInfo): Response
{ {

View file

@ -91,8 +91,6 @@ class PartController extends AbstractController
* @Route("/{id}/info/{timestamp}", name="part_info") * @Route("/{id}/info/{timestamp}", name="part_info")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}", requirements={"id"="\d+"})
* *
* @return Response
*
* @throws \Exception * @throws \Exception
*/ */
public function show(Part $part, Request $request, TimeTravel $timeTravel, HistoryHelper $historyHelper, public function show(Part $part, Request $request, TimeTravel $timeTravel, HistoryHelper $historyHelper,
@ -144,8 +142,6 @@ class PartController extends AbstractController
/** /**
* @Route("/{id}/edit", name="part_edit") * @Route("/{id}/edit", name="part_edit")
*
* @return Response
*/ */
public function edit(Part $part, Request $request, EntityManagerInterface $em, TranslatorInterface $translator, public function edit(Part $part, Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
AttachmentSubmitHandler $attachmentSubmitHandler): Response AttachmentSubmitHandler $attachmentSubmitHandler): Response
@ -183,7 +179,7 @@ class PartController extends AbstractController
//Redirect to clone page if user wished that... //Redirect to clone page if user wished that...
//@phpstan-ignore-next-line //@phpstan-ignore-next-line
if ("save_and_clone" === $form->getClickedButton()->getName()) { if ('save_and_clone' === $form->getClickedButton()->getName()) {
return $this->redirectToRoute('part_clone', ['id' => $part->getID()]); return $this->redirectToRoute('part_clone', ['id' => $part->getID()]);
} }
@ -202,8 +198,6 @@ class PartController extends AbstractController
/** /**
* @Route("/{id}/delete", name="part_delete", methods={"DELETE"}) * @Route("/{id}/delete", name="part_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function delete(Request $request, Part $part): RedirectResponse public function delete(Request $request, Part $part): RedirectResponse
{ {
@ -229,8 +223,6 @@ class PartController extends AbstractController
/** /**
* @Route("/new", name="part_new") * @Route("/new", name="part_new")
* @Route("/{id}/clone", name="part_clone") * @Route("/{id}/clone", name="part_clone")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator, public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null): Response AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null): Response
@ -310,7 +302,7 @@ class PartController extends AbstractController
//Redirect to clone page if user wished that... //Redirect to clone page if user wished that...
//@phpstan-ignore-next-line //@phpstan-ignore-next-line
if ("save_and_clone" === $form->getClickedButton()->getName()) { if ('save_and_clone' === $form->getClickedButton()->getName()) {
return $this->redirectToRoute('part_clone', ['id' => $new_part->getID()]); return $this->redirectToRoute('part_clone', ['id' => $new_part->getID()]);
} }

View file

@ -78,10 +78,11 @@ class PartListsController extends AbstractController
if (!$this->isCsrfTokenValid('table_action', $request->request->get('_token'))) { if (!$this->isCsrfTokenValid('table_action', $request->request->get('_token'))) {
$this->addFlash('error', 'csfr_invalid'); $this->addFlash('error', 'csfr_invalid');
return $this->redirect($redirect); return $this->redirect($redirect);
} }
if ($action === null || $ids === null) { if (null === $action || null === $ids) {
$this->addFlash('error', 'part.table.actions.no_params_given'); $this->addFlash('error', 'part.table.actions.no_params_given');
} else { } else {
$parts = $actionHandler->idStringToArray($ids); $parts = $actionHandler->idStringToArray($ids);
@ -93,7 +94,6 @@ class PartListsController extends AbstractController
$this->addFlash('success', 'part.table.actions.success'); $this->addFlash('success', 'part.table.actions.success');
} }
return $this->redirect($redirect); return $this->redirect($redirect);
} }

View file

@ -69,8 +69,6 @@ class RedirectController extends AbstractController
/** /**
* This function is called whenever a route was not matching the localized routes. * This function is called whenever a route was not matching the localized routes.
* The purpose is to redirect the user to the localized version of the page. * The purpose is to redirect the user to the localized version of the page.
*
* @return RedirectResponse
*/ */
public function addLocalePart(Request $request): RedirectResponse public function addLocalePart(Request $request): RedirectResponse
{ {
@ -100,8 +98,6 @@ class RedirectController extends AbstractController
* Check if mod_rewrite is available (URL rewriting is possible). * Check if mod_rewrite is available (URL rewriting is possible).
* If this is true, we can redirect to /en, otherwise we have to redirect to index.php/en. * If this is true, we can redirect to /en, otherwise we have to redirect to index.php/en.
* When the PHP is not used via Apache SAPI, we just assume that URL rewriting is available. * When the PHP is not used via Apache SAPI, we just assume that URL rewriting is available.
*
* @return bool
*/ */
public function checkIfModRewriteAvailable(): bool public function checkIfModRewriteAvailable(): bool
{ {

View file

@ -77,8 +77,6 @@ class SecurityController extends AbstractController
/** /**
* @Route("/login", name="login", methods={"GET", "POST"}) * @Route("/login", name="login", methods={"GET", "POST"})
*
* @return \Symfony\Component\HttpFoundation\Response
*/ */
public function login(AuthenticationUtils $authenticationUtils): \Symfony\Component\HttpFoundation\Response public function login(AuthenticationUtils $authenticationUtils): \Symfony\Component\HttpFoundation\Response
{ {

View file

@ -20,7 +20,6 @@
namespace App\Controller; namespace App\Controller;
use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint; use App\Entity\Parts\Footprint;
@ -29,13 +28,11 @@ use App\Entity\Parts\MeasurementUnit;
use App\Services\Trees\NodesListBuilder; use App\Services\Trees\NodesListBuilder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
/** /**
* @Route("/select_api") * @Route("/select_api")
* @package App\Controller
*/ */
class SelectAPIController extends AbstractController class SelectAPIController extends AbstractController
{ {
@ -82,7 +79,7 @@ class SelectAPIController extends AbstractController
protected function getResponseForClass(string $class, bool $include_empty = false): Response protected function getResponseForClass(string $class, bool $include_empty = false): Response
{ {
$test_obj = new $class; $test_obj = new $class();
$this->denyAccessUnlessGranted('read', $test_obj); $this->denyAccessUnlessGranted('read', $test_obj);
$nodes = $this->nodesListBuilder->typeToNodesList($class); $nodes = $this->nodesListBuilder->typeToNodesList($class);

View file

@ -32,8 +32,6 @@ class StatisticsController extends AbstractController
{ {
/** /**
* @Route("/statistics", name="statistics_view") * @Route("/statistics", name="statistics_view")
*
* @return Response
*/ */
public function showStatistics(StatisticsHelper $helper): Response public function showStatistics(StatisticsHelper $helper): Response
{ {

View file

@ -1,28 +1,23 @@
<?php <?php
namespace App\Controller; namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
/** /**
* @Route("/tools") * @Route("/tools")
* @package App\Controller
*/ */
class ToolsController extends AbstractController class ToolsController extends AbstractController
{ {
/** /**
* @Route("/reel_calc", name="tools_reel_calculator") * @Route("/reel_calc", name="tools_reel_calculator")
* @return Response
*/ */
public function reelCalculator(): Response public function reelCalculator(): Response
{ {
$this->denyAccessUnlessGranted('@tools.reel_calculator'); $this->denyAccessUnlessGranted('@tools.reel_calculator');
return $this->render("Tools/ReelCalculator/main.html.twig"); return $this->render('Tools/ReelCalculator/main.html.twig');
} }
} }

View file

@ -70,8 +70,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/tools", name="tree_tools") * @Route("/tools", name="tree_tools")
*
* @return JsonResponse
*/ */
public function tools(ToolsTreeBuilder $builder): JsonResponse public function tools(ToolsTreeBuilder $builder): JsonResponse
{ {
@ -83,8 +81,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/category/{id}", name="tree_category") * @Route("/category/{id}", name="tree_category")
* @Route("/categories") * @Route("/categories")
*
* @return JsonResponse
*/ */
public function categoryTree(?Category $category = null): JsonResponse public function categoryTree(?Category $category = null): JsonResponse
{ {
@ -96,8 +92,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/footprint/{id}", name="tree_footprint") * @Route("/footprint/{id}", name="tree_footprint")
* @Route("/footprints") * @Route("/footprints")
*
* @return JsonResponse
*/ */
public function footprintTree(?Footprint $footprint = null): JsonResponse public function footprintTree(?Footprint $footprint = null): JsonResponse
{ {
@ -109,8 +103,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/location/{id}", name="tree_location") * @Route("/location/{id}", name="tree_location")
* @Route("/locations") * @Route("/locations")
*
* @return JsonResponse
*/ */
public function locationTree(?Storelocation $location = null): JsonResponse public function locationTree(?Storelocation $location = null): JsonResponse
{ {
@ -122,8 +114,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/manufacturer/{id}", name="tree_manufacturer") * @Route("/manufacturer/{id}", name="tree_manufacturer")
* @Route("/manufacturers") * @Route("/manufacturers")
*
* @return JsonResponse
*/ */
public function manufacturerTree(?Manufacturer $manufacturer = null): JsonResponse public function manufacturerTree(?Manufacturer $manufacturer = null): JsonResponse
{ {
@ -135,8 +125,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/supplier/{id}", name="tree_supplier") * @Route("/supplier/{id}", name="tree_supplier")
* @Route("/suppliers") * @Route("/suppliers")
*
* @return JsonResponse
*/ */
public function supplierTree(?Supplier $supplier = null): JsonResponse public function supplierTree(?Supplier $supplier = null): JsonResponse
{ {
@ -148,8 +136,6 @@ class TreeController extends AbstractController
/** /**
* @Route("/device/{id}", name="tree_device") * @Route("/device/{id}", name="tree_device")
* @Route("/devices") * @Route("/devices")
*
* @return JsonResponse
*/ */
public function deviceTree(?Device $device = null): JsonResponse public function deviceTree(?Device $device = null): JsonResponse
{ {

View file

@ -88,6 +88,7 @@ class UserController extends AdminPages\BaseAdminController
$event = new SecurityEvent($entity); $event = new SecurityEvent($entity);
$this->eventDispatcher->dispatch($event, SecurityEvents::PASSWORD_CHANGED); $this->eventDispatcher->dispatch($event, SecurityEvents::PASSWORD_CHANGED);
} }
return true; return true;
} }
@ -146,8 +147,6 @@ class UserController extends AdminPages\BaseAdminController
* @Route("/new", name="user_new") * @Route("/new", name="user_new")
* @Route("/{id}/clone", name="user_clone") * @Route("/{id}/clone", name="user_clone")
* @Route("/") * @Route("/")
*
* @return Response
*/ */
public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?User $entity = null): Response public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?User $entity = null): Response
{ {
@ -159,6 +158,7 @@ class UserController extends AdminPages\BaseAdminController
if ($entity instanceof User) { if ($entity instanceof User) {
//TODO: Find a better solution //TODO: Find a better solution
$this->addFlash('error', 'Currently it is not possible to delete a user, as this would break the log... This will be implemented later...'); $this->addFlash('error', 'Currently it is not possible to delete a user, as this would break the log... This will be implemented later...');
return false; return false;
} }
@ -181,8 +181,6 @@ class UserController extends AdminPages\BaseAdminController
/** /**
* @Route("/export", name="user_export_all") * @Route("/export", name="user_export_all")
*
* @return Response
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -191,8 +189,6 @@ class UserController extends AdminPages\BaseAdminController
/** /**
* @Route("/{id}/export", name="user_export") * @Route("/{id}/export", name="user_export")
*
* @return Response
*/ */
public function exportEntity(User $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(User $entity, EntityExporter $exporter, Request $request): Response
{ {
@ -202,8 +198,6 @@ class UserController extends AdminPages\BaseAdminController
/** /**
* @Route("/info", name="user_info_self") * @Route("/info", name="user_info_self")
* @Route("/{id}/info", name="user_info") * @Route("/{id}/info", name="user_info")
*
* @return Response
*/ */
public function userInfo(?User $user, Packages $packages, Request $request, DataTableFactory $dataTableFactory): Response public function userInfo(?User $user, Packages $packages, Request $request, DataTableFactory $dataTableFactory): Response
{ {

View file

@ -110,8 +110,6 @@ class UserSettingsController extends AbstractController
/** /**
* @Route("/u2f_delete", name="u2f_delete", methods={"DELETE"}) * @Route("/u2f_delete", name="u2f_delete", methods={"DELETE"})
*
* @return RedirectResponse
*/ */
public function removeU2FToken(Request $request, EntityManagerInterface $entityManager, BackupCodeManager $backupCodeManager): RedirectResponse public function removeU2FToken(Request $request, EntityManagerInterface $entityManager, BackupCodeManager $backupCodeManager): RedirectResponse
{ {

View file

@ -83,7 +83,6 @@ final class AttachmentDataTable implements DataTableTypeInterface
if ($context->isPicture() if ($context->isPicture()
&& !$context->isExternal() && !$context->isExternal()
&& $this->attachmentHelper->isFileExisting($context)) { && $this->attachmentHelper->isFileExisting($context)) {
$title = htmlspecialchars($context->getName()); $title = htmlspecialchars($context->getName());
if ($context->getFilename()) { if ($context->getFilename()) {
$title .= ' ('.htmlspecialchars($context->getFilename()).')'; $title .= ' ('.htmlspecialchars($context->getFilename()).')';

View file

@ -66,8 +66,6 @@ class EntityColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type. * The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
* *
* @param mixed $value The single value of the column * @param mixed $value The single value of the column
*
* @return mixed
*/ */
public function normalize($value) public function normalize($value)
{ {

View file

@ -58,8 +58,6 @@ class MarkdownColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type. * The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
* *
* @param mixed $value The single value of the column * @param mixed $value The single value of the column
*
* @return mixed
*/ */
public function normalize($value) public function normalize($value)
{ {

View file

@ -68,8 +68,6 @@ class PartAttachmentsColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type. * The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
* *
* @param mixed $value The single value of the column * @param mixed $value The single value of the column
*
* @return mixed
*/ */
public function normalize($value) public function normalize($value)
{ {

View file

@ -58,8 +58,6 @@ class TagsColumn extends AbstractColumn
* The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type. * The normalize function is responsible for converting parsed and processed data to a datatables-appropriate type.
* *
* @param mixed $value The single value of the column * @param mixed $value The single value of the column
*
* @return mixed
*/ */
public function normalize($value) public function normalize($value)
{ {

View file

@ -49,7 +49,6 @@ use App\DataTables\Column\LocaleDateTimeColumn;
use App\DataTables\Column\MarkdownColumn; use App\DataTables\Column\MarkdownColumn;
use App\DataTables\Column\PartAttachmentsColumn; use App\DataTables\Column\PartAttachmentsColumn;
use App\DataTables\Column\TagsColumn; use App\DataTables\Column\TagsColumn;
use App\Entity\LogSystem\AbstractLogEntry;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint; use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer; use App\Entity\Parts\Manufacturer;

View file

@ -68,7 +68,7 @@ abstract class Attachment extends AbstractNamedDBElement
public const INTERNAL_PLACEHOLDER = ['%BASE%', '%MEDIA%', '%SECURE%']; public const INTERNAL_PLACEHOLDER = ['%BASE%', '%MEDIA%', '%SECURE%'];
/** /**
* @var array Placeholders for attachments which using built in files. * @var array placeholders for attachments which using built in files
*/ */
public const BUILTIN_PLACEHOLDER = ['%FOOTPRINTS%', '%FOOTPRINTS3D%']; public const BUILTIN_PLACEHOLDER = ['%FOOTPRINTS%', '%FOOTPRINTS3D%'];
@ -345,7 +345,6 @@ abstract class Attachment extends AbstractNamedDBElement
return $this->attachment_type; return $this->attachment_type;
} }
/***************************************************************************************************** /*****************************************************************************************************
* Setters * Setters
*************************************************************************************************** ***************************************************************************************************

View file

@ -118,5 +118,4 @@ class AttachmentType extends AbstractStructuralDBElement
return $this; return $this;
} }
} }

View file

@ -39,7 +39,7 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
use TimestampTrait; use TimestampTrait;
/** /**
* @var string The name of this element. * @var string the name of this element
* @ORM\Column(type="string") * @ORM\Column(type="string")
* @Assert\NotBlank() * @Assert\NotBlank()
* @Groups({"simple", "extended", "full"}) * @Groups({"simple", "extended", "full"})
@ -92,8 +92,6 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
* Change the name of this element. * Change the name of this element.
* *
* @param string $new_name the new name * @param string $new_name the new name
*
* @return self
*/ */
public function setName(string $new_name): self public function setName(string $new_name): self
{ {

View file

@ -22,9 +22,6 @@ declare(strict_types=1);
namespace App\Entity\Base; namespace App\Entity\Base;
use App\Entity\Parts\Part;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
@ -34,5 +31,4 @@ use Doctrine\ORM\Mapping as ORM;
*/ */
abstract class AbstractPartsContainingDBElement extends AbstractStructuralDBElement abstract class AbstractPartsContainingDBElement extends AbstractStructuralDBElement
{ {
} }

View file

@ -130,7 +130,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
* @param AbstractStructuralDBElement $another_element the object to compare * @param AbstractStructuralDBElement $another_element the object to compare
* IMPORTANT: both objects to compare must be from the same class (for example two "Device" objects)! * IMPORTANT: both objects to compare must be from the same class (for example two "Device" objects)!
* *
* @return bool True, if this element is child of $another_element. * @return bool true, if this element is child of $another_element
* *
* @throws InvalidArgumentException if there was an error * @throws InvalidArgumentException if there was an error
*/ */
@ -156,7 +156,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
/** /**
* Checks if this element is an root element (has no parent). * Checks if this element is an root element (has no parent).
* *
* @return bool True if the this element is an root element. * @return bool true if the this element is an root element
*/ */
public function isRoot(): bool public function isRoot(): bool
{ {
@ -283,9 +283,6 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
return $this->children; return $this->children;
} }
/**
* @return bool
*/
public function isNotSelectable(): bool public function isNotSelectable(): bool
{ {
return $this->not_selectable; return $this->not_selectable;

View file

@ -20,24 +20,24 @@
namespace App\Entity\Base; namespace App\Entity\Base;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use Doctrine\Common\Collections\Collection;
interface PartsContainingRepositoryInterface interface PartsContainingRepositoryInterface
{ {
/** /**
* Returns all parts associated with this element. * Returns all parts associated with this element.
* @param object $element The element for which the parts should be determined. *
* @param object $element the element for which the parts should be determined
* @param array $order_by The order of the parts. Format ['name' => 'ASC'] * @param array $order_by The order of the parts. Format ['name' => 'ASC']
*
* @return Part[] * @return Part[]
*/ */
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array; public function getParts(object $element, array $order_by = ['name' => 'ASC']): array;
/** /**
* Gets the count of the parts associated with this element. * Gets the count of the parts associated with this element.
* @param object $element The element for which the parts should be determined. *
* @return int * @param object $element the element for which the parts should be determined
*/ */
public function getPartsCount(object $element): int; public function getPartsCount(object $element): int;
} }

View file

@ -27,16 +27,12 @@ interface LogWithCommentInterface
{ {
/** /**
* Checks if this log entry has a user provided comment. * Checks if this log entry has a user provided comment.
*
* @return bool
*/ */
public function hasComment(): bool; public function hasComment(): bool;
/** /**
* Gets the user provided comment associated with this log entry. * Gets the user provided comment associated with this log entry.
* Returns null if not comment was set. * Returns null if not comment was set.
*
* @return string|null
*/ */
public function getComment(): ?string; public function getComment(): ?string;

View file

@ -29,15 +29,11 @@ interface LogWithEventUndoInterface
{ {
/** /**
* Checks if this element undoes another event. * Checks if this element undoes another event.
*
* @return bool
*/ */
public function isUndoEvent(): bool; public function isUndoEvent(): bool;
/** /**
* Returns the ID of the undone event or null if no event is undone. * Returns the ID of the undone event or null if no event is undone.
*
* @return int|null
*/ */
public function getUndoEventID(): ?int; public function getUndoEventID(): ?int;
@ -52,8 +48,6 @@ interface LogWithEventUndoInterface
* Returns the mode how the event was undone: * Returns the mode how the event was undone:
* "undo" = Only a single event was applied to element * "undo" = Only a single event was applied to element
* "revert" = Element was reverted to the state it was to the timestamp of the log. * "revert" = Element was reverted to the state it was to the timestamp of the log.
*
* @return string
*/ */
public function getUndoMode(): string; public function getUndoMode(): string;
} }

View file

@ -29,7 +29,7 @@ interface TimeTravelInterface
/** /**
* Checks if this entry has informations which data has changed. * Checks if this entry has informations which data has changed.
* *
* @return bool True if this entry has informations about the changed data. * @return bool true if this entry has informations about the changed data
*/ */
public function hasOldDataInformations(): bool; public function hasOldDataInformations(): bool;
@ -40,8 +40,6 @@ interface TimeTravelInterface
/** /**
* Returns the the timestamp associated with this change. * Returns the the timestamp associated with this change.
*
* @return \DateTime
*/ */
public function getTimestamp(): \DateTime; public function getTimestamp(): \DateTime;
} }

View file

@ -73,12 +73,12 @@ class LabelOptions
protected $supported_element = 'part'; protected $supported_element = 'part';
/** /**
* @var string Any additional CSS for the label. * @var string any additional CSS for the label
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $additional_css = ''; protected $additional_css = '';
/** @var string The mode that will be used to interpret the lines. /** @var string The mode that will be used to interpret the lines
* @Assert\Choice(choices=LabelOptions::LINES_MODES) * @Assert\Choice(choices=LabelOptions::LINES_MODES)
* @ORM\Column(type="string") * @ORM\Column(type="string")
*/ */
@ -90,9 +90,6 @@ class LabelOptions
*/ */
protected $lines = ''; protected $lines = '';
/**
* @return float
*/
public function getWidth(): float public function getWidth(): float
{ {
return $this->width; return $this->width;
@ -108,9 +105,6 @@ class LabelOptions
return $this; return $this;
} }
/**
* @return float
*/
public function getHeight(): float public function getHeight(): float
{ {
return $this->height; return $this->height;
@ -126,9 +120,6 @@ class LabelOptions
return $this; return $this;
} }
/**
* @return string
*/
public function getBarcodeType(): string public function getBarcodeType(): string
{ {
return $this->barcode_type; return $this->barcode_type;
@ -144,9 +135,6 @@ class LabelOptions
return $this; return $this;
} }
/**
* @return string
*/
public function getPictureType(): string public function getPictureType(): string
{ {
return $this->picture_type; return $this->picture_type;
@ -162,9 +150,6 @@ class LabelOptions
return $this; return $this;
} }
/**
* @return string
*/
public function getSupportedElement(): string public function getSupportedElement(): string
{ {
return $this->supported_element; return $this->supported_element;
@ -180,9 +165,6 @@ class LabelOptions
return $this; return $this;
} }
/**
* @return string
*/
public function getLines(): string public function getLines(): string
{ {
return $this->lines; return $this->lines;
@ -200,8 +182,6 @@ class LabelOptions
/** /**
* Gets additional CSS (it will simply be attached. * Gets additional CSS (it will simply be attached.
*
* @return string
*/ */
public function getAdditionalCss(): string public function getAdditionalCss(): string
{ {
@ -218,9 +198,6 @@ class LabelOptions
return $this; return $this;
} }
/**
* @return string
*/
public function getLinesMode(): string public function getLinesMode(): string
{ {
return $this->lines_mode; return $this->lines_mode;

View file

@ -59,7 +59,7 @@ class LabelProfile extends AttachmentContainingDBElement
protected $comment = ''; protected $comment = '';
/** /**
* @var bool Determines, if this label profile should be shown in the dropdown quick menu. * @var bool determines, if this label profile should be shown in the dropdown quick menu
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $show_in_dropdown = true; protected $show_in_dropdown = true;
@ -101,8 +101,6 @@ class LabelProfile extends AttachmentContainingDBElement
/** /**
* Returns true, if this label profile should be shown in label generator quick menu. * Returns true, if this label profile should be shown in label generator quick menu.
*
* @return bool
*/ */
public function isShowInDropdown(): bool public function isShowInDropdown(): bool
{ {

View file

@ -162,7 +162,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
*/ */
protected $user; protected $user;
/** @var DateTime The datetime the event associated with this log entry has occured. /** @var DateTime The datetime the event associated with this log entry has occured
* @ORM\Column(type="datetime", name="datetime") * @ORM\Column(type="datetime", name="datetime")
*/ */
protected $timestamp; protected $timestamp;
@ -223,8 +223,6 @@ abstract class AbstractLogEntry extends AbstractDBElement
/** /**
* Returns the timestamp when the event that caused this log entry happened. * Returns the timestamp when the event that caused this log entry happened.
*
* @return DateTime
*/ */
public function getTimestamp(): DateTime public function getTimestamp(): DateTime
{ {
@ -246,8 +244,6 @@ abstract class AbstractLogEntry extends AbstractDBElement
/** /**
* Get the priority level of this log entry. 0 is highest and 7 lowest level. * Get the priority level of this log entry. 0 is highest and 7 lowest level.
* See LEVEL_* consts in this class for more info. * See LEVEL_* consts in this class for more info.
*
* @return int
*/ */
public function getLevel(): int public function getLevel(): int
{ {
@ -276,8 +272,6 @@ abstract class AbstractLogEntry extends AbstractDBElement
/** /**
* Get the priority level of this log entry as PSR3 compatible string. * Get the priority level of this log entry as PSR3 compatible string.
*
* @return string
*/ */
public function getLevelString(): string public function getLevelString(): string
{ {
@ -298,8 +292,6 @@ abstract class AbstractLogEntry extends AbstractDBElement
/** /**
* Returns the type of the event this log entry is associated with. * Returns the type of the event this log entry is associated with.
*
* @return string
*/ */
public function getType(): string public function getType(): string
{ {
@ -310,7 +302,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
* Returns the class name of the target element associated with this log entry. * Returns the class name of the target element associated with this log entry.
* Returns null, if this log entry is not associated with an log entry. * Returns null, if this log entry is not associated with an log entry.
* *
* @return string|null The class name of the target class. * @return string|null the class name of the target class
*/ */
public function getTargetClass(): ?string public function getTargetClass(): ?string
{ {
@ -325,7 +317,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
* Returns the ID of the target element associated with this log entry. * Returns the ID of the target element associated with this log entry.
* Returns null, if this log entry is not associated with an log entry. * Returns null, if this log entry is not associated with an log entry.
* *
* @return int|null The ID of the associated element. * @return int|null the ID of the associated element
*/ */
public function getTargetID(): ?int public function getTargetID(): ?int
{ {
@ -339,7 +331,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
/** /**
* Checks if this log entry is associated with an element. * Checks if this log entry is associated with an element.
* *
* @return bool True if this log entry is associated with an element, false otherwise. * @return bool true if this log entry is associated with an element, false otherwise
*/ */
public function hasTarget(): bool public function hasTarget(): bool
{ {
@ -349,7 +341,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
/** /**
* Sets the target element associated with this element. * Sets the target element associated with this element.
* *
* @param AbstractDBElement $element The element that should be associated with this element. * @param AbstractDBElement $element the element that should be associated with this element
* *
* @return $this * @return $this
*/ */
@ -406,7 +398,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
* *
* @param string $level the PSR3 compatible string that should be converted * @param string $level the PSR3 compatible string that should be converted
* *
* @return int The internal int representation. * @return int the internal int representation
*/ */
final public static function levelStringToInt(string $level): int final public static function levelStringToInt(string $level): int
{ {
@ -422,8 +414,6 @@ abstract class AbstractLogEntry extends AbstractDBElement
* Converts an target type id to an full qualified class name. * Converts an target type id to an full qualified class name.
* *
* @param int $type_id The target type ID * @param int $type_id The target type ID
*
* @return string
*/ */
final public static function targetTypeIdToClass(int $type_id): string final public static function targetTypeIdToClass(int $type_id): string
{ {
@ -439,7 +429,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
* *
* @param string $class The name of the class (FQN) that should be converted to id * @param string $class The name of the class (FQN) that should be converted to id
* *
* @return int The ID of the associated target type ID. * @return int the ID of the associated target type ID
*/ */
final public static function targetTypeClassToID(string $class): int final public static function targetTypeClassToID(string $class): int
{ {

View file

@ -54,8 +54,6 @@ class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventU
/** /**
* Get the name of the collection (on target element) that was changed. * Get the name of the collection (on target element) that was changed.
*
* @return string
*/ */
public function getCollectionName(): string public function getCollectionName(): string
{ {
@ -65,8 +63,6 @@ class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventU
/** /**
* Gets the name of the element that was deleted. * Gets the name of the element that was deleted.
* Return null, if the element did not have a name. * Return null, if the element did not have a name.
*
* @return string|null
*/ */
public function getOldName(): ?string public function getOldName(): ?string
{ {
@ -75,8 +71,6 @@ class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventU
/** /**
* Returns the class of the deleted element. * Returns the class of the deleted element.
*
* @return string
*/ */
public function getDeletedElementClass(): string public function getDeletedElementClass(): string
{ {
@ -85,8 +79,6 @@ class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventU
/** /**
* Returns the ID of the deleted element. * Returns the ID of the deleted element.
*
* @return int
*/ */
public function getDeletedElementID(): int public function getDeletedElementID(): int
{ {

View file

@ -60,8 +60,6 @@ class DatabaseUpdatedLogEntry extends AbstractLogEntry
/** /**
* Checks if the database update was successful. * Checks if the database update was successful.
*
* @return bool
*/ */
public function isSuccessful(): bool public function isSuccessful(): bool
{ {
@ -71,8 +69,6 @@ class DatabaseUpdatedLogEntry extends AbstractLogEntry
/** /**
* Gets the database version before update. * Gets the database version before update.
*
* @return string
*/ */
public function getOldVersion(): string public function getOldVersion(): string
{ {
@ -81,8 +77,6 @@ class DatabaseUpdatedLogEntry extends AbstractLogEntry
/** /**
* Gets the (target) database version after update. * Gets the (target) database version after update.
*
* @return string
*/ */
public function getNewVersion(): string public function getNewVersion(): string
{ {

View file

@ -70,8 +70,6 @@ class ElementCreatedLogEntry extends AbstractLogEntry implements LogWithCommentI
/** /**
* Gets the instock when the part was created. * Gets the instock when the part was created.
*
* @return string|null
*/ */
public function getCreationInstockValue(): ?string public function getCreationInstockValue(): ?string
{ {
@ -80,8 +78,6 @@ class ElementCreatedLogEntry extends AbstractLogEntry implements LogWithCommentI
/** /**
* Checks if a creation instock value was saved with this entry. * Checks if a creation instock value was saved with this entry.
*
* @return bool
*/ */
public function hasCreationInstockValue(): bool public function hasCreationInstockValue(): bool
{ {

View file

@ -65,8 +65,6 @@ class ElementEditedLogEntry extends AbstractLogEntry implements TimeTravelInterf
/** /**
* Checks if this log contains infos about which fields has changed. * Checks if this log contains infos about which fields has changed.
*
* @return bool
*/ */
public function hasChangedFieldsInfo(): bool public function hasChangedFieldsInfo(): bool
{ {

View file

@ -61,8 +61,6 @@ class ExceptionLogEntry extends AbstractLogEntry
/** /**
* The class name of the exception that caused this log entry. * The class name of the exception that caused this log entry.
*
* @return string
*/ */
public function getExceptionClass(): string public function getExceptionClass(): string
{ {
@ -71,8 +69,6 @@ class ExceptionLogEntry extends AbstractLogEntry
/** /**
* Returns the file where the exception happened. * Returns the file where the exception happened.
*
* @return string
*/ */
public function getFile(): string public function getFile(): string
{ {
@ -81,8 +77,6 @@ class ExceptionLogEntry extends AbstractLogEntry
/** /**
* Returns the line where the exception happened. * Returns the line where the exception happened.
*
* @return int
*/ */
public function getLine(): int public function getLine(): int
{ {
@ -91,8 +85,6 @@ class ExceptionLogEntry extends AbstractLogEntry
/** /**
* Return the message of the exception. * Return the message of the exception.
*
* @return string
*/ */
public function getMessage(): string public function getMessage(): string
{ {

View file

@ -53,8 +53,6 @@ class InstockChangedLogEntry extends AbstractLogEntry
/** /**
* Get the old instock. * Get the old instock.
*
* @return int
*/ */
public function getOldInstock(): int public function getOldInstock(): int
{ {
@ -63,8 +61,6 @@ class InstockChangedLogEntry extends AbstractLogEntry
/** /**
* Get the new instock. * Get the new instock.
*
* @return int
*/ */
public function getNewInstock(): int public function getNewInstock(): int
{ {
@ -73,8 +69,6 @@ class InstockChangedLogEntry extends AbstractLogEntry
/** /**
* Gets the comment associated with the instock change. * Gets the comment associated with the instock change.
*
* @return string
*/ */
public function getComment(): string public function getComment(): string
{ {
@ -85,8 +79,6 @@ class InstockChangedLogEntry extends AbstractLogEntry
* Returns the price that has to be payed for the change (in the base currency). * Returns the price that has to be payed for the change (in the base currency).
* *
* @param bool $absolute Set this to true, if you want only get the absolute value of the price (without minus) * @param bool $absolute Set this to true, if you want only get the absolute value of the price (without minus)
*
* @return float
*/ */
public function getPrice(bool $absolute = false): float public function getPrice(bool $absolute = false): float
{ {
@ -100,9 +92,9 @@ class InstockChangedLogEntry extends AbstractLogEntry
/** /**
* Returns the difference value of the change ($new_instock - $old_instock). * Returns the difference value of the change ($new_instock - $old_instock).
* *
* @param bool $absolute Set this to true if you want only the absolute value of the difference. * @param bool $absolute set this to true if you want only the absolute value of the difference
* *
* @return int Difference is positive if instock has increased, negative if decreased. * @return int difference is positive if instock has increased, negative if decreased
*/ */
public function getDifference(bool $absolute = false): int public function getDifference(bool $absolute = false): int
{ {
@ -122,7 +114,7 @@ class InstockChangedLogEntry extends AbstractLogEntry
/** /**
* Checks if the Change was an withdrawal of parts. * Checks if the Change was an withdrawal of parts.
* *
* @return bool True if the change was an withdrawal, false if not. * @return bool true if the change was an withdrawal, false if not
*/ */
public function isWithdrawal(): bool public function isWithdrawal(): bool
{ {

View file

@ -89,8 +89,6 @@ class SecurityEventLogEntry extends AbstractLogEntry
/** /**
* Return what event this log entry represents (e.g. password_reset). * Return what event this log entry represents (e.g. password_reset).
*
* @return string
*/ */
public function getEventType(): string public function getEventType(): string
{ {
@ -104,8 +102,6 @@ class SecurityEventLogEntry extends AbstractLogEntry
/** /**
* Return the (anonymized) IP address used to login the user. * Return the (anonymized) IP address used to login the user.
*
* @return string
*/ */
public function getIPAddress(): string public function getIPAddress(): string
{ {
@ -115,7 +111,7 @@ class SecurityEventLogEntry extends AbstractLogEntry
/** /**
* Sets the IP address used to login the user. * Sets the IP address used to login the user.
* *
* @param string $ip The IP address used to login the user. * @param string $ip the IP address used to login the user
* @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant * @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant
* *
* @return $this * @return $this

View file

@ -63,8 +63,6 @@ class UserLoginLogEntry extends AbstractLogEntry
/** /**
* Return the (anonymized) IP address used to login the user. * Return the (anonymized) IP address used to login the user.
*
* @return string
*/ */
public function getIPAddress(): string public function getIPAddress(): string
{ {
@ -74,7 +72,7 @@ class UserLoginLogEntry extends AbstractLogEntry
/** /**
* Sets the IP address used to login the user. * Sets the IP address used to login the user.
* *
* @param string $ip The IP address used to login the user. * @param string $ip the IP address used to login the user
* @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant * @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant
* *
* @return $this * @return $this

View file

@ -61,8 +61,6 @@ class UserLogoutLogEntry extends AbstractLogEntry
/** /**
* Return the (anonymized) IP address used to login the user. * Return the (anonymized) IP address used to login the user.
*
* @return string
*/ */
public function getIPAddress(): string public function getIPAddress(): string
{ {
@ -72,7 +70,7 @@ class UserLogoutLogEntry extends AbstractLogEntry
/** /**
* Sets the IP address used to login the user. * Sets the IP address used to login the user.
* *
* @param string $ip The IP address used to login the user. * @param string $ip the IP address used to login the user
* @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant * @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant
* *
* @return $this * @return $this

View file

@ -61,8 +61,6 @@ class UserNotAllowedLogEntry extends AbstractLogEntry
/** /**
* Returns the path the user tried to accessed and what was denied. * Returns the path the user tried to accessed and what was denied.
*
* @return string
*/ */
public function getPath(): string public function getPath(): string
{ {

View file

@ -64,7 +64,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
protected $symbol = ''; protected $symbol = '';
/** /**
* @var float|null The guaranteed minimum value of this property. * @var float|null the guaranteed minimum value of this property
* @Assert\Type({"float","null"}) * @Assert\Type({"float","null"})
* @Assert\LessThanOrEqual(propertyPath="value_typical", message="parameters.validator.min_lesser_typical") * @Assert\LessThanOrEqual(propertyPath="value_typical", message="parameters.validator.min_lesser_typical")
* @Assert\LessThan(propertyPath="value_max", message="parameters.validator.min_lesser_max") * @Assert\LessThan(propertyPath="value_max", message="parameters.validator.min_lesser_max")
@ -73,14 +73,14 @@ abstract class AbstractParameter extends AbstractNamedDBElement
protected $value_min; protected $value_min;
/** /**
* @var float|null The typical value of this property. * @var float|null the typical value of this property
* @Assert\Type({"null", "float"}) * @Assert\Type({"null", "float"})
* @ORM\Column(type="float", nullable=true) * @ORM\Column(type="float", nullable=true)
*/ */
protected $value_typical; protected $value_typical;
/** /**
* @var float|null The maximum value of this property. * @var float|null the maximum value of this property
* @Assert\Type({"float", "null"}) * @Assert\Type({"float", "null"})
* @Assert\GreaterThanOrEqual(propertyPath="value_typical", message="parameters.validator.max_greater_typical") * @Assert\GreaterThanOrEqual(propertyPath="value_typical", message="parameters.validator.max_greater_typical")
* @ORM\Column(type="float", nullable=true) * @ORM\Column(type="float", nullable=true)
@ -95,13 +95,13 @@ abstract class AbstractParameter extends AbstractNamedDBElement
protected $unit = ''; protected $unit = '';
/** /**
* @var string A text value for the given property. * @var string a text value for the given property
* @ORM\Column(type="string", nullable=false) * @ORM\Column(type="string", nullable=false)
*/ */
protected $value_text = ''; protected $value_text = '';
/** /**
* @var string The group this parameter belongs to. * @var string the group this parameter belongs to
* @ORM\Column(type="string", nullable=false, name="param_group") * @ORM\Column(type="string", nullable=false, name="param_group")
*/ */
protected $group = ''; protected $group = '';
@ -109,7 +109,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Mapping is done in sub classes. * Mapping is done in sub classes.
* *
* @var AbstractDBElement|null The element to which this parameter belongs to. * @var AbstractDBElement|null the element to which this parameter belongs to
*/ */
protected $element; protected $element;
@ -130,8 +130,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the element this parameter belongs to. * Returns the element this parameter belongs to.
*
* @return AbstractDBElement|null
*/ */
public function getElement(): ?AbstractDBElement public function getElement(): ?AbstractDBElement
{ {
@ -141,8 +139,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Return a formatted string version of the values of the string. * Return a formatted string version of the values of the string.
* Based on the set values it can return something like this: 34 V (12 V ... 50 V) [Text]. * Based on the set values it can return something like this: 34 V (12 V ... 50 V) [Text].
*
* @return string
*/ */
public function getFormattedValue(): string public function getFormattedValue(): string
{ {
@ -211,8 +207,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the name of the group this parameter is associated to (e.g. Technical Parameters). * Returns the name of the group this parameter is associated to (e.g. Technical Parameters).
*
* @return string
*/ */
public function getGroup(): string public function getGroup(): string
{ {
@ -233,8 +227,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the mathematical symbol for this specification (e.g. "V_CB"). * Returns the mathematical symbol for this specification (e.g. "V_CB").
*
* @return string
*/ */
public function getSymbol(): string public function getSymbol(): string
{ {
@ -255,8 +247,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns The guaranteed minimum value of this property. * Returns The guaranteed minimum value of this property.
*
* @return float|null
*/ */
public function getValueMin(): ?float public function getValueMin(): ?float
{ {
@ -277,8 +267,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the typical value of this property. * Returns the typical value of this property.
*
* @return float|null
*/ */
public function getValueTypical(): ?float public function getValueTypical(): ?float
{ {
@ -287,8 +275,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Return a formatted version with the minimum value with the unit of this parameter. * Return a formatted version with the minimum value with the unit of this parameter.
*
* @return string
*/ */
public function getValueTypicalWithUnit(): string public function getValueTypicalWithUnit(): string
{ {
@ -297,8 +283,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Return a formatted version with the maximum value with the unit of this parameter. * Return a formatted version with the maximum value with the unit of this parameter.
*
* @return string
*/ */
public function getValueMaxWithUnit(): string public function getValueMaxWithUnit(): string
{ {
@ -307,8 +291,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Return a formatted version with the typical value with the unit of this parameter. * Return a formatted version with the typical value with the unit of this parameter.
*
* @return string
*/ */
public function getValueMinWithUnit(): string public function getValueMinWithUnit(): string
{ {
@ -331,8 +313,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the guaranteed maximum value. * Returns the guaranteed maximum value.
*
* @return float|null
*/ */
public function getValueMax(): ?float public function getValueMax(): ?float
{ {
@ -353,8 +333,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the unit used by the value (e.g. "V"). * Returns the unit used by the value (e.g. "V").
*
* @return string
*/ */
public function getUnit(): string public function getUnit(): string
{ {
@ -375,8 +353,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Returns the text value. * Returns the text value.
*
* @return string
*/ */
public function getValueText(): string public function getValueText(): string
{ {
@ -397,8 +373,6 @@ abstract class AbstractParameter extends AbstractNamedDBElement
/** /**
* Return a string representation and (if possible) with its unit. * Return a string representation and (if possible) with its unit.
*
* @return string
*/ */
protected function formatWithUnit(float $value, string $format = '%g'): string protected function formatWithUnit(float $value, string $format = '%g'): string
{ {

View file

@ -39,8 +39,6 @@ trait ParametersTrait
/** /**
* Return all associated specifications. * Return all associated specifications.
* *
* @return Collection
*
* @psalm-return Collection<int, PartParameter> * @psalm-return Collection<int, PartParameter>
*/ */
public function getParameters(): \Doctrine\Common\Collections\Collection public function getParameters(): \Doctrine\Common\Collections\Collection

View file

@ -111,7 +111,6 @@ class Category extends AbstractPartsContainingDBElement
*/ */
protected $parameters; protected $parameters;
public function getPartnameHint(): string public function getPartnameHint(): string
{ {
return $this->partname_hint; return $this->partname_hint;

View file

@ -99,7 +99,6 @@ class Footprint extends AbstractPartsContainingDBElement
*/ */
protected $parameters; protected $parameters;
/**************************************** /****************************************
* Getters * Getters
****************************************/ ****************************************/

View file

@ -109,7 +109,6 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
*/ */
protected $parameters; protected $parameters;
/** /**
* @return string * @return string
*/ */

View file

@ -176,7 +176,6 @@ class Part extends AttachmentContainingDBElement
parent::__clone(); parent::__clone();
} }
/** /**
* Get all devices which uses this part. * Get all devices which uses this part.
* *

View file

@ -73,7 +73,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
protected $description = ''; protected $description = '';
/** /**
* @var string A comment stored with this lot. * @var string a comment stored with this lot
* @ORM\Column(type="text") * @ORM\Column(type="text")
*/ */
protected $comment = ''; protected $comment = '';
@ -107,7 +107,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
protected $amount = 0; protected $amount = 0;
/** /**
* @var bool Determines if this lot was manually marked for refilling. * @var bool determines if this lot was manually marked for refilling
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
*/ */
protected $needs_refill = false; protected $needs_refill = false;
@ -128,7 +128,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
parent::__clone(); parent::__clone();
} }
/** /**
* Check if the current part lot is expired. * Check if the current part lot is expired.
* This is the case, if the expiration date is greater the the current date. * This is the case, if the expiration date is greater the the current date.
@ -149,8 +148,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
/** /**
* Gets the description of the part lot. Similar to a "name" of the part lot. * Gets the description of the part lot. Similar to a "name" of the part lot.
*
* @return string
*/ */
public function getDescription(): string public function getDescription(): string
{ {
@ -171,8 +168,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
/** /**
* Gets the comment for this part lot. * Gets the comment for this part lot.
*
* @return string
*/ */
public function getComment(): string public function getComment(): string
{ {
@ -193,8 +188,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
/** /**
* Gets the expiration date for the part lot. Returns null, if no expiration date was set. * Gets the expiration date for the part lot. Returns null, if no expiration date was set.
*
* @return DateTime|null
*/ */
public function getExpirationDate(): ?DateTime public function getExpirationDate(): ?DateTime
{ {
@ -239,8 +232,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
/** /**
* Return the part that is stored in this part lot. * Return the part that is stored in this part lot.
*
* @return Part
*/ */
public function getPart(): Part public function getPart(): Part
{ {
@ -261,8 +252,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
/** /**
* Checks if the instock value in the part lot is unknown. * Checks if the instock value in the part lot is unknown.
*
* @return bool
*/ */
public function isInstockUnknown(): bool public function isInstockUnknown(): bool
{ {
@ -281,9 +270,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
return $this; return $this;
} }
/**
* @return float
*/
public function getAmount(): float public function getAmount(): float
{ {
if ($this->part instanceof Part && !$this->part->useFloatAmount()) { if ($this->part instanceof Part && !$this->part->useFloatAmount()) {
@ -312,9 +298,6 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
return $this; return $this;
} }
/**
* @return bool
*/
public function isNeedsRefill(): bool public function isNeedsRefill(): bool
{ {
return $this->needs_refill; return $this->needs_refill;

View file

@ -136,8 +136,6 @@ class Storelocation extends AbstractPartsContainingDBElement
/** /**
* When this property is set, only one part (but many instock) is allowed to be stored in this store location. * When this property is set, only one part (but many instock) is allowed to be stored in this store location.
*
* @return bool
*/ */
public function isOnlySinglePart(): bool public function isOnlySinglePart(): bool
{ {
@ -156,8 +154,6 @@ class Storelocation extends AbstractPartsContainingDBElement
/** /**
* When this property is set, it is only possible to increase the instock of parts, that are already stored here. * When this property is set, it is only possible to increase the instock of parts, that are already stored here.
*
* @return bool
*/ */
public function isLimitToExistingParts(): bool public function isLimitToExistingParts(): bool
{ {
@ -174,9 +170,6 @@ class Storelocation extends AbstractPartsContainingDBElement
return $this; return $this;
} }
/**
* @return MeasurementUnit|null
*/
public function getStorageType(): ?MeasurementUnit public function getStorageType(): ?MeasurementUnit
{ {
return $this->storage_type; return $this->storage_type;

View file

@ -57,7 +57,6 @@ use App\Entity\PriceInformations\Currency;
use App\Validator\Constraints\BigDecimal\BigDecimalPositiveOrZero; use App\Validator\Constraints\BigDecimal\BigDecimalPositiveOrZero;
use App\Validator\Constraints\Selectable; use App\Validator\Constraints\Selectable;
use Brick\Math\BigDecimal; use Brick\Math\BigDecimal;
use Brick\Math\BigNumber;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -120,8 +119,6 @@ class Supplier extends AbstractCompany
/** /**
* Gets the currency that should be used by default, when creating a orderdetail with this supplier. * Gets the currency that should be used by default, when creating a orderdetail with this supplier.
*
* @return Currency|null
*/ */
public function getDefaultCurrency(): ?Currency public function getDefaultCurrency(): ?Currency
{ {
@ -159,7 +156,7 @@ class Supplier extends AbstractCompany
*/ */
public function setShippingCosts(?BigDecimal $shipping_costs): self public function setShippingCosts(?BigDecimal $shipping_costs): self
{ {
if ($shipping_costs === null) { if (null === $shipping_costs) {
$this->shipping_costs = null; $this->shipping_costs = null;
} }

View file

@ -51,7 +51,6 @@ use Brick\Math\RoundingMode;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use DoctrineExtensions\Query\Mysql\Round;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -119,9 +118,6 @@ class Currency extends AbstractStructuralDBElement
parent::__construct(); parent::__construct();
} }
/**
* @return Collection
*/
public function getPricedetails(): Collection public function getPricedetails(): Collection
{ {
return $this->pricedetails; return $this->pricedetails;
@ -182,7 +178,7 @@ class Currency extends AbstractStructuralDBElement
*/ */
public function setExchangeRate(?BigDecimal $exchange_rate): self public function setExchangeRate(?BigDecimal $exchange_rate): self
{ {
if ($exchange_rate === null) { if (null === $exchange_rate) {
$this->exchange_rate = null; $this->exchange_rate = null;
} }
$tmp = $exchange_rate->toScale(self::PRICE_SCALE, RoundingMode::HALF_UP); $tmp = $exchange_rate->toScale(self::PRICE_SCALE, RoundingMode::HALF_UP);

View file

@ -299,6 +299,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
if ((string) $tmp !== (string) $this->price) { if ((string) $tmp !== (string) $this->price) {
$this->price = $tmp; $this->price = $tmp;
} }
return $this; return $this;
} }

View file

@ -103,7 +103,6 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
*/ */
protected $parameters; protected $parameters;
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
@ -113,8 +112,6 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
/** /**
* Check if the users of this group are enforced to have two factor authentification (2FA) enabled. * Check if the users of this group are enforced to have two factor authentification (2FA) enabled.
*
* @return bool
*/ */
public function isEnforce2FA(): bool public function isEnforce2FA(): bool
{ {
@ -124,7 +121,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
/** /**
* Sets if the user of this group are enforced to have two factor authentification enabled. * Sets if the user of this group are enforced to have two factor authentification enabled.
* *
* @param bool $enforce2FA True, if the users of this group are enforced to have 2FA enabled. * @param bool $enforce2FA true, if the users of this group are enforced to have 2FA enabled
* *
* @return $this * @return $this
*/ */

View file

@ -493,6 +493,7 @@ class PermissionsEmbed
} }
$mask = 0b11 << $n; //Create a mask for the data $mask = 0b11 << $n; //Create a mask for the data
return ($data & $mask) >> $n; //Apply mask and shift back return ($data & $mask) >> $n; //Apply mask and shift back
} }

View file

@ -180,8 +180,6 @@ class U2FKey implements TwoFactorKeyInterface
/** /**
* Gets the user, this U2F key belongs to. * Gets the user, this U2F key belongs to.
*
* @return User
*/ */
public function getUser(): User public function getUser(): User
{ {
@ -190,8 +188,6 @@ class U2FKey implements TwoFactorKeyInterface
/** /**
* The primary key ID of this key. * The primary key ID of this key.
*
* @return int
*/ */
public function getID(): int public function getID(): int
{ {

View file

@ -110,7 +110,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
protected $theme = ''; protected $theme = '';
/** /**
* @var string|null The hash of a token the user must provide when he wants to reset his password. * @var string|null the hash of a token the user must provide when he wants to reset his password
* @ORM\Column(type="string", nullable=true) * @ORM\Column(type="string", nullable=true)
*/ */
protected $pw_reset_token; protected $pw_reset_token;
@ -261,7 +261,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
protected $permissions; protected $permissions;
/** /**
* @var DateTime The time until the password reset token is valid. * @var DateTime the time until the password reset token is valid
* @ORM\Column(type="datetime", nullable=true) * @ORM\Column(type="datetime", nullable=true)
*/ */
protected $pw_reset_expires; protected $pw_reset_expires;
@ -367,7 +367,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Gets the currency the user prefers when showing him prices. * Gets the currency the user prefers when showing him prices.
* *
* @return Currency|null The currency the user prefers, or null if the global currency should be used. * @return Currency|null the currency the user prefers, or null if the global currency should be used
*/ */
public function getCurrency(): ?Currency public function getCurrency(): ?Currency
{ {
@ -389,7 +389,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Checks if this user is disabled (user cannot login any more). * Checks if this user is disabled (user cannot login any more).
* *
* @return bool True, if the user is disabled. * @return bool true, if the user is disabled
*/ */
public function isDisabled(): bool public function isDisabled(): bool
{ {
@ -399,7 +399,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Sets the status if a user is disabled. * Sets the status if a user is disabled.
* *
* @param bool $disabled True if the user should be disabled. * @param bool $disabled true if the user should be disabled
* *
* @return User * @return User
*/ */
@ -410,7 +410,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
return $this; return $this;
} }
public function getPermissions(): PermissionsEmbed public function getPermissions(): PermissionsEmbed
{ {
return $this->permissions; return $this->permissions;
@ -418,8 +417,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Check if the user needs a password change. * Check if the user needs a password change.
*
* @return bool
*/ */
public function isNeedPwChange(): bool public function isNeedPwChange(): bool
{ {
@ -440,8 +437,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Returns the encrypted password reset token. * Returns the encrypted password reset token.
*
* @return string|null
*/ */
public function getPwResetToken(): ?string public function getPwResetToken(): ?string
{ {
@ -462,8 +457,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Gets the datetime when the password reset token expires. * Gets the datetime when the password reset token expires.
*
* @return DateTime
*/ */
public function getPwResetExpires(): DateTime public function getPwResetExpires(): DateTime
{ {
@ -513,7 +506,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Change the username of this user. * Change the username of this user.
* *
* @param string $new_name The new username. * @param string $new_name the new username
* *
* @return $this * @return $this
*/ */
@ -529,8 +522,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Get the first name of the user. * Get the first name of the user.
*
* @return string|null
*/ */
public function getFirstName(): ?string public function getFirstName(): ?string
{ {
@ -553,8 +544,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Get the last name of the user. * Get the last name of the user.
*
* @return string|null
*/ */
public function getLastName(): ?string public function getLastName(): ?string
{ {
@ -675,7 +664,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Gets the theme the users wants to see. See self::AVAILABLE_THEMES for valid values. * Gets the theme the users wants to see. See self::AVAILABLE_THEMES for valid values.
* *
* @return string|null The name of the theme the user wants to see, or null if the system wide should be used. * @return string|null the name of the theme the user wants to see, or null if the system wide should be used
*/ */
public function getTheme(): ?string public function getTheme(): ?string
{ {
@ -723,8 +712,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Return true if the user should do two-factor authentication. * Return true if the user should do two-factor authentication.
*
* @return bool
*/ */
public function isGoogleAuthenticatorEnabled(): bool public function isGoogleAuthenticatorEnabled(): bool
{ {
@ -733,8 +720,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Return the user name that should be shown in Google Authenticator. * Return the user name that should be shown in Google Authenticator.
*
* @return string
*/ */
public function getGoogleAuthenticatorUsername(): string public function getGoogleAuthenticatorUsername(): string
{ {
@ -744,8 +729,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Return the Google Authenticator secret * Return the Google Authenticator secret
* When an empty string is returned, the Google authentication is disabled. * When an empty string is returned, the Google authentication is disabled.
*
* @return string|null
*/ */
public function getGoogleAuthenticatorSecret(): ?string public function getGoogleAuthenticatorSecret(): ?string
{ {
@ -767,9 +750,9 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Check if the given code is a valid backup code. * Check if the given code is a valid backup code.
* *
* @param string $code The code that should be checked. * @param string $code the code that should be checked
* *
* @return bool True if the backup code is valid. * @return bool true if the backup code is valid
*/ */
public function isBackupCode(string $code): bool public function isBackupCode(string $code): bool
{ {
@ -822,8 +805,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Return the date when the backup codes were generated. * Return the date when the backup codes were generated.
*
* @return DateTime|null
*/ */
public function getBackupCodesGenerationDate(): ?DateTime public function getBackupCodesGenerationDate(): ?DateTime
{ {
@ -851,8 +832,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Check if U2F is enabled. * Check if U2F is enabled.
*
* @return bool
*/ */
public function isU2FAuthEnabled(): bool public function isU2FAuthEnabled(): bool
{ {
@ -862,8 +841,6 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/** /**
* Get all U2F Keys that are associated with this user. * Get all U2F Keys that are associated with this user.
* *
* @return Collection
*
* @psalm-return Collection<int, TwoFactorKeyInterface> * @psalm-return Collection<int, TwoFactorKeyInterface>
*/ */
public function getU2FKeys(): Collection public function getU2FKeys(): Collection

View file

@ -99,6 +99,7 @@ class AttachmentDeleteListener
/** /**
* Ensure that attachments are not used in preview, so that they can be deleted (without integrity violation). * Ensure that attachments are not used in preview, so that they can be deleted (without integrity violation).
*
* @ORM\PreRemove() * @ORM\PreRemove()
*/ */
public function preRemoveHandler(Attachment $attachment, LifecycleEventArgs $event): void public function preRemoveHandler(Attachment $attachment, LifecycleEventArgs $event): void
@ -106,7 +107,7 @@ class AttachmentDeleteListener
//Ensure that the attachment that will be deleted, is not used as preview picture anymore... //Ensure that the attachment that will be deleted, is not used as preview picture anymore...
$attachment_holder = $attachment->getElement(); $attachment_holder = $attachment->getElement();
if ($attachment_holder === null) { if (null === $attachment_holder) {
return; return;
} }

View file

@ -200,8 +200,6 @@ class EventLoggerSubscriber implements EventSubscriber
/** /**
* Checks if the field of the given element should be saved (if it is not blacklisted). * Checks if the field of the given element should be saved (if it is not blacklisted).
*
* @return bool
*/ */
public function shouldFieldBeSaved(AbstractDBElement $element, string $field_name): bool public function shouldFieldBeSaved(AbstractDBElement $element, string $field_name): bool
{ {
@ -297,8 +295,6 @@ class EventLoggerSubscriber implements EventSubscriber
/** /**
* Filter out every forbidden field and return the cleaned array. * Filter out every forbidden field and return the cleaned array.
*
* @return array
*/ */
protected function filterFieldRestrictions(AbstractDBElement $element, array $fields): array protected function filterFieldRestrictions(AbstractDBElement $element, array $fields): array
{ {
@ -349,7 +345,7 @@ class EventLoggerSubscriber implements EventSubscriber
/** /**
* Check if the given entity can be logged. * Check if the given entity can be logged.
* *
* @return bool True, if the given entity can be logged. * @return bool true, if the given entity can be logged
*/ */
protected function validEntity(object $entity): bool protected function validEntity(object $entity): bool
{ {

View file

@ -48,7 +48,6 @@ use Doctrine\Common\EventSubscriber;
use Doctrine\Migrations\DependencyFactory; use Doctrine\Migrations\DependencyFactory;
use Doctrine\Migrations\Event\MigrationsEventArgs; use Doctrine\Migrations\Event\MigrationsEventArgs;
use Doctrine\Migrations\Events; use Doctrine\Migrations\Events;
use Doctrine\Migrations\Version\AliasResolver;
/** /**
* This subscriber logs databaseMigrations to Event log. * This subscriber logs databaseMigrations to Event log.

View file

@ -45,11 +45,7 @@ namespace App\EventSubscriber\LogSystem;
use App\Entity\LogSystem\UserLogoutLogEntry; use App\Entity\LogSystem\UserLogoutLogEntry;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use App\Services\LogSystem\EventLogger; use App\Services\LogSystem\EventLogger;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Event\LogoutEvent; use Symfony\Component\Security\Http\Event\LogoutEvent;
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
/** /**
* This handler logs to event log, if a user logs out. * This handler logs to event log, if a user logs out.
@ -65,13 +61,12 @@ class LogoutLoggerListener
$this->gpdr_compliance = $gpdr_compliance; $this->gpdr_compliance = $gpdr_compliance;
} }
public function __invoke(LogoutEvent $event) public function __invoke(LogoutEvent $event)
{ {
$request = $event->getRequest(); $request = $event->getRequest();
$token = $event->getToken(); $token = $event->getToken();
if ($token === null) { if (null === $token) {
return; return;
} }

View file

@ -44,7 +44,6 @@ namespace App\EventSubscriber\UserSystem;
use App\Entity\UserSystem\User; use App\Entity\UserSystem\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
@ -140,9 +139,9 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
* That is the case if the group of the user enforces 2FA, but the user has neither Google Authenticator nor an * That is the case if the group of the user enforces 2FA, but the user has neither Google Authenticator nor an
* U2F key setup. * U2F key setup.
* *
* @param User $user The user for which should be checked if it needs to be redirected. * @param User $user the user for which should be checked if it needs to be redirected
* *
* @return bool True if the user needs to be redirected. * @return bool true if the user needs to be redirected
*/ */
public static function TFARedirectNeeded(User $user): bool public static function TFARedirectNeeded(User $user): bool
{ {

View file

@ -51,7 +51,6 @@ use R\U2FTwoFactorBundle\Event\RegisterEvent;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

View file

@ -45,7 +45,6 @@ namespace App\Form\AdminPages;
use App\Entity\Base\AbstractNamedDBElement; use App\Entity\Base\AbstractNamedDBElement;
use App\Form\Type\BigDecimalMoneyType; use App\Form\Type\BigDecimalMoneyType;
use Symfony\Component\Form\Extension\Core\Type\CurrencyType; use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
@ -90,7 +89,7 @@ class CurrencyAdminForm extends BaseEntityAdminForm
SubmitType::class, SubmitType::class,
[ [
'label' => 'currency.edit.update_rate', 'label' => 'currency.edit.update_rate',
'disabled' => ! $this->security->isGranted('edit', $entity) 'disabled' => !$this->security->isGranted('edit', $entity),
] ]
); );
} }

View file

@ -46,7 +46,6 @@ use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\PriceInformations\Currency; use App\Entity\PriceInformations\Currency;
use App\Form\Type\BigDecimalMoneyType; use App\Form\Type\BigDecimalMoneyType;
use App\Form\Type\StructuralEntityType; use App\Form\Type\StructuralEntityType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;

View file

@ -179,7 +179,7 @@ class AttachmentFormType extends AbstractType
if ($attachment instanceof Attachment && $file instanceof UploadedFile && $attachment->getAttachmentType()) { if ($attachment instanceof Attachment && $file instanceof UploadedFile && $attachment->getAttachmentType()) {
if (!$this->submitHandler->isValidFileExtension($attachment->getAttachmentType(), $file)) { if (!$this->submitHandler->isValidFileExtension($attachment->getAttachmentType(), $file)) {
$event->getForm()->get('file')->addError( $event->getForm()->get('file')->addError(
new FormError($this->translator->trans("validator.file_ext_not_allowed")) new FormError($this->translator->trans('validator.file_ext_not_allowed'))
); );
} }
} }

View file

@ -50,7 +50,6 @@ use App\Form\Type\StructuralEntityType;
use App\Form\WorkaroundCollectionType; use App\Form\WorkaroundCollectionType;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;

View file

@ -133,8 +133,7 @@ class PartBaseType extends AbstractType
'disable_not_selectable' => true, 'disable_not_selectable' => true,
'disabled' => !$this->security->isGranted('category.edit', $part), 'disabled' => !$this->security->isGranted('category.edit', $part),
'constraints' => [ 'constraints' => [
],
]
]) ])
->add('footprint', StructuralEntityType::class, [ ->add('footprint', StructuralEntityType::class, [
'class' => Footprint::class, 'class' => Footprint::class,
@ -298,7 +297,7 @@ class PartBaseType extends AbstractType
//Buttons //Buttons
->add('save', SubmitType::class, ['label' => 'part.edit.save']) ->add('save', SubmitType::class, ['label' => 'part.edit.save'])
->add('save_and_clone', SubmitType::class, [ ->add('save_and_clone', SubmitType::class, [
'label' => 'part.edit.save_and_clone' 'label' => 'part.edit.save_and_clone',
]) ])
->add('reset', ResetType::class, ['label' => 'part.edit.reset']); ->add('reset', ResetType::class, ['label' => 'part.edit.reset']);
} }

View file

@ -44,7 +44,6 @@ namespace App\Form\Part;
use App\Entity\Parts\MeasurementUnit; use App\Entity\Parts\MeasurementUnit;
use App\Entity\PriceInformations\Pricedetail; use App\Entity\PriceInformations\Pricedetail;
use App\Form\Type\BigDecimalMoneyType;
use App\Form\Type\BigDecimalNumberType; use App\Form\Type\BigDecimalNumberType;
use App\Form\Type\CurrencyEntityType; use App\Form\Type\CurrencyEntityType;
use App\Form\Type\SIUnitType; use App\Form\Type\SIUnitType;

View file

@ -20,12 +20,9 @@
namespace App\Form\Type; namespace App\Form\Type;
use Brick\Math\BigDecimal; use Brick\Math\BigDecimal;
use Brick\Math\BigNumber;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Extension\Core\Type\MoneyType; use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
@ -43,7 +40,7 @@ class BigDecimalMoneyType extends AbstractType implements DataTransformerInterfa
public function transform($value) public function transform($value)
{ {
if ($value === null) { if (null === $value) {
return null; return null;
} }
@ -56,7 +53,7 @@ class BigDecimalMoneyType extends AbstractType implements DataTransformerInterfa
public function reverseTransform($value) public function reverseTransform($value)
{ {
if ($value === null) { if (null === $value) {
return null; return null;
} }

View file

@ -20,7 +20,6 @@
namespace App\Form\Type; namespace App\Form\Type;
use Brick\Math\BigDecimal; use Brick\Math\BigDecimal;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\DataTransformerInterface;
@ -41,7 +40,7 @@ class BigDecimalNumberType extends AbstractType implements DataTransformerInterf
public function transform($value) public function transform($value)
{ {
if ($value === null) { if (null === $value) {
return null; return null;
} }
@ -54,7 +53,7 @@ class BigDecimalNumberType extends AbstractType implements DataTransformerInterf
public function reverseTransform($value) public function reverseTransform($value)
{ {
if ($value === null) { if (null === $value) {
return null; return null;
} }

View file

@ -134,8 +134,6 @@ class StructuralEntityType extends AbstractType
/** /**
* Gets the entries from database and return an array of them. * Gets the entries from database and return an array of them.
*
* @return array
*/ */
public function getEntries(Options $options): array public function getEntries(Options $options): array
{ {

View file

@ -1,26 +1,18 @@
<?php <?php
namespace App\Form; namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType; use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormView;
/** /**
* This a workaround for the issue #37024. * This a workaround for the issue #37024.
* @package App\Form
*/ */
class WorkaroundCollectionType extends CollectionType class WorkaroundCollectionType extends CollectionType
{ {
/** /**
* Use the original implementation for finishView() instead of the one, the one that cause the bug. * Use the original implementation for finishView() instead of the one, the one that cause the bug.
* @param FormView $view
* @param FormInterface $form
* @param array $options
*/ */
public function finishView(FormView $view, FormInterface $form, array $options) public function finishView(FormView $view, FormInterface $form, array $options)
{ {

View file

@ -20,7 +20,6 @@
namespace App\Helpers; namespace App\Helpers;
use Brick\Math\BigDecimal; use Brick\Math\BigDecimal;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
@ -36,12 +35,12 @@ class BigDecimalType extends Type
/** /**
* @param string $value * @param string $value
* @param AbstractPlatform $platform *
* @return BigDecimal|\Brick\Math\BigNumber|mixed * @return BigDecimal|\Brick\Math\BigNumber|mixed
*/ */
public function convertToPHPValue($value, AbstractPlatform $platform) public function convertToPHPValue($value, AbstractPlatform $platform)
{ {
if ($value === null) { if (null === $value) {
return null; return null;
} }
@ -50,12 +49,10 @@ class BigDecimalType extends Type
/** /**
* @param BigDecimal $value * @param BigDecimal $value
* @param AbstractPlatform $platform
* @return mixed
*/ */
public function convertToDatabaseValue($value, AbstractPlatform $platform) public function convertToDatabaseValue($value, AbstractPlatform $platform)
{ {
if ($value === null) { if (null === $value) {
return null; return null;
} }

View file

@ -81,8 +81,6 @@ final class TreeViewNode implements JsonSerializable
/** /**
* Return the ID of the entity associated with this node. * Return the ID of the entity associated with this node.
* Null if this node is not connected with an entity. * Null if this node is not connected with an entity.
*
* @return int|null
*/ */
public function getId(): ?int public function getId(): ?int
{ {
@ -104,8 +102,6 @@ final class TreeViewNode implements JsonSerializable
/** /**
* Returns the node text. * Returns the node text.
*
* @return string
*/ */
public function getText(): string public function getText(): string
{ {
@ -115,7 +111,7 @@ final class TreeViewNode implements JsonSerializable
/** /**
* Sets the node text. * Sets the node text.
* *
* @param string $text The new node text. * @param string $text the new node text
* *
* @return TreeViewNode * @return TreeViewNode
*/ */
@ -128,8 +124,6 @@ final class TreeViewNode implements JsonSerializable
/** /**
* Returns the href link. * Returns the href link.
*
* @return string|null
*/ */
public function getHref(): ?string public function getHref(): ?string
{ {
@ -139,7 +133,7 @@ final class TreeViewNode implements JsonSerializable
/** /**
* Sets the href link. * Sets the href link.
* *
* @param string|null $href The new href link. * @param string|null $href the new href link
* *
* @return TreeViewNode * @return TreeViewNode
*/ */

View file

@ -61,9 +61,6 @@ final class TreeViewNodeState implements JsonSerializable
*/ */
private $selected = null; private $selected = null;
/**
* @return bool|null
*/
public function getDisabled(): ?bool public function getDisabled(): ?bool
{ {
return $this->disabled; return $this->disabled;
@ -74,9 +71,6 @@ final class TreeViewNodeState implements JsonSerializable
$this->disabled = $disabled; $this->disabled = $disabled;
} }
/**
* @return bool|null
*/
public function getExpanded(): ?bool public function getExpanded(): ?bool
{ {
return $this->expanded; return $this->expanded;
@ -87,9 +81,6 @@ final class TreeViewNodeState implements JsonSerializable
$this->expanded = $expanded; $this->expanded = $expanded;
} }
/**
* @return bool|null
*/
public function getSelected(): ?bool public function getSelected(): ?bool
{ {
return $this->selected; return $this->selected;

View file

@ -1,9 +1,7 @@
<?php <?php
namespace App\Migration; namespace App\Migration;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
@ -15,7 +13,7 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration
public const ADMIN_PW_LENGTH = 10; public const ADMIN_PW_LENGTH = 10;
protected $permissions_updated = false; protected $permissions_updated = false;
protected $admin_pw = ""; protected $admin_pw = '';
protected $logger; protected $logger;
@ -61,11 +59,10 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration
/** /**
* Gets the legacy Part-DB version number. Returns 0, if target database is not an legacy Part-DB database. * Gets the legacy Part-DB version number. Returns 0, if target database is not an legacy Part-DB database.
* @return int
*/ */
public function getOldDBVersion(): int public function getOldDBVersion(): int
{ {
if ($this->connection->getDatabasePlatform()->getName() !== "mysql") { if ('mysql' !== $this->connection->getDatabasePlatform()->getName()) {
//Old Part-DB version only supported MySQL therefore only //Old Part-DB version only supported MySQL therefore only
return 0; return 0;
} }
@ -81,7 +78,6 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration
/** /**
* Returns the hash of a new random password, created for the initial admin user, which can be written to DB. * Returns the hash of a new random password, created for the initial admin user, which can be written to DB.
* The plaintext version of the password will be outputed to user after this migration. * The plaintext version of the password will be outputed to user after this migration.
* @return string
*/ */
public function getInitalAdminPW(): string public function getInitalAdminPW(): string
{ {

View file

@ -20,28 +20,26 @@
namespace App\Repository; namespace App\Repository;
use App\Entity\Base\AbstractPartsContainingDBElement; use App\Entity\Base\AbstractPartsContainingDBElement;
use App\Entity\Base\PartsContainingRepositoryInterface; use App\Entity\Base\PartsContainingRepositoryInterface;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
abstract class AbstractPartsContainingRepository extends StructuralDBElementRepository abstract class AbstractPartsContainingRepository extends StructuralDBElementRepository implements PartsContainingRepositoryInterface
implements PartsContainingRepositoryInterface
{ {
/** /**
* Returns all parts associated with this element. * Returns all parts associated with this element.
* @param AbstractPartsContainingDBElement $element The element for which the parts should be determined. *
* @param AbstractPartsContainingDBElement $element the element for which the parts should be determined
* @param array $order_by The order of the parts. Format ['name' => 'ASC'] * @param array $order_by The order of the parts. Format ['name' => 'ASC']
*
* @return Part[] * @return Part[]
*/ */
abstract public function getParts(object $element, array $order_by = ['name' => 'ASC']): array; abstract public function getParts(object $element, array $order_by = ['name' => 'ASC']): array;
/** /**
* Gets the count of the parts associated with this element. * Gets the count of the parts associated with this element.
* @param AbstractPartsContainingDBElement $element The element for which the parts should be determined. *
* @return int * @param AbstractPartsContainingDBElement $element the element for which the parts should be determined
*/ */
abstract public function getPartsCount(object $element): int; abstract public function getPartsCount(object $element): int;
@ -66,5 +64,4 @@ abstract class AbstractPartsContainingRepository extends StructuralDBElementRepo
return $repo->count([$field_name => $element]); return $repo->count([$field_name => $element]);
} }
} }

View file

@ -27,8 +27,6 @@ class AttachmentRepository extends DBElementRepository
{ {
/** /**
* Gets the count of all private/secure attachments. * Gets the count of all private/secure attachments.
*
* @return int
*/ */
public function getPrivateAttachmentsCount(): int public function getPrivateAttachmentsCount(): int
{ {
@ -44,8 +42,6 @@ class AttachmentRepository extends DBElementRepository
/** /**
* Gets the count of all external attachments (attachments only containing an URL). * Gets the count of all external attachments (attachments only containing an URL).
* *
* @return int
*
* @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException * @throws \Doctrine\ORM\NonUniqueResultException
*/ */
@ -65,8 +61,6 @@ class AttachmentRepository extends DBElementRepository
/** /**
* Gets the count of all attachments where an user uploaded an file. * Gets the count of all attachments where an user uploaded an file.
* *
* @return int
*
* @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException * @throws \Doctrine\ORM\NonUniqueResultException
*/ */

View file

@ -32,8 +32,6 @@ class LabelProfileRepository extends NamedDBElementRepository
/** /**
* Find the profiles that are shown in the dropdown for the given type. * Find the profiles that are shown in the dropdown for the given type.
* You should maybe use the cached version of this in LabelProfileDropdownHelper. * You should maybe use the cached version of this in LabelProfileDropdownHelper.
*
* @return array
*/ */
public function getDropdownProfiles(string $type): array public function getDropdownProfiles(string $type): array
{ {
@ -78,10 +76,8 @@ class LabelProfileRepository extends NamedDBElementRepository
/** /**
* Find all LabelProfiles that can be used with the given type. * Find all LabelProfiles that can be used with the given type.
* *
* @param string $type See LabelOptions::SUPPORTED_ELEMENTS for valid values. * @param string $type see LabelOptions::SUPPORTED_ELEMENTS for valid values
* @param array $order_by The way the results should be sorted. By default ordered by * @param array $order_by The way the results should be sorted. By default ordered by
*
* @return array
*/ */
public function findForSupportedElement(string $type, array $order_by = ['name' => 'ASC']): array public function findForSupportedElement(string $type, array $order_by = ['name' => 'ASC']): array
{ {

View file

@ -86,8 +86,6 @@ class LogEntryRepository extends DBElementRepository
* *
* @param string $class The class of the element that should be undeleted * @param string $class The class of the element that should be undeleted
* @param int $id The ID of the element that should be deleted * @param int $id The ID of the element that should be deleted
*
* @return ElementDeletedLogEntry
*/ */
public function getUndeleteDataForElement(string $class, int $id): ElementDeletedLogEntry public function getUndeleteDataForElement(string $class, int $id): ElementDeletedLogEntry
{ {
@ -180,8 +178,6 @@ class LogEntryRepository extends DBElementRepository
* @param string $order * @param string $order
* @param null $limit * @param null $limit
* @param null $offset * @param null $offset
*
* @return array
*/ */
public function getLogsOrderedByTimestamp($order = 'DESC', $limit = null, $offset = null): array public function getLogsOrderedByTimestamp($order = 'DESC', $limit = null, $offset = null): array
{ {
@ -191,8 +187,8 @@ class LogEntryRepository extends DBElementRepository
/** /**
* Gets the target element associated with the logentry. * Gets the target element associated with the logentry.
* *
* @return AbstractDBElement|null Returns the associated DBElement or null if the log either has no target or the element * @return AbstractDBElement|null returns the associated DBElement or null if the log either has no target or the element
* was deleted from DB. * was deleted from DB
* *
* @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\ORMException
* @throws \Doctrine\ORM\OptimisticLockException * @throws \Doctrine\ORM\OptimisticLockException
@ -213,7 +209,7 @@ class LogEntryRepository extends DBElementRepository
/** /**
* Returns the last user that has edited the given element. * Returns the last user that has edited the given element.
* *
* @return User|null A user object, or null if no user could be determined. * @return User|null a user object, or null if no user could be determined
*/ */
public function getLastEditingUser(AbstractDBElement $element): ?User public function getLastEditingUser(AbstractDBElement $element): ?User
{ {
@ -223,7 +219,7 @@ class LogEntryRepository extends DBElementRepository
/** /**
* Returns the user that has created the given element. * Returns the user that has created the given element.
* *
* @return User|null A user object, or null if no user could be determined. * @return User|null a user object, or null if no user could be determined
*/ */
public function getCreatingUser(AbstractDBElement $element): ?User public function getCreatingUser(AbstractDBElement $element): ?User
{ {

View file

@ -50,8 +50,6 @@ class PartRepository extends NamedDBElementRepository
/** /**
* Gets the summed up instock of all parts (only parts without an measurent unit). * Gets the summed up instock of all parts (only parts without an measurent unit).
* *
* @return float
*
* @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException * @throws \Doctrine\ORM\NonUniqueResultException
*/ */
@ -71,8 +69,6 @@ class PartRepository extends NamedDBElementRepository
/** /**
* Gets the number of parts that has price informations. * Gets the number of parts that has price informations.
* *
* @return int
*
* @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException * @throws \Doctrine\ORM\NonUniqueResultException
*/ */

View file

@ -21,12 +21,10 @@
namespace App\Repository\Parts; namespace App\Repository\Parts;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
use App\Entity\Parts\Storelocation;
use App\Repository\AbstractPartsContainingRepository; use App\Repository\AbstractPartsContainingRepository;
class CategoryRepository extends AbstractPartsContainingRepository class CategoryRepository extends AbstractPartsContainingRepository
{ {
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
{ {
if (!$element instanceof Category) { if (!$element instanceof Category) {

View file

@ -21,7 +21,6 @@
namespace App\Repository\Parts; namespace App\Repository\Parts;
use App\Entity\Parts\Footprint; use App\Entity\Parts\Footprint;
use App\Entity\Parts\Storelocation;
use App\Repository\AbstractPartsContainingRepository; use App\Repository\AbstractPartsContainingRepository;
class FootprintRepository extends AbstractPartsContainingRepository class FootprintRepository extends AbstractPartsContainingRepository

View file

@ -20,13 +20,11 @@
namespace App\Repository\Parts; namespace App\Repository\Parts;
use App\Entity\Parts\Category;
use App\Entity\Parts\Manufacturer; use App\Entity\Parts\Manufacturer;
use App\Repository\AbstractPartsContainingRepository; use App\Repository\AbstractPartsContainingRepository;
class ManufacturerRepository extends AbstractPartsContainingRepository class ManufacturerRepository extends AbstractPartsContainingRepository
{ {
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
{ {
if (!$element instanceof Manufacturer) { if (!$element instanceof Manufacturer) {

View file

@ -20,13 +20,11 @@
namespace App\Repository\Parts; namespace App\Repository\Parts;
use App\Entity\Parts\Manufacturer;
use App\Entity\Parts\MeasurementUnit; use App\Entity\Parts\MeasurementUnit;
use App\Repository\AbstractPartsContainingRepository; use App\Repository\AbstractPartsContainingRepository;
class MeasurementUnitRepository extends AbstractPartsContainingRepository class MeasurementUnitRepository extends AbstractPartsContainingRepository
{ {
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
{ {
if (!$element instanceof MeasurementUnit) { if (!$element instanceof MeasurementUnit) {

View file

@ -21,11 +21,9 @@
namespace App\Repository\Parts; namespace App\Repository\Parts;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use App\Entity\Parts\PartLot;
use App\Entity\Parts\Storelocation; use App\Entity\Parts\Storelocation;
use App\Repository\AbstractPartsContainingRepository; use App\Repository\AbstractPartsContainingRepository;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\HttpKernel\HttpCache\Store;
class StorelocationRepository extends AbstractPartsContainingRepository class StorelocationRepository extends AbstractPartsContainingRepository
{ {
@ -67,7 +65,6 @@ class StorelocationRepository extends AbstractPartsContainingRepository
->where('lots.storage_location = ?1') ->where('lots.storage_location = ?1')
->setParameter(1, $element); ->setParameter(1, $element);
return (int) $qb->getQuery()->getSingleScalarResult(); return (int) $qb->getQuery()->getSingleScalarResult();
} }
} }

View file

@ -21,7 +21,6 @@
namespace App\Repository\Parts; namespace App\Repository\Parts;
use App\Entity\Parts\Part; use App\Entity\Parts\Part;
use App\Entity\Parts\Storelocation;
use App\Entity\Parts\Supplier; use App\Entity\Parts\Supplier;
use App\Repository\AbstractPartsContainingRepository; use App\Repository\AbstractPartsContainingRepository;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
@ -63,7 +62,6 @@ class SupplierRepository extends AbstractPartsContainingRepository
->where('orderdetail.supplier = ?1') ->where('orderdetail.supplier = ?1')
->setParameter(1, $element); ->setParameter(1, $element);
return (int) $qb->getQuery()->getSingleScalarResult(); return (int) $qb->getQuery()->getSingleScalarResult();
} }
} }

View file

@ -63,7 +63,7 @@ class StructuralDBElementRepository extends NamedDBElementRepository
* Gets a tree of TreeViewNode elements. The root elements has $parent as parent. * Gets a tree of TreeViewNode elements. The root elements has $parent as parent.
* The treeview is generic, that means the href are null and ID values are set. * The treeview is generic, that means the href are null and ID values are set.
* *
* @param AbstractStructuralDBElement|null $parent The parent the root elements should have. * @param AbstractStructuralDBElement|null $parent the parent the root elements should have
* *
* @return TreeViewNode[] * @return TreeViewNode[]
*/ */
@ -90,7 +90,7 @@ class StructuralDBElementRepository extends NamedDBElementRepository
* *
* @param AbstractStructuralDBElement|null $parent This entity will be used as root element. Set to null, to use global root * @param AbstractStructuralDBElement|null $parent This entity will be used as root element. Set to null, to use global root
* *
* @return AbstractStructuralDBElement[] A flattened list containing the tree elements. * @return AbstractStructuralDBElement[] a flattened list containing the tree elements
*/ */
public function toNodesList(?AbstractStructuralDBElement $parent = null): array public function toNodesList(?AbstractStructuralDBElement $parent = null): array
{ {

View file

@ -60,8 +60,6 @@ final class UserRepository extends NamedDBElementRepository implements PasswordU
/** /**
* Returns the anonymous user. * Returns the anonymous user.
* The result is cached, so the database is only called once, after the anonymous user was found. * The result is cached, so the database is only called once, after the anonymous user was found.
*
* @return User|null
*/ */
public function getAnonymousUser(): ?User public function getAnonymousUser(): ?User
{ {

Some files were not shown because too many files have changed in this diff Show more