fix phpstan, cs, and rector rules

This commit is contained in:
2024-05-28 12:45:07 +02:00
parent 059e4a0acd
commit 56d173046d
27 changed files with 30 additions and 65 deletions

View File

@@ -29,7 +29,7 @@ class JWTOnDavUrlAuthenticator extends JWTTokenAuthenticator
TokenExtractorInterface $tokenExtractor,
private readonly DavOnUrlTokenExtractor $davOnUrlTokenExtractor,
TokenStorageInterface $preAuthenticationTokenStorage,
TranslatorInterface $translator = null,
?TranslatorInterface $translator = null,
) {
parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $preAuthenticationTokenStorage, $translator);
}

View File

@@ -149,7 +149,7 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
*/
public function renderButtonGroup(Environment $environment, StoredObject $document, string $title = null, bool $canEdit = true, array $options = []): string
public function renderButtonGroup(Environment $environment, StoredObject $document, ?string $title = null, bool $canEdit = true, array $options = []): string
{
$accessToken = $this->davTokenProvider->createToken(
$document,
@@ -174,7 +174,7 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt
]);
}
public function renderEditButton(Environment $environment, StoredObject $document, array $options = null): string
public function renderEditButton(Environment $environment, StoredObject $document, ?array $options = null): string
{
return $environment->render(self::TEMPLATE, [
'document' => $document,

View File

@@ -32,7 +32,7 @@ class StoredObjectVoterTest extends TestCase
/**
* @dataProvider provideDataVote
*/
public function testVote(TokenInterface $token, null|object $subject, string $attribute, mixed $expected): void
public function testVote(TokenInterface $token, ?object $subject, string $attribute, mixed $expected): void
{
$voter = new StoredObjectVoter();
@@ -98,7 +98,7 @@ class StoredObjectVoterTest extends TestCase
];
}
private function buildToken(StoredObjectRoleEnum $storedObjectRoleEnum = null, StoredObject $storedObject = null): TokenInterface
private function buildToken(?StoredObjectRoleEnum $storedObjectRoleEnum = null, ?StoredObject $storedObject = null): TokenInterface
{
$token = $this->prophesize(TokenInterface::class);