Skip to content

Commit a32ad20

Browse files
author
MateuszKolankowski
committed
Merge branch '4.6'
# Conflicts: # phpstan-baseline.neon # src/contracts/Notification/UserPasswordReset.php # src/contracts/Notification/UserRegister.php # src/lib/EventListener/ViewTemplatesListener.php # src/lib/Form/Data/UserInvitationData.php # src/lib/Permission/UserPermissionsLimitationType.php # src/lib/Templating/Twig/DateTimeExtension.php # src/lib/UserSetting/DateTimeFormat/Formatter.php # src/lib/UserSetting/DateTimeFormat/FormatterInterface.php
2 parents 3c2c70c + 76dc302 commit a32ad20

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

.github/workflows/browser-tests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
test-suite: '--profile=browser --suite=password'
1717
secrets:
1818
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
19+
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
20+
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
21+
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
1922
login-providers:
2023
name: "User login providers tests"
2124
uses: ibexa/gh-workflows/.github/workflows/browser-tests.yml@main
@@ -25,3 +28,6 @@ jobs:
2528
test-setup-phase-1: '--mode=standard --profile=setup --suite=login-methods'
2629
secrets:
2730
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
31+
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
32+
AUTOMATION_CLIENT_INSTALLATION: ${{ secrets.AUTOMATION_CLIENT_INSTALLATION }}
33+
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}

phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ parameters:
156156
count: 1
157157
path: src/lib/Form/DataTransformer/LimitationValueTransformer.php
158158

159-
-
160-
message: '#^Cannot call method getContentType\(\) on Ibexa\\User\\Form\\Data\\UserPasswordResetData\|null\.$#'
161-
identifier: method.nonObject
162-
count: 1
163-
path: src/lib/Form/Factory/FormFactory.php
164-
165159
-
166160
message: '#^Method Ibexa\\User\\Form\\Factory\\FormFactory\:\:changeUserPassword\(\) return type with generic interface Symfony\\Component\\Form\\FormInterface does not specify its types\: TData$#'
167161
identifier: missingType.generics

src/contracts/Notification/UserRegister.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
parent::__construct();
2323
}
2424

25-
public function asEmailMessage(EmailRecipientInterface $recipient, string $transport = null): ?EmailMessage
25+
public function asEmailMessage(EmailRecipientInterface $recipient, ?string $transport = null): ?EmailMessage
2626
{
2727
return null;
2828
}

src/lib/Form/Factory/FormFactory.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Ibexa\User\Form\Type\UserPasswordForgotWithLoginType;
2121
use Ibexa\User\Form\Type\UserPasswordResetType;
2222
use Ibexa\User\Form\Type\UserSettingUpdateType;
23+
use InvalidArgumentException;
2324
use Symfony\Component\Form\FormFactoryInterface;
2425
use Symfony\Component\Form\FormInterface;
2526
use Symfony\Component\Form\Util\StringUtil;
@@ -35,7 +36,7 @@ public function __construct(
3536

3637
public function changeUserPassword(
3738
ContentType $contentType,
38-
UserPasswordChangeData $data = null,
39+
?UserPasswordChangeData $data = null,
3940
?string $name = null,
4041
?User $user = null
4142
): FormInterface {
@@ -56,7 +57,7 @@ public function changeUserPassword(
5657
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
5758
*/
5859
public function forgotUserPassword(
59-
UserPasswordForgotData $data = null,
60+
?UserPasswordForgotData $data = null,
6061
?string $name = null
6162
): FormInterface {
6263
$name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordForgotType::class);
@@ -68,7 +69,7 @@ public function forgotUserPassword(
6869
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
6970
*/
7071
public function forgotUserPasswordWithLogin(
71-
UserPasswordForgotWithLoginData $data = null,
72+
?UserPasswordForgotWithLoginData $data = null,
7273
?string $name = null
7374
): FormInterface {
7475
$name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordForgotWithLoginType::class);
@@ -80,13 +81,16 @@ public function forgotUserPasswordWithLogin(
8081
* @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
8182
*/
8283
public function resetUserPassword(
83-
UserPasswordResetData $data = null,
84+
?UserPasswordResetData $data = null,
8485
?string $name = null,
8586
?ContentType $contentType = null,
8687
?User $user = null
8788
): FormInterface {
8889
$name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordResetType::class);
8990

91+
if (null === $data) {
92+
throw new InvalidArgumentException('UserPasswordResetData is required for resetting user password');
93+
}
9094
$userContentType = $contentType ?? $data->getContentType();
9195

9296
return $this->formFactory->createNamed(
@@ -102,7 +106,7 @@ public function resetUserPassword(
102106

103107
public function updateUserSetting(
104108
string $userSettingIdentifier,
105-
UserSettingUpdateData $data = null,
109+
?UserSettingUpdateData $data = null,
106110
?string $name = null
107111
): FormInterface {
108112
$name = $name ?: StringUtil::fqcnToBlockPrefix(UserSettingUpdateType::class);

src/lib/Permission/UserPermissionsLimitationType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function buildValue(array $limitationValues): APILimitationValue
140140
* @param \Ibexa\Contracts\Core\Repository\Values\ValueObject $object
141141
* @param \Ibexa\Contracts\Core\Repository\Values\ValueObject[]|null $targets The context of the $object, like Location of Content, if null none where provided by caller
142142
*/
143-
public function evaluate(APILimitationValue $value, APIUserReference $currentUser, object $object, array $targets = null): ?bool
143+
public function evaluate(APILimitationValue $value, APIUserReference $currentUser, object $object, ?array $targets = null): ?bool
144144
{
145145
if (!$value instanceof UserPermissionsLimitation) {
146146
throw new InvalidArgumentException('$value', 'Must be of type: APISiteAccessLimitation');

0 commit comments

Comments
 (0)