Skip to content

Commit

Permalink
[TASK] Make code compatible with code quality tools
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey1988 committed Sep 18, 2023
1 parent 373d213 commit 78ba8bf
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/.php-cs-fixer.cache
/auth.json
/composer.lock
/composer.json.testing

/Documentation-GENERATED-temp

Expand Down
6 changes: 6 additions & 0 deletions Build/phpstan/Core11/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ parameters:
- ../../../.Build
- ../../../.cache
- ../../../Build

typo3:
contextApiGetAspectMapping:
frontend.profile: Fgtclb\AcademicPersonsEdit\Context\ProfileAspect
requestGetAttributeMapping:
frontend.profileUid: int
6 changes: 6 additions & 0 deletions Build/phpstan/Core12/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ parameters:
- ../../../.Build
- ../../../Tests/Functional/Updates/Fixtures/Extension/test_extension/ext_emconf.php
- ../../../Classes/Override/Core11

typo3:
contextApiGetAspectMapping:
frontend.profile: Fgtclb\AcademicPersonsEdit\Context\ProfileAspect
requestGetAttributeMapping:
frontend.profileUid: int
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/AddressRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public function getAddressFromOrganisation(
$query->equals('employeeType', $employeeType),
$query->equals('organisationalLevel1', $organizationalLevel1),
$query->equals('organisationalLevel2', $organizationalLevel2),
$query->equals('organisationalLevel3', $organizationalLevel3)
$query->equals('organisationalLevel3', $organizationalLevel3),
])
);
$query->setOrderings([
'zip' => QueryInterface::ORDER_ASCENDING
'zip' => QueryInterface::ORDER_ASCENDING,
]);

return $query->execute();
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/ProfileRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function findByUids(array $uids): QueryResultInterface
$query->in('uid', $uids)
)
->setOrderings([
'lastName' => QueryInterface::ORDER_ASCENDING
'lastName' => QueryInterface::ORDER_ASCENDING,
])
->execute();
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/EventListener/GenerateSlugForProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __invoke(AfterProfileUpdateEvent $event): void
'slug' => $profileSlug,
],
[
'uid' => $profileUid
'uid' => $profileUid,
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion Migrations/Mysql/Version20230720082500.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function up(Schema $schema): void
'sDEF' => [
'lDEF' => [
'settings.pages' => [
'vDEF' => sprintf('pages_%d', $userStorageUid)
'vDEF' => sprintf('pages_%d', $userStorageUid),
],
],
],
Expand Down
14 changes: 7 additions & 7 deletions Tests/Unit/Context/ProfileAspectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function emptyProfileUidsWillResultInNotHavingProfile(): void
{
$subject = new ProfileAspect([], 1);

self::assertFalse($subject->get('hasProfile'));
static::assertFalse($subject->get('hasProfile'));
}

/**
Expand All @@ -37,7 +37,7 @@ public function givenProfileUidsWillResultInHavingProfile(): void
{
$subject = new ProfileAspect([1], 1);

self::assertTrue($subject->get('hasProfile'));
static::assertTrue($subject->get('hasProfile'));
}

/**
Expand All @@ -47,7 +47,7 @@ public function emptyProfileUidsWillReturnEmptyArray(): void
{
$subject = new ProfileAspect([], 1);

self::assertSame([], $subject->get('allProfileUids'));
static::assertSame([], $subject->get('allProfileUids'));
}

/**
Expand All @@ -57,7 +57,7 @@ public function givenProfileUidsWillReturnUids(): void
{
$subject = new ProfileAspect([1, 2], 1);

self::assertSame([1, 2], $subject->get('allProfileUids'));
static::assertSame([1, 2], $subject->get('allProfileUids'));
}

/**
Expand All @@ -67,7 +67,7 @@ public function emptyProfileUidsAndGivenActiveProfileUidWillReturnZero(): void
{
$subject = new ProfileAspect([], 1);

self::assertSame(0, $subject->get('activeProfileUid'));
static::assertSame(0, $subject->get('activeProfileUid'));
}

/**
Expand All @@ -77,7 +77,7 @@ public function givenProfileUidsAndGivenActiveProfileUidWillReturnActiveProfileU
{
$subject = new ProfileAspect([1], 1);

self::assertSame(1, $subject->get('activeProfileUid'));
static::assertSame(1, $subject->get('activeProfileUid'));
}

/**
Expand All @@ -87,7 +87,7 @@ public function givenProfileUidsAndNoActiveProfileUidWillReturnZero(): void
{
$subject = new ProfileAspect([1], 0);

self::assertSame(0, $subject->get('activeProfileUid'));
static::assertSame(0, $subject->get('activeProfileUid'));
}

/**
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"require": {
"php": "^8.0",
"typo3/cms-core": "^11.5",
"fgtclb/academic-persons": "^0.1"
"fgtclb/academic-persons": "^0.1 | dev-main"
},
"require-dev": {
"typo3/minimal": "v11.5.0",
Expand Down Expand Up @@ -55,6 +55,7 @@
},
"config": {
"vendor-dir": ".Build/vendor",
"bin-dir": ".Build/bin",
"allow-plugins": true
},
"scripts": {
Expand All @@ -65,6 +66,7 @@
"extra": {
"typo3/cms": {
"web-dir": ".Build/public",
"app-dir": ".Build",
"extension-key": "academic_persons_edit"
},
"patches": {
Expand Down
5 changes: 3 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
$EM_CONF['academic_persons_edit'] = [

$EM_CONF[$_EXTKEY] = [
'title' => 'FGTCLB: Academic Persons Edit',
'description' => 'dds the option to assign frontend users to academic persons and allow editing the profiles in frontend.',
'category' => 'plugin',
Expand All @@ -12,7 +13,7 @@
'constraints' => [
'depends' => [
'typo3' => '11.5.0-11.5.99',
"academic_persons" => "0.1.0 - 0.1.99",
'academic_persons' => '0.1.0 - 0.1.99',
],
'conflicts' => [
],
Expand Down

0 comments on commit 78ba8bf

Please sign in to comment.