Added declare strict types to all files

This commit is contained in:
Jan Böhmer 2023-06-11 18:59:07 +02:00
parent bea90a7d94
commit 6a2ff9d153
196 changed files with 685 additions and 360 deletions

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Form\ProjectSystem;
use Symfony\Component\Form\AbstractType;
@ -27,4 +29,4 @@ class ProjectBOMEntryCollectionType extends AbstractType
'label' => false,
]);
}
}
}

View file

@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace App\Form\ProjectSystem;
use App\Entity\ProjectSystem\ProjectBOMEntry;
@ -87,4 +89,4 @@ class ProjectBOMEntryType extends AbstractType
'data_class' => ProjectBOMEntry::class,
]);
}
}
}

View file

@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
@ -17,7 +20,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Form\ProjectSystem;
use Symfony\Bundle\SecurityBundle\Security;
@ -153,7 +155,7 @@ class ProjectBuildType extends AbstractType implements DataMapperInterface
if (!$lot) { //When the user selected "Create new lot", create a new lot
$lot = new PartLot();
$description = 'Build ' . date('Y-m-d H:i:s');
if (!empty($data->getComment())) {
if ($data->getComment() !== '') {
$description .= ' (' . $data->getComment() . ')';
}
$lot->setDescription($description);
@ -166,4 +168,4 @@ class ProjectBuildType extends AbstractType implements DataMapperInterface
//This has to be set after the builds part lot, so that it can disable the option
$data->setAddBuildsToBuildsPart($forms['addBuildsToBuildsPart']->getData());
}
}
}