Skip to content

Commit

Permalink
code format commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed May 28, 2024
1 parent 235e8d7 commit 4686622
Show file tree
Hide file tree
Showing 33 changed files with 120 additions and 70 deletions.
3 changes: 2 additions & 1 deletion src/Builder/AlternativeLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ final class AlternativeLookup implements Builder

public function __construct(
private readonly Builder $capacity,
) {}
) {
}

public function withMerge(Builder $merge): self
{
Expand Down
10 changes: 5 additions & 5 deletions src/Builder/Capacity/Extractor/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

final class All implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $search = null;
private null|Node\Expr $code = null;
private null|Node\Expr $referenceEntity = null;
private null|Node\Expr $referenceEntityAttributeCode = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $search = null;
private ?Node\Expr $code = null;
private ?Node\Expr $referenceEntity = null;
private ?Node\Expr $referenceEntityAttributeCode = null;

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
8 changes: 5 additions & 3 deletions src/Builder/Capacity/Extractor/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

final class Get implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $identifier = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $identifier = null;

public function __construct() {}
public function __construct()
{
}

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
10 changes: 6 additions & 4 deletions src/Builder/Capacity/Extractor/ListPerPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@

final class ListPerPage implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $search = null;
private null|Node\Expr $code = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $search = null;
private ?Node\Expr $code = null;

public function __construct() {}
public function __construct()
{
}

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
10 changes: 5 additions & 5 deletions src/Builder/Capacity/Loader/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

final class Create implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $code = null;
private null|Node\Expr $data = null;
private null|Node\Expr $referenceEntity = null;
private null|Node\Expr $referenceEntityAttribute = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $code = null;
private ?Node\Expr $data = null;
private ?Node\Expr $referenceEntity = null;
private ?Node\Expr $referenceEntityAttribute = null;

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
10 changes: 5 additions & 5 deletions src/Builder/Capacity/Loader/Upsert.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

final class Upsert implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $code = null;
private null|Node\Expr $data = null;
private null|Node\Expr $referenceEntity = null;
private null|Node\Expr $referenceEntityAttribute = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $code = null;
private ?Node\Expr $data = null;
private ?Node\Expr $referenceEntity = null;
private ?Node\Expr $referenceEntityAttribute = null;

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
8 changes: 4 additions & 4 deletions src/Builder/Capacity/Loader/UpsertList.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

final class UpsertList implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $data = null;
private null|Node\Expr $referenceEntity = null;
private null|Node\Expr $attributeCode = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $data = null;
private ?Node\Expr $referenceEntity = null;
private ?Node\Expr $attributeCode = null;

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
10 changes: 6 additions & 4 deletions src/Builder/Capacity/Lookup/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

final class All implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $search = null;
private null|Node\Expr $code = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $search = null;
private ?Node\Expr $code = null;
private string $type = '';

public function __construct() {}
public function __construct()
{
}

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
8 changes: 5 additions & 3 deletions src/Builder/Capacity/Lookup/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

final class Download implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $file = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $file = null;

public function __construct() {}
public function __construct()
{
}

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
12 changes: 7 additions & 5 deletions src/Builder/Capacity/Lookup/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

final class Get implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $identifier = null;
private null|Node\Expr $code = null;
private null|string $type = '';
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $identifier = null;
private ?Node\Expr $code = null;
private ?string $type = '';

public function __construct() {}
public function __construct()
{
}

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
10 changes: 6 additions & 4 deletions src/Builder/Capacity/Lookup/ListPerPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@

final class ListPerPage implements Builder
{
private null|Node\Expr|Node\Identifier $endpoint = null;
private null|Node\Expr $search = null;
private null|Node\Expr $code = null;
private Node\Expr|Node\Identifier|null $endpoint = null;
private ?Node\Expr $search = null;
private ?Node\Expr $code = null;

public function __construct() {}
public function __construct()
{
}

public function withEndpoint(Node\Expr|Node\Identifier $endpoint): self
{
Expand Down
4 changes: 3 additions & 1 deletion src/Builder/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ final class Client implements Builder
private ?Node\Expr $httpStreamFactory = null;
private ?Node\Expr $fileSystem = null;

public function __construct(private readonly Node\Expr $baseUrl, private readonly Node\Expr $clientId, private readonly Node\Expr $secret) {}
public function __construct(private readonly Node\Expr $baseUrl, private readonly Node\Expr $clientId, private readonly Node\Expr $secret)
{
}

public function withToken(Node\Expr $token, Node\Expr $refreshToken): self
{
Expand Down
4 changes: 3 additions & 1 deletion src/Builder/ConditionalLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ final class ConditionalLookup implements StepBuilderInterface
private iterable $alternatives = [];
private ?Node\Expr $client = null;

public function __construct() {}
public function __construct()
{
}

public function withClient(Node\Expr $client): self
{
Expand Down
3 changes: 2 additions & 1 deletion src/Builder/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ final class Extractor implements StepBuilderInterface

public function __construct(
private readonly Builder $capacity,
) {}
) {
}

public function withClient(Node\Expr $client): self
{
Expand Down
4 changes: 3 additions & 1 deletion src/Builder/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

final readonly class Inline implements Builder
{
public function __construct(private ArrayBuilderInterface|ObjectBuilderInterface $mapper) {}
public function __construct(private ArrayBuilderInterface|ObjectBuilderInterface $mapper)
{
}

public function getNode(): Node
{
Expand Down
3 changes: 2 additions & 1 deletion src/Builder/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ final class Loader implements StepBuilderInterface

public function __construct(
private readonly Builder $capacity,
) {}
) {
}

public function withClient(Node\Expr $client): self
{
Expand Down
4 changes: 3 additions & 1 deletion src/Builder/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ final class Lookup implements StepBuilderInterface
private ?Node\Expr $logger = null;
private ?Node\Expr $client = null;

public function __construct(private readonly AlternativeLookup $alternative) {}
public function __construct(private readonly AlternativeLookup $alternative)
{
}

public function withClient(Node\Expr $client): self
{
Expand Down
9 changes: 5 additions & 4 deletions src/Builder/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ final class Search implements Builder
{
public function __construct(
private array $filters = []
) {}
) {
}

public function addFilter(
Node\Expr $field,
Node\Expr $operator,
Node\Expr $value = null,
Node\Expr $scope = null,
Node\Expr $locale = null
?Node\Expr $value = null,
?Node\Expr $scope = null,
?Node\Expr $locale = null
): self {
$arguments = [
new Node\Arg(
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Extractor/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ final class All implements Akeneo\Capacity\CapacityInterface
'UNCLASSIFIED',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Extractor/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ final class Get implements Akeneo\Capacity\CapacityInterface
'assetManager',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Extractor/ListPerPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ final class ListPerPage implements Akeneo\Capacity\CapacityInterface
'UNCLASSIFIED',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
8 changes: 5 additions & 3 deletions src/Capacity/Loader/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use PhpParser\Builder;
use PhpParser\Node;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;

use function Kiboko\Component\SatelliteToolbox\Configuration\compileValueWhenExpression;

final class Create implements Akeneo\Capacity\CapacityInterface
Expand All @@ -16,7 +17,9 @@ final class Create implements Akeneo\Capacity\CapacityInterface
'productMediaFile',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand All @@ -28,11 +31,10 @@ public function applies(array $config): bool

public function getBuilder(array $config): Builder
{
$builder = (new Akeneo\Builder\Capacity\Loader\Create())
return (new Akeneo\Builder\Capacity\Loader\Create())
->withEndpoint(endpoint: new Node\Identifier(sprintf('get%sApi', ucfirst((string) $config['type']))))
->withCode(code: compileValueWhenExpression($this->interpreter, $config['code'], 'line'))
->withData(line: new Node\Expr\Variable('line["product"]'))
;
return $builder;
}
}
4 changes: 3 additions & 1 deletion src/Capacity/Loader/Upsert.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ final class Upsert implements Akeneo\Capacity\CapacityInterface
'referenceEntity',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Lookup/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ final class All implements Akeneo\Capacity\CapacityInterface
'UNCLASSIFIED',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Lookup/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ final class Download implements Akeneo\Capacity\CapacityInterface
'assetMediaFile',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Lookup/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ final class Get implements Akeneo\Capacity\CapacityInterface
'assetManager',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
4 changes: 3 additions & 1 deletion src/Capacity/Lookup/ListPerPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ final class ListPerPage implements Akeneo\Capacity\CapacityInterface
'UNCLASSIFIED',
];

public function __construct(private readonly ExpressionLanguage $interpreter) {}
public function __construct(private readonly ExpressionLanguage $interpreter)
{
}

public function applies(array $config): bool
{
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ final class Loader implements PluginConfigurationInterface
],
];

public function getConfigTreeBuilder(): \Symfony\Component\Config\Definition\Builder\TreeBuilder
public function getConfigTreeBuilder(): Config\Definition\Builder\TreeBuilder
{
$builder = new Config\Definition\Builder\TreeBuilder('loader');

Expand Down
Loading

0 comments on commit 4686622

Please sign in to comment.