diff --git a/src/Command/Migrations/ImportPartKeeprCommand.php b/src/Command/Migrations/ImportPartKeeprCommand.php index ec5010e4..d436bb1c 100644 --- a/src/Command/Migrations/ImportPartKeeprCommand.php +++ b/src/Command/Migrations/ImportPartKeeprCommand.php @@ -69,7 +69,7 @@ class ImportPartKeeprCommand extends Command $this->addOption('--import-users', null, InputOption::VALUE_NONE, 'Import users (passwords will not be imported).'); } - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Controller/ProjectController.php b/src/Controller/ProjectController.php index 81833f82..5f4390ae 100644 --- a/src/Controller/ProjectController.php +++ b/src/Controller/ProjectController.php @@ -64,7 +64,7 @@ class ProjectController extends AbstractController /** * @Route("/{id}/info", name="project_info", requirements={"id"="\d+"}) */ - public function info(Project $project, Request $request, ProjectBuildHelper $buildHelper) + public function info(Project $project, Request $request, ProjectBuildHelper $buildHelper): Response { $this->denyAccessUnlessGranted('read', $project); diff --git a/src/DataTables/Adapters/CustomFetchJoinORMAdapter.php b/src/DataTables/Adapters/CustomFetchJoinORMAdapter.php index 052e2e28..9a01a55f 100644 --- a/src/DataTables/Adapters/CustomFetchJoinORMAdapter.php +++ b/src/DataTables/Adapters/CustomFetchJoinORMAdapter.php @@ -38,7 +38,7 @@ use Omines\DataTablesBundle\Adapter\Doctrine\FetchJoinORMAdapter; */ class CustomFetchJoinORMAdapter extends FetchJoinORMAdapter { - public function getCount(QueryBuilder $queryBuilder, $identifier) + public function getCount(QueryBuilder $queryBuilder, $identifier): ?int { $qb_without_group_by = clone $queryBuilder; diff --git a/src/DataTables/Column/PrettyBoolColumn.php b/src/DataTables/Column/PrettyBoolColumn.php index 3a74db6e..a6f74c3c 100644 --- a/src/DataTables/Column/PrettyBoolColumn.php +++ b/src/DataTables/Column/PrettyBoolColumn.php @@ -41,7 +41,7 @@ class PrettyBoolColumn extends AbstractColumn return (bool) $value; } - public function render($value, $context) + public function render($value, $context): string { if ($value === true) { return ' ' diff --git a/src/DataTables/Column/RowClassColumn.php b/src/DataTables/Column/RowClassColumn.php index 4ac61c02..d25ffc20 100644 --- a/src/DataTables/Column/RowClassColumn.php +++ b/src/DataTables/Column/RowClassColumn.php @@ -27,7 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class RowClassColumn extends AbstractColumn { - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): self { parent::configureOptions($resolver); diff --git a/src/DataTables/Column/SIUnitNumberColumn.php b/src/DataTables/Column/SIUnitNumberColumn.php index bc9d866f..42a0649a 100644 --- a/src/DataTables/Column/SIUnitNumberColumn.php +++ b/src/DataTables/Column/SIUnitNumberColumn.php @@ -33,7 +33,7 @@ class SIUnitNumberColumn extends AbstractColumn $this->formatter = $formatter; } - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): self { parent::configureOptions($resolver); diff --git a/src/DataTables/Column/SelectColumn.php b/src/DataTables/Column/SelectColumn.php index 218f022d..6a057be3 100644 --- a/src/DataTables/Column/SelectColumn.php +++ b/src/DataTables/Column/SelectColumn.php @@ -28,7 +28,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class SelectColumn extends AbstractColumn { - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): self { parent::configureOptions($resolver); @@ -48,7 +48,7 @@ class SelectColumn extends AbstractColumn return $value; } - public function render($value, $context) + public function render($value, $context): string { //Return empty string, as it this column is filled by datatables on client side return ''; diff --git a/src/Doctrine/SQLiteRegexExtension.php b/src/Doctrine/SQLiteRegexExtension.php index f1bca465..1cdab603 100644 --- a/src/Doctrine/SQLiteRegexExtension.php +++ b/src/Doctrine/SQLiteRegexExtension.php @@ -49,7 +49,7 @@ class SQLiteRegexExtension implements EventSubscriberInterface } } - public function getSubscribedEvents() + public function getSubscribedEvents(): array { return[ Events::postConnect diff --git a/src/Doctrine/Types/TinyIntType.php b/src/Doctrine/Types/TinyIntType.php index 817b87f1..951417db 100644 --- a/src/Doctrine/Types/TinyIntType.php +++ b/src/Doctrine/Types/TinyIntType.php @@ -29,17 +29,17 @@ use Doctrine\DBAL\Types\Type; class TinyIntType extends Type { - public function getSQLDeclaration(array $column, AbstractPlatform $platform) + public function getSQLDeclaration(array $column, AbstractPlatform $platform): string { return 'TINYINT'; } - public function getName() + public function getName(): string { return 'tinyint'; } - public function requiresSQLCommentHint(AbstractPlatform $platform) + public function requiresSQLCommentHint(AbstractPlatform $platform): bool { //We use the comment, so that doctrine migrations can properly detect, that nothing has changed and no migration is needed. return true; diff --git a/src/Form/Filters/Constraints/InstanceOfConstraintType.php b/src/Form/Filters/Constraints/InstanceOfConstraintType.php index 4a53e0f5..5800d7e3 100644 --- a/src/Form/Filters/Constraints/InstanceOfConstraintType.php +++ b/src/Form/Filters/Constraints/InstanceOfConstraintType.php @@ -41,7 +41,7 @@ class InstanceOfConstraintType extends AbstractType $resolver->setDefault('data_class', InstanceOfConstraint::class); } - public function getParent() + public function getParent(): string { return ChoiceConstraintType::class; } diff --git a/src/Form/ProjectSystem/ProjectBOMEntryCollectionType.php b/src/Form/ProjectSystem/ProjectBOMEntryCollectionType.php index 71c745c7..606f23f0 100644 --- a/src/Form/ProjectSystem/ProjectBOMEntryCollectionType.php +++ b/src/Form/ProjectSystem/ProjectBOMEntryCollectionType.php @@ -8,7 +8,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ProjectBOMEntryCollectionType extends AbstractType { - public function getParent() + public function getParent(): string { return CollectionType::class; } @@ -28,7 +28,7 @@ class ProjectBOMEntryCollectionType extends AbstractType ]); } - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'project_bom_entry_collection'; } diff --git a/src/Form/ProjectSystem/ProjectBOMEntryType.php b/src/Form/ProjectSystem/ProjectBOMEntryType.php index 49292235..dbe2ad70 100644 --- a/src/Form/ProjectSystem/ProjectBOMEntryType.php +++ b/src/Form/ProjectSystem/ProjectBOMEntryType.php @@ -93,7 +93,7 @@ class ProjectBOMEntryType extends AbstractType } - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'project_bom_entry'; } diff --git a/src/Form/Type/PartLotSelectType.php b/src/Form/Type/PartLotSelectType.php index 61e119b0..9e93c85b 100644 --- a/src/Form/Type/PartLotSelectType.php +++ b/src/Form/Type/PartLotSelectType.php @@ -31,7 +31,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PartLotSelectType extends AbstractType { - public function getParent() + public function getParent(): string { return EntityType::class; } diff --git a/src/Form/Type/PartSelectType.php b/src/Form/Type/PartSelectType.php index 5ca543f7..1795a9c0 100644 --- a/src/Form/Type/PartSelectType.php +++ b/src/Form/Type/PartSelectType.php @@ -117,7 +117,7 @@ class PartSelectType extends AbstractType implements DataMapperInterface ]); } - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'part_select'; } diff --git a/src/Form/Type/ThemeChoiceType.php b/src/Form/Type/ThemeChoiceType.php index 88843903..f2d040e8 100644 --- a/src/Form/Type/ThemeChoiceType.php +++ b/src/Form/Type/ThemeChoiceType.php @@ -34,7 +34,7 @@ class ThemeChoiceType extends AbstractType $this->available_themes = $available_themes; } - public function getParent() + public function getParent(): string { return ChoiceType::class; } diff --git a/src/Form/Type/UserSelectType.php b/src/Form/Type/UserSelectType.php index c9c0830c..97d8e26d 100644 --- a/src/Form/Type/UserSelectType.php +++ b/src/Form/Type/UserSelectType.php @@ -40,7 +40,7 @@ class UserSelectType extends AbstractType ]); } - public function getParent() + public function getParent(): string { return StructuralEntityType::class; } diff --git a/src/Security/EnsureSAMLUserForSAMLLoginChecker.php b/src/Security/EnsureSAMLUserForSAMLLoginChecker.php index 1d4c3cfe..bba13c01 100644 --- a/src/Security/EnsureSAMLUserForSAMLLoginChecker.php +++ b/src/Security/EnsureSAMLUserForSAMLLoginChecker.php @@ -37,7 +37,7 @@ class EnsureSAMLUserForSAMLLoginChecker implements EventSubscriberInterface $this->translator = $translator; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ AuthenticationSuccessEvent::class => 'onAuthenticationSuccess', diff --git a/src/Security/Voter/ParameterVoter.php b/src/Security/Voter/ParameterVoter.php index 525a75b6..352c405d 100644 --- a/src/Security/Voter/ParameterVoter.php +++ b/src/Security/Voter/ParameterVoter.php @@ -118,7 +118,7 @@ class ParameterVoter extends ExtendedVoter return $this->resolver->inherit($user, $param, $attribute) ?? false; } - protected function supports(string $attribute, $subject) + protected function supports(string $attribute, $subject): bool { if (is_a($subject, AbstractParameter::class, true)) { //These are the allowed attributes diff --git a/src/Serializer/StructuralElementDenormalizer.php b/src/Serializer/StructuralElementDenormalizer.php index bd832f1f..89141f02 100644 --- a/src/Serializer/StructuralElementDenormalizer.php +++ b/src/Serializer/StructuralElementDenormalizer.php @@ -43,7 +43,7 @@ class StructuralElementDenormalizer implements ContextAwareDenormalizerInterface $this->entityManager = $entityManager; } - public function supportsDenormalization($data, string $type, string $format = null, array $context = []) + public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool { return is_array($data) && is_subclass_of($type, AbstractStructuralDBElement::class) diff --git a/src/Serializer/StructuralElementFromNameDenormalizer.php b/src/Serializer/StructuralElementFromNameDenormalizer.php index ac035946..adeb50cc 100644 --- a/src/Serializer/StructuralElementFromNameDenormalizer.php +++ b/src/Serializer/StructuralElementFromNameDenormalizer.php @@ -37,7 +37,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface, Ca $this->em = $em; } - public function supportsDenormalization($data, string $type, string $format = null) + public function supportsDenormalization($data, string $type, string $format = null): bool { return is_string($data) && is_subclass_of($type, AbstractStructuralDBElement::class); } diff --git a/src/Twig/MiscExtension.php b/src/Twig/MiscExtension.php index e154ccf8..6181e9cd 100644 --- a/src/Twig/MiscExtension.php +++ b/src/Twig/MiscExtension.php @@ -32,7 +32,7 @@ final class MiscExtension extends AbstractExtension $this->eventCommentNeededHelper = $eventCommentNeededHelper; } - public function getFunctions() + public function getFunctions(): array { return [ new \Twig\TwigFunction('event_comment_needed', diff --git a/src/Twig/TwigCoreExtension.php b/src/Twig/TwigCoreExtension.php index aecbdd17..fd63d334 100644 --- a/src/Twig/TwigCoreExtension.php +++ b/src/Twig/TwigCoreExtension.php @@ -54,7 +54,7 @@ final class TwigCoreExtension extends AbstractExtension ]; } - public function getFilters() + public function getFilters(): array { return [ /* Converts the given object to an array representation of the public/accessible properties */ diff --git a/tests/Entity/UserSystem/PermissionDataTest.php b/tests/Entity/UserSystem/PermissionDataTest.php index 5107c2a0..0536cd5b 100644 --- a/tests/Entity/UserSystem/PermissionDataTest.php +++ b/tests/Entity/UserSystem/PermissionDataTest.php @@ -26,7 +26,7 @@ use PHPUnit\Framework\TestCase; class PermissionDataTest extends TestCase { - public function testGetSetIs() + public function testGetSetIs(): void { $perm_data = new PermissionData(); @@ -60,7 +60,7 @@ class PermissionDataTest extends TestCase $this->assertFalse($perm_data->isPermissionSet('p1', 'op1')); } - public function testJSONSerialization() + public function testJSONSerialization(): void { $perm_data = new PermissionData(); @@ -99,7 +99,7 @@ class PermissionDataTest extends TestCase } - public function testFromJSON() + public function testFromJSON(): void { $json = json_encode([ 'perm1' => [ @@ -120,7 +120,7 @@ class PermissionDataTest extends TestCase $this->assertFalse($perm_data->getPermissionValue('perm2', 'op2')); } - public function testResetPermissions() + public function testResetPermissions(): void { $data = new PermissionData(); @@ -147,7 +147,7 @@ class PermissionDataTest extends TestCase $this->assertFalse($data->isPermissionSet('perm1', 'op3')); } - public function testGetSchemaVersion() + public function testGetSchemaVersion(): void { $data = new PermissionData(); @@ -159,7 +159,7 @@ class PermissionDataTest extends TestCase $this->assertEquals(12345, $data->getSchemaVersion()); } - public function testIsAnyOperationOfPermissionSet() + public function testIsAnyOperationOfPermissionSet(): void { $data = new PermissionData(); @@ -170,7 +170,7 @@ class PermissionDataTest extends TestCase $this->assertTrue($data->isAnyOperationOfPermissionSet('perm1')); } - public function testGetAllDefinedOperationsOfPermission() + public function testGetAllDefinedOperationsOfPermission(): void { $data = new PermissionData(); @@ -185,7 +185,7 @@ class PermissionDataTest extends TestCase $data->getAllDefinedOperationsOfPermission('perm1')); } - public function testSetAllOperationsOfPermission() + public function testSetAllOperationsOfPermission(): void { $data = new PermissionData(); @@ -200,7 +200,7 @@ class PermissionDataTest extends TestCase $data->getAllDefinedOperationsOfPermission('perm1')); } - public function testRemovePermission() + public function testRemovePermission(): void { $data = new PermissionData(); diff --git a/tests/Helpers/Projects/ProjectBuildRequestTest.php b/tests/Helpers/Projects/ProjectBuildRequestTest.php index 0af0aa72..92c61a28 100644 --- a/tests/Helpers/Projects/ProjectBuildRequestTest.php +++ b/tests/Helpers/Projects/ProjectBuildRequestTest.php @@ -115,7 +115,7 @@ class ProjectBuildRequestTest extends TestCase $this->project1->addBomEntry($this->bom_entry1c); } - public function testInitialization() + public function testInitialization(): void { //The values should be already prefilled correctly $request = new ProjectBuildRequest($this->project1, 10); @@ -127,19 +127,19 @@ class ProjectBuildRequestTest extends TestCase $this->assertEquals(2.5, $request->getLotWithdrawAmount($this->lot2)); } - public function testGetNumberOfBuilds() + public function testGetNumberOfBuilds(): void { $build_request = new ProjectBuildRequest($this->project1, 5); $this->assertEquals(5, $build_request->getNumberOfBuilds()); } - public function testGetProject() + public function testGetProject(): void { $build_request = new ProjectBuildRequest($this->project1, 5); $this->assertEquals($this->project1, $build_request->getProject()); } - public function testGetNeededAmountForBOMEntry() + public function testGetNeededAmountForBOMEntry(): void { $build_request = new ProjectBuildRequest($this->project1, 5); $this->assertEquals(10, $build_request->getNeededAmountForBOMEntry($this->bom_entry1a)); @@ -147,7 +147,7 @@ class ProjectBuildRequestTest extends TestCase $this->assertEquals(20, $build_request->getNeededAmountForBOMEntry($this->bom_entry1c)); } - public function testGetSetLotWithdrawAmount() + public function testGetSetLotWithdrawAmount(): void { $build_request = new ProjectBuildRequest($this->project1, 5); @@ -160,7 +160,7 @@ class ProjectBuildRequestTest extends TestCase $this->assertEquals(3, $build_request->getLotWithdrawAmount($this->lot1b)); } - public function testGetWithdrawAmountSum() + public function testGetWithdrawAmountSum(): void { //The sum of all withdraw amounts for an BOM entry (over all lots of the associated part) should be correct $build_request = new ProjectBuildRequest($this->project1, 5); diff --git a/tests/Security/SamlUserFactoryTest.php b/tests/Security/SamlUserFactoryTest.php index f7dd15d7..ddfffe96 100644 --- a/tests/Security/SamlUserFactoryTest.php +++ b/tests/Security/SamlUserFactoryTest.php @@ -37,7 +37,7 @@ class SamlUserFactoryTest extends WebTestCase $this->service = self::getContainer()->get(SamlUserFactory::class); } - public function testCreateUser() + public function testCreateUser(): void { $user = $this->service->createUser('sso_user', [ 'email' => ['j.doe@invalid.invalid'], @@ -63,7 +63,7 @@ class SamlUserFactoryTest extends WebTestCase $this->assertEquals('j.doe@invalid.invalid', $user->getEmail()); } - public function testMapSAMLRolesToLocalGroupID() + public function testMapSAMLRolesToLocalGroupID(): void { $mapping = [ 'admin' => 2, //This comes first, as this should have higher priority diff --git a/tests/Serializer/BigNumberNormalizerTest.php b/tests/Serializer/BigNumberNormalizerTest.php index 1c05dc19..b98968fe 100644 --- a/tests/Serializer/BigNumberNormalizerTest.php +++ b/tests/Serializer/BigNumberNormalizerTest.php @@ -39,13 +39,13 @@ class BigNumberNormalizerTest extends WebTestCase $this->service = self::getContainer()->get(BigNumberNormalizer::class); } - public function testNormalize() + public function testNormalize(): void { $bigDecimal = BigDecimal::of('1.23456789'); $this->assertSame('1.23456789', $this->service->normalize($bigDecimal)); } - public function testSupportsNormalization() + public function testSupportsNormalization(): void { //Normalizer must only support BigNumber objects (and child classes) $this->assertFalse($this->service->supportsNormalization(new \stdClass())); diff --git a/tests/Serializer/PartNormalizerTest.php b/tests/Serializer/PartNormalizerTest.php index 21f86990..d812b0b7 100644 --- a/tests/Serializer/PartNormalizerTest.php +++ b/tests/Serializer/PartNormalizerTest.php @@ -41,14 +41,14 @@ class PartNormalizerTest extends WebTestCase $this->service = self::getContainer()->get(PartNormalizer::class); } - public function testSupportsNormalization() + public function testSupportsNormalization(): void { //Normalizer must only support Part objects (and child classes) $this->assertFalse($this->service->supportsNormalization(new \stdClass())); $this->assertTrue($this->service->supportsNormalization(new Part())); } - public function testNormalize() + public function testNormalize(): void { $part = new Part(); $part->setName('Test Part'); @@ -70,7 +70,7 @@ class PartNormalizerTest extends WebTestCase $this->assertArrayNotHasKey('type', $data); } - public function testSupportsDenormalization() + public function testSupportsDenormalization(): void { //Normalizer must only support Part type with array as input $this->assertFalse($this->service->supportsDenormalization(new \stdClass(), Part::class)); @@ -79,7 +79,7 @@ class PartNormalizerTest extends WebTestCase $this->assertTrue($this->service->supportsDenormalization(['a' => 'b'], Part::class)); } - public function testDenormalize() + public function testDenormalize(): void { $input = [ 'name' => 'Test Part', diff --git a/tests/Serializer/StructuralElementNormalizerTest.php b/tests/Serializer/StructuralElementNormalizerTest.php index 09cf7299..cc5f996d 100644 --- a/tests/Serializer/StructuralElementNormalizerTest.php +++ b/tests/Serializer/StructuralElementNormalizerTest.php @@ -42,7 +42,7 @@ class StructuralElementNormalizerTest extends WebTestCase $this->service = self::getContainer()->get(StructuralElementNormalizer::class); } - public function testNormalize() + public function testNormalize(): void { $category1 = (new Category())->setName('Category 1'); $category11 = (new Category())->setName('Category 1.1'); @@ -65,7 +65,7 @@ class StructuralElementNormalizerTest extends WebTestCase $this->assertArrayNotHasKey('type', $data11); } - public function testSupportsNormalization() + public function testSupportsNormalization(): void { //Normalizer must only support StructuralElement objects (and child classes) $this->assertFalse($this->service->supportsNormalization(new \stdClass())); diff --git a/tests/Services/Attachments/AttachmentPathResolverTest.php b/tests/Services/Attachments/AttachmentPathResolverTest.php index 9edde560..76694412 100644 --- a/tests/Services/Attachments/AttachmentPathResolverTest.php +++ b/tests/Services/Attachments/AttachmentPathResolverTest.php @@ -140,7 +140,7 @@ class AttachmentPathResolverTest extends WebTestCase $this->assertSame($expected, $this->service->realPathToPlaceholder($param, $old_method)); } - public function germanFootprintPathdDataProvider() + public function germanFootprintPathdDataProvider(): ?\Generator { self::bootKernel(); $this->projectDir_orig = realpath(self::$kernel->getProjectDir()); diff --git a/tests/Services/LogSystem/EventCommentNeededHelperTest.php b/tests/Services/LogSystem/EventCommentNeededHelperTest.php index 9816d078..9cfabd6a 100644 --- a/tests/Services/LogSystem/EventCommentNeededHelperTest.php +++ b/tests/Services/LogSystem/EventCommentNeededHelperTest.php @@ -25,7 +25,7 @@ use PHPUnit\Framework\TestCase; class EventCommentNeededHelperTest extends TestCase { - public function testIsCommentNeeded() + public function testIsCommentNeeded(): void { $service = new EventCommentNeededHelper(['part_edit', 'part_create']); $this->assertTrue($service->isCommentNeeded('part_edit')); @@ -34,7 +34,7 @@ class EventCommentNeededHelperTest extends TestCase $this->assertFalse($service->isCommentNeeded('part_stock_operation')); } - public function testIsCommentNeededInvalidTypeException() + public function testIsCommentNeededInvalidTypeException(): void { $service = new EventCommentNeededHelper(['part_edit', 'part_create']); $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Services/Misc/MySQLDumpXMLConverterTest.php b/tests/Services/Misc/MySQLDumpXMLConverterTest.php index 9f2a9925..b666597a 100644 --- a/tests/Services/Misc/MySQLDumpXMLConverterTest.php +++ b/tests/Services/Misc/MySQLDumpXMLConverterTest.php @@ -26,7 +26,7 @@ use PHPUnit\Framework\TestCase; class MySQLDumpXMLConverterTest extends TestCase { - public function testConvertMySQLDumpXMLDataToArrayStructure() + public function testConvertMySQLDumpXMLDataToArrayStructure(): void { $service = new MySQLDumpXMLConverter(); diff --git a/tests/Services/Parts/PartLotWithdrawAddHelperTest.php b/tests/Services/Parts/PartLotWithdrawAddHelperTest.php index b2f8a2f3..33968857 100644 --- a/tests/Services/Parts/PartLotWithdrawAddHelperTest.php +++ b/tests/Services/Parts/PartLotWithdrawAddHelperTest.php @@ -89,7 +89,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase $this->lotWithUnknownInstock->setStorageLocation($this->storageLocation); } - public function testCanWithdraw() + public function testCanWithdraw(): void { //Normal lots should be withdrawable $this->assertTrue($this->service->canWithdraw($this->partLot1)); @@ -103,7 +103,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase $this->assertFalse($this->service->canWithdraw($this->lotWithUnknownInstock)); } - public function testCanAdd() + public function testCanAdd(): void { //Normal lots should be addable $this->assertTrue($this->service->canAdd($this->partLot1)); @@ -116,7 +116,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase $this->assertFalse($this->service->canAdd($this->lotWithUnknownInstock)); } - public function testAdd() + public function testAdd(): void { //Add 5 to lot 1 $this->service->add($this->partLot1, 5, "Test"); @@ -132,7 +132,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase } - public function testWithdraw() + public function testWithdraw(): void { //Withdraw 5 from lot 1 $this->service->withdraw($this->partLot1, 5, "Test"); @@ -143,7 +143,7 @@ class PartLotWithdrawAddHelperTest extends WebTestCase $this->assertEquals(0, $this->partLot2->getAmount()); } - public function testMove() + public function testMove(): void { //Move 5 from lot 1 to lot 2 $this->service->move($this->partLot1, $this->partLot2, 5, "Test"); diff --git a/tests/Services/ProjectSystem/ProjectBuildHelperTest.php b/tests/Services/ProjectSystem/ProjectBuildHelperTest.php index 0037ae0c..199a7dac 100644 --- a/tests/Services/ProjectSystem/ProjectBuildHelperTest.php +++ b/tests/Services/ProjectSystem/ProjectBuildHelperTest.php @@ -39,7 +39,7 @@ class ProjectBuildHelperTest extends WebTestCase $this->service = self::getContainer()->get(ProjectBuildHelper::class); } - public function testGetMaximumBuildableCountForBOMEntryNonPartBomEntry() + public function testGetMaximumBuildableCountForBOMEntryNonPartBomEntry(): void { $bom_entry = new ProjectBOMEntry(); $bom_entry->setPart(null); @@ -50,7 +50,7 @@ class ProjectBuildHelperTest extends WebTestCase $this->service->getMaximumBuildableCountForBOMEntry($bom_entry); } - public function testGetMaximumBuildableCountForBOMEntry() + public function testGetMaximumBuildableCountForBOMEntry(): void { $project_bom_entry = new ProjectBOMEntry(); $project_bom_entry->setQuantity(10); @@ -74,7 +74,7 @@ class ProjectBuildHelperTest extends WebTestCase $this->assertEquals(0, $this->service->getMaximumBuildableCountForBOMEntry($project_bom_entry)); } - public function testGetMaximumBuildableCount() + public function testGetMaximumBuildableCount(): void { $project = new Project(); diff --git a/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php b/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php index 79abb89c..44ad88a7 100644 --- a/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php +++ b/tests/Services/UserSystem/PermissionSchemaUpdaterTest.php @@ -56,7 +56,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase $this->service = self::$container->get(PermissionSchemaUpdater::class); } - public function testIsSchemaUpdateNeeded() + public function testIsSchemaUpdateNeeded(): void { $perm_data = new PermissionData(); $perm_data->setSchemaVersion(0); @@ -70,7 +70,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase self::assertFalse($this->service->isSchemaUpdateNeeded($user)); } - public function testUpgradeSchema() + public function testUpgradeSchema(): void { $perm_data = new PermissionData(); $perm_data->setSchemaVersion(0); @@ -84,7 +84,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase self::assertFalse($this->service->upgradeSchema($user)); } - public function testUpgradeSchemaToVersion1() + public function testUpgradeSchemaToVersion1(): void { $perm_data = new PermissionData(); $perm_data->setSchemaVersion(0); @@ -98,7 +98,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase self::assertEquals(PermissionData::ALLOW, $user->getPermissions()->getPermissionValue('parts_stock', 'withdraw')); } - public function testUpgradeSchemaToVersion2() + public function testUpgradeSchemaToVersion2(): void { $perm_data = new PermissionData(); $perm_data->setSchemaVersion(1); diff --git a/tests/Twig/EntityExtensionTest.php b/tests/Twig/EntityExtensionTest.php index 9e951ea6..00209414 100644 --- a/tests/Twig/EntityExtensionTest.php +++ b/tests/Twig/EntityExtensionTest.php @@ -51,7 +51,7 @@ class EntityExtensionTest extends WebTestCase $this->service = self::getContainer()->get(EntityExtension::class); } - public function testGetEntityType() + public function testGetEntityType(): void { $this->assertEquals('part', $this->service->getEntityType(new Part())); $this->assertEquals('footprint', $this->service->getEntityType(new Footprint())); diff --git a/tests/Twig/TwigCoreExtensionTest.php b/tests/Twig/TwigCoreExtensionTest.php index dccb43ca..ed55dcbc 100644 --- a/tests/Twig/TwigCoreExtensionTest.php +++ b/tests/Twig/TwigCoreExtensionTest.php @@ -55,7 +55,7 @@ class TwigCoreExtensionTest extends WebTestCase private $test3 = 5; private $test4 = 7; - public function getTest4() + public function getTest4(): int { return $this->test4; } diff --git a/tests/Twig/UserExtensionTest.php b/tests/Twig/UserExtensionTest.php index 6a469cda..04dd888f 100644 --- a/tests/Twig/UserExtensionTest.php +++ b/tests/Twig/UserExtensionTest.php @@ -34,7 +34,7 @@ class UserExtensionTest extends WebTestCase $this->service = self::getContainer()->get(UserExtension::class); } - public function removeeLocaleFromPathDataSet() + public function removeeLocaleFromPathDataSet(): ?\Generator { yield ['/', '/de/']; yield ['/test', '/de/test'];