Skip to content

Commit

Permalink
UHF-9986: Merge branch 'main' into UHF-9986
Browse files Browse the repository at this point in the history
  • Loading branch information
tuutti committed Apr 23, 2024
2 parents 7227f54 + 45489df commit 4184bca
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/ApiClient/ApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ApiResponse {
* The response.
*/
public function __construct(
public readonly array|object $data
public readonly array|object $data,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Cache/CacheTagInvalidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface CacheTagInvalidatorInterface {
*/
public function invalidateTags(
array $tags,
array $instances = []
array $instances = [],
): void;

}
16 changes: 9 additions & 7 deletions src/Commands/ApiAccountCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ public function reveal(string $value) : int {
#[Option(name: 'id', description: 'An unique ID for given item.')]
#[Option(name: 'plugin', description: 'The plugin')]
#[Option(name: 'data', description: 'The data.')]
public function update(array $options = [
'file' => NULL,
'type' => NULL,
'id' => NULL,
'plugin' => NULL,
'data' => NULL,
]) : int {
public function update(
array $options = [
'file' => NULL,
'type' => NULL,
'id' => NULL,
'plugin' => NULL,
'data' => NULL,
],
) : int {
$type = $this->askType($options['type']);

if ($options['file']) {
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/DeployCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class DeployCommands extends DrushCommands {
* The event dispatcher.
*/
public function __construct(
private readonly EventDispatcherInterface $eventDispatcher
private readonly EventDispatcherInterface $eventDispatcher,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/LocaleCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(
protected LanguageManagerInterface $languageManager,
protected FileSystemInterface $fileSystem,
protected TranslationManager $translationManager,
protected ModuleExtensionList $moduleExtensionList
protected ModuleExtensionList $moduleExtensionList,
) {
}

Expand Down
10 changes: 7 additions & 3 deletions src/Commands/RevisionCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ public function __construct(
#[Command(name: 'helfi:revision:delete')]
#[Option(name: 'id', description: 'The entity ID')]
#[Option(name: 'keep', description: 'Number of revisions to keep')]
public function delete(string $entityType, ?int $entityId = NULL, array $options = [
'keep' => NULL,
]) : int {
public function delete(
string $entityType,
?int $entityId = NULL,
array $options = [
'keep' => NULL,
],
) : int {
if (!$this->revisionManager->entityTypeIsSupported($entityType)) {
$this->io()->writeln('Given entity type is not supported.');

Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Revision/RevisionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function deleteRevisions(string $entityType, array $revisionIds) : void {
public function getRevisionsPerLanguage(
string $entityType,
string|int $id,
?int $keep = NULL
?int $keep = NULL,
) : array {
$this->assertEntityType($entityType);

Expand Down
2 changes: 1 addition & 1 deletion src/Environment/EnvironmentResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class EnvironmentResolver implements EnvironmentResolverInterface {
*/
public function __construct(
#[Autowire('%helfi_api_base.environment_file%')] string $pathOrJson,
private readonly ConfigFactoryInterface $configFactory
private readonly ConfigFactoryInterface $configFactory,
) {
$this->populateEnvironments($pathOrJson);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Environment/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class Project {
public function __construct(
private readonly string $name,
private readonly ProjectMetadata $metadata,
array $environments = []
array $environments = [],
) {
Assert::allIsInstanceOf($environments, Environment::class);
$this->environments = $environments;
Expand Down
2 changes: 1 addition & 1 deletion src/Event/MigrationConfigurationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class MigrationConfigurationEvent extends Event {
*/
public function __construct(
public array &$configuration,
public ?MigrationInterface $migration = NULL
public ?MigrationInterface $migration = NULL,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/EnvironmentResponseSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class EnvironmentResponseSubscriber implements EventSubscriberInterface {
* The environment resolver.
*/
public function __construct(
private EnvironmentResolver $environmentResolver
private EnvironmentResolver $environmentResolver,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Language/DefaultLanguageResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class DefaultLanguageResolver {
public function __construct(
#[Autowire('%helfi_api_base.default_languages%')] private readonly array $defaultLanguages,
#[Autowire('%helfi_api_base.fallback_language%')] private readonly string $fallbackLanguage,
private readonly LanguageManagerInterface $languageManager
private readonly LanguageManagerInterface $languageManager,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Link/InternalDomainResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class InternalDomainResolver {
* The domains.
*/
public function __construct(
#[Autowire('%helfi_api_base.internal_domains%')] private array $domains = []
#[Autowire('%helfi_api_base.internal_domains%')] private array $domains = [],
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Package/HelfiPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class HelfiPackage implements VersionCheckerInterface {
* The HTTP client.
*/
public function __construct(
private ClientInterface $client
private ClientInterface $client,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/Action/MigrationUpdateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function create(
ContainerInterface $container,
array $configuration,
$plugin_id,
$plugin_definition
$plugin_definition,
) : self {
$instance = new self($configuration, $plugin_definition, $plugin_definition);
$instance->migrationPluginManager = $container->get('plugin.manager.migration');
Expand Down Expand Up @@ -133,7 +133,7 @@ public function execute($entity = NULL) {
public function access(
$object,
AccountInterface $account = NULL,
$return_as_object = FALSE
$return_as_object = FALSE,
) {
/** @var \Drupal\helfi_api_base\Entity\RemoteEntityBase $object */
$access = $object->access('update', NULL, TRUE);
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Filter/LinkConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static function create(
ContainerInterface $container,
array $configuration,
$plugin_id,
$plugin_definition
$plugin_definition,
) : self {
$instance = new self($configuration, $plugin_id, $plugin_definition);
$instance->renderer = $container->get('renderer');
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/migrate/source/HttpSourcePluginBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static function create(
array $configuration,
$plugin_id,
$plugin_definition,
MigrationInterface $migration = NULL
MigrationInterface $migration = NULL,
) {
/** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher */
$eventDispatcher = $container->get('event_dispatcher');
Expand Down
2 changes: 1 addition & 1 deletion src/Vault/VaultManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class VaultManager {
* The vault items.
*/
public function __construct(
array $vaultItems
array $vaultItems,
) {
Assert::allIsInstanceOf($vaultItems, VaultItemInterface::class);

Expand Down
3 changes: 2 additions & 1 deletion tests/src/Kernel/Plugin/Filter/LinkConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ protected function processText(
string $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED,
array $filter_ids = [
'helfi_link_converter',
]) : FilterProcessResult {
],
) : FilterProcessResult {
$manager = $this->container->get('plugin.manager.filter');
$bag = new FilterPluginCollection($manager);
$filters = [];
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Traits/ApiTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function getMockedRequest(
string $uri,
string $method = 'GET',
array $parameters = [],
array $document = []
array $document = [],
): Request {
$document = $document ? Json::encode($document) : NULL;

Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/Environment/EnvironmentResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function testGetEnvironmentException(
string $project,
string $language,
string $environment,
string $message
string $message,
) : void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage($message);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Unit/Package/HelfiPackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function testGet(
array $packageVersions,
string $packageVersion,
string $expectedLatestVersion,
bool $isLatest
bool $isLatest,
) : void {
$client = $this->createMockHttpClient([
new Response(body: json_encode([
Expand Down

0 comments on commit 4184bca

Please sign in to comment.