Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CS] Update phpcs rules #1374

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'@Symfony' => true,
'@Symfony:risky' => true,
'header_comment' => ['header' => $fileHeaderComment],
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match', 'parameters']],
])
->setRiskyAllowed(true)
->setFinder(
Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/AutocompleterRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
final class AutocompleterRegistry
{
public function __construct(
private ServiceLocator $autocompletersLocator
private ServiceLocator $autocompletersLocator,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/Doctrine/DoctrineRegistryWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class DoctrineRegistryWrapper
{
public function __construct(
private ?ManagerRegistry $registry = null
private ?ManagerRegistry $registry = null,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/Doctrine/EntityMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class EntityMetadata
{
public function __construct(
private ClassMetadata $metadata
private ClassMetadata $metadata,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/Doctrine/EntityMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class EntityMetadataFactory
{
public function __construct(
private DoctrineRegistryWrapper $doctrine
private DoctrineRegistryWrapper $doctrine,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
final class AutocompleteEntityTypeSubscriber implements EventSubscriberInterface
{
public function __construct(
private ?string $autocompleteUrl = null
private ?string $autocompleteUrl = null,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/Form/ParentEntityAutocompleteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
final class ParentEntityAutocompleteType extends AbstractType implements DataMapperInterface
{
public function __construct(
private UrlGeneratorInterface $urlGenerator
private UrlGeneratorInterface $urlGenerator,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
private FormFactoryInterface $formFactory,
private EntityMetadataFactory $metadataFactory,
private PropertyAccessorInterface $propertyAccessor,
private EntitySearchUtil $entitySearchUtil
private EntitySearchUtil $entitySearchUtil,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Autocomplete/src/Maker/MakeAutocompleteField.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MakeAutocompleteField extends AbstractMaker
private string $entityClass;

public function __construct(
private ?DoctrineHelper $doctrineHelper = null
private ?DoctrineHelper $doctrineHelper = null,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/LiveComponent/src/Attribute/AsLiveComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
bool $exposePublicProps = true,
string $attributesVar = 'attributes',
public bool $csrf = true,
public string $route = 'ux_live_component'
public string $route = 'ux_live_component',
) {
parent::__construct($name, $template, $exposePublicProps, $attributesVar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ final class ResetDeterministicIdSubscriber implements EventSubscriberInterface
{
public function __construct(
private DeterministicTwigIdCalculator $idCalculator,
private ComponentStack $componentStack
private ComponentStack $componentStack,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class ReactReplaceProcessEnvAssetCompiler implements AssetCompilerInterface
{
public function __construct(
private bool $isDebug
private bool $isDebug,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MappedControllerAutoImport
{
public function __construct(
public string $path,
public bool $isBareImport
public bool $isBareImport,
) {
}
}
12 changes: 6 additions & 6 deletions src/Translator/src/Intl/IntlMessageParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private function tryParseQuote(string $parentArgType): string|null

private function tryParseUnquoted(
int $nestingLevel,
string $parentArgType
string $parentArgType,
): string|null {
if ($this->isEOF()) {
return null;
Expand All @@ -273,7 +273,7 @@ private function tryParseUnquoted(
*/
private function parseArgument(
int $nestingLevel,
bool $expectingCloseTag
bool $expectingCloseTag,
): array {
$openingBracePosition = clone $this->position;
$this->bump(); // `{`
Expand Down Expand Up @@ -381,7 +381,7 @@ private function parseArgumentOptions(
int $nestingLevel,
bool $expectingCloseTag,
string $value,
Position $openingBracePosition
Position $openingBracePosition,
): array {
// Parse this range:
// {name, type, style}
Expand Down Expand Up @@ -611,7 +611,7 @@ private function parseArgumentOptions(
}

private function tryParseArgumentClose(
Position $openingBracePosition
Position $openingBracePosition,
): array {
// Parse: {value, number, ::currency/GBP }
//
Expand Down Expand Up @@ -683,7 +683,7 @@ private function parseSimpleArgStyleIfPossible(): array

private function parseNumberSkeletonFromString(
string $skeleton,
Location $location
Location $location,
) {
$tokens = [];

Expand Down Expand Up @@ -712,7 +712,7 @@ private function tryParsePluralOrSelectOptions(
int $nestingLevel,
string $parentArgType,
bool $expectCloseTag,
array $parsedFirstIdentifier
array $parsedFirstIdentifier,
): array {
$hasOtherClause = false;
$options = [];
Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/ComponentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
private PropertyAccessorInterface $propertyAccessor,
private EventDispatcherInterface $eventDispatcher,
private array $config,
private array $classMap
private array $classMap,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/ComponentRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(
private EventDispatcherInterface $dispatcher,
private ComponentFactory $factory,
private PropertyAccessorInterface $propertyAccessor,
private ComponentStack $componentStack
private ComponentStack $componentStack,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/Event/PostMountEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(
private object $component,
private array $data,
array|ComponentMetadata $metadata = [],
$extraMetadata = []
$extraMetadata = [],
) {
if (\is_array($metadata)) {
trigger_deprecation('symfony/ux-twig-component', '2.13', 'In TwigComponent 3.0, the third argument of "%s()" will be a "%s" object and the "$extraMetadata" array should be passed as the fourth argument.', __METHOD__, ComponentMetadata::class);
Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/Event/PreCreateForRenderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class PreCreateForRenderEvent extends Event

public function __construct(
private string $name,
private array $inputProps = []
private array $inputProps = [],
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/Event/PreRenderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class PreRenderEvent extends Event
public function __construct(
private MountedComponent $mounted,
private ComponentMetadata $metadata,
private array $variables
private array $variables,
) {
$this->template = $this->metadata->getTemplate();
$this->parentTemplateForEmbedded = $this->template;
Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/src/Twig/TwigEnvironmentConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TwigEnvironmentConfigurator
private EnvironmentConfigurator $decorated;

public function __construct(
EnvironmentConfigurator $decorated
EnvironmentConfigurator $decorated,
) {
$this->decorated = $decorated;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CropperjsController extends AbstractController
{
public function __construct(
private Packages $assets,
private string $projectDir
private string $projectDir,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/src/Service/TwigPackageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TwigPackageHelper
{
public function __construct(
private UxPackageRepository $packageRepository,
private PackageContext $packageContext
private PackageContext $packageContext,
) {
}

Expand Down