apply rector rules: php up to php82

This commit is contained in:
2023-07-19 23:16:01 +02:00
parent 7b637d1287
commit 023a29cb78
744 changed files with 1369 additions and 1381 deletions

View File

@@ -35,17 +35,17 @@ class Convert
{
private const LOG_PREFIX = '[convert] ';
private string $collaboraDomain;
private readonly string $collaboraDomain;
/**
* @param StoredObjectManager $storedObjectManager
*/
public function __construct(
private HttpClientInterface $httpClient,
private RequestStack $requestStack,
private Security $security,
private StoredObjectManagerInterface $storedObjectManager,
private LoggerInterface $logger,
private readonly HttpClientInterface $httpClient,
private readonly RequestStack $requestStack,
private readonly Security $security,
private readonly StoredObjectManagerInterface $storedObjectManager,
private readonly LoggerInterface $logger,
ParameterBagInterface $parameters
) {
$this->collaboraDomain = $parameters->get('wopi')['server'];

View File

@@ -36,7 +36,7 @@ use Twig\Environment;
* @internal
* @coversNothing
*/
final class Editor
final readonly class Editor
{
public function __construct(private ConfigurationInterface $wopiConfiguration, private DiscoveryInterface $wopiDiscovery, private DocumentManagerInterface $documentManager, private EngineInterface $engine, private JWTTokenManagerInterface $JWTTokenManager, private NormalizerInterface $normalizer, private ResponderInterface $responder, private Security $security, private Psr17Interface $psr17, private RouterInterface $router)
{

View File

@@ -20,7 +20,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Serializer\SerializerInterface;
use Twig\Environment;
final class Responder implements ResponderInterface
final readonly class Responder implements ResponderInterface
{
public function __construct(private Environment $twig, private UrlGeneratorInterface $urlGenerator, private SerializerInterface $serializer)
{
@@ -51,12 +51,7 @@ final class Responder implements ResponderInterface
->serialize(
$data,
'json',
array_merge(
[
'json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS,
],
$context
)
['json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS, ...$context]
),
$status,
$headers,

View File

@@ -35,12 +35,11 @@ interface ResponderInterface
/**
* Returns a JsonResponse that uses the serializer component if enabled, or json_encode.
*
* @param mixed $data
* @param array<string, list<string>|string> $headers
* @param array<string, mixed> $context
*/
public function json(
$data,
mixed $data,
int $status = 200,
array $headers = [],
array $context = []

View File

@@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Security;
class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\AuthorizationManagerInterface
{
public function __construct(private JWTTokenManagerInterface $tokenManager, private Security $security)
public function __construct(private readonly JWTTokenManagerInterface $tokenManager, private readonly Security $security)
{
}

View File

@@ -26,7 +26,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface
*/
private const LOCK_GRACEFUL_DURATION_TIME = 3;
public function __construct(private ChillRedis $redis)
public function __construct(private readonly ChillRedis $redis)
{
}

View File

@@ -34,16 +34,16 @@ use function strlen;
final class ChillDocumentManager implements DocumentManagerInterface
{
private RequestInterface $request;
private readonly RequestInterface $request;
public function __construct(
private DocumentLockManagerInterface $documentLockManager,
private EntityManagerInterface $entityManager,
private readonly DocumentLockManagerInterface $documentLockManager,
private readonly EntityManagerInterface $entityManager,
HttpMessageFactoryInterface $httpMessageFactory,
private Psr17Interface $psr17,
private readonly Psr17Interface $psr17,
RequestStack $requestStack,
private StoredObjectManagerInterface $storedObjectManager,
private StoredObjectRepository $storedObjectRepository
private readonly StoredObjectManagerInterface $storedObjectManager,
private readonly StoredObjectRepository $storedObjectRepository
) {
$this->request = $httpMessageFactory->createRequest($requestStack->getCurrentRequest());
}

View File

@@ -15,7 +15,7 @@ use ChampsLibres\WopiLib\Contract\Service\WopiInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
final class ChillWopi implements WopiInterface
final readonly class ChillWopi implements WopiInterface
{
public function __construct(private WopiInterface $wopi)
{

View File

@@ -17,7 +17,7 @@ use Symfony\Component\Security\Core\Security;
class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInterface
{
public function __construct(private Security $security)
public function __construct(private readonly Security $security)
{
}