@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | protected function additionalActionNew(FormInterface $form, AbstractNamedDBElement $entity): bool |
| 134 | 134 | { |
| 135 | - if ($entity instanceof User && ! empty($form['new_password']->getData())) { |
|
| 135 | + if ($entity instanceof User && !empty($form['new_password']->getData())) { |
|
| 136 | 136 | $password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData()); |
| 137 | 137 | $entity->setPassword($password); |
| 138 | 138 | //By default the user must change the password afterwards |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @return Response |
| 151 | 151 | */ |
| 152 | - public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?User $entity = null): Response |
|
| 152 | + public function new(Request $request, EntityManagerInterface $em, EntityImporter $importer, ?User $entity = null) : Response |
|
| 153 | 153 | { |
| 154 | 154 | return $this->_new($request, $em, $importer, $entity); |
| 155 | 155 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | //If no user id was passed, then we show info about the current user |
| 211 | 211 | if (null === $user) { |
| 212 | 212 | $tmp = $this->getUser(); |
| 213 | - if (! $tmp instanceof User) { |
|
| 213 | + if (!$tmp instanceof User) { |
|
| 214 | 214 | throw new InvalidArgumentException('Userinfo only works for database users!'); |
| 215 | 215 | } |
| 216 | 216 | $user = $tmp; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 'title' => 'selectpicker.nothing_selected', |
| 74 | 74 | 'data-live-search' => true, |
| 75 | 75 | ], |
| 76 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 76 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 77 | 77 | ]); |
| 78 | 78 | |
| 79 | 79 | $builder->add('exchange_rate', BigDecimalMoneyType::class, [ |
@@ -81,16 +81,16 @@ discard block |
||
| 81 | 81 | 'label' => 'currency.edit.exchange_rate', |
| 82 | 82 | 'currency' => $this->default_currency, |
| 83 | 83 | 'scale' => 6, |
| 84 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 84 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 85 | 85 | ]); |
| 86 | 86 | |
| 87 | - if(!$is_new) { |
|
| 87 | + if (!$is_new) { |
|
| 88 | 88 | $builder->add( |
| 89 | 89 | 'update_exchange_rate', |
| 90 | 90 | SubmitType::class, |
| 91 | 91 | [ |
| 92 | 92 | 'label' => 'currency.edit.update_rate', |
| 93 | - 'disabled' => ! $this->security->isGranted('edit', $entity) |
|
| 93 | + 'disabled' => !$this->security->isGranted('edit', $entity) |
|
| 94 | 94 | ] |
| 95 | 95 | ); |
| 96 | 96 | } |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function validate($value, Constraint $constraint): void |
| 69 | 69 | { |
| 70 | - if (! $constraint instanceof ValidPartLot) { |
|
| 70 | + if (!$constraint instanceof ValidPartLot) { |
|
| 71 | 71 | throw new UnexpectedTypeException($constraint, ValidPartLot::class); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (! $value instanceof PartLot) { |
|
| 74 | + if (!$value instanceof PartLot) { |
|
| 75 | 75 | throw new UnexpectedTypeException($value, PartLot::class); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | ->atPath('amount')->addViolation(); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (! $parts->contains($value->getPart())) { |
|
| 100 | + if (!$parts->contains($value->getPart())) { |
|
| 101 | 101 | $this->context->buildViolation('validator.part_lot.location_full') |
| 102 | 102 | ->atPath('storage_location')->addViolation(); |
| 103 | 103 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | //Check for onlyExisting |
| 107 | 107 | if ($value->getStorageLocation()->isLimitToExistingParts()) { |
| 108 | - if (! $parts->contains($value->getPart())) { |
|
| 108 | + if (!$parts->contains($value->getPart())) { |
|
| 109 | 109 | $this->context->buildViolation('validator.part_lot.only_existing') |
| 110 | 110 | ->atPath('storage_location')->addViolation(); |
| 111 | 111 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | //Check for only single part |
| 115 | 115 | if ($value->getStorageLocation()->isOnlySinglePart()) { |
| 116 | - if (($parts->count() > 0) && ! $parts->contains($value->getPart())) { |
|
| 116 | + if (($parts->count() > 0) && !$parts->contains($value->getPart())) { |
|
| 117 | 117 | $this->context->buildViolation('validator.part_lot.single_part') |
| 118 | 118 | ->atPath('storage_location')->addViolation(); |
| 119 | 119 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | public function getParts(object $element, array $order_by = ['name' => 'ASC']): array |
| 30 | 30 | { |
| 31 | - if(!$element instanceof Footprint) { |
|
| 31 | + if (!$element instanceof Footprint) { |
|
| 32 | 32 | throw new \InvalidArgumentException('$element must be an Footprint!'); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function getPartsCount(object $element): int |
| 39 | 39 | { |
| 40 | - if(!$element instanceof Footprint) { |
|
| 40 | + if (!$element instanceof Footprint) { |
|
| 41 | 41 | throw new \InvalidArgumentException('$element must be an Footprint!'); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | public function getParts(object $element, array $order_by = ['name' => 'ASC']): array |
| 32 | 32 | { |
| 33 | - if(!$element instanceof Supplier) { |
|
| 33 | + if (!$element instanceof Supplier) { |
|
| 34 | 34 | throw new \InvalidArgumentException('$element must be an Supplier!'); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ->setParameter(1, $element); |
| 44 | 44 | |
| 45 | 45 | foreach ($order_by as $field => $order) { |
| 46 | - $qb->addOrderBy('part.' . $field, $order); |
|
| 46 | + $qb->addOrderBy('part.'.$field, $order); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $qb->getQuery()->getResult(); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function getPartsCount(object $element): int |
| 53 | 53 | { |
| 54 | - if(!$element instanceof Supplier) { |
|
| 54 | + if (!$element instanceof Supplier) { |
|
| 55 | 55 | throw new \InvalidArgumentException('$element must be an Supplier!'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function getParts(object $element, array $order_by = ['name' => 'ASC']): array |
| 36 | 36 | { |
| 37 | - if(!$element instanceof Storelocation) { |
|
| 37 | + if (!$element instanceof Storelocation) { |
|
| 38 | 38 | throw new \InvalidArgumentException('$element must be an Storelocation!'); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ->setParameter(1, $element); |
| 48 | 48 | |
| 49 | 49 | foreach ($order_by as $field => $order) { |
| 50 | - $qb->addOrderBy('part.' . $field, $order); |
|
| 50 | + $qb->addOrderBy('part.'.$field, $order); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return $qb->getQuery()->getResult(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function getPartsCount(object $element): int |
| 57 | 57 | { |
| 58 | - if(!$element instanceof Storelocation) { |
|
| 58 | + if (!$element instanceof Storelocation) { |
|
| 59 | 59 | throw new \InvalidArgumentException('$element must be an Storelocation!'); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | |
| 100 | 100 | if (!empty($this->admin_pw)) { |
| 101 | 101 | $this->write(''); |
| 102 | - $this->write('<bg=yellow;fg=black>The initial password for the "admin" user is: ' . $this->admin_pw . '</>'); |
|
| 102 | + $this->write('<bg=yellow;fg=black>The initial password for the "admin" user is: '.$this->admin_pw.'</>'); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |