Skip to content

Commit

Permalink
Ran php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed May 24, 2023
1 parent d975028 commit b4b1678
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
23 changes: 13 additions & 10 deletions src/Value.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Kiboko\Component\ExpressionLanguage\Akeneo;

Expand All @@ -8,33 +10,34 @@ public function __construct(
private readonly mixed $value,
private ?string $scope = null,
private ?string $locale = null,
) {}

) {
}

public function withScope(string $scope): self
{
$this->scope = $scope;

return $this;
}

public function withoutScope(): self
{
$this->scope = null;

return $this;
}

public function withLocale(string $locale): self
{
$this->locale = $locale;

return $this;
}

public function withoutLocale(): self
{
$this->locale = null;

return $this;
}

Expand Down
16 changes: 8 additions & 8 deletions src/WithMultipleOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ private function compile(string $codes, string $attribute, string $labels, strin
(function() {
\$linkedData = array_map(
function (string \$code) {
\$labels = $labels;
\$labels = {$labels};
}
return [
'attribute' => $attribute,
'attribute' => {$attribute},
'code' => \$code,
'labels' => \$labels[\$code] ?? [],
];
},
$codes,
{$codes},
);
return [
[
'data' => ($codes),
'locale' => $locale,
'scope' => $scope,
'data' => ({$codes}),
'locale' => {$locale},
'scope' => {$scope},
'linked_data' => \$linkedData,
],
];
Expand All @@ -46,8 +46,8 @@ function (string \$code) {
}

/**
* @var list<string> $codes
* @var array<string, array<string, string>> $labels
* @var list<string>
* @var array<string, array<string, string>>
*/
private function evaluate(array $context, array $codes, string $attribute, array $labels, ?string $locale = null, ?string $scope = null): array
{
Expand Down
14 changes: 7 additions & 7 deletions src/WithSimpleOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ private function compile(string $code, string $attribute, string $labels, string
return <<<PHP
([
[
'data' => ($code),
'locale' => $locale,
'scope' => $scope,
'data' => ({$code}),
'locale' => {$locale},
'scope' => {$scope},
'linked_data' => [
'attribute' => ($attribute),
'code' => ($code),
'labels' => ($labels),
'attribute' => ({$attribute}),
'code' => ({$code}),
'labels' => ({$labels}),
],
],
])
PHP;
}

/**
* @var array<string, string> $labels
* @var array<string, string>
*/
private function evaluate(array $context, string $code, string $attribute, array $labels, ?string $locale = null, ?string $scope = null): array
{
Expand Down

0 comments on commit b4b1678

Please sign in to comment.