repo
stringlengths
7
63
file_url
stringlengths
81
284
file_path
stringlengths
5
200
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:02:33
2026-01-05 05:24:06
truncated
bool
2 classes
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/InvalidOptionsForEnvException.php
src/FixerConfiguration/InvalidOptionsForEnvException.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class InvalidOptionsForEnvException extends InvalidOptionsException {}
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/FixerOptionBuilder.php
src/FixerConfiguration/FixerOptionBuilder.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FixerOptionBuilder { private string $name; private string $description; /** * @var null|mixed */ private $default; private bool $isRequired = true; /** * @var null|list<string> */ private ?array $allowedTypes = null; /** * @var null|non-empty-list<null|(callable(mixed): bool)|scalar> */ private ?array $allowedValues = null; private ?\Closure $normalizer = null; private ?string $deprecationMessage = null; public function __construct(string $name, string $description) { $this->name = $name; $this->description = $description; $this->default = null; } /** * @param mixed $default * * @return $this */ public function setDefault($default): self { $this->default = $default; $this->isRequired = false; return $this; } /** * @param list<string> $allowedTypes * * @return $this */ public function setAllowedTypes(array $allowedTypes): self { $this->allowedTypes = $allowedTypes; return $this; } /** * @param non-empty-list<null|(callable(mixed): bool)|scalar> $allowedValues * * @return $this */ public function setAllowedValues(array $allowedValues): self { $this->allowedValues = $allowedValues; return $this; } /** * @return $this */ public function setNormalizer(\Closure $normalizer): self { $this->normalizer = $normalizer; return $this; } /** * @return $this */ public function setDeprecationMessage(?string $deprecationMessage): self { $this->deprecationMessage = $deprecationMessage; return $this; } public function getOption(): FixerOptionInterface { $option = new FixerOption( $this->name, $this->description, $this->isRequired, $this->default, $this->allowedTypes, $this->allowedValues, $this->normalizer, ); if (null !== $this->deprecationMessage) { $option = new DeprecatedFixerOption($option, $this->deprecationMessage); } return $option; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/FixerOptionSorter.php
src/FixerConfiguration/FixerOptionSorter.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; /** * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FixerOptionSorter { /** * @param iterable<FixerOptionInterface> $options * * @return list<FixerOptionInterface> */ public function sort(iterable $options): array { if (!\is_array($options)) { $options = iterator_to_array($options, false); } usort($options, static fn (FixerOptionInterface $a, FixerOptionInterface $b): int => $a->getName() <=> $b->getName()); return $options; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/FixerConfigurationResolverInterface.php
src/FixerConfiguration/FixerConfigurationResolverInterface.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ interface FixerConfigurationResolverInterface { /** * @return list<FixerOptionInterface> */ public function getOptions(): array; /** * @param array<string, mixed> $configuration * * @return array<string, mixed> */ public function resolve(array $configuration): array; }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/AliasedFixerOption.php
src/FixerConfiguration/AliasedFixerOption.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; /** * @author ntzm * * @readonly * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class AliasedFixerOption implements FixerOptionInterface { private FixerOptionInterface $fixerOption; private string $alias; public function __construct(FixerOptionInterface $fixerOption, string $alias) { $this->fixerOption = $fixerOption; $this->alias = $alias; } public function getAlias(): string { return $this->alias; } public function getName(): string { return $this->fixerOption->getName(); } public function getDescription(): string { return $this->fixerOption->getDescription(); } public function hasDefault(): bool { return $this->fixerOption->hasDefault(); } /** * @return mixed * * @throws \LogicException when no default value is defined */ public function getDefault() { return $this->fixerOption->getDefault(); } public function getAllowedTypes(): ?array { return $this->fixerOption->getAllowedTypes(); } public function getAllowedValues(): ?array { return $this->fixerOption->getAllowedValues(); } public function getNormalizer(): ?\Closure { return $this->fixerOption->getNormalizer(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/AliasedFixerOptionBuilder.php
src/FixerConfiguration/AliasedFixerOptionBuilder.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; /** * @author ntzm * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class AliasedFixerOptionBuilder { private FixerOptionBuilder $optionBuilder; private string $alias; public function __construct(FixerOptionBuilder $optionBuilder, string $alias) { $this->optionBuilder = $optionBuilder; $this->alias = $alias; } /** * @param mixed $default */ public function setDefault($default): self { $this->optionBuilder->setDefault($default); return $this; } /** * @param list<string> $allowedTypes */ public function setAllowedTypes(array $allowedTypes): self { $this->optionBuilder->setAllowedTypes($allowedTypes); return $this; } /** * @param non-empty-list<null|(callable(mixed): bool)|scalar> $allowedValues */ public function setAllowedValues(array $allowedValues): self { $this->optionBuilder->setAllowedValues($allowedValues); return $this; } public function setNormalizer(\Closure $normalizer): self { $this->optionBuilder->setNormalizer($normalizer); return $this; } public function getOption(): AliasedFixerOption { return new AliasedFixerOption( $this->optionBuilder->getOption(), $this->alias, ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/FixerConfiguration/FixerConfigurationResolver.php
src/FixerConfiguration/FixerConfigurationResolver.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\FixerConfiguration; use PhpCsFixer\Future; use PhpCsFixer\Preg; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\OptionsResolver; /** * @readonly * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FixerConfigurationResolver implements FixerConfigurationResolverInterface { /** * @var list<FixerOptionInterface> * * @readonly */ private array $options; /** * @param iterable<FixerOptionInterface> $options */ public function __construct(iterable $options) { $fixerOptionSorter = new FixerOptionSorter(); $this->validateOptions($options); $this->options = $fixerOptionSorter->sort($options); if (0 === \count($this->options)) { throw new \LogicException('Options cannot be empty.'); } } public function getOptions(): array { return $this->options; } public function resolve(array $configuration): array { $resolver = new OptionsResolver(); foreach ($this->options as $option) { $name = $option->getName(); if ($option instanceof AliasedFixerOption) { $alias = $option->getAlias(); if (\array_key_exists($alias, $configuration)) { if (\array_key_exists($name, $configuration)) { throw new InvalidOptionsException(\sprintf('Aliased option "%s"/"%s" is passed multiple times.', $name, $alias)); } Future::triggerDeprecation(new \RuntimeException(\sprintf( 'Option "%s" is deprecated, use "%s" instead.', $alias, $name, ))); $configuration[$name] = $configuration[$alias]; unset($configuration[$alias]); } } if ($option->hasDefault()) { $resolver->setDefault($name, $option->getDefault()); } else { $resolver->setRequired($name); } $allowedValues = $option->getAllowedValues(); if (null !== $allowedValues) { foreach ($allowedValues as &$allowedValue) { if (\is_object($allowedValue) && \is_callable($allowedValue)) { $allowedValue = static fn (/* mixed */ $values) => $allowedValue($values); } } $resolver->setAllowedValues($name, $allowedValues); } $allowedTypes = $option->getAllowedTypes(); if (null !== $allowedTypes) { $allowedTypesNormalised = array_map( static function (string $type): string { // Symfony OptionsResolver doesn't support `array<foo, bar>` natively, let's simplify the type $matches = []; if (true === Preg::match('/array<\w+,\s*(\??[\w\'|]+)>/', $type, $matches)) { if ('?' === $matches[1][0]) { return 'array'; } if ("'" === $matches[1][0]) { return 'string[]'; } return $matches[1].'[]'; } // Symfony OptionsResolver doesn't support 'class-string' natively, let's simplify the type return str_replace('class-string', 'string', $type); }, $allowedTypes, ); $resolver->setAllowedTypes($name, $allowedTypesNormalised); } $normalizer = $option->getNormalizer(); if (null !== $normalizer) { $resolver->setNormalizer($name, $normalizer); } } return $resolver->resolve($configuration); } /** * @param iterable<FixerOptionInterface> $options * * @throws \LogicException when the option is already defined */ private function validateOptions(iterable $options): void { $names = []; foreach ($options as $option) { $name = $option->getName(); if (\in_array($name, $names, true)) { throw new \LogicException(\sprintf('The "%s" option is defined multiple times.', $name)); } $names[] = $name; } } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/LintingFileIterator.php
src/Runner/LintingFileIterator.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\LintingResultInterface; /** * @internal * * @extends \IteratorIterator<mixed, \SplFileInfo, \Traversable<\SplFileInfo>> * * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class LintingFileIterator extends \IteratorIterator implements LintingResultAwareFileIteratorInterface { private ?LintingResultInterface $currentResult = null; private LinterInterface $linter; /** * @param \Iterator<mixed, \SplFileInfo> $iterator */ public function __construct(\Iterator $iterator, LinterInterface $linter) { parent::__construct($iterator); $this->linter = $linter; } public function currentLintingResult(): ?LintingResultInterface { return $this->currentResult; } public function next(): void { parent::next(); $this->currentResult = $this->valid() ? $this->handleItem($this->current()) : null; } public function rewind(): void { parent::rewind(); $this->currentResult = $this->valid() ? $this->handleItem($this->current()) : null; } private function handleItem(\SplFileInfo $file): LintingResultInterface { return $this->linter->lintFile($file->getRealPath()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/FileCachingLintingFileIterator.php
src/Runner/FileCachingLintingFileIterator.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\LintingResultInterface; /** * @internal * * @extends \CachingIterator<mixed, \SplFileInfo, \Iterator<mixed, \SplFileInfo>> * * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FileCachingLintingFileIterator extends \CachingIterator implements LintingResultAwareFileIteratorInterface { private LinterInterface $linter; private ?LintingResultInterface $currentResult = null; private ?LintingResultInterface $nextResult = null; /** * @param \Iterator<mixed, \SplFileInfo> $iterator */ public function __construct(\Iterator $iterator, LinterInterface $linter) { parent::__construct($iterator); $this->linter = $linter; } public function currentLintingResult(): ?LintingResultInterface { return $this->currentResult; } public function next(): void { parent::next(); $this->currentResult = $this->nextResult; if ($this->hasNext()) { $this->nextResult = $this->handleItem($this->getInnerIterator()->current()); } } public function rewind(): void { parent::rewind(); if ($this->valid()) { $this->currentResult = $this->handleItem($this->current()); } if ($this->hasNext()) { $this->nextResult = $this->handleItem($this->getInnerIterator()->current()); } } private function handleItem(\SplFileInfo $file): LintingResultInterface { return $this->linter->lintFile($file->getRealPath()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/FileFilterIterator.php
src/Runner/FileFilterIterator.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner; use PhpCsFixer\Cache\CacheManagerInterface; use PhpCsFixer\FileReader; use PhpCsFixer\Runner\Event\FileProcessed; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\EventDispatcher\Event; /** * @internal * * @extends \FilterIterator<mixed, \SplFileInfo, \Iterator<mixed, \SplFileInfo>> * * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FileFilterIterator extends \FilterIterator { private ?EventDispatcherInterface $eventDispatcher; private CacheManagerInterface $cacheManager; /** * @var array<string, bool> */ private array $visitedElements = []; /** * @param \Traversable<\SplFileInfo> $iterator */ public function __construct( \Traversable $iterator, ?EventDispatcherInterface $eventDispatcher, CacheManagerInterface $cacheManager ) { if (!$iterator instanceof \Iterator) { $iterator = new \IteratorIterator($iterator); } parent::__construct($iterator); $this->eventDispatcher = $eventDispatcher; $this->cacheManager = $cacheManager; } public function accept(): bool { $file = $this->current(); if (!$file instanceof \SplFileInfo) { throw new \RuntimeException( \sprintf( 'Expected instance of "\SplFileInfo", got "%s".', get_debug_type($file), ), ); } $path = $file->isLink() ? $file->getPathname() : $file->getRealPath(); if (isset($this->visitedElements[$path])) { return false; } $this->visitedElements[$path] = true; if (!$file->isFile() || $file->isLink()) { return false; } $content = FileReader::createSingleton()->read($path); // mark as skipped: if ( // empty file '' === $content // file that does not need fixing due to cache || !$this->cacheManager->needFixing($file->getPathname(), $content) ) { $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_SKIPPED)); return false; } return true; } private function dispatchEvent(string $name, Event $event): void { if (null === $this->eventDispatcher) { return; } $this->eventDispatcher->dispatch($event, $name); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Runner.php
src/Runner/Runner.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner; use Clue\React\NDJson\Decoder; use Clue\React\NDJson\Encoder; use PhpCsFixer\AbstractFixer; use PhpCsFixer\Cache\CacheManagerInterface; use PhpCsFixer\Cache\Directory; use PhpCsFixer\Cache\DirectoryInterface; use PhpCsFixer\Config\NullRuleCustomisationPolicy; use PhpCsFixer\Config\RuleCustomisationPolicyInterface; use PhpCsFixer\Console\Command\WorkerCommand; use PhpCsFixer\Differ\DifferInterface; use PhpCsFixer\Error\Error; use PhpCsFixer\Error\ErrorsManager; use PhpCsFixer\Error\SourceExceptionFactory; use PhpCsFixer\FileReader; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\Future; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\LintingException; use PhpCsFixer\Linter\LintingResultInterface; use PhpCsFixer\Preg; use PhpCsFixer\Runner\Event\AnalysisStarted; use PhpCsFixer\Runner\Event\FileProcessed; use PhpCsFixer\Runner\Parallel\ParallelAction; use PhpCsFixer\Runner\Parallel\ParallelConfig; use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; use PhpCsFixer\Runner\Parallel\ParallelisationException; use PhpCsFixer\Runner\Parallel\ProcessFactory; use PhpCsFixer\Runner\Parallel\ProcessIdentifier; use PhpCsFixer\Runner\Parallel\ProcessPool; use PhpCsFixer\Runner\Parallel\WorkerException; use PhpCsFixer\Tokenizer\Analyzer\FixerAnnotationAnalyzer; use PhpCsFixer\Tokenizer\Tokens; use React\EventLoop\StreamSelectLoop; use React\Socket\ConnectionInterface; use React\Socket\TcpServer; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Contracts\EventDispatcher\Event; /** * @phpstan-type _RunResult array<string, array{appliedFixers: list<string>, diff: string}> * * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * @author Greg Korba <greg@codito.dev> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. * * @TODO v4: decide if marking Runner as internal or making it dependencies public * * @phpstan-ignore-next-line phpCsFixer.internalTypeInPublicApi */ final class Runner { /** * Buffer size used in the NDJSON decoder for communication between main process and workers. * * @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8068 */ private const PARALLEL_BUFFER_SIZE = 16 * (1_024 * 1_024 /* 1MB */); private DifferInterface $differ; private DirectoryInterface $directory; private ?EventDispatcherInterface $eventDispatcher; private ErrorsManager $errorsManager; private CacheManagerInterface $cacheManager; private bool $isDryRun; private LinterInterface $linter; /** * @var null|\Traversable<array-key, \SplFileInfo> */ private ?\Traversable $fileIterator = null; private int $fileCount; /** * @var list<FixerInterface> */ private array $fixers; /** * @var array<non-empty-string, FixerInterface> */ private array $fixersByName; private bool $stopOnViolation; private ParallelConfig $parallelConfig; private ?InputInterface $input; private ?string $configFile; private RuleCustomisationPolicyInterface $ruleCustomisationPolicy; /** * @param null|\Traversable<array-key, \SplFileInfo> $fileIterator * @param list<FixerInterface> $fixers */ public function __construct( ?\Traversable $fileIterator, array $fixers, DifferInterface $differ, ?EventDispatcherInterface $eventDispatcher, ErrorsManager $errorsManager, LinterInterface $linter, bool $isDryRun, CacheManagerInterface $cacheManager, ?DirectoryInterface $directory = null, bool $stopOnViolation = false, // @TODO Make these arguments required in 4.0 ?ParallelConfig $parallelConfig = null, ?InputInterface $input = null, ?string $configFile = null, ?RuleCustomisationPolicyInterface $ruleCustomisationPolicy = null ) { // Required only for main process (calculating workers count) $this->fileCount = null !== $fileIterator ? \count(iterator_to_array($fileIterator)) : 0; $this->fileIterator = $fileIterator; $this->fixers = $fixers; $this->fixersByName = array_reduce( $fixers, static function (array $carry, FixerInterface $fixer): array { $carry[$fixer->getName()] = $fixer; return $carry; }, [], ); $this->differ = $differ; $this->eventDispatcher = $eventDispatcher; $this->errorsManager = $errorsManager; $this->linter = $linter; $this->isDryRun = $isDryRun; $this->cacheManager = $cacheManager; $this->directory = $directory ?? new Directory(''); $this->stopOnViolation = $stopOnViolation; $this->parallelConfig = $parallelConfig ?? ParallelConfigFactory::sequential(); $this->input = $input; $this->configFile = $configFile; $this->ruleCustomisationPolicy = $ruleCustomisationPolicy ?? new NullRuleCustomisationPolicy(); } /** * @TODO consider to drop this method and make iterator parameter obligatory in constructor, * more in https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777/files#r1590447581 * * @param \Traversable<array-key, \SplFileInfo> $fileIterator */ public function setFileIterator(iterable $fileIterator): void { $this->fileIterator = $fileIterator; // Required only for main process (calculating workers count) $this->fileCount = \count(iterator_to_array($fileIterator)); } /** * @return _RunResult */ public function fix(): array { if (0 === $this->fileCount) { return []; } $ruleCustomisers = $this->ruleCustomisationPolicy->getRuleCustomisers(); $this->validateRulesNamesForExceptions( array_keys($ruleCustomisers), <<<'EOT' Rule Customisation Policy contains customisers for rules that are not in the current set of enabled rules: %s Please check your configuration to ensure that these rules are included, or update your Rule Customisation Policy if they have been replaced by other rules in the version of PHP CS Fixer you are using. EOT, ); // @TODO 4.0: Remove condition and its body, as no longer needed when param will be required in the constructor. // This is a fallback only in case someone calls `new Runner()` in a custom repo and does not provide v4-ready params in v3-codebase. if (null === $this->input) { return $this->fixSequential(); } if ( 1 === $this->parallelConfig->getMaxProcesses() || $this->fileCount <= $this->parallelConfig->getFilesPerProcess() ) { return $this->fixSequential(); } return $this->fixParallel(); } /** * @param list<string> $ruleExceptions * @param non-empty-string $errorTemplate */ private function validateRulesNamesForExceptions(array $ruleExceptions, string $errorTemplate): void { if (true === filter_var(getenv('PHP_CS_FIXER_IGNORE_MISMATCHED_RULES_EXCEPTIONS'), \FILTER_VALIDATE_BOOLEAN)) { return; } if ([] === $ruleExceptions) { return; } $fixersByName = $this->fixersByName; $usedRules = array_keys($fixersByName); $missingRuleNames = array_diff($ruleExceptions, $usedRules); if ([] === $missingRuleNames) { return; } /** @TODO v3.999 check if rule is deprecated and show the replacement rules as well */ $missingRulesDesc = implode("\n", array_map( static function (string $name) use ($fixersByName): string { $extra = ''; if ('' === $name) { $extra = '(no name provided)'; } elseif ('@' === $name[0]) { $extra = ' (can exclude only rules, not sets)'; } elseif (!isset($fixersByName[$name])) { $extra = ' (unknown rule)'; } return '- '.$name.$extra; }, $missingRuleNames, )); throw new \RuntimeException( \sprintf($errorTemplate, $missingRulesDesc), ); } /** * Heavily inspired by {@see https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/ParallelAnalyser.php}. * * @return _RunResult */ private function fixParallel(): array { $this->dispatchEvent(AnalysisStarted::NAME, new AnalysisStarted(AnalysisStarted::MODE_PARALLEL, $this->isDryRun)); $changed = []; $streamSelectLoop = new StreamSelectLoop(); $server = new TcpServer('127.0.0.1:0', $streamSelectLoop); $serverPort = parse_url($server->getAddress() ?? '', \PHP_URL_PORT); if (!is_numeric($serverPort)) { throw new ParallelisationException(\sprintf( 'Unable to parse server port from "%s"', $server->getAddress() ?? '', )); } $processPool = new ProcessPool($server); $maxFilesPerProcess = $this->parallelConfig->getFilesPerProcess(); $fileIterator = $this->getFilteringFileIterator(); $fileIterator->rewind(); $getFileChunk = static function () use ($fileIterator, $maxFilesPerProcess): array { $files = []; while (\count($files) < $maxFilesPerProcess) { $current = $fileIterator->current(); if (null === $current) { break; } $files[] = $current->getPathname(); $fileIterator->next(); } return $files; }; // [REACT] Handle worker's handshake (init connection) $server->on('connection', static function (ConnectionInterface $connection) use ($processPool, $getFileChunk): void { $decoder = new Decoder( $connection, true, 512, \JSON_INVALID_UTF8_IGNORE, self::PARALLEL_BUFFER_SIZE, ); $encoder = new Encoder($connection, \JSON_INVALID_UTF8_IGNORE); // [REACT] Bind connection when worker's process requests "hello" action (enables 2-way communication) $decoder->on('data', static function (array $data) use ($processPool, $getFileChunk, $decoder, $encoder): void { if (ParallelAction::WORKER_HELLO !== $data['action']) { return; } $identifier = ProcessIdentifier::fromRaw($data['identifier']); // Avoid race condition where worker tries to establish connection, // but runner already ended all processes because `stop-on-violation` mode was enabled. try { $process = $processPool->getProcess($identifier); } catch (ParallelisationException $e) { return; } $process->bindConnection($decoder, $encoder); $fileChunk = $getFileChunk(); if (0 === \count($fileChunk)) { $process->request(['action' => ParallelAction::RUNNER_THANK_YOU]); $processPool->endProcessIfKnown($identifier); return; } $process->request(['action' => ParallelAction::RUNNER_REQUEST_ANALYSIS, 'files' => $fileChunk]); }); }); $processesToSpawn = min( $this->parallelConfig->getMaxProcesses(), max( 1, (int) ceil($this->fileCount / $this->parallelConfig->getFilesPerProcess()), ), ); $processFactory = new ProcessFactory(); for ($i = 0; $i < $processesToSpawn; ++$i) { $identifier = ProcessIdentifier::create(); $process = $processFactory->create( $streamSelectLoop, $this->input, new RunnerConfig( $this->isDryRun, $this->stopOnViolation, $this->parallelConfig, $this->configFile, ), $identifier, $serverPort, ); $processPool->addProcess($identifier, $process); $process->start( // [REACT] Handle workers' responses (multiple actions possible) function (array $workerResponse) use ($processPool, $process, $identifier, $getFileChunk, &$changed): void { // File analysis result (we want close-to-realtime progress with frequent cache savings) if (ParallelAction::WORKER_RESULT === $workerResponse['action']) { // Dispatch an event for each file processed and dispatch its status (required for progress output) $this->dispatchEvent(FileProcessed::NAME, new FileProcessed($workerResponse['status'])); if (isset($workerResponse['fileHash'])) { $this->cacheManager->setFileHash($workerResponse['file'], $workerResponse['fileHash']); } foreach ($workerResponse['errors'] ?? [] as $error) { $this->errorsManager->report(new Error( $error['type'], $error['filePath'], null !== $error['source'] ? SourceExceptionFactory::fromArray($error['source']) : null, $error['appliedFixers'], $error['diff'], )); } // Pass-back information about applied changes (only if there are any) if (isset($workerResponse['fixInfo'])) { $relativePath = $this->directory->getRelativePathTo($workerResponse['file']); $changed[$relativePath] = $workerResponse['fixInfo']; if ($this->stopOnViolation) { $processPool->endAll(); return; } } return; } if (ParallelAction::WORKER_GET_FILE_CHUNK === $workerResponse['action']) { // Request another chunk of files, if still available $fileChunk = $getFileChunk(); if (0 === \count($fileChunk)) { $process->request(['action' => ParallelAction::RUNNER_THANK_YOU]); $processPool->endProcessIfKnown($identifier); return; } $process->request(['action' => ParallelAction::RUNNER_REQUEST_ANALYSIS, 'files' => $fileChunk]); return; } if (ParallelAction::WORKER_ERROR_REPORT === $workerResponse['action']) { throw WorkerException::fromRaw($workerResponse); // @phpstan-ignore-line } throw new ParallelisationException('Unsupported action: '.($workerResponse['action'] ?? 'n/a')); }, // [REACT] Handle errors encountered during worker's execution static function (\Throwable $error) use ($processPool): void { $processPool->endAll(); throw new ParallelisationException($error->getMessage(), $error->getCode(), $error); }, // [REACT] Handle worker's shutdown static function ($exitCode, string $output) use ($processPool, $identifier): void { $processPool->endProcessIfKnown($identifier); if (0 === $exitCode || null === $exitCode) { return; } $errorsReported = Preg::matchAll( \sprintf('/^(?:%s)([^\n]+)+/m', WorkerCommand::ERROR_PREFIX), $output, $matches, ); if ($errorsReported > 0) { throw WorkerException::fromRaw( json_decode($matches[1][0], true, 512, \JSON_THROW_ON_ERROR), ); } }, ); } $streamSelectLoop->run(); return $changed; } /** * @return _RunResult */ private function fixSequential(): array { $this->dispatchEvent(AnalysisStarted::NAME, new AnalysisStarted(AnalysisStarted::MODE_SEQUENTIAL, $this->isDryRun)); $changed = []; $collection = $this->getLintingFileIterator(); foreach ($collection as $file) { $fixInfo = $this->fixFile($file, $collection->currentLintingResult()); // we do not need Tokens to still caching just fixed file - so clear the cache Tokens::clearCache(); if (null !== $fixInfo) { $relativePath = $this->directory->getRelativePathTo($file->__toString()); $changed[$relativePath] = $fixInfo; if ($this->stopOnViolation) { break; } } } return $changed; } /** * @return null|array{appliedFixers: list<string>, diff: string} */ private function fixFile(\SplFileInfo $file, LintingResultInterface $lintingResult): ?array { $filePathname = $file->getPathname(); try { $lintingResult->check(); } catch (LintingException $e) { $this->dispatchEvent( FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_INVALID), ); $this->errorsManager->report(new Error(Error::TYPE_INVALID, $filePathname, $e)); return null; } $old = FileReader::createSingleton()->read($file->getRealPath()); $tokens = Tokens::fromCode($old); if ( Future::isFutureModeEnabled() // @TODO 4.0 drop this line && !filter_var(getenv('PHP_CS_FIXER_NON_MONOLITHIC'), \FILTER_VALIDATE_BOOL) && !$tokens->isMonolithicPhp() ) { $this->dispatchEvent( FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_NON_MONOLITHIC), ); return null; } $oldHash = $tokens->getCodeHash(); $newHash = $oldHash; $new = $old; $appliedFixers = []; $ruleCustomisers = $this->ruleCustomisationPolicy->getRuleCustomisers(); // were already validated try { $fixerAnnotationAnalysis = (new FixerAnnotationAnalyzer())->find($tokens); $rulesIgnoredByAnnotations = $fixerAnnotationAnalysis['php-cs-fixer-ignore'] ?? []; } catch (\RuntimeException $e) { throw new \RuntimeException( \sprintf( 'Error while analysing file "%s": %s', $filePathname, $e->getMessage(), ), $e->getCode(), $e, ); } $this->validateRulesNamesForExceptions( $rulesIgnoredByAnnotations, <<<EOT @php-cs-fixer-ignore annotation(s) used for rules that are not in the current set of enabled rules: %s Please check your annotation(s) usage in {$filePathname} to ensure that these rules are included, or update your annotation(s) usage if they have been replaced by other rules in the version of PHP CS Fixer you are using. EOT, ); try { foreach ($this->fixers as $fixer) { if (\in_array($fixer->getName(), $rulesIgnoredByAnnotations, true)) { continue; } $customiser = $ruleCustomisers[$fixer->getName()] ?? null; if (null !== $customiser) { $actualFixer = $customiser($file); if (false === $actualFixer) { continue; } if (true !== $actualFixer) { if (\get_class($fixer) !== \get_class($actualFixer)) { throw new \RuntimeException(\sprintf( 'The fixer returned by the Rule Customisation Policy must be of the same class as the original fixer (expected `%s`, got `%s`).', \get_class($fixer), \get_class($actualFixer), )); } $fixer = $actualFixer; } } // for custom fixers we don't know is it safe to run `->fix()` without checking `->supports()` and `->isCandidate()`, // thus we need to check it and conditionally skip fixing if ( !$fixer instanceof AbstractFixer && (!$fixer->supports($file) || !$fixer->isCandidate($tokens)) ) { continue; } $fixer->fix($file, $tokens); if ($tokens->isChanged()) { $tokens->clearEmptyTokens(); $tokens->clearChanged(); $appliedFixers[] = $fixer->getName(); } } } catch (\ParseError $e) { $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_LINT)); $this->errorsManager->report(new Error(Error::TYPE_LINT, $filePathname, $e)); return null; } catch (\Throwable $e) { $this->processException($filePathname, $e); return null; } $fixInfo = null; if ([] !== $appliedFixers) { $new = $tokens->generateCode(); $newHash = $tokens->getCodeHash(); } // We need to check if content was changed and then applied changes. // But we can't simply check $appliedFixers, because one fixer may revert // work of other and both of them will mark collection as changed. // Therefore we need to check if code hashes changed. if ($oldHash !== $newHash) { $fixInfo = [ 'appliedFixers' => $appliedFixers, 'diff' => $this->differ->diff($old, $new, $file), ]; try { $this->linter->lintSource($new)->check(); } catch (LintingException $e) { $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_LINT)); $this->errorsManager->report(new Error(Error::TYPE_LINT, $filePathname, $e, $fixInfo['appliedFixers'], $fixInfo['diff'])); return null; } if (!$this->isDryRun) { $fileRealPath = $file->getRealPath(); if (!file_exists($fileRealPath)) { throw new IOException( \sprintf('Failed to write file "%s" (no longer) exists.', $file->getPathname()), 0, null, $file->getPathname(), ); } if (is_dir($fileRealPath)) { throw new IOException( \sprintf('Cannot write file "%s" as the location exists as directory.', $fileRealPath), 0, null, $fileRealPath, ); } if (!is_writable($fileRealPath)) { throw new IOException( \sprintf('Cannot write to file "%s" as it is not writable.', $fileRealPath), 0, null, $fileRealPath, ); } if (false === @file_put_contents($fileRealPath, $new)) { $error = error_get_last(); throw new IOException( \sprintf('Failed to write file "%s", "%s".', $fileRealPath, null !== $error ? $error['message'] : 'no reason available'), 0, null, $fileRealPath, ); } } } $this->cacheManager->setFileHash($filePathname, $newHash); $this->dispatchEvent( FileProcessed::NAME, new FileProcessed(null !== $fixInfo ? FileProcessed::STATUS_FIXED : FileProcessed::STATUS_NO_CHANGES, $newHash), ); return $fixInfo; } /** * Process an exception that occurred. */ private function processException(string $name, \Throwable $e): void { $this->dispatchEvent(FileProcessed::NAME, new FileProcessed(FileProcessed::STATUS_EXCEPTION)); $this->errorsManager->report(new Error(Error::TYPE_EXCEPTION, $name, $e)); } private function dispatchEvent(string $name, Event $event): void { if (null === $this->eventDispatcher) { return; } $this->eventDispatcher->dispatch($event, $name); } private function getLintingFileIterator(): LintingResultAwareFileIteratorInterface { $fileFilterIterator = $this->getFilteringFileIterator(); return $this->linter->isAsync() ? new FileCachingLintingFileIterator($fileFilterIterator, $this->linter) : new LintingFileIterator($fileFilterIterator, $this->linter); } private function getFilteringFileIterator(): FileFilterIterator { if (null === $this->fileIterator) { throw new \RuntimeException('File iterator is not configured. Pass paths during Runner initialisation or set them after with `setFileIterator()`.'); } return new FileFilterIterator( $this->fileIterator instanceof \IteratorAggregate ? $this->fileIterator->getIterator() : $this->fileIterator, $this->eventDispatcher, $this->cacheManager, ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/RunnerConfig.php
src/Runner/RunnerConfig.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner; use PhpCsFixer\Runner\Parallel\ParallelConfig; /** * @author Greg Korba <greg@codito.dev> * * @readonly * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class RunnerConfig { private bool $isDryRun; private bool $stopOnViolation; private ParallelConfig $parallelConfig; private ?string $configFile; public function __construct( bool $isDryRun, bool $stopOnViolation, ParallelConfig $parallelConfig, ?string $configFile = null ) { $this->isDryRun = $isDryRun; $this->stopOnViolation = $stopOnViolation; $this->parallelConfig = $parallelConfig; $this->configFile = $configFile; } public function isDryRun(): bool { return $this->isDryRun; } public function shouldStopOnViolation(): bool { return $this->stopOnViolation; } public function getParallelConfig(): ParallelConfig { return $this->parallelConfig; } public function getConfigFile(): ?string { return $this->configFile; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/LintingResultAwareFileIteratorInterface.php
src/Runner/LintingResultAwareFileIteratorInterface.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner; use PhpCsFixer\Linter\LintingResultInterface; /** * @internal * * @extends \Iterator<mixed, \SplFileInfo> * * @author Greg Korba <greg@codito.dev> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ interface LintingResultAwareFileIteratorInterface extends \Iterator { public function currentLintingResult(): ?LintingResultInterface; }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Event/AnalysisStarted.php
src/Runner/Event/AnalysisStarted.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Event; use Symfony\Contracts\EventDispatcher\Event; /** * Event that is fired when Fixer starts analysis. * * @author Greg Korba <greg@codito.dev> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class AnalysisStarted extends Event { public const NAME = 'fixer.analysis_started'; public const MODE_SEQUENTIAL = 'sequential'; public const MODE_PARALLEL = 'parallel'; /** @var self::MODE_* */ private string $mode; private bool $dryRun; /** * @param self::MODE_* $mode */ public function __construct(string $mode, bool $dryRun) { $this->mode = $mode; $this->dryRun = $dryRun; } public function getMode(): string { return $this->mode; } public function isDryRun(): bool { return $this->dryRun; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Event/FileProcessed.php
src/Runner/Event/FileProcessed.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Event; use Symfony\Contracts\EventDispatcher\Event; /** * Event that is fired when file was processed by Fixer. * * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FileProcessed extends Event { /** * Event name. */ public const NAME = 'fixer.file_processed'; public const STATUS_INVALID = 1; public const STATUS_SKIPPED = 2; public const STATUS_NO_CHANGES = 3; public const STATUS_FIXED = 4; public const STATUS_EXCEPTION = 5; public const STATUS_LINT = 6; public const STATUS_NON_MONOLITHIC = 7; /** * @var self::STATUS_* */ private int $status; private ?string $fileHash; /** * @param self::STATUS_* $status */ public function __construct(int $status, ?string $fileHash = null) { $this->status = $status; $this->fileHash = $fileHash; } /** * @return self::STATUS_* */ public function getStatus(): int { return $this->status; } public function getFileHash(): ?string { return $this->fileHash; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/Process.php
src/Runner/Parallel/Process.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; use React\ChildProcess\Process as ReactProcess; use React\EventLoop\LoopInterface; use React\EventLoop\TimerInterface; use React\Stream\ReadableStreamInterface; use React\Stream\WritableStreamInterface; /** * Represents single process that is handled within parallel run. * Inspired by: * - https://github.com/phpstan/phpstan-src/blob/9ce425bca5337039fb52c0acf96a20a2b8ace490/src/Parallel/Process.php * - https://github.com/phpstan/phpstan-src/blob/1477e752b4b5893f323b6d2c43591e68b3d85003/src/Process/ProcessHelper.php. * * @author Greg Korba <greg@codito.dev> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class Process { // Properties required for process instantiation private string $command; private LoopInterface $loop; private int $timeoutSeconds; // Properties required for process execution private ?ReactProcess $process = null; private ?WritableStreamInterface $in = null; /** @var resource */ private $stdErr; /** @var resource */ private $stdOut; /** @var callable(array<array-key, mixed>): void */ private $onData; /** @var callable(\Throwable): void */ private $onError; private ?TimerInterface $timer = null; public function __construct(string $command, LoopInterface $loop, int $timeoutSeconds) { $this->command = $command; $this->loop = $loop; $this->timeoutSeconds = $timeoutSeconds; } /** * @param callable(array<array-key, mixed> $json): void $onData callback to be called when data is received from the parallelisation operator * @param callable(\Throwable $exception): void $onError callback to be called when an exception occurs * @param callable(?int $exitCode, string $output): void $onExit callback to be called when the process exits */ public function start(callable $onData, callable $onError, callable $onExit): void { $sysTempDir = sys_get_temp_dir(); if (!is_writable($sysTempDir)) { throw new ParallelisationException(\sprintf( 'Failed creating temp file as sys_get_temp_dir="%s" is not writable.', $sysTempDir, )); } $stdOut = tmpfile(); if (false === $stdOut) { throw new ParallelisationException('Failed creating temp file for stdOut.'); } $this->stdOut = $stdOut; $stdErr = tmpfile(); if (false === $stdErr) { throw new ParallelisationException('Failed creating temp file for stdErr.'); } $this->stdErr = $stdErr; $this->onData = $onData; $this->onError = $onError; $this->process = new ReactProcess($this->command, null, null, [ 1 => $this->stdOut, 2 => $this->stdErr, ]); $this->process->start($this->loop); $this->process->on('exit', function ($exitCode) use ($onExit): void { $this->cancelTimer(); $output = ''; rewind($this->stdOut); $stdOut = stream_get_contents($this->stdOut); if (\is_string($stdOut)) { $output .= $stdOut; } rewind($this->stdErr); $stdErr = stream_get_contents($this->stdErr); if (\is_string($stdErr)) { $output .= $stdErr; } $onExit($exitCode, $output); fclose($this->stdOut); fclose($this->stdErr); }); } /** * Handles requests from parallelisation operator to its worker (spawned process). * * @param array<array-key, mixed> $data */ public function request(array $data): void { $this->cancelTimer(); // Configured process timeout actually means "chunk timeout" (each request resets timer) if (null === $this->in) { throw new ParallelisationException( 'Process not connected with parallelisation operator, ensure `bindConnection()` was called', ); } $this->in->write($data); $this->timer = $this->loop->addTimer($this->timeoutSeconds, function (): void { ($this->onError)( new \Exception( \sprintf( 'Child process timed out after %d seconds. Try making it longer using `ParallelConfig`.', $this->timeoutSeconds, ), ) ); }); } public function quit(): void { $this->cancelTimer(); if (null === $this->process || !$this->process->isRunning()) { return; } foreach ($this->process->pipes as $pipe) { $pipe->close(); } if (null === $this->in) { return; } $this->in->end(); } public function bindConnection(ReadableStreamInterface $out, WritableStreamInterface $in): void { $this->in = $in; $in->on('error', function (\Throwable $error): void { ($this->onError)($error); }); $out->on('data', function (array $json): void { $this->cancelTimer(); // Pass everything to the parallelisation operator, it should decide how to handle the data ($this->onData)($json); }); $out->on('error', function (\Throwable $error): void { ($this->onError)($error); }); } private function cancelTimer(): void { if (null === $this->timer) { return; } $this->loop->cancelTimer($this->timer); $this->timer = null; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ParallelAction.php
src/Runner/Parallel/ParallelAction.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; /** * @author Greg Korba <greg@codito.dev> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ParallelAction { // Actions executed by the runner (main process) public const RUNNER_REQUEST_ANALYSIS = 'requestAnalysis'; public const RUNNER_THANK_YOU = 'thankYou'; // Actions executed by the worker public const WORKER_ERROR_REPORT = 'errorReport'; public const WORKER_GET_FILE_CHUNK = 'getFileChunk'; public const WORKER_HELLO = 'hello'; public const WORKER_RESULT = 'result'; private function __construct() {} }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ParallelisationException.php
src/Runner/Parallel/ParallelisationException.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; /** * Common exception for all the errors related to parallelisation. * * @author Greg Korba <greg@codito.dev> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ParallelisationException extends \RuntimeException { public static function forUnknownIdentifier(ProcessIdentifier $identifier): self { return new self('Unknown process identifier: '.$identifier->toString()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ProcessIdentifier.php
src/Runner/Parallel/ProcessIdentifier.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; /** * Represents identifier of single process that is handled within parallel run. * * @author Greg Korba <greg@codito.dev> * * @readonly * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessIdentifier { private const IDENTIFIER_PREFIX = 'php-cs-fixer_parallel_'; private string $identifier; private function __construct(string $identifier) { $this->identifier = $identifier; } public function toString(): string { return $this->identifier; } public static function create(): self { return new self(uniqid(self::IDENTIFIER_PREFIX, true)); } public static function fromRaw(string $identifier): self { if (!str_starts_with($identifier, self::IDENTIFIER_PREFIX)) { throw new ParallelisationException(\sprintf('Invalid process identifier "%s".', $identifier)); } return new self($identifier); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ProcessFactory.php
src/Runner/Parallel/ProcessFactory.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; use PhpCsFixer\Runner\RunnerConfig; use React\EventLoop\LoopInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Process\PhpExecutableFinder; /** * @author Greg Korba <greg@codito.dev> * * @readonly * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessFactory { public function create( LoopInterface $loop, InputInterface $input, RunnerConfig $runnerConfig, ProcessIdentifier $identifier, int $serverPort ): Process { $commandArgs = $this->getCommandArgs($serverPort, $identifier, $input, $runnerConfig); return new Process( implode(' ', $commandArgs), $loop, $runnerConfig->getParallelConfig()->getProcessTimeout(), ); } /** * @private * * @return non-empty-list<string> */ public function getCommandArgs(int $serverPort, ProcessIdentifier $identifier, InputInterface $input, RunnerConfig $runnerConfig): array { $phpBinary = (new PhpExecutableFinder())->find(false); if (false === $phpBinary) { throw new ParallelisationException('Cannot find PHP executable.'); } $mainScript = realpath(__DIR__.'/../../../php-cs-fixer'); if (false === $mainScript && isset($_SERVER['argv'][0]) && str_contains($_SERVER['argv'][0], 'php-cs-fixer') ) { $mainScript = $_SERVER['argv'][0]; } if (!is_file($mainScript)) { throw new ParallelisationException('Cannot determine Fixer executable.'); } $commandArgs = [ ProcessUtils::escapeArgument($phpBinary), ProcessUtils::escapeArgument($mainScript), 'worker', \sprintf('--port=%s', (string) $serverPort), \sprintf('--identifier=%s', ProcessUtils::escapeArgument($identifier->toString())), ]; if ($runnerConfig->isDryRun()) { $commandArgs[] = '--dry-run'; } if (filter_var($input->getOption('diff'), \FILTER_VALIDATE_BOOLEAN)) { $commandArgs[] = '--diff'; } if (filter_var($input->getOption('stop-on-violation'), \FILTER_VALIDATE_BOOLEAN)) { $commandArgs[] = '--stop-on-violation'; } foreach (['allow-risky', 'config', 'rules', 'using-cache', 'cache-file'] as $option) { $optionValue = $input->getOption($option); if (null !== $optionValue) { $commandArgs[] = \sprintf('--%s=%s', $option, ProcessUtils::escapeArgument($optionValue)); } } return $commandArgs; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ProcessUtils.php
src/Runner/Parallel/ProcessUtils.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This file was copied (and slightly modified) from Symfony: * - https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Process/ProcessUtils.php#L41 * - (c) Fabien Potencier <fabien@symfony.com> * - For the full copyright and license information, please see https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Process/LICENSE * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; /** * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessUtils { /** * This class should not be instantiated. */ private function __construct() {} /** * Escapes a string to be used as a shell argument. * * @param string $argument The argument that will be escaped * * @return string The escaped argument */ public static function escapeArgument(string $argument): string { // Fix for PHP bug #43784 escapeshellarg removes % from given string // Fix for PHP bug #49446 escapeshellarg doesn't work on Windows // @see https://bugs.php.net/43784 // @see https://bugs.php.net/49446 if ('\\' === \DIRECTORY_SEPARATOR) { if ('' === $argument) { return escapeshellarg($argument); } $escapedArgument = ''; $quote = false; foreach (preg_split('/(")/', $argument, -1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE) as $part) { // @phpstan-ignore foreach.nonIterable if ('"' === $part) { $escapedArgument .= '\"'; } elseif (self::isSurroundedBy($part, '%')) { // Avoid environment variable expansion $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; } else { // escape trailing backslash if ('\\' === substr($part, -1)) { $part .= '\\'; } $quote = true; $escapedArgument .= $part; } } if ($quote) { $escapedArgument = '"'.$escapedArgument.'"'; } return $escapedArgument; } return "'".str_replace("'", "'\\''", $argument)."'"; } private static function isSurroundedBy(string $arg, string $char): bool { return 2 < \strlen($arg) && $char === $arg[0] && $char === $arg[\strlen($arg) - 1]; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ProcessPool.php
src/Runner/Parallel/ProcessPool.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; use React\Socket\ServerInterface; /** * Represents collection of active processes that are being run in parallel. * Inspired by {@see https://github.com/phpstan/phpstan-src/blob/ed68345a82992775112acc2c2bd639d1bd3a1a02/src/Parallel/ProcessPool.php}. * * @author Greg Korba <greg@codito.dev> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessPool { /** * @readonly */ private ServerInterface $server; /** * @var null|(callable(): void) * * @readonly */ private $onServerClose; /** * @var array<string, Process> */ private array $processes = []; /** * @param null|(callable(): void) $onServerClose */ public function __construct(ServerInterface $server, ?callable $onServerClose = null) { $this->server = $server; $this->onServerClose = $onServerClose; } public function getProcess(ProcessIdentifier $identifier): Process { if (!isset($this->processes[$identifier->toString()])) { throw ParallelisationException::forUnknownIdentifier($identifier); } return $this->processes[$identifier->toString()]; } public function addProcess(ProcessIdentifier $identifier, Process $process): void { $this->processes[$identifier->toString()] = $process; } public function endProcessIfKnown(ProcessIdentifier $identifier): void { if (!isset($this->processes[$identifier->toString()])) { return; } $this->endProcess($identifier); } public function endAll(): void { foreach ($this->processes as $identifier => $process) { $this->endProcessIfKnown(ProcessIdentifier::fromRaw($identifier)); } } private function endProcess(ProcessIdentifier $identifier): void { $this->getProcess($identifier)->quit(); unset($this->processes[$identifier->toString()]); if (0 === \count($this->processes)) { $this->server->close(); if (null !== $this->onServerClose) { ($this->onServerClose)(); } } } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/WorkerException.php
src/Runner/Parallel/WorkerException.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; /** * @author Greg Korba <gre@codito.dev> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class WorkerException extends \RuntimeException { private string $originalTraceAsString; private function __construct(string $message, int $code) { parent::__construct($message, $code); } /** * @param array{ * class: class-string<\Throwable>, * message: string, * file: string, * line: int, * code: int, * trace: string * } $data */ public static function fromRaw(array $data): self { $exception = new self( \sprintf('[%s] %s', $data['class'], $data['message']), $data['code'], ); $exception->file = $data['file']; $exception->line = $data['line']; $exception->originalTraceAsString = \sprintf( '## %s(%d)%s%s', $data['file'], $data['line'], \PHP_EOL, $data['trace'], ); return $exception; } public function getOriginalTraceAsString(): string { return $this->originalTraceAsString; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ParallelConfigFactory.php
src/Runner/Parallel/ParallelConfigFactory.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; use Fidry\CpuCoreCounter\CpuCoreCounter; use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder; use Fidry\CpuCoreCounter\Finder\FinderRegistry; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ParallelConfigFactory { private static ?CpuCoreCounter $cpuDetector = null; private function __construct() {} public static function sequential(): ParallelConfig { return new ParallelConfig(1); } /** * @param null|positive-int $filesPerProcess * @param null|positive-int $processTimeout * @param null|positive-int $maxProcesses */ public static function detect( ?int $filesPerProcess = null, ?int $processTimeout = null, ?int $maxProcesses = null ): ParallelConfig { if (null === self::$cpuDetector) { self::$cpuDetector = new CpuCoreCounter([ ...FinderRegistry::getDefaultLogicalFinders(), new DummyCpuCoreFinder(1), ]); } // Reserve 1 core for the main orchestrating process $available = self::$cpuDetector->getAvailableForParallelisation(1, $maxProcesses); return new ParallelConfig( $available->availableCpus, $filesPerProcess ?? ParallelConfig::DEFAULT_FILES_PER_PROCESS, $processTimeout ?? ParallelConfig::DEFAULT_PROCESS_TIMEOUT, ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/src/Runner/Parallel/ParallelConfig.php
src/Runner/Parallel/ParallelConfig.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Runner\Parallel; /** * @author Greg Korba <greg@codito.dev> * * @readonly * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ParallelConfig { /** @internal */ public const DEFAULT_FILES_PER_PROCESS = 10; /** @internal */ public const DEFAULT_PROCESS_TIMEOUT = 120; private int $filesPerProcess; private int $maxProcesses; private int $processTimeout; /** * @param positive-int $maxProcesses * @param positive-int $filesPerProcess * @param positive-int $processTimeout */ public function __construct( int $maxProcesses = 2, int $filesPerProcess = self::DEFAULT_FILES_PER_PROCESS, int $processTimeout = self::DEFAULT_PROCESS_TIMEOUT ) { if ($maxProcesses <= 0 || $filesPerProcess <= 0 || $processTimeout <= 0) { throw new \InvalidArgumentException('Invalid parallelisation configuration: only positive integers are allowed'); } $this->maxProcesses = $maxProcesses; $this->filesPerProcess = $filesPerProcess; $this->processTimeout = $processTimeout; } public function getFilesPerProcess(): int { return $this->filesPerProcess; } public function getMaxProcesses(): int { return $this->maxProcesses; } public function getProcessTimeout(): int { return $this->processTimeout; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/FutureTest.php
tests/FutureTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Future; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\Future * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FutureTest extends TestCase { /** * @var null|false|string */ private $originalValueOfFutureMode; protected function setUp(): void { parent::setUp(); $this->originalValueOfFutureMode = getenv('PHP_CS_FIXER_FUTURE_MODE'); } protected function tearDown(): void { putenv("PHP_CS_FIXER_FUTURE_MODE={$this->originalValueOfFutureMode}"); parent::tearDown(); } /** * @group legacy */ public function testTriggerDeprecationWhenFutureModeIsOff(): void { putenv('PHP_CS_FIXER_FUTURE_MODE=0'); $message = __METHOD__.'::The message'; $this->expectDeprecation($message); Future::triggerDeprecation(new \DomainException($message)); $triggered = Future::getTriggeredDeprecations(); self::assertContains($message, $triggered); } public function testTriggerDeprecationWhenFutureModeIsOn(): void { putenv('PHP_CS_FIXER_FUTURE_MODE=1'); $message = __METHOD__.'::The message'; $exception = new \DomainException($message); $futureModeException = null; try { Future::triggerDeprecation($exception); } catch (\Exception $futureModeException) { } self::assertInstanceOf(\RuntimeException::class, $futureModeException); self::assertSame($exception, $futureModeException->getPrevious()); $triggered = Future::getTriggeredDeprecations(); self::assertNotContains($message, $triggered); } public function testGetV4OrV3ForOldBehaviour(): void { putenv('PHP_CS_FIXER_FUTURE_MODE=0'); self::assertSame( 'old', Future::getV4OrV3('new', 'old'), ); } public function testGetV4OrV3ForNewBehaviour(): void { putenv('PHP_CS_FIXER_FUTURE_MODE=1'); self::assertSame( 'new', Future::getV4OrV3('new', 'old'), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/FileReaderTest.php
tests/FileReaderTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use org\bovigo\vfs\vfsStream; use PhpCsFixer\FileReader; /** * @author ntzm * * @internal * * @covers \PhpCsFixer\FileReader * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FileReaderTest extends TestCase { public static function tearDownAfterClass(): void { parent::tearDownAfterClass(); // testReadStdinCaches registers a stream wrapper for PHP so we can mock // php://stdin. Restore the original stream wrapper after this class so // we don't affect other tests running after it stream_wrapper_restore('php'); } public function testCreateSingleton(): void { $instance = FileReader::createSingleton(); self::assertSame($instance, FileReader::createSingleton()); } public function testRead(): void { $fs = vfsStream::setup('root', null, [ 'foo.php' => '<?php echo "hi";', ]); $reader = new FileReader(); self::assertSame('<?php echo "hi";', $reader->read($fs->url().'/foo.php')); } public function testReadStdinCaches(): void { $reader = new FileReader(); $stdinStream = $this->createStdinStreamDouble(); stream_wrapper_unregister('php'); stream_wrapper_register('php', \get_class($stdinStream)); self::assertSame('<?php echo "foo";', $reader->read('php://stdin')); self::assertSame('<?php echo "foo";', $reader->read('php://stdin')); } public function testThrowsExceptionOnFail(): void { $fs = vfsStream::setup(); $nonExistentFilePath = $fs->url().'/non-existent.php'; $reader = new FileReader(); $this->expectException(\RuntimeException::class); $this->expectExceptionMessageMatches('#^Failed to read content from "'.preg_quote($nonExistentFilePath, '#').'.*$#'); $reader->read($nonExistentFilePath); } private function createStdinStreamDouble(): object { return new class { /** * @var resource */ public $context; private static bool $hasReadContent = false; private string $content = '<?php echo "foo";'; private bool $hasReadCurrentString = false; public function stream_open(string $path): bool { return 'php://stdin' === $path; } /** * @return false|string */ public function stream_read() { if ($this->stream_eof()) { return false; } $this->hasReadCurrentString = true; if (self::$hasReadContent) { return ''; } self::$hasReadContent = true; return $this->content; } public function stream_eof(): bool { return $this->hasReadCurrentString; } /** * @return array{} */ public function stream_stat(): array { return []; } }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/AbstractDoctrineAnnotationFixerTestCase.php
tests/AbstractDoctrineAnnotationFixerTestCase.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\AbstractDoctrineAnnotationFixer; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Preg; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @internal * * @template TFixer of AbstractDoctrineAnnotationFixer * * @extends AbstractFixerTestCase<TFixer> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ abstract class AbstractDoctrineAnnotationFixerTestCase extends AbstractFixerTestCase { /** * @param array<string, mixed> $configuration * * @dataProvider provideConfigureWithInvalidConfigurationCases */ public function testConfigureWithInvalidConfiguration(array $configuration): void { $this->expectException(InvalidFixerConfigurationException::class); $this->fixer->configure($configuration); } /** * @return iterable<int, array{array<string, mixed>}> */ public static function provideConfigureWithInvalidConfigurationCases(): iterable { yield [['foo' => 'bar']]; yield [['ignored_tags' => 'foo']]; } /** * @template AutogeneratedInputConfiguration of array * * @param list<array{0: string, 1?: string}> $commentCases * @param AutogeneratedInputConfiguration $configuration * * @return iterable<array{string, null|string, AutogeneratedInputConfiguration}> */ protected static function createTestCases(array $commentCases, array $configuration = []): iterable { $noFixCases = []; foreach ($commentCases as $commentCase) { yield [ self::withClassDocBlock($commentCase[0]), isset($commentCase[1]) ? self::withClassDocBlock($commentCase[1]) : null, $configuration, ]; yield [ self::withPropertyDocBlock($commentCase[0]), isset($commentCase[1]) ? self::withPropertyDocBlock($commentCase[1]) : null, $configuration, ]; yield [ self::withMethodDocBlock($commentCase[0]), isset($commentCase[1]) ? self::withMethodDocBlock($commentCase[1]) : null, $configuration, ]; $noFixCases[$commentCase[0]] = [ self::withWrongElementDocBlock($commentCase[0]), null, $configuration, ]; } yield from array_values($noFixCases); } private static function withClassDocBlock(string $comment): string { return self::with('<?php %s class FooClass { }', $comment, false); } private static function withPropertyDocBlock(string $comment): string { return self::with('<?php class FooClass { %s private $foo; }', $comment, true); } private static function withMethodDocBlock(string $comment): string { return self::with('<?php class FooClass { %s public function foo() { } }', $comment, true); } private static function withWrongElementDocBlock(string $comment): string { return self::with('<?php %s $foo = bar();', $comment, false); } private static function with(string $php, string $comment, bool $indent): string { $comment = trim($comment); if ($indent) { $comment = str_replace("\n", "\n ", $comment); } return \sprintf($php, Preg::replace('/^\n+/', '', $comment)); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/StdinFileInfoTest.php
tests/StdinFileInfoTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\StdinFileInfo; /** * @author ntzm * * @internal * * @covers \PhpCsFixer\StdinFileInfo * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class StdinFileInfoTest extends TestCase { public function testToString(): void { $fileInfo = new StdinFileInfo(); self::assertSame('php://stdin', (string) $fileInfo); } public function testGetRealPath(): void { $fileInfo = new StdinFileInfo(); self::assertSame('php://stdin', $fileInfo->getRealPath()); } public function testGetATime(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getATime()); } public function testGetBasename(): void { $fileInfo = new StdinFileInfo(); self::assertSame('stdin.php', $fileInfo->getBasename()); } public function testGetCTime(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getCTime()); } public function testGetExtension(): void { $fileInfo = new StdinFileInfo(); self::assertSame('.php', $fileInfo->getExtension()); } public function testGetFileInfo(): void { $fileInfo = new StdinFileInfo(); $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Method "PhpCsFixer\StdinFileInfo::getFileInfo" is not implemented.'); $fileInfo->getFileInfo(); } public function testGetFilename(): void { $fileInfo = new StdinFileInfo(); self::assertSame('stdin.php', $fileInfo->getFilename()); } public function testGetGroup(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getGroup()); } public function testGetInode(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getInode()); } public function testGetLinkTarget(): void { $fileInfo = new StdinFileInfo(); self::assertSame('', $fileInfo->getLinkTarget()); } public function testGetMTime(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getMTime()); } public function testGetOwner(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getOwner()); } public function testGetPath(): void { $fileInfo = new StdinFileInfo(); self::assertSame('', $fileInfo->getPath()); } public function testGetPathInfo(): void { $fileInfo = new StdinFileInfo(); $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Method "PhpCsFixer\StdinFileInfo::getPathInfo" is not implemented.'); $fileInfo->getPathInfo(); } public function testGetPathname(): void { $fileInfo = new StdinFileInfo(); self::assertSame('stdin.php', $fileInfo->getPathname()); } public function testGetPerms(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getPerms()); } public function testGetSize(): void { $fileInfo = new StdinFileInfo(); self::assertSame(0, $fileInfo->getSize()); } public function testGetType(): void { $fileInfo = new StdinFileInfo(); self::assertSame('file', $fileInfo->getType()); } public function testIsDir(): void { $fileInfo = new StdinFileInfo(); self::assertFalse($fileInfo->isDir()); } public function testIsExecutable(): void { $fileInfo = new StdinFileInfo(); self::assertFalse($fileInfo->isExecutable()); } public function testIsFile(): void { $fileInfo = new StdinFileInfo(); self::assertTrue($fileInfo->isFile()); } public function testIsLink(): void { $fileInfo = new StdinFileInfo(); self::assertFalse($fileInfo->isLink()); } public function testIsReadable(): void { $fileInfo = new StdinFileInfo(); self::assertTrue($fileInfo->isReadable()); } public function testIsWritable(): void { $fileInfo = new StdinFileInfo(); self::assertFalse($fileInfo->isWritable()); } public function testOpenFile(): void { $fileInfo = new StdinFileInfo(); $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Method "PhpCsFixer\StdinFileInfo::openFile" is not implemented.'); $fileInfo->openFile(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/HasherTest.php
tests/HasherTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Hasher; /** * @internal * * @covers \PhpCsFixer\Hasher * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class HasherTest extends TestCase { public function testCalculate(): void { $expectedHash = \PHP_VERSION_ID >= 8_01_00 ? '6592e7f937d52d1ab4a819e9aff6c888' : 'd9de49676ba2316990a5acd04c8418e8'; self::assertSame($expectedHash, Hasher::calculate('<?php echo 1;')); self::assertSame($expectedHash, Hasher::calculate('<?php echo 1;')); // calling twice, hashes should always be the same when the input doesn't change. } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/ToolInfoTest.php
tests/ToolInfoTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Console\Application; use PhpCsFixer\ToolInfo; /** * @internal * * @covers \PhpCsFixer\ToolInfo * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ToolInfoTest extends TestCase { public function testGetVersion(): void { $toolInfo = new ToolInfo(); self::assertStringStartsWith(Application::VERSION, $toolInfo->getVersion()); } public function testIsInstallAsPhar(): void { $toolInfo = new ToolInfo(); self::assertFalse($toolInfo->isInstalledAsPhar()); } public function testIsInstalledByComposer(): void { $toolInfo = new ToolInfo(); self::assertFalse($toolInfo->isInstalledByComposer()); } public function testGetComposerVersionThrowsExceptionIfOutsideComposerScope(): void { $toolInfo = new ToolInfo(); $this->expectException(\LogicException::class); $toolInfo->getComposerVersion(); } public function testGetPharDownloadUri(): void { $toolInfo = new ToolInfo(); self::assertSame( 'https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/foo/php-cs-fixer.phar', $toolInfo->getPharDownloadUri('foo'), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/PharCheckerTest.php
tests/PharCheckerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\PharChecker; /** * @internal * * @covers \PhpCsFixer\PharChecker * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class PharCheckerTest extends TestCase { public function testPharChecker(): void { $checker = new PharChecker(); self::assertNull($checker->checkFileValidity(__DIR__.'/Fixtures/empty.phar')); } public function testPharCheckerInvalidFile(): void { $checker = new PharChecker(); self::assertStringStartsWith('Failed to create Phar instance.', $checker->checkFileValidity(__FILE__)); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/FixerFactoryTest.php
tests/FixerFactoryTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException; use PhpCsFixer\Fixer\ConfigurableFixerInterface; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\Fixer\InternalFixerInterface; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\FixerFactory; use PhpCsFixer\RuleSet\RuleSet; use PhpCsFixer\RuleSet\RuleSetInterface; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\WhitespacesFixerConfig; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\FixerFactory * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FixerFactoryTest extends TestCase { public function testInterfaceIsFluent(): void { $factory = new FixerFactory(); $testInstance = $factory->registerBuiltInFixers(); self::assertSame($factory, $testInstance); $testInstance = $factory->registerCustomFixers( [$this->createFixerDouble('Foo/f1'), $this->createFixerDouble('Foo/f2')], ); self::assertSame($factory, $testInstance); $testInstance = $factory->registerFixer( $this->createFixerDouble('f3'), false, ); self::assertSame($factory, $testInstance); $ruleSet = new class([]) implements RuleSetInterface { /** @var array<string, array<string, mixed>|true> */ private array $set; /** @param array<string, array<string, mixed>|true> $set */ public function __construct(array $set = []) { $this->set = $set; } public function getRuleConfiguration(string $rule): ?array { throw new \LogicException('Not implemented.'); } public function getRules(): array { return $this->set; } public function hasRule(string $rule): bool { throw new \LogicException('Not implemented.'); } }; $testInstance = $factory->useRuleSet( $ruleSet, ); self::assertSame($factory, $testInstance); } /** * @covers \PhpCsFixer\FixerFactory::registerBuiltInFixers */ public function testRegisterBuiltInFixers(): void { $factory = new FixerFactory(); $factory->registerBuiltInFixers(); $fixerClasses = array_filter( get_declared_classes(), static function (string $className): bool { $class = new \ReflectionClass($className); return !$class->isAbstract() && !$class->isAnonymous() && $class->implementsInterface(FixerInterface::class) && !$class->implementsInterface(InternalFixerInterface::class) && str_starts_with($class->getNamespaceName(), 'PhpCsFixer\Fixer\\'); }, ); sort($fixerClasses); $fixers = array_map( static fn (FixerInterface $fixer): string => \get_class($fixer), $factory->getFixers(), ); sort($fixers); self::assertSame($fixerClasses, $fixers); } /** * @covers \PhpCsFixer\FixerFactory::getFixers */ public function testThatFixersAreSorted(): void { $factory = new FixerFactory(); $fxs = [ $this->createFixerDouble('f1', 0), $this->createFixerDouble('f2', -10), $this->createFixerDouble('f3', 10), $this->createFixerDouble('f4', -10), ]; foreach ($fxs as $fx) { $factory->registerFixer($fx, false); } // There are no rules that forces $fxs[1] to be prioritized before $fxs[3]. We should not test against that self::assertSame([$fxs[2], $fxs[0]], \array_slice($factory->getFixers(), 0, 2)); } /** * @covers \PhpCsFixer\FixerFactory::getFixers * @covers \PhpCsFixer\FixerFactory::registerCustomFixers * @covers \PhpCsFixer\FixerFactory::registerFixer */ public function testThatCanRegisterAndGetFixers(): void { $factory = new FixerFactory(); $f1 = $this->createFixerDouble('f1'); $f2 = $this->createFixerDouble('Foo/f2'); $f3 = $this->createFixerDouble('Foo/f3'); $factory->registerFixer($f1, false); $factory->registerCustomFixers([$f2, $f3]); self::assertTrue(\in_array($f1, $factory->getFixers(), true)); self::assertTrue(\in_array($f2, $factory->getFixers(), true)); self::assertTrue(\in_array($f3, $factory->getFixers(), true)); } /** * @covers \PhpCsFixer\FixerFactory::registerFixer */ public function testRegisterFixerWithOccupiedName(): void { $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessage('Fixer named "non_unique_name" is already registered.'); $factory = new FixerFactory(); $f1 = $this->createFixerDouble('non_unique_name'); $f2 = $this->createFixerDouble('non_unique_name'); $factory->registerFixer($f1, false); $factory->registerFixer($f2, false); } /** * @covers \PhpCsFixer\FixerFactory::useRuleSet */ public function testUseRuleSet(): void { $factory = (new FixerFactory()) ->registerBuiltInFixers() ->useRuleSet(new RuleSet([])) ; self::assertCount(0, $factory->getFixers()); $factory = (new FixerFactory()) ->registerBuiltInFixers() ->useRuleSet(new RuleSet(['strict_comparison' => true, 'blank_line_before_statement' => false])) ; $fixers = $factory->getFixers(); self::assertCount(1, $fixers); self::assertSame('strict_comparison', $fixers[0]->getName()); } /** * @covers \PhpCsFixer\FixerFactory::useRuleSet */ public function testUseRuleSetWithNonExistingRule(): void { $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessage('Rule "non_existing_rule" does not exist.'); $factory = (new FixerFactory()) ->registerBuiltInFixers() ->useRuleSet(new RuleSet(['non_existing_rule' => true])) ; $factory->getFixers(); } /** * @covers \PhpCsFixer\FixerFactory::useRuleSet */ public function testUseRuleSetWithInvalidConfigForRule(): void { $this->expectException(InvalidFixerConfigurationException::class); $this->expectExceptionMessage('Configuration must be an array and may not be empty.'); $testRuleSet = new class implements RuleSetInterface { public function __construct(array $set = []) { if ([] !== $set) { throw new \RuntimeException('Set is not used in test.'); } } /** * @return array<string, mixed> */ public function getRuleConfiguration(string $rule): ?array { if (!$this->hasRule($rule)) { throw new \InvalidArgumentException(\sprintf('Rule "%s" is not in the set.', $rule)); } // @phpstan-ignore-next-line offsetAccess.notFound The offset existence was check in the `if` above if (true === $this->getRules()[$rule]) { return null; } return $this->getRules()[$rule]; } public function getRules(): array { return ['header_comment' => []]; } public function hasRule(string $rule): bool { return isset($this->getRules()[$rule]); } }; $factory = (new FixerFactory()) ->registerBuiltInFixers() ->useRuleSet($testRuleSet) ; $factory->getFixers(); } public function testHasRule(): void { $factory = new FixerFactory(); $f1 = $this->createFixerDouble('f1'); $f2 = $this->createFixerDouble('Foo/f2'); $f3 = $this->createFixerDouble('Foo/f3'); $factory->registerFixer($f1, false); $factory->registerCustomFixers([$f2, $f3]); self::assertTrue($factory->hasRule('f1'), 'Should have f1 fixer'); self::assertTrue($factory->hasRule('Foo/f2'), 'Should have f2 fixer'); self::assertTrue($factory->hasRule('Foo/f3'), 'Should have f3 fixer'); self::assertFalse($factory->hasRule('dummy'), 'Should not have dummy fixer'); } public function testHasRuleWithChangedRuleSet(): void { $factory = new FixerFactory(); $f1 = $this->createFixerDouble('f1'); $f2 = $this->createFixerDouble('f2'); $factory->registerFixer($f1, false); $factory->registerFixer($f2, false); self::assertTrue($factory->hasRule('f1'), 'Should have f1 fixer'); self::assertTrue($factory->hasRule('f2'), 'Should have f2 fixer'); $factory->useRuleSet(new RuleSet(['f2' => true])); self::assertFalse($factory->hasRule('f1'), 'Should not have f1 fixer'); self::assertTrue($factory->hasRule('f2'), 'Should have f2 fixer'); } /** * @dataProvider provideConflictingFixersCases */ public function testConflictingFixers(RuleSet $ruleSet): void { $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessageMatches('#^Rule contains conflicting fixers:\n#'); (new FixerFactory()) ->registerBuiltInFixers()->useRuleSet($ruleSet) ; } /** * @return iterable<int, array{RuleSet}> */ public static function provideConflictingFixersCases(): iterable { yield [new RuleSet(['no_blank_lines_before_namespace' => true, 'single_blank_line_before_namespace' => true])]; yield [new RuleSet(['single_blank_line_before_namespace' => true, 'no_blank_lines_before_namespace' => true])]; } public function testNoDoubleConflictReporting(): void { $factory = new FixerFactory(); self::assertSame( 'Rule contains conflicting fixers: - "a" with "b" - "c" with "d", "e" and "f" - "d" with "g" and "h" - "e" with "a"', \Closure::bind(static fn (FixerFactory $factory): string => $factory->generateConflictMessage([ 'a' => ['b'], 'b' => ['a'], 'c' => ['d', 'e', 'f'], 'd' => ['c', 'g', 'h'], 'e' => ['a'], ]), null, FixerFactory::class)($factory), ); } public function testSetWhitespacesConfig(): void { $factory = new FixerFactory(); $config = new WhitespacesFixerConfig(); $fixer = new class($config) implements WhitespacesAwareFixerInterface { private WhitespacesFixerConfig $config; public function __construct(WhitespacesFixerConfig $config) { $this->config = $config; } public function isCandidate(Tokens $tokens): bool { throw new \LogicException('Not implemented.'); } public function isRisky(): bool { throw new \LogicException('Not implemented.'); } public function fix(\SplFileInfo $file, Tokens $tokens): void { throw new \LogicException('Not implemented.'); } public function getDefinition(): FixerDefinitionInterface { throw new \LogicException('Not implemented.'); } public function getName(): string { return 'foo'; } public function getPriority(): int { throw new \LogicException('Not implemented.'); } public function supports(\SplFileInfo $file): bool { throw new \LogicException('Not implemented.'); } public function setWhitespacesConfig(WhitespacesFixerConfig $config): void { TestCase::assertSame($this->config, $config); } }; $factory->registerFixer($fixer, false); $factory->setWhitespacesConfig($config); } public function testRegisterFixerInvalidName(): void { $factory = new FixerFactory(); $fixer = $this->createFixerDouble('0'); $this->expectException(\UnexpectedValueException::class); $this->expectExceptionMessage('Fixer named "0" has invalid name.'); $factory->registerFixer($fixer, false); } public function testConfigureNonConfigurableFixer(): void { $factory = new FixerFactory(); $fixer = $this->createFixerDouble('non_configurable'); $factory->registerFixer($fixer, false); $this->expectException(InvalidFixerConfigurationException::class); $this->expectExceptionMessage('[non_configurable] Is not configurable.'); $factory->useRuleSet(new RuleSet([ 'non_configurable' => ['bar' => 'baz'], ])); } /** * @param mixed $value * * @dataProvider provideConfigureFixerWithNonArrayCases */ public function testConfigureFixerWithNonArray($value): void { $factory = new FixerFactory(); $fixer = new class implements ConfigurableFixerInterface { public function configure(array $configuration): void { throw new \LogicException('Not implemented.'); } public function getConfigurationDefinition(): FixerConfigurationResolverInterface { throw new \LogicException('Not implemented.'); } public function isCandidate(Tokens $tokens): bool { throw new \LogicException('Not implemented.'); } public function isRisky(): bool { throw new \LogicException('Not implemented.'); } public function fix(\SplFileInfo $file, Tokens $tokens): void { throw new \LogicException('Not implemented.'); } public function getDefinition(): FixerDefinitionInterface { throw new \LogicException('Not implemented.'); } public function getName(): string { return 'foo'; } public function getPriority(): int { throw new \LogicException('Not implemented.'); } public function supports(\SplFileInfo $file): bool { throw new \LogicException('Not implemented.'); } }; $factory->registerFixer($fixer, false); $this->expectException(InvalidFixerConfigurationException::class); $this->expectExceptionMessage( '[foo] Rule must be enabled (true), disabled (false) or configured (non-empty, assoc array). Other values are not allowed.', ); $factory->useRuleSet(new RuleSet([ 'foo' => $value, ])); } /** * @return iterable<int, array{float|int|\stdClass|string}> */ public static function provideConfigureFixerWithNonArrayCases(): iterable { yield ['bar']; yield [new \stdClass()]; yield [5]; yield [5.5]; } public function testConfigurableFixerIsConfigured(): void { $fixer = new class implements ConfigurableFixerInterface { public function configure(array $configuration): void { TestCase::assertSame(['bar' => 'baz'], $configuration); } public function getConfigurationDefinition(): FixerConfigurationResolverInterface { throw new \LogicException('Not implemented.'); } public function isCandidate(Tokens $tokens): bool { throw new \LogicException('Not implemented.'); } public function isRisky(): bool { throw new \LogicException('Not implemented.'); } public function fix(\SplFileInfo $file, Tokens $tokens): void { throw new \LogicException('Not implemented.'); } public function getDefinition(): FixerDefinitionInterface { throw new \LogicException('Not implemented.'); } public function getName(): string { return 'foo'; } public function getPriority(): int { throw new \LogicException('Not implemented.'); } public function supports(\SplFileInfo $file): bool { throw new \LogicException('Not implemented.'); } }; $factory = new FixerFactory(); $factory->registerFixer($fixer, false); $factory->useRuleSet(new RuleSet([ 'foo' => ['bar' => 'baz'], ])); } private function createFixerDouble(string $name, int $priority = 0): FixerInterface { return new class($name, $priority) implements FixerInterface { private string $name; private int $priority; public function __construct(string $name, int $priority) { $this->name = $name; $this->priority = $priority; } public function isCandidate(Tokens $tokens): bool { throw new \LogicException('Not implemented.'); } public function isRisky(): bool { throw new \LogicException('Not implemented.'); } public function fix(\SplFileInfo $file, Tokens $tokens): void { throw new \LogicException('Not implemented.'); } public function getDefinition(): FixerDefinitionInterface { throw new \LogicException('Not implemented.'); } public function getName(): string { return $this->name; } public function getPriority(): int { return $this->priority; } public function supports(\SplFileInfo $file): bool { throw new \LogicException('Not implemented.'); } }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/TestCase.php
tests/TestCase.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PHPUnit\Framework\TestCase as BaseTestCase; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ abstract class TestCase extends BaseTestCase { /** @var null|callable */ private $previouslyDefinedErrorHandler; /** @var array<int, string> */ private array $expectedDeprecations = []; /** @var array<int, string> */ private array $actualDeprecations = []; protected function assertPostConditions(): void { if (null !== $this->previouslyDefinedErrorHandler) { $this->actualDeprecations = array_unique($this->actualDeprecations); sort($this->actualDeprecations); $this->expectedDeprecations = array_unique($this->expectedDeprecations); sort($this->expectedDeprecations); self::assertSame($this->expectedDeprecations, $this->actualDeprecations); } parent::assertPostConditions(); } protected function tearDown(): void { if (null !== $this->previouslyDefinedErrorHandler) { restore_error_handler(); } parent::tearDown(); } final public function testNotDefiningConstructor(): void { $reflection = new \ReflectionObject($this); self::assertNotSame( $reflection->getConstructor()->getDeclaringClass()->getName(), $reflection->getName(), ); } /** * Mark test to expect given deprecation. Order or repetition count of expected vs actual deprecation usage can vary, but result sets must be identical. * * @TODO change access to protected and pass the parameter when PHPUnit 9 support is dropped */ public function expectDeprecation(/* string $message */): void { $this->expectedDeprecations[] = func_get_arg(0); if (null === $this->previouslyDefinedErrorHandler) { $this->previouslyDefinedErrorHandler = set_error_handler( function ( int $code, string $message ) { if (\E_USER_DEPRECATED === $code || \E_DEPRECATED === $code) { $this->actualDeprecations[] = $message; } return true; }, ); } } /** @TODO find better place for me */ final protected static function createSerializedStringOfClassName(string $className): string { return \sprintf('O:%d:"%s":0:{}', \strlen($className), $className); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/AbstractFixerTest.php
tests/AbstractFixerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\AbstractFixer; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\WhitespacesFixerConfig; /** * @internal * * @covers \PhpCsFixer\AbstractFixer * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class AbstractFixerTest extends TestCase { public function testDefaults(): void { $fixer = $this->createUnconfigurableFixerDouble(); self::assertFalse($fixer->isRisky()); self::assertTrue($fixer->supports(new \SplFileInfo(__FILE__))); } public function testSetWhitespacesConfigUnconfigurable(): void { $fixer = $this->createUnconfigurableFixerDouble(); $this->expectException(\LogicException::class); $this->expectExceptionMessage('Cannot run method for class not implementing "PhpCsFixer\Fixer\WhitespacesAwareFixerInterface".'); $fixer->setWhitespacesConfig(new WhitespacesFixerConfig()); } public function testGetWhitespacesFixerConfig(): void { $fixer = $this->createWhitespacesAwareFixerDouble(); $config = \Closure::bind(static fn ($fixer): WhitespacesFixerConfig => $fixer->whitespacesConfig, null, AbstractFixer::class)($fixer); self::assertSame(' ', $config->getIndent()); self::assertSame("\n", $config->getLineEnding()); $newConfig = new WhitespacesFixerConfig("\t", "\r\n"); $fixer->setWhitespacesConfig($newConfig); $config = \Closure::bind(static fn ($fixer): WhitespacesFixerConfig => $fixer->whitespacesConfig, null, AbstractFixer::class)($fixer); self::assertSame("\t", $config->getIndent()); self::assertSame("\r\n", $config->getLineEnding()); } private function createWhitespacesAwareFixerDouble(): WhitespacesAwareFixerInterface { return new class extends AbstractFixer implements WhitespacesAwareFixerInterface { public function getDefinition(): FixerDefinitionInterface { throw new \BadMethodCallException('Not implemented.'); } public function isCandidate(Tokens $tokens): bool { throw new \BadMethodCallException('Not implemented.'); } protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { throw new \BadMethodCallException('Not implemented.'); } }; } private function createUnconfigurableFixerDouble(): AbstractFixer { return new class extends AbstractFixer { public function getDefinition(): FixerDefinitionInterface { throw new \LogicException('Not implemented.'); } public function isCandidate(Tokens $tokens): bool { return true; } protected function applyFix(\SplFileInfo $file, Tokens $tokens): void {} }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/RuleSetNameValidatorTest.php
tests/RuleSetNameValidatorTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\RuleSetNameValidator; /** * @internal * * @coversNothing * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class RuleSetNameValidatorTest extends TestCase { /** * @dataProvider provideValidNamesCases */ public function testValidNames(string $name, bool $isCustom): void { self::assertTrue(RuleSetNameValidator::isValid($name, $isCustom)); } /** * @return iterable<string, array{0: string, 1: bool}> */ public static function provideValidNamesCases(): iterable { yield 'Built-in' => ['@Foo', false]; yield 'Built-in lowercase' => ['@foo', false]; yield 'Built-in risky' => ['@Foo:risky', false]; yield 'Built-in with sub-namespace' => ['@PhpCsFixer/testing', false]; yield 'Built-in with sub-namespace + risky' => ['@PhpCsFixer/testing:risky', false]; yield 'Built-in with dot-based namespace' => ['@PhpCsFixer.testing', false]; yield 'Built-in with hyphen' => ['@PER-CS', false]; yield 'Simple name' => ['@Vendor/MyRules', true]; yield 'Simple name risky' => ['@Vendor/MyRules:risky', true]; yield 'Versioned with dash and X.Y' => ['@Vendor/MyRules-1.0', true]; yield 'Versioned with underscores' => ['@Vendor/MyRules_1_0', true]; yield 'Short name 1' => ['@Vendor/X', true]; yield 'Short name 2' => ['@Vendor/y', true]; yield 'Short name lowercase' => ['@vendor/y', true]; } /** * @dataProvider provideInvalidNamesCases */ public function testInvalidNames(string $name, bool $isCustom): void { self::assertFalse(RuleSetNameValidator::isValid($name, $isCustom)); } /** * @return iterable<string, array{0: string, 1: bool}> */ public static function provideInvalidNamesCases(): iterable { yield 'Built-in without @' => ['Foo', false]; yield 'Built-in with invalid :suffix' => ['Foo:bar', false]; yield 'Built-in starting with number' => ['@100rules', false]; yield 'Built-in containing @ in the middle' => ['@Foo@Bar', false]; yield 'Does not start with @' => ['Vendor/MyRules', true]; yield 'Contains comma 1' => ['MyRules,', true]; yield 'Contains comma 2' => ['@MyRules,', true]; yield 'Contains hash' => ['@MyRules#', true]; yield 'Uses PhpCsFixer as part of vendor' => ['@PhpCsFixerExtensions', true]; yield 'Uses PhpCsFixer as part of vendor, with subnamespace' => ['@PhpCsFixerExtensions/CS', true]; yield 'Invalid :suffix' => ['@Vendor/CS:custom', true]; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/AbstractProxyFixerTest.php
tests/AbstractProxyFixerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\AbstractProxyFixer; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\WhitespacesFixerConfig; /** * @internal * * @covers \PhpCsFixer\AbstractProxyFixer * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class AbstractProxyFixerTest extends TestCase { public function testCandidate(): void { $proxyFixer = $this->createProxyFixerDouble([$this->createFixerDouble(true)]); self::assertTrue($proxyFixer->isCandidate(new Tokens())); $proxyFixer = $this->createProxyFixerDouble([$this->createFixerDouble(false)]); self::assertFalse($proxyFixer->isCandidate(new Tokens())); $proxyFixer = $this->createProxyFixerDouble([ $this->createFixerDouble(false), $this->createFixerDouble(true), ]); self::assertTrue($proxyFixer->isCandidate(new Tokens())); } public function testRisky(): void { $proxyFixer = $this->createProxyFixerDouble([$this->createFixerDouble(true, false)]); self::assertFalse($proxyFixer->isRisky()); $proxyFixer = $this->createProxyFixerDouble([$this->createFixerDouble(true, true)]); self::assertTrue($proxyFixer->isRisky()); $proxyFixer = $this->createProxyFixerDouble([ $this->createFixerDouble(true, false), $this->createFixerDouble(true, true), $this->createFixerDouble(true, false), ]); self::assertTrue($proxyFixer->isRisky()); } public function testSupports(): void { $file = new \SplFileInfo(__FILE__); $proxyFixer = $this->createProxyFixerDouble([$this->createFixerDouble(true, false, false)]); self::assertFalse($proxyFixer->supports($file)); $proxyFixer = $this->createProxyFixerDouble([$this->createFixerDouble(true, true, true)]); self::assertTrue($proxyFixer->supports($file)); $proxyFixer = $this->createProxyFixerDouble([ $this->createFixerDouble(true, false, false), $this->createFixerDouble(true, true, false), $this->createFixerDouble(true, false, true), ]); self::assertTrue($proxyFixer->supports($file)); } public function testPrioritySingleFixer(): void { $proxyFixer = $this->createProxyFixerDouble([ $this->createFixerDouble(true, false, false, 123), ]); self::assertSame(123, $proxyFixer->getPriority()); } public function testPriorityMultipleFixersNotSet(): void { $proxyFixer = $this->createProxyFixerDouble([ $this->createFixerDouble(true), $this->createFixerDouble(true, true), $this->createFixerDouble(true, false, true), ]); $this->expectException(\LogicException::class); $this->expectExceptionMessage('You need to override this method to provide the priority of combined fixers.'); $proxyFixer->getPriority(); } public function testWhitespacesConfig(): void { $config = new WhitespacesFixerConfig(); $whitespacesAwareFixer = $this->createWhitespacesAwareFixerDouble(); $proxyFixer = $this->createProxyFixerDouble([ $this->createFixerDouble(true, true), $whitespacesAwareFixer, $this->createFixerDouble(true, false, true), ]); $proxyFixer->setWhitespacesConfig($config); self::assertSame( $config, \Closure::bind(static fn ($fixer): WhitespacesFixerConfig => $fixer->whitespacesConfig, null, \get_class($whitespacesAwareFixer))($whitespacesAwareFixer), ); } public function testApplyFixInPriorityOrder(): void { $fixer1 = $this->createFixerDouble(true, false, true, 1); $fixer2 = $this->createFixerDouble(true, false, true, 10); $proxyFixer = $this->createProxyFixerDouble([$fixer1, $fixer2]); $proxyFixer->fix(new \SplFileInfo(__FILE__), Tokens::fromCode('<?php echo 1;')); self::assertSame(2, \Closure::bind(static fn ($fixer): int => $fixer->fixCalled, null, \get_class($fixer1))($fixer1)); self::assertSame(1, \Closure::bind(static fn ($fixer): int => $fixer->fixCalled, null, \get_class($fixer2))($fixer2)); } private function createFixerDouble( bool $isCandidate, bool $isRisky = false, bool $supports = false, int $priority = 999 ): FixerInterface { return new class($isCandidate, $isRisky, $supports, $priority) implements FixerInterface { private bool $isCandidate; private bool $isRisky; private bool $supports; private int $priority; private int $fixCalled = 0; private static int $callCount = 1; public function __construct(bool $isCandidate, bool $isRisky, bool $supports, int $priority) { $this->isCandidate = $isCandidate; $this->isRisky = $isRisky; $this->supports = $supports; $this->priority = $priority; } public function fix(\SplFileInfo $file, Tokens $tokens): void { if (0 !== $this->fixCalled) { throw new \RuntimeException('Fixer called multiple times.'); } $this->fixCalled = self::$callCount; ++self::$callCount; } public function getDefinition(): FixerDefinitionInterface { throw new \BadMethodCallException('Not implemented.'); } public function getName(): string { return uniqid('abstract_proxy_test_'); } public function getPriority(): int { return $this->priority; } public function isCandidate(Tokens $tokens): bool { return $this->isCandidate; } public function isRisky(): bool { return $this->isRisky; } public function supports(\SplFileInfo $file): bool { return $this->supports; } }; } private function createWhitespacesAwareFixerDouble(): WhitespacesAwareFixerInterface { return new class implements WhitespacesAwareFixerInterface { /** @phpstan-ignore-next-line to not complain that property is never read */ private WhitespacesFixerConfig $whitespacesConfig; public function getDefinition(): FixerDefinitionInterface { throw new \BadMethodCallException('Not implemented.'); } public function fix(\SplFileInfo $file, Tokens $tokens): void { throw new \BadMethodCallException('Not implemented.'); } public function getName(): string { return uniqid('abstract_proxy_aware_test_'); } public function getPriority(): int { return 1; } public function isCandidate(Tokens $tokens): bool { throw new \BadMethodCallException('Not implemented.'); } public function isRisky(): bool { throw new \BadMethodCallException('Not implemented.'); } public function setWhitespacesConfig(WhitespacesFixerConfig $config): void { $this->whitespacesConfig = $config; } public function supports(\SplFileInfo $file): bool { throw new \BadMethodCallException('Not implemented.'); } }; } /** * @param non-empty-list<FixerInterface> $fixers */ private function createProxyFixerDouble(array $fixers): AbstractProxyFixer { return new class($fixers) extends AbstractProxyFixer implements WhitespacesAwareFixerInterface { /** * @var non-empty-list<FixerInterface> */ private array $fixers; /** * @param non-empty-list<FixerInterface> $fixers */ public function __construct(array $fixers) { $this->fixers = $fixers; parent::__construct(); } public function getDefinition(): FixerDefinitionInterface { throw new \BadMethodCallException('Not implemented.'); } protected function createProxyFixers(): array { return $this->fixers; } }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/FinderTest.php
tests/FinderTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Finder; use Symfony\Component\Finder\SplFileInfo; /** * @internal * * @covers \PhpCsFixer\Finder * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FinderTest extends TestCase { public function testThatDefaultFinderDoesNotSpecifyAnyDirectory(): void { $this->expectException(\LogicException::class); $this->expectExceptionMessageMatches('/^You must call (?:the in\(\) method)|(?:one of in\(\) or append\(\)) methods before iterating over a Finder\.$/'); $finder = Finder::create(); $finder->getIterator(); } public function testThatFinderFindsDotFilesWhenConfigured(): void { $finder = Finder::create() ->in(__DIR__.'/..') ->depth(0) ->ignoreDotFiles(false) ; self::assertContains( realpath(__DIR__.'/../.php-cs-fixer.dist.php'), array_map( static fn (SplFileInfo $file): string => $file->getRealPath(), iterator_to_array($finder->getIterator()), ), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/ExecutorWithoutErrorHandlerExceptionTest.php
tests/ExecutorWithoutErrorHandlerExceptionTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\ExecutorWithoutErrorHandlerException; /** * @internal * * @covers \PhpCsFixer\ExecutorWithoutErrorHandlerException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ExecutorWithoutErrorHandlerExceptionTest extends TestCase { public function testIsRuntimeException(): void { $exception = new ExecutorWithoutErrorHandlerException('foo', 123); self::assertSame('foo', $exception->getMessage()); self::assertSame(123, $exception->getCode()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/FileRemovalTest.php
tests/FileRemovalTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStreamDirectory; use PhpCsFixer\FileRemoval; /** * @author ntzm * * @internal * * @covers \PhpCsFixer\FileRemoval * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FileRemovalTest extends TestCase { /** * Should temporary files be removed on tear down? * * This is necessary for testShutdownRemovesObserved files, as the setup * runs in a separate process to trigger the shutdown function, and * tearDownAfterClass is called for every separate process */ private static bool $removeFilesOnTearDown = true; public static function tearDownAfterClass(): void { if (self::$removeFilesOnTearDown) { @unlink(sys_get_temp_dir().'/cs_fixer_foo.php'); @unlink(sys_get_temp_dir().'/cs_fixer_bar.php'); } parent::tearDownAfterClass(); } public function testCleanRemovesObservedFiles(): void { $fs = $this->getMockFileSystem(); $fileRemoval = new FileRemoval(); $fileRemoval->observe($fs->url().'/foo.php'); $fileRemoval->observe($fs->url().'/baz.php'); $fileRemoval->clean(); self::assertFileDoesNotExist($fs->url().'/foo.php'); self::assertFileDoesNotExist($fs->url().'/baz.php'); self::assertFileExists($fs->url().'/bar.php'); } public function testDestructRemovesObservedFiles(): void { $fs = $this->getMockFileSystem(); $fileRemoval = new FileRemoval(); $fileRemoval->observe($fs->url().'/foo.php'); $fileRemoval->observe($fs->url().'/baz.php'); $fileRemoval->__destruct(); self::assertFileDoesNotExist($fs->url().'/foo.php'); self::assertFileDoesNotExist($fs->url().'/baz.php'); self::assertFileExists($fs->url().'/bar.php'); } public function testDeleteObservedFile(): void { $fs = $this->getMockFileSystem(); $fileRemoval = new FileRemoval(); $fileRemoval->observe($fs->url().'/foo.php'); $fileRemoval->observe($fs->url().'/baz.php'); $fileRemoval->delete($fs->url().'/foo.php'); self::assertFileDoesNotExist($fs->url().'/foo.php'); self::assertFileExists($fs->url().'/baz.php'); } public function testDeleteNonObservedFile(): void { $fs = $this->getMockFileSystem(); $fileRemoval = new FileRemoval(); $fileRemoval->delete($fs->url().'/foo.php'); self::assertFileDoesNotExist($fs->url().'/foo.php'); } public function testSerialize(): void { $fileRemoval = new FileRemoval(); $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Cannot serialize '.FileRemoval::class); serialize($fileRemoval); } public function testUnserialize(): void { $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Cannot unserialize '.FileRemoval::class); unserialize(self::createSerializedStringOfClassName(FileRemoval::class)); } /** * Must NOT be run as first test, see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7104. * * @runInSeparateProcess * * @preserveGlobalState disabled * * @doesNotPerformAssertions */ public function testShutdownRemovesObservedFilesSetup(): void { self::$removeFilesOnTearDown = false; $fileToBeDeleted = sys_get_temp_dir().'/cs_fixer_foo.php'; $fileNotToBeDeleted = sys_get_temp_dir().'/cs_fixer_bar.php'; file_put_contents($fileToBeDeleted, ''); file_put_contents($fileNotToBeDeleted, ''); $fileRemoval = new FileRemoval(); $fileRemoval->observe($fileToBeDeleted); } /** * @depends testShutdownRemovesObservedFilesSetup */ public function testShutdownRemovesObservedFiles(): void { self::assertFileDoesNotExist(sys_get_temp_dir().'/cs_fixer_foo.php'); self::assertFileExists(sys_get_temp_dir().'/cs_fixer_bar.php'); } private function getMockFileSystem(): vfsStreamDirectory { return vfsStream::setup('root', null, [ 'foo.php' => '', 'bar.php' => '', 'baz.php' => '', ]); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/ExecutorWithoutErrorHandlerTest.php
tests/ExecutorWithoutErrorHandlerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\ExecutorWithoutErrorHandler; use PhpCsFixer\ExecutorWithoutErrorHandlerException; /** * @internal * * @covers \PhpCsFixer\ExecutorWithoutErrorHandler * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ExecutorWithoutErrorHandlerTest extends TestCase { public function testWithError(): void { $this->expectException(ExecutorWithoutErrorHandlerException::class); $this->expectExceptionMessageMatches('/failed to open stream: No such file or directory/i'); ExecutorWithoutErrorHandler::execute(static fn () => fopen(__DIR__.'/404', 'r')); } public function testWithoutError(): void { self::assertTrue( ExecutorWithoutErrorHandler::execute(static fn () => is_readable(__DIR__)), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/WhitespacesFixerConfigTest.php
tests/WhitespacesFixerConfigTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\WhitespacesFixerConfig; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\WhitespacesFixerConfig * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class WhitespacesFixerConfigTest extends TestCase { /** * @param non-empty-string $indent * @param non-empty-string $lineEnding * @param ?non-empty-string $exceptionRegExp * * @dataProvider provideFixCases */ public function testFix(string $indent, string $lineEnding, ?string $exceptionRegExp = null): void { if (null !== $exceptionRegExp) { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessageMatches('%^'.preg_quote($exceptionRegExp, '%').'$%'); } $config = new WhitespacesFixerConfig($indent, $lineEnding); self::assertSame($indent, $config->getIndent()); self::assertSame($lineEnding, $config->getLineEnding()); } /** * @return iterable<int, array{0: non-empty-string, 1: non-empty-string, 2?: non-empty-string}> */ public static function provideFixCases(): iterable { yield [' ', "\n"]; yield ["\t", "\n"]; yield [' ', "\r\n"]; yield ["\t", "\r\n"]; yield [' ', 'asd', 'Invalid "lineEnding" param, expected "\n" or "\r\n".']; yield ['std', "\n", 'Invalid "indent" param, expected tab or two or four spaces.']; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/AbstractFunctionReferenceFixerTest.php
tests/AbstractFunctionReferenceFixerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\AbstractFunctionReferenceFixer; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Tokenizer\Tokens; /** * @internal * * @covers \PhpCsFixer\AbstractFunctionReferenceFixer * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class AbstractFunctionReferenceFixerTest extends TestCase { /** * @param null|list<int> $expected * * @dataProvider provideAbstractFunctionReferenceFixerCases */ public function testAbstractFunctionReferenceFixer( ?array $expected, string $source, string $functionNameToSearch, int $start = 0, ?int $end = null ): void { $fixer = $this->createAbstractFunctionReferenceFixerDouble(); self::assertTrue($fixer->isRisky()); $tokens = Tokens::fromCode($source); self::assertSame( $expected, \Closure::bind(static fn (AbstractFunctionReferenceFixer $fixer): ?array => $fixer->find( $functionNameToSearch, $tokens, $start, $end, ), null, AbstractFunctionReferenceFixer::class)($fixer), ); self::assertFalse($tokens->isChanged()); } /** * @return iterable<string, array{0: null|list<int>, 1: string, 2: string, 3?: int}> */ public static function provideAbstractFunctionReferenceFixerCases(): iterable { yield 'simple case I' => [ [1, 2, 3], '<?php foo();', 'foo', ]; yield 'simple case II' => [ [2, 3, 4], '<?php \foo();', 'foo', ]; yield 'test start offset' => [ null, '<?php foo(); bar(); ', 'foo', 5, ]; yield 'test returns only the first candidate' => [ [2, 3, 4], '<?php foo(); foo(); foo(); foo(); foo(); ', 'foo', ]; yield 'not found I' => [ null, '<?php foo();', 'bar', ]; yield 'not found II' => [ null, '<?php $foo();', 'foo', ]; yield 'not found III' => [ null, '<?php function foo(){}', 'foo', ]; yield 'not found IIIb' => [ null, '<?php function foo($a){}', 'foo', ]; yield 'not found IV' => [ null, '<?php \A\foo();', 'foo', ]; } private function createAbstractFunctionReferenceFixerDouble(): AbstractFunctionReferenceFixer { return new class extends AbstractFunctionReferenceFixer { public function getDefinition(): FixerDefinitionInterface { throw new \BadMethodCallException('Not implemented.'); } public function isCandidate(Tokens $tokens): bool { throw new \BadMethodCallException('Not implemented.'); } protected function applyFix(\SplFileInfo $file, Tokens $tokens): void { throw new \BadMethodCallException('Not implemented.'); } }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/PregTest.php
tests/PregTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Preg; use PhpCsFixer\PregException; /** * @author Kuba Werłos <werlos@gmail.com> * * @covers \PhpCsFixer\Preg * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class PregTest extends TestCase { public function testMatchFailing(): void { $this->expectException(PregException::class); $this->expectExceptionMessage('Preg::match(): Invalid PCRE pattern ""'); Preg::match('', 'foo'); } /** * @dataProvider provideCommonCases */ public function testMatch(string $pattern, string $subject): void { $expectedResult = 1 === preg_match($pattern, $subject, $expectedMatches); $actualResult = Preg::match($pattern, $subject, $actualMatches); self::assertSame($expectedResult, $actualResult); self::assertSame($expectedMatches, $actualMatches); } /** * @dataProvider providePatternValidationCases * * @param null|class-string<\Throwable> $expectedException */ public function testPatternValidation(string $pattern, ?bool $expected = null, ?string $expectedException = null, ?string $expectedMessage = null): void { $setup = function () use ($expectedException, $expectedMessage): bool { $i = 0; if (null !== $expectedException) { ++$i; $this->expectException($expectedException); } if (null !== $expectedMessage) { ++$i; $this->expectExceptionMessageMatches($expectedMessage); } return 0 !== $i; }; try { $actual = Preg::match($pattern, "The quick brown \xFF\x00\\xXX jumps over the lazy dog\n"); } catch (\Exception $ex) { $setup(); throw $ex; } if (null !== $expected) { self::assertSame($expected, $actual); return; } if (!$setup()) { $this->addToAssertionCount(1); } } /** * @dataProvider providePatternValidationCases * * @param null|class-string<\Throwable> $expectedException */ public function testPatternsValidation(string $pattern, ?bool $expected = null, ?string $expectedException = null, ?string $expectedMessage = null): void { $setup = function () use ($expectedException, $expectedMessage): bool { $i = 0; if (null !== $expectedException) { ++$i; $this->expectException($expectedException); } if (null !== $expectedMessage) { ++$i; $this->expectExceptionMessageMatches($expectedMessage); } return (bool) $i; }; try { $buffer = "The quick brown \xFF\x00\\xXX jumps over the lazy dog\n"; $actual = $buffer !== Preg::replace($pattern, 'abc', $buffer); } catch (\Exception $ex) { $setup(); throw $ex; } if (null !== $expected) { self::assertSame($expected, $actual); return; } if (!$setup()) { $this->addToAssertionCount(1); } } /** * @return iterable<string, array{0: string, 1: null|bool, 2?: string, 3?: string}> */ public static function providePatternValidationCases(): iterable { yield 'invalid_blank' => ['', null, PregException::class]; yield 'invalid_open' => ["\1", null, PregException::class, "/'\x01' found/"]; yield 'valid_control_character_delimiter' => ["\1\1", true]; yield 'invalid_control_character_modifier' => ["\1\1\1", null, PregException::class, '/ Unknown modifier|Invalid PCRE pattern /']; yield 'valid_slate' => ['//', true]; yield 'valid_paired' => ['()', true]; yield 'paired_non_utf8_only' => ["((*UTF8)\xFF)", null, PregException::class, '/UTF-8/']; yield 'valid_paired_non_utf8_only' => ["(\xFF)", true]; yield 'php_version_dependent' => ['([\R])', false, PregException::class, '/Compilation failed: escape sequence is invalid/']; yield 'null_byte_injection' => ['()'."\0", null, PregException::class, '/NUL( byte)? is not a valid modifier|Null byte in regex/']; } public function testMatchAllFailing(): void { $this->expectException(PregException::class); $this->expectExceptionMessage('Preg::matchAll(): Invalid PCRE pattern ""'); Preg::matchAll('', 'foo'); } /** * @dataProvider provideCommonCases */ public function testMatchAll(string $pattern, string $subject): void { $expectedResult = preg_match_all($pattern, $subject, $expectedMatches); $actualResult = Preg::matchAll($pattern, $subject, $actualMatches); self::assertSame($expectedResult, $actualResult); self::assertSame($expectedMatches, $actualMatches); } public function testReplaceFailing(): void { $this->expectException(PregException::class); $this->expectExceptionMessageMatches('~\Q\Preg::replace()\E: Invalid PCRE pattern "": \(code: \d+\) [^(]+ \(version: \d+~'); Preg::replace('', 'foo', 'bar'); } /** * @dataProvider provideCommonCases */ public function testReplace(string $pattern, string $subject): void { $expectedResult = preg_replace($pattern, 'foo', $subject); $actualResult = Preg::replace($pattern, 'foo', $subject); self::assertSame($expectedResult, $actualResult); } public function testReplaceCallbackFailing(): void { $this->expectException(PregException::class); $this->expectExceptionMessage('Preg::replaceCallback(): Invalid PCRE pattern ""'); Preg::replaceCallback('', 'sort', 'foo'); } /** * @dataProvider provideCommonCases */ public function testReplaceCallback(string $pattern, string $subject): void { $callback = static fn (array $x): string => implode('-', $x); $expectedResult = preg_replace_callback($pattern, $callback, $subject); $actualResult = Preg::replaceCallback($pattern, $callback, $subject); self::assertSame($expectedResult, $actualResult); } public function testSplitFailing(): void { $this->expectException(PregException::class); $this->expectExceptionMessage('Preg::split(): Invalid PCRE pattern ""'); Preg::split('', 'foo'); } /** * @dataProvider provideCommonCases */ public function testSplit(string $pattern, string $subject): void { $expectedResult = preg_split($pattern, $subject); $actualResult = Preg::split($pattern, $subject); self::assertSame($expectedResult, $actualResult); } /** * @return iterable<int, array{string, string}> */ public static function provideCommonCases(): iterable { yield ['/u/u', 'u']; yield ['/u/u', 'u/u']; yield ['/./', \chr(224).'bc']; yield ['/à/', 'àbc']; yield ['/'.\chr(224).'|í/', 'àbc']; } public function testCorrectnessForUtf8String(): void { $pattern = '/./'; $subject = 'àbc'; Preg::match($pattern, $subject, $methodMatches); preg_match($pattern, $subject, $functionMatches); self::assertSame(['à'], $methodMatches); self::assertNotSame(['à'], $functionMatches); } public function testCorrectnessForNonUtf8String(): void { $pattern = '/./u'; $subject = \chr(224).'bc'; Preg::match($pattern, $subject, $methodMatches); preg_match($pattern, $subject, $functionMatches); self::assertSame([\chr(224)], $methodMatches); self::assertNotSame([\chr(224)], $functionMatches); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/TextDiffTest.php
tests/TextDiffTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Console\Command\FixCommand; use PhpCsFixer\Console\ConfigurationResolver; use PhpCsFixer\Console\Report\FixReport\ReporterFactory; use PhpCsFixer\ToolInfo; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; /** * @internal * * @coversNothing * * @group covers-nothing * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class TextDiffTest extends TestCase { /** * @dataProvider provideDiffReportingDecoratedCases */ public function testDiffReportingDecorated(string $expected, string $format, bool $isDecorated): void { $command = new FixCommand(new ToolInfo()); $commandTester = new CommandTester($command); $commandTester->execute( [ 'path' => [__DIR__.'/Fixtures/FixCommand/TextDiffTestInput.php'], '--diff' => true, '--dry-run' => true, '--format' => $format, '--rules' => 'cast_spaces', '--using-cache' => 'no', '--config' => ConfigurationResolver::IGNORE_CONFIG_FILE, ], [ 'decorated' => $isDecorated, 'interactive' => false, 'verbosity' => OutputInterface::VERBOSITY_NORMAL, ], ); if ($isDecorated !== $commandTester->getOutput()->isDecorated()) { self::markTestSkipped(\sprintf('Output should %sbe decorated.', $isDecorated ? '' : 'not ')); } if ($isDecorated !== $commandTester->getOutput()->getFormatter()->isDecorated()) { self::markTestSkipped(\sprintf('Formatter should %sbe decorated.', $isDecorated ? '' : 'not ')); } self::assertStringMatchesFormat($expected, $commandTester->getDisplay(false)); } /** * @return iterable<int, array{string, string, bool}> */ public static function provideDiffReportingDecoratedCases(): iterable { $expected = <<<'TEST' %A$output->writeln('<error>'.(int)$output.'</error>');%A %A$output->writeln('<error>'.(int) $output.'</error>');%A %A$output->writeln('<error> TEST </error>');%A %A$output->writeln('<error>'.(int)$output.'</error>');%A %A$output->writeln('<error>'.(int) $output.'</error>');%A TEST; foreach (['txt', 'xml', 'junit'] as $format) { yield [$expected, $format, true]; yield [$expected, $format, false]; } $expected = substr(json_encode($expected, \JSON_THROW_ON_ERROR), 1, -1); yield [$expected, 'json', true]; yield [$expected, 'json', false]; } /** * Test to make sure @see TextDiffTest::provideDiffReportingCases covers all formats. */ public function testAllFormatsCovered(): void { $factory = new ReporterFactory(); $formats = $factory->registerBuiltInReporters()->getFormats(); sort($formats); self::assertSame( ['checkstyle', 'gitlab', 'json', 'junit', 'txt', 'xml'], $formats, ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/UtilsTest.php
tests/UtilsTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\FixerDefinition\FixerDefinitionInterface; use PhpCsFixer\Preg; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; use PhpCsFixer\Utils; /** * @phpstan-import-type _PhpTokenPrototype from Token * * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * @author Graham Campbell <hello@gjcampbell.co.uk> * @author Odín del Río <odin.drp@gmail.com> * * @internal * * @covers \PhpCsFixer\Utils * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class UtilsTest extends TestCase { /** * @param string $expected Camel case string * * @dataProvider provideCamelCaseToUnderscoreCases */ public function testCamelCaseToUnderscore(string $expected, ?string $input = null): void { if (null !== $input) { self::assertSame($expected, Utils::camelCaseToUnderscore($input)); } self::assertSame($expected, Utils::camelCaseToUnderscore($expected)); } /** * @return iterable<int, array{0: string, 1?: string}> */ public static function provideCamelCaseToUnderscoreCases(): iterable { yield [ 'dollar_close_curly_braces', 'DollarCloseCurlyBraces', ]; yield [ 'utf8_encoder_fixer', 'utf8EncoderFixer', ]; yield [ 'terminated_with_number10', 'TerminatedWithNumber10', ]; yield [ 'utf8_encoder_fixer', ]; yield [ 'a', 'A', ]; yield [ 'aa', 'AA', ]; yield [ 'foo', 'FOO', ]; yield [ 'foo_bar_baz', 'FooBarBAZ', ]; yield [ 'foo_bar_baz', 'FooBARBaz', ]; yield [ 'foo_bar_baz', 'FOOBarBaz', ]; yield [ 'mr_t', 'MrT', ]; yield [ 'voyage_éclair', 'VoyageÉclair', ]; yield [ 'i_want_to_fully_be_a_snake', 'i_wantTo_fully_be_A_Snake', ]; } /** * @param _PhpTokenPrototype $input token prototype * * @dataProvider provideCalculateTrailingWhitespaceIndentCases */ public function testCalculateTrailingWhitespaceIndent(string $spaces, $input): void { $token = new Token($input); self::assertSame($spaces, Utils::calculateTrailingWhitespaceIndent($token)); } /** * @return iterable<int, array{string, _PhpTokenPrototype}> */ public static function provideCalculateTrailingWhitespaceIndentCases(): iterable { yield [' ', [\T_WHITESPACE, "\n\n "]]; yield [' ', [\T_WHITESPACE, "\r\n\r\r\r "]]; yield ["\t", [\T_WHITESPACE, "\r\n\t"]]; yield ['', [\T_WHITESPACE, "\t\n\r"]]; yield ['', [\T_WHITESPACE, "\n"]]; yield ['', '']; } public function testCalculateTrailingWhitespaceIndentFail(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The given token must be whitespace, got "T_STRING".'); $token = new Token([\T_STRING, 'foo']); Utils::calculateTrailingWhitespaceIndent($token); } /** * @param list<mixed> $expected * @param list<mixed> $elements * * @dataProvider provideStableSortCases */ public function testStableSort( array $expected, array $elements, callable $getComparableValueCallback, callable $compareValuesCallback ): void { self::assertSame( $expected, Utils::stableSort($elements, $getComparableValueCallback, $compareValuesCallback), ); } /** * @return iterable<int, array{list<mixed>, list<mixed>, callable, callable}> */ public static function provideStableSortCases(): iterable { yield [ ['a', 'b', 'c', 'd', 'e'], ['b', 'd', 'e', 'a', 'c'], static fn ($element) => $element, 'strcmp', ]; yield [ ['b', 'd', 'e', 'a', 'c'], ['b', 'd', 'e', 'a', 'c'], static fn (): string => 'foo', 'strcmp', ]; yield [ ['b', 'd', 'e', 'a', 'c'], ['b', 'd', 'e', 'a', 'c'], static fn ($element) => $element, static fn (): int => 0, ]; yield [ ['bar1', 'baz1', 'foo1', 'bar2', 'baz2', 'foo2'], ['foo1', 'foo2', 'bar1', 'bar2', 'baz1', 'baz2'], static fn ($element) => Preg::replace('/([a-z]+)(\d+)/', '$2$1', $element), 'strcmp', ]; } public function testSortFixers(): void { $fixers = [ $this->createFixerDouble('f1', 0), $this->createFixerDouble('f2', -10), $this->createFixerDouble('f3', 10), $this->createFixerDouble('f4', -10), ]; self::assertSame( [ $fixers[2], $fixers[0], $fixers[1], $fixers[3], ], Utils::sortFixers($fixers), ); } public function testNaturalLanguageJoinThrowsInvalidArgumentExceptionForEmptyArray(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Array of names cannot be empty.'); Utils::naturalLanguageJoin([]); } public function testNaturalLanguageJoinThrowsInvalidArgumentExceptionForMoreThanOneCharWrapper(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Wrapper should be a single-char string or empty.'); Utils::naturalLanguageJoin(['a', 'b'], 'foo'); } /** * @dataProvider provideNaturalLanguageJoinCases * * @param list<string> $names */ public function testNaturalLanguageJoin(string $joined, array $names, string $wrapper = '"', ?string $lastJoin = null): void { self::assertSame($joined, Utils::naturalLanguageJoin($names, $wrapper, ...null === $lastJoin ? [] : [$lastJoin])); } /** * @return iterable<int, array{0: string, 1: list<string>, 2?: string, 3?: string}> */ public static function provideNaturalLanguageJoinCases(): iterable { yield [ '"a"', ['a'], ]; yield [ '"a" and "b"', ['a', 'b'], ]; yield [ '"a", "b" and "c"', ['a', 'b', 'c'], ]; yield [ '\'a\'', ['a'], '\'', ]; yield [ '\'a\' and \'b\'', ['a', 'b'], '\'', ]; yield [ '\'a\', \'b\' and \'c\'', ['a', 'b', 'c'], '\'', ]; yield [ '?a?', ['a'], '?', ]; yield [ '?a? and ?b?', ['a', 'b'], '?', ]; yield [ '?a?, ?b? and ?c?', ['a', 'b', 'c'], '?', ]; yield [ 'a', ['a'], '', ]; yield [ 'a and b', ['a', 'b'], '', ]; yield [ 'a, b and c', ['a', 'b', 'c'], '', ]; yield [ '"a"', ['a'], '"', 'or', ]; yield [ '"a" or "b"', ['a', 'b'], '"', 'or', ]; yield [ '"a", "b" or "c"', ['a', 'b', 'c'], '"', 'or', ]; } public function testNaturalLanguageJoinWithBackticksThrowsInvalidArgumentExceptionForEmptyArray(): void { $this->expectException(\InvalidArgumentException::class); Utils::naturalLanguageJoinWithBackticks([]); } /** * @param list<string> $names * * @dataProvider provideNaturalLanguageJoinWithBackticksCases */ public function testNaturalLanguageJoinWithBackticks(string $joined, array $names, ?string $lastJoin = null): void { self::assertSame($joined, Utils::naturalLanguageJoinWithBackticks($names, ...null === $lastJoin ? [] : [$lastJoin])); } /** * @return iterable<int, array{0: string, 1: list<string>, 2?: string}> */ public static function provideNaturalLanguageJoinWithBackticksCases(): iterable { yield [ '`a`', ['a'], ]; yield [ '`a` and `b`', ['a', 'b'], ]; yield [ '`a`, `b` and `c`', ['a', 'b', 'c'], ]; yield [ '`a`', ['a'], 'or', ]; yield [ '`a` or `b`', ['a', 'b'], 'or', ]; yield [ '`a`, `b` or `c`', ['a', 'b', 'c'], 'or', ]; } /** * @param mixed $input * * @dataProvider provideToStringCases */ public function testToString(string $expected, $input): void { self::assertSame($expected, Utils::toString($input)); } /** * @return iterable<int, array{string, mixed}> */ public static function provideToStringCases(): iterable { yield ["['a' => 3, 'b' => 'c']", ['a' => 3, 'b' => 'c']]; yield ['[[1], [2]]', [[1], [2]]]; yield ['[0 => [1], \'a\' => [2]]', [[1], 'a' => [2]]]; yield ['[1, 2, \'foo\', null]', [1, 2, 'foo', null]]; yield ['[1, 2]', [1, 2]]; yield ['[]', []]; yield ['1.5', 1.5]; yield ['false', false]; yield ['true', true]; yield ['1', 1]; yield ["'foo'", 'foo']; } private function createFixerDouble(string $name, int $priority): FixerInterface { return new class($name, $priority) implements FixerInterface { private string $name; private int $priority; public function __construct(string $name, int $priority) { $this->name = $name; $this->priority = $priority; } public function isCandidate(Tokens $tokens): bool { throw new \LogicException('Not implemented.'); } public function isRisky(): bool { throw new \LogicException('Not implemented.'); } public function fix(\SplFileInfo $file, Tokens $tokens): void { throw new \LogicException('Not implemented.'); } public function getDefinition(): FixerDefinitionInterface { throw new \LogicException('Not implemented.'); } public function getName(): string { return $this->name; } public function getPriority(): int { return $this->priority; } public function supports(\SplFileInfo $file): bool { throw new \LogicException('Not implemented.'); } }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/FixerNameValidatorTest.php
tests/FixerNameValidatorTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\FixerNameValidator; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\FixerNameValidator * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FixerNameValidatorTest extends TestCase { /** * @dataProvider provideIsValidCases */ public function testIsValid(string $name, bool $isCustom, bool $isValid): void { $validator = new FixerNameValidator(); self::assertSame($isValid, $validator->isValid($name, $isCustom)); } /** * @return iterable<int, array{string, bool, bool}> */ public static function provideIsValidCases(): iterable { yield ['', true, false]; yield ['', false, false]; yield ['foo', true, false]; yield ['foo', false, true]; yield ['foo_bar', false, true]; yield ['foo_bar_4', false, true]; yield ['Foo', false, false]; yield ['fooBar', false, false]; yield ['4foo', false, false]; yield ['_foo', false, false]; yield ['4_foo', false, false]; yield ['vendor/foo', false, false]; yield ['bendor/foo', true, false]; yield ['Vendor/foo', true, true]; yield ['Vendor4/foo', true, true]; yield ['4vendor/foo', true, false]; yield ['FooBar/foo', true, true]; yield ['Foo-Bar/foo', true, false]; yield ['Foo_Bar/foo', true, false]; yield ['Foo/foo/bar', true, false]; yield ['/foo', true, false]; yield ['/foo', false, false]; yield ['/foo/bar', true, false]; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/bootstrap.php
tests/bootstrap.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ use PhpCsFixer\ComposerJsonReader; use PhpCsFixer\Documentation\FixerDocumentGenerator; require_once dirname(__DIR__).'/vendor/autoload.php'; // Call this to: // - populate the cache of `FixerDocumentGenerator`, // - trigger all the deprecations while pre-calculating internal cache of `FixerDocumentGenerator`, // so it will happen on a random test. // // The used argument is a random rule - it doesn't matter which one we call. FixerDocumentGenerator::getSetsOfRule('ordered_imports'); // @phpstan-ignore-line // drop the `ComposerJsonReader` instance created while populating `FixerDocumentGenerator` cache Closure::bind( static function (): void { ComposerJsonReader::$singleton = null; // @phpstan-ignore staticProperty.internalClass }, null, ComposerJsonReader::class, // @phpstan-ignore classConstant.internalClass )();
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/WordMatcherTest.php
tests/WordMatcherTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\WordMatcher; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\WordMatcher * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class WordMatcherTest extends TestCase { /** * @param list<string> $candidates * * @dataProvider provideMatchCases */ public function testMatch(?string $expected, string $needle, array $candidates): void { $matcher = new WordMatcher($candidates); self::assertSame($expected, $matcher->match($needle)); } /** * @return iterable<int, array{?string, string, list<string>}> */ public static function provideMatchCases(): iterable { yield [ null, 'foo', [ 'no_blank_lines_after_class_opening', 'no_blank_lines_after_phpdoc', ], ]; yield [ 'no_blank_lines_after_phpdoc', 'no_blank_lines_after_phpdocs', [ 'no_blank_lines_after_class_opening', 'no_blank_lines_after_phpdoc', ], ]; yield [ 'no_blank_lines_after_foo', 'no_blank_lines_foo', [ 'no_blank_lines_after_foo', 'no_blank_lines_before_foo', ], ]; yield [ null, 'braces', [ 'elseif', ], ]; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/ComposerJsonReaderTest.php
tests/ComposerJsonReaderTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\ComposerJsonReader; /** * @author ntzm * * @internal * * @covers \PhpCsFixer\ComposerJsonReader * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ComposerJsonReaderTest extends TestCase { public function testCreateSingleton(): void { $instance = ComposerJsonReader::createSingleton(); self::assertSame($instance, ComposerJsonReader::createSingleton()); } /** * @dataProvider provideGetPhpUnitCases */ public function testGetPhpUnit(?string $expected, string $inputJson): void { self::assertJson($inputJson); $instance = new ComposerJsonReader(); \Closure::bind( static fn ($instance) => $instance->processJson($inputJson), null, \get_class($instance), )($instance); self::assertSame($expected, $instance->getPhpUnit()); } /** * @return iterable<string, array{0: ?string, 1: string}> */ public static function provideGetPhpUnitCases(): iterable { yield 'no version' => [ null, '{ "require": {}, "require-dev": {} }', ]; yield 'dev-master' => [ null, '{ "require": {}, "require-dev": { "phpunit/phpunit": "dev-master" } }', ]; yield 'dev-master or normal version' => [ null, '{ "require": {}, "require-dev": { "phpunit/phpunit": "^10 || dev-master" } }', ]; yield 'regular version' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": "9.6" } }', ]; yield 'version with ^' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": "^9.6.25" } }', ]; yield 'version with ~' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": "~9.6.25" } }', ]; yield 'version with >' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": ">9.6.25" } }', ]; yield 'version with >=' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": ">=9.6.25" } }', ]; yield 'version with >= and a space' => [ '9.6', '{ "require-dev": { "phpunit/phpunit": ">= 9.6.25" } }', ]; yield 'version with <' => [ null, // not supported ! '{ "require": {}, "require-dev": { "phpunit/phpunit": "^8 || <9.6.25" } }', ]; yield 'version with < but combined with normal version' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": "^10 || ^9.1 <9.6.25" } }', ]; yield 'version with range separated by a space' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": ">=9.1 <9.6.25" } }', ]; yield 'version with range separated by a comma' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": ">=9.1,<9.6.25" } }', ]; yield 'version with range separated by a hyphen' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": "9.1-9.6.25" } }', ]; yield 'version with range separated by a hyphen and asterisk' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": "9.1.*-9.6.*" } }', ]; yield 'version with beta' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": "9.1-BETA.0" } }', ]; yield 'version with v' => [ '9.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": "v9.1 || v10" } }', ]; yield 'version with <=' => [ null, // not supported ! '{ "require": {}, "require-dev": { "phpunit/phpunit": "^8 || <=9.6.25" } }', ]; yield 'version with !=' => [ null, // not supported ! '{ "require": {}, "require-dev": { "phpunit/phpunit": "^8 || !=9.6.25" } }', ]; yield 'version with @dev' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": "^9.6.25@dev" } }', ]; yield 'version with asterisk' => [ '8.1', '{ "require": {}, "require-dev": { "phpunit/phpunit": " 8.1.* || 8.2.* || 8.3.* || 8.4.* " } }', ]; yield 'alternation' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34" } }', ]; yield 'alternation in non-dev require' => [ '9.6', '{ "require": { "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34" }, "require-dev": {} }', ]; yield 'alternation with deprecated single |' => [ '9.6', '{ "require": {}, "require-dev": { "phpunit/phpunit": "^9.6.25 | ^10.5.53 | ^11.5.34" } }', ]; yield 'alternation but oldest version not on start' => [ '8.0', '{ "require": {}, "require-dev": { "phpunit/phpunit": "^9.6.25 || ~8 || ^11.5.34" } }', ]; yield 'merge require with require-dev A' => [ '7.0', '{ "require": { "phpunit/phpunit": "^8.1 || ~9 || ^10" }, "require-dev": { "phpunit/phpunit": "^8.0 || ^7 || 11" } }', ]; yield 'merge require with require-dev B' => [ '6.0', '{ "require": { "phpunit/phpunit": "^8.1 || ~6 || ^10" }, "require-dev": { "phpunit/phpunit": "^8.0 || ^7 || 11" } }', ]; } /** * @dataProvider provideGetPhpCases */ public function testGetPhp(?string $expected, string $inputJson): void { self::assertJson($inputJson); $instance = new ComposerJsonReader(); \Closure::bind( static fn ($instance) => $instance->processJson($inputJson), null, \get_class($instance), )($instance); self::assertSame($expected, $instance->getPhp()); } /** * @return iterable<string, array{0: ?string, 1: string}> */ public static function provideGetPhpCases(): iterable { yield 'all missing' => [ null, '{}', ]; yield 'standard usage' => [ '8.4', '{ "require": { "php": "^8.4" } }', ]; yield 'all mixed with prio for require' => [ '7.0', '{ "require": { "php": "^7.4 || ^7.0 || >=8" }, "require-dev": { "php": "^7.4 || ^7.2 || >=8" }, "config": { "platform": { "php": "7.3" } } }', ]; yield 'all mixed with prio for require-dev' => [ '7.0', '{ "require": { "php": "^7.4 || ^7.1 || >=8" }, "require-dev": { "php": "^7.4 || ^7.0 || >=8" }, "config": { "platform": { "php": "7.3" } } }', ]; yield 'all mixed with prio for platform' => [ '7.0', '{ "require": { "php": "^7.4 || ^7.1 || >=8" }, "require-dev": { "php": "^7.4 || ^7.2 || >=8" }, "config": { "platform": { "php": "7.0" } } }', ]; yield 'version with asterisk' => [ '8.1', '{ "require": { "php": " 8.1.* || 8.2.* || 8.3.* || 8.4.* " } }', ]; yield 'version with >= and a space' => [ '8.2', '{ "require": { "php": ">= 8.2" } }', ]; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/ConfigTest.php
tests/ConfigTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Config; use PhpCsFixer\Config\NullRuleCustomisationPolicy; use PhpCsFixer\ConfigurationException\InvalidConfigurationException; use PhpCsFixer\Console\Application; use PhpCsFixer\Console\Command\FixCommand; use PhpCsFixer\Console\ConfigurationResolver; use PhpCsFixer\Finder; use PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer; use PhpCsFixer\Fixer\ControlStructure\IncludeFixer; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\Runner\Parallel\ParallelConfig; use PhpCsFixer\Tests\Fixtures\ExternalRuleSet\ExampleRuleSet; use PhpCsFixer\ToolInfo; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Finder\Finder as SymfonyFinder; /** * @internal * * @covers \PhpCsFixer\Config * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ConfigTest extends TestCase { public function testFutureMode(): void { $futureMode = getenv('PHP_CS_FIXER_FUTURE_MODE'); putenv('PHP_CS_FIXER_FUTURE_MODE=1'); $config = new Config('test'); self::assertSame('test (future mode)', $config->getName()); self::assertArrayHasKey('@PER-CS', $config->getRules()); putenv('PHP_CS_FIXER_FUTURE_MODE='.$futureMode); } public function testConfigRulesUsingSeparateMethod(): void { $config = new Config(); $configResolver = new ConfigurationResolver( $config, [ 'rules' => 'cast_spaces,statement_indentation', 'config' => ConfigurationResolver::IGNORE_CONFIG_FILE, ], (string) getcwd(), new ToolInfo(), ); self::assertSame( [ 'cast_spaces' => true, 'statement_indentation' => true, ], $configResolver->getRules(), ); } public function testConfigRulesUsingJsonMethod(): void { $config = new Config(); $configResolver = new ConfigurationResolver( $config, [ 'rules' => '{"array_syntax": {"syntax": "short"}, "cast_spaces": true}', 'config' => ConfigurationResolver::IGNORE_CONFIG_FILE, ], (string) getcwd(), new ToolInfo(), ); self::assertSame( [ 'array_syntax' => [ 'syntax' => 'short', ], 'cast_spaces' => true, ], $configResolver->getRules(), ); } public function testConfigRulesUsingInvalidJson(): void { $this->expectException(InvalidConfigurationException::class); $config = new Config(); $configResolver = new ConfigurationResolver( $config, [ 'rules' => '{blah', 'config' => ConfigurationResolver::IGNORE_CONFIG_FILE, ], (string) getcwd(), new ToolInfo(), ); $configResolver->getRules(); } public function testCustomConfig(): void { $customConfigFile = __DIR__.'/Fixtures/.php-cs-fixer.custom.php'; $application = new Application(); $application->add(new FixCommand(new ToolInfo())); $commandTester = new CommandTester($application->find('fix')); $commandTester->execute( [ 'path' => [$customConfigFile], '--dry-run' => true, '--config' => $customConfigFile, ], [ 'decorated' => false, 'verbosity' => OutputInterface::VERBOSITY_VERY_VERBOSE, ], ); self::assertStringMatchesFormat( \sprintf('%%ALoaded config custom_config_test from "%s".%%A', $customConfigFile), $commandTester->getDisplay(true), ); } public function testThatFinderWorksWithDirSetOnConfig(): void { $config = new Config(); $finder = $config->getFinder(); \assert($finder instanceof Finder); // Config::getFinder() ensures only `iterable` $items = iterator_to_array( $finder->in(__DIR__.'/Fixtures/FinderDirectory'), false, ); self::assertCount(1, $items); $item = reset($items); self::assertSame('somefile.php', $item->getFilename()); } public function testThatCustomFinderWorks(): void { $finder = new Finder(); $finder->in(__DIR__.'/Fixtures/FinderDirectory'); $config = (new Config())->setFinder($finder); $items = iterator_to_array( $config->getFinder(), false, ); self::assertCount(1, $items); self::assertSame('somefile.php', $items[0]->getFilename()); } public function testThatCustomSymfonyFinderWorks(): void { $finder = new SymfonyFinder(); $finder->in(__DIR__.'/Fixtures/FinderDirectory'); $config = (new Config())->setFinder($finder); $items = iterator_to_array( $config->getFinder(), false, ); self::assertCount(1, $items); self::assertSame('somefile.php', $items[0]->getFilename()); } public function testThatCacheFileHasDefaultValue(): void { $config = new Config(); self::assertSame('.php-cs-fixer.cache', $config->getCacheFile()); } public function testThatCacheFileCanBeMutated(): void { $cacheFile = 'some-directory/some.file'; $config = new Config(); $config->setCacheFile($cacheFile); self::assertSame($cacheFile, $config->getCacheFile()); } public function testThatMutatorHasFluentInterface(): void { $config = new Config(); self::assertSame($config, $config->setCacheFile('some-directory/some.file')); } /** * @param list<FixerInterface> $expected * @param iterable<FixerInterface> $suite * * @dataProvider provideRegisterCustomFixersCases */ public function testRegisterCustomFixers(array $expected, iterable $suite): void { $config = new Config(); $config->registerCustomFixers($suite); self::assertSame($expected, $config->getCustomFixers()); } /** * @return iterable<int, array{list<FixerInterface>, iterable<FixerInterface>}> */ public static function provideRegisterCustomFixersCases(): iterable { $fixers = [ new NoWhitespaceBeforeCommaInArrayFixer(), new IncludeFixer(), ]; yield [$fixers, $fixers]; yield [$fixers, new \ArrayIterator($fixers)]; } public function testRegisterCustomRuleSets(): void { $ruleset = new ExampleRuleSet(__METHOD__); $config = new Config(); $config->registerCustomRuleSets([$ruleset]); self::assertSame([$ruleset], $config->getCustomRuleSets()); } public function testConfigDefault(): void { $config = new Config(); self::assertSame('.php-cs-fixer.cache', $config->getCacheFile()); self::assertSame([], $config->getCustomFixers()); self::assertSame('txt', $config->getFormat()); self::assertFalse($config->getHideProgress()); self::assertSame(' ', $config->getIndent()); self::assertSame("\n", $config->getLineEnding()); self::assertSame('default', $config->getName()); self::assertNull($config->getPhpExecutable()); self::assertFalse($config->getRiskyAllowed()); self::assertSame(['@PSR12' => true], $config->getRules()); self::assertTrue($config->getUsingCache()); self::assertSame(filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), \FILTER_VALIDATE_BOOL), $config->getUnsupportedPhpVersionAllowed()); $finder = $config->getFinder(); self::assertInstanceOf(Finder::class, $finder); $config->setFormat('xml'); self::assertSame('xml', $config->getFormat()); $config->setHideProgress(true); self::assertTrue($config->getHideProgress()); $config->setIndent("\t"); self::assertSame("\t", $config->getIndent()); $finder = new Finder(); $config->setFinder($finder); self::assertSame($finder, $config->getFinder()); $config->setLineEnding("\r\n"); self::assertSame("\r\n", $config->getLineEnding()); $config->setPhpExecutable(null); self::assertNull($config->getPhpExecutable()); $config->setUsingCache(false); self::assertFalse($config->getUsingCache()); $config->setUnsupportedPhpVersionAllowed(true); self::assertTrue($config->getUnsupportedPhpVersionAllowed()); self::assertNull($config->getRuleCustomisationPolicy()); $ruleCustomisationPolicy = new NullRuleCustomisationPolicy(); $config->setRuleCustomisationPolicy($ruleCustomisationPolicy); self::assertSame($ruleCustomisationPolicy, $config->getRuleCustomisationPolicy()); $config->setRuleCustomisationPolicy(null); self::assertNull($config->getRuleCustomisationPolicy()); } public function testConfigConstructorWithName(): void { $anonymousConfig = new Config(); $namedConfig = new Config('foo'); self::assertSame($anonymousConfig->getName(), 'default'); self::assertSame($namedConfig->getName(), 'foo'); } public function testConfigWithDefaultParallelConfig(): void { $config = new Config(); self::assertSame(1, $config->getParallelConfig()->getMaxProcesses()); } public function testConfigWithExplicitParallelConfig(): void { $config = new Config(); $config->setParallelConfig(new ParallelConfig(5, 10, 15)); self::assertSame(5, $config->getParallelConfig()->getMaxProcesses()); self::assertSame(10, $config->getParallelConfig()->getFilesPerProcess()); self::assertSame(15, $config->getParallelConfig()->getProcessTimeout()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/PregExceptionTest.php
tests/PregExceptionTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\PregException; /** * @author Kuba Werłos <werlos@gmail.com> * * @internal * * @covers \PhpCsFixer\PregException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class PregExceptionTest extends TestCase { public function testPregException(): void { $exception = new PregException('foo', 123); self::assertSame('foo', $exception->getMessage()); self::assertSame(123, $exception->getCode()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/IntegrationTest.php
tests/IntegrationTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests; use PhpCsFixer\Tests\Test\AbstractIntegrationTestCase; use PhpCsFixer\Tests\Test\IntegrationCase; use PhpCsFixer\Tests\Test\IntegrationCaseFactoryInterface; use PhpCsFixer\Tests\Test\InternalIntegrationCaseFactory; /** * Test that parses and runs the fixture '*.test' files found in '/Fixtures/Integration'. * * @internal * * @coversNothing * * @group covers-nothing * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class IntegrationTest extends AbstractIntegrationTestCase { protected static function getFixturesDir(): string { return __DIR__.\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR.'Integration'; } protected static function getTempFile(): string { return sys_get_temp_dir().\DIRECTORY_SEPARATOR.'MyClass.php'; } protected static function createIntegrationCaseFactory(): IntegrationCaseFactoryInterface { return new InternalIntegrationCaseFactory(); } protected static function assertRevertedOrderFixing(IntegrationCase $case, string $fixedInputCode, string $fixedInputCodeWithReversedFixers): void { parent::assertRevertedOrderFixing($case, $fixedInputCode, $fixedInputCodeWithReversedFixers); $settings = $case->getSettings(); if (!isset($settings['isExplicitPriorityCheck'])) { self::markTestIncomplete('Missing `isExplicitPriorityCheck` extension setting.'); } if ($settings['isExplicitPriorityCheck']) { self::assertNotSame( $fixedInputCode, $fixedInputCodeWithReversedFixers, \sprintf( 'Test "%s" in "%s" is expected to be priority check, but fixers applied in reversed order made the same changes.', $case->getTitle(), $case->getFileName(), ), ); } } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Doctrine/Annotation/TokensTest.php
tests/Doctrine/Annotation/TokensTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Doctrine\Annotation; use PhpCsFixer\Doctrine\Annotation\Tokens; use PhpCsFixer\Tests\TestCase; use PhpCsFixer\Tokenizer\Token; /** * @internal * * @covers \PhpCsFixer\Doctrine\Annotation\Tokens * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class TokensTest extends TestCase { public function testCreateFromEmptyPhpdocComment(): void { $docComment = '/** */'; $token = new Token([\T_DOC_COMMENT, $docComment]); $tokens = Tokens::createFromDocComment($token); self::assertCount(1, $tokens); self::assertSame($docComment, $tokens->getCode()); } /** * @dataProvider provideOffSetOtherThanTokenCases */ public function testOffSetOtherThanToken(string $message, ?string $wrongType): void { $docComment = '/** */'; $token = new Token([\T_DOC_COMMENT, $docComment]); $tokens = Tokens::createFromDocComment($token); $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage($message); // @phpstan-ignore-next-line as we are testing the type error $tokens[1] = $wrongType; } /** * @return iterable<int, array{string, null|string}> */ public static function provideOffSetOtherThanTokenCases(): iterable { yield [ 'Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "null" given.', null, ]; yield [ 'Token must be an instance of PhpCsFixer\Doctrine\Annotation\Token, "string" given.', 'foo', ]; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Doctrine/Annotation/DocLexerTest.php
tests/Doctrine/Annotation/DocLexerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Doctrine\Annotation; use PhpCsFixer\Doctrine\Annotation\DocLexer; use PhpCsFixer\Doctrine\Annotation\Token; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Doctrine\Annotation\DocLexer * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class DocLexerTest extends TestCase { public function testCreateFromEmptyPhpdocComment(): void { $lexer = new DocLexer(); $lexer->setInput('/** @Foo("bar": 42) */'); $expectedContents = [ [DocLexer::T_NONE, '/', 0], [DocLexer::T_AT, '@', 4], [DocLexer::T_IDENTIFIER, 'Foo', 5], [DocLexer::T_OPEN_PARENTHESIS, '(', 8], [DocLexer::T_STRING, 'bar', 9], [DocLexer::T_COLON, ':', 14], [DocLexer::T_INTEGER, '42', 16], [DocLexer::T_CLOSE_PARENTHESIS, ')', 18], [DocLexer::T_NONE, '/', 21], ]; foreach ($expectedContents as $expectedContent) { $token = $lexer->peek(); self::assertInstanceOf(Token::class, $token); self::assertSame($expectedContent[0], $token->getType()); self::assertSame($expectedContent[1], $token->getContent()); self::assertSame($expectedContent[2], $token->getPosition()); } self::assertNull($lexer->peek()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Doctrine/Annotation/TokenTest.php
tests/Doctrine/Annotation/TokenTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Doctrine\Annotation; use PhpCsFixer\Doctrine\Annotation\DocLexer; use PhpCsFixer\Doctrine\Annotation\Token; use PhpCsFixer\Tests\TestCase; /** * @author Andreas Möller <am@localheinz.com> * * @internal * * @covers \PhpCsFixer\Doctrine\Annotation\Token * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class TokenTest extends TestCase { public function testDefaults(): void { $token = new Token(); self::assertSame(DocLexer::T_NONE, $token->getType()); self::assertSame('', $token->getContent()); self::assertSame(0, $token->getPosition()); } public function testConstructorSetsValues(): void { $type = 42; $content = 'questionable'; $position = 16; $token = new Token( $type, $content, $position, ); self::assertSame($type, $token->getType()); self::assertSame($content, $token->getContent()); self::assertSame($position, $token->getPosition()); } public function testCanModifyType(): void { $type = 42; $token = new Token(); $token->setType($type); self::assertSame($type, $token->getType()); } /** * @dataProvider provideIsTypeReturnsTrueCases * * @param int|list<int> $types */ public function testIsTypeReturnsTrue(int $type, $types): void { $token = new Token(); $token->setType($type); self::assertTrue($token->isType($types)); } /** * @return iterable<string, array{int, int|list<int>}> */ public static function provideIsTypeReturnsTrueCases(): iterable { yield 'same-value' => [ 42, 42, ]; yield 'array-with-value' => [ 42, [ 42, 9_001, ], ]; } /** * @dataProvider provideIsTypeReturnsFalseCases * * @param int|list<int> $types */ public function testIsTypeReturnsFalse(int $type, $types): void { $token = new Token(); $token->setType($type); self::assertFalse($token->isType($types)); } /** * @return iterable<string, array{int, int|list<int>}> */ public static function provideIsTypeReturnsFalseCases(): iterable { yield 'different-value' => [ 42, 9_001, ]; yield 'array-without-value' => [ 42, [ 9_001, ], ]; } public function testCanModifyContent(): void { $content = 'questionable'; $token = new Token(); $token->setContent($content); self::assertSame($content, $token->getContent()); } public function testCanClearContent(): void { $content = 'questionable'; $token = new Token(); $token->setContent($content); $token->clear(); self::assertSame('', $token->getContent()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Smoke/CiIntegrationTest.php
tests/Smoke/CiIntegrationTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Smoke; use Keradus\CliExecutor\CliResult; use Keradus\CliExecutor\CommandExecutor; use Keradus\CliExecutor\ScriptExecutor; use PhpCsFixer\Console\Application; use PhpCsFixer\Preg; use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @requires OS Linux|Darwin * * @coversNothing * * @group covers-nothing * * @large * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class CiIntegrationTest extends AbstractSmokeTestCase { public static string $fixtureDir; public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); self::$fixtureDir = __DIR__.'/../Fixtures/ci-integration'; try { CommandExecutor::create('composer --version', __DIR__)->getResult(); } catch (\RuntimeException $e) { self::fail('Missing `composer` env script. Details:'."\n".$e->getMessage()); } try { CommandExecutor::create('composer check', __DIR__.'/../..')->getResult(); } catch (\RuntimeException $e) { self::fail('Composer check failed. Details:'."\n".$e->getMessage()); } try { self::executeScript([ 'rm -rf .git', 'git init --initial-branch=master -q', 'git config user.name test', 'git config user.email test', 'git add .', 'git commit -m "init" -q', ]); } catch (\RuntimeException $e) { self::fail($e->getMessage()); } } public static function tearDownAfterClass(): void { parent::tearDownAfterClass(); self::executeCommand('rm -rf .git'); } protected function tearDown(): void { parent::tearDown(); self::executeScript([ 'git reset . -q', 'git checkout . -q', 'git clean -fdq', 'git checkout master -q', ]); } /** * @param list<string> $caseCommands * @param list<string> $expectedResult1Lines * @param list<string> $expectedResult2Lines * * @dataProvider provideIntegrationCases */ public function testIntegration( string $branchName, array $caseCommands, array $expectedResult1Lines, array $expectedResult2Lines, string $expectedResult3FilesLine ): void { self::executeScript(array_merge( [ "git checkout -b {$branchName} -q", ], $caseCommands, )); $integrationScript = explode("\n", str_replace('vendor/bin/', './../../../', (string) file_get_contents(__DIR__.'/../../doc/examples/ci-integration.sh'))); self::assertArrayHasKey(3, $integrationScript); self::assertArrayHasKey(4, $integrationScript); self::assertArrayHasKey(5, $integrationScript); self::assertArrayHasKey(6, $integrationScript); self::assertArrayHasKey(7, $integrationScript); $steps = [ "COMMIT_RANGE=\"master..{$branchName}\"", "{$integrationScript[3]}\n{$integrationScript[4]}", $integrationScript[5], $integrationScript[6], $integrationScript[7], ]; $result1 = self::executeScript([ $steps[0], $steps[1], $steps[2], 'echo "$CHANGED_FILES"', ]); self::assertSame(implode("\n", $expectedResult1Lines)."\n", $result1->getOutput()); $result2 = self::executeScript([ $steps[0], $steps[1], $steps[2], $steps[3], 'echo "${EXTRA_ARGS}"', ]); self::assertSame(implode("\n", $expectedResult2Lines), $result2->getOutput()); $result3 = self::executeScript([ $steps[0], $steps[1], $steps[2], $steps[3], $steps[4], ]); $optionalDeprecatedVersionWarning = 'You are running PHP CS Fixer v3, which is not maintained anymore. Please update to v4. You may find an UPGRADE guide at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v4.0.0/UPGRADE-v4.md . '; $optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.2.*. Current PHP version: '.\PHP_VERSION.'. Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable. '; $optionalXdebugWarning = 'You are running PHP CS Fixer with xdebug enabled. This has a major impact on runtime performance. '; $optionalComposerWarning = 'Unable to determine minimum PHP version supported by your project from composer.json: Failed to read file "composer.json". '; $optionalWarningsHelp = 'If you need help while solving warnings, ask at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you! '; $expectedResult3FilesLineAfterDotsIndex = strpos($expectedResult3FilesLine, ' '); self::assertIsInt($expectedResult3FilesLineAfterDotsIndex); $expectedResult3FilesDots = substr($expectedResult3FilesLine, 0, $expectedResult3FilesLineAfterDotsIndex); $expectedResult3FilesPercentage = substr($expectedResult3FilesLine, $expectedResult3FilesLineAfterDotsIndex); /** @phpstan-ignore-next-line to avoid `Ternary operator condition is always true|false.` */ $aboutSubpattern = Application::VERSION_CODENAME ? 'PHP CS Fixer '.preg_quote(Application::VERSION, '/').' '.preg_quote(Application::VERSION_CODENAME, '/')." by Fabien Potencier, Dariusz Ruminski and contributors.\nPHP runtime: ".\PHP_VERSION : 'PHP CS Fixer '.preg_quote(Application::VERSION, '/')." by Fabien Potencier, Dariusz Ruminski and contributors.\nPHP runtime: ".\PHP_VERSION; $availableMaxProcesses = ParallelConfigFactory::detect()->getMaxProcesses(); $pattern = \sprintf( '/^(?:%s)?(?:%s)?(?:%s)?(?:%s)?(?:%s)?%s\n%s\n%s\n%s\n([\.S]{%d})%s\n%s$/', preg_quote($optionalDeprecatedVersionWarning, '/'), preg_quote($optionalIncompatibilityWarning, '/'), preg_quote($optionalXdebugWarning, '/'), preg_quote($optionalComposerWarning, '/'), preg_quote($optionalWarningsHelp, '/'), $aboutSubpattern, preg_quote('Loaded config default from ".php-cs-fixer.dist.php".', '/'), 'Running analysis on \d+ core(?: sequentially|s with \d+ files? per process)+\.', $availableMaxProcesses > 1 ? preg_quote('You can enable parallel runner and speed up the analysis! Please see https://cs.symfony.com/doc/usage.html for more information.', '/') : '', \strlen($expectedResult3FilesDots), preg_quote($expectedResult3FilesPercentage, '/'), preg_quote('Legend: .-no changes, F-fixed, S-skipped (cached or empty file), M-skipped (non-monolithic), I-invalid file syntax (file ignored), E-error', '/'), ); self::assertMatchesRegularExpression($pattern, $result3->getError()); Preg::match($pattern, $result3->getError(), $matches); self::assertArrayHasKey(1, $matches); self::assertSame(substr_count($expectedResult3FilesDots, '.'), substr_count($matches[1], '.')); self::assertSame(substr_count($expectedResult3FilesDots, 'S'), substr_count($matches[1], 'S')); self::assertMatchesRegularExpression( '/^\s*Found \d+ of \d+ files that can be fixed in \d+\.\d+ seconds, \d+\.\d+ MB memory used\s*$/', $result3->getOutput(), ); } /** * @return iterable<string, array{string, list<string>, list<string>, list<string>, string}> */ public static function provideIntegrationCases(): iterable { yield 'random-changes' => [ 'random-changes', [ 'touch dir\ a/file.php', 'rm -r dir\ c', 'echo "" >> dir\ b/file\ b.php', 'echo "echo 1;" >> dir\ b/file\ b.php', 'git add .', 'git commit -m "Random changes" -q', ], [ 'dir a/file.php', 'dir b/file b.php', ], [ '--path-mode=intersection', '--', 'dir a/file.php', 'dir b/file b.php', '', ], 'S. 2 / 2 (100%)', ]; yield 'changes-including-dist-config-file' => [ 'changes-including-dist-config-file', [ 'echo "" >> dir\ b/file\ b.php', 'echo "echo 1;" >> dir\ b/file\ b.php', // `sed -i ...` is not handled the same on Linux and macOS 'sed -e \'s/@Symfony/@PSR2/\' .php-cs-fixer.dist.php > .php-cs-fixer.dist.php.new', 'mv .php-cs-fixer.dist.php.new .php-cs-fixer.dist.php', 'git add .', 'git commit -m "Random changes including config file" -q', ], [ '.php-cs-fixer.dist.php', 'dir b/file b.php', ], [ '', '', ], '... 3 / 3 (100%)', ]; yield 'changes-including-custom-config-file-creation' => [ 'changes-including-custom-config-file-creation', [ 'echo "" >> dir\ b/file\ b.php', 'echo "echo 1;" >> dir\ b/file\ b.php', 'sed -e \'s/@Symfony/@PSR2/\' .php-cs-fixer.dist.php > .php-cs-fixer.php', 'git add .', 'git commit -m "Random changes including custom config file creation" -q', ], [ '.php-cs-fixer.php', 'dir b/file b.php', ], [ '', '', ], '... 3 / 3 (100%)', ]; yield 'changes-including-composer-lock' => [ 'changes-including-composer-lock', [ 'echo "" >> dir\ b/file\ b.php', 'echo "echo 1;" >> dir\ b/file\ b.php', 'touch composer.lock', 'git add .', 'git commit -m "Random changes including composer.lock" -q', ], [ 'composer.lock', 'dir b/file b.php', ], [ '', '', ], '... 3 / 3 (100%)', ]; } public function testWithUsingNonExistingFile(): void { $output = ScriptExecutor::create( ['php php-cs-fixer check --config=tests/Fixtures/.php-cs-fixer.append-non-existing-file.php --show-progress=dots --no-interaction'], __DIR__.'/../..', )->getResult(); self::assertSame(0, $output->getCode()); self::assertStringContainsString(' (100%)', $output->getError()); } private static function executeCommand(string $command): CliResult { return CommandExecutor::create($command, self::$fixtureDir)->getResult(); } /** * @param list<string> $scriptParts */ private static function executeScript(array $scriptParts): CliResult { return ScriptExecutor::create($scriptParts, self::$fixtureDir)->getResult(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Smoke/PharTest.php
tests/Smoke/PharTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Smoke; use Keradus\CliExecutor\CliResult; use Keradus\CliExecutor\CommandExecutor; use PhpCsFixer\Console\Application; use PhpCsFixer\Console\Command\DescribeCommand; use PhpCsFixer\Console\ConfigurationResolver; use Symfony\Component\Console\Tester\CommandTester; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @coversNothing * * @group covers-nothing * @group legacy * * @large * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class PharTest extends AbstractSmokeTestCase { private static string $pharCwd; private static string $pharName; public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); self::$pharCwd = __DIR__.'/../..'; self::$pharName = 'php-cs-fixer.phar'; if (!file_exists(self::$pharCwd.'/'.self::$pharName)) { self::fail('No phar file available.'); } } public function testVersion(): void { /** @phpstan-ignore-next-line to avoid `Ternary operator condition is always true|false.` */ $shouldExpectCodename = Application::VERSION_CODENAME ? 1 : 0; self::assertMatchesRegularExpression( \sprintf("/^PHP CS Fixer (?<version>%s)(?<git_sha> \\([a-z0-9]+\\))?(?<codename> %s){%d}(?<by> by .*)\nPHP runtime: (?<php_version>\\d\\.\\d+\\..*)$/", Application::VERSION, Application::VERSION_CODENAME, $shouldExpectCodename), self::executePharCommand('--version')->getOutput(), ); } public function testDescribe(): void { $command = new DescribeCommand(); $application = new Application(); $application->add($command); $commandTester = new CommandTester($command); $commandTester->execute([ 'command' => $command->getName(), 'name' => 'header_comment', '--config' => ConfigurationResolver::IGNORE_CONFIG_FILE, ]); self::assertSame( $commandTester->getDisplay(), self::executePharCommand('describe header_comment --config=-')->getOutput(), ); } public function testFixSequential(): void { // `--congig=-`, as sequential is default in current MAJOR $command = self::executePharCommand('fix src/Config.php -vvv --dry-run --diff --using-cache=no --config=- --sequential 2>&1'); self::assertSame(0, $command->getCode()); self::assertMatchesRegularExpression( '/Running analysis on 1 core sequentially/', $command->getOutput(), ); } public function testFixParallel(): void { $command = self::executePharCommand('fix src/Config.php -vvv --dry-run --diff --using-cache=no --config='.__DIR__.'/../Fixtures/.php-cs-fixer.parallel.php 2>&1'); self::assertSame(0, $command->getCode()); self::assertMatchesRegularExpression( '/Running analysis on [0-9]+ cores with [0-9]+ files per process/', $command->getOutput(), ); } public function testFixHelp(): void { self::assertSame( 0, self::executePharCommand('fix --help')->getCode(), ); } /** * @dataProvider provideReportCases */ public function testReport(string $usingCache): void { try { $json = self::executePharCommand(\sprintf( 'fix %s --dry-run --sequential --format=json --rules=\'%s\' --using-cache=%s --config=-', __FILE__, json_encode(['concat_space' => ['spacing' => 'one']], \JSON_THROW_ON_ERROR), $usingCache, ))->getOutput(); self::assertJson($json); $report = json_decode($json, true, 512, \JSON_THROW_ON_ERROR); self::assertIsArray($report); self::assertArrayHasKey('files', $report); self::assertCount(1, $report['files']); self::assertArrayHasKey(0, $report['files']); self::assertSame( 'tests/Smoke/PharTest.php', $report['files'][0]['name'], ); } catch (\Throwable $exception) { throw $exception; } finally { $cacheFile = __DIR__.'/../../.php-cs-fixer.cache'; if (file_exists($cacheFile)) { unlink($cacheFile); } } } /** * @return iterable<int, array{string}> */ public static function provideReportCases(): iterable { yield ['no']; yield ['yes']; } private static function executePharCommand(string $params): CliResult { return CommandExecutor::create('php '.self::$pharName.' '.$params.' --no-interaction', self::$pharCwd)->getResult(false); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Smoke/InstallViaComposerTest.php
tests/Smoke/InstallViaComposerTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Smoke; use Keradus\CliExecutor\CommandExecutor; use PhpCsFixer\Console\Application; use PhpCsFixer\Preg; use Symfony\Component\Filesystem\Filesystem; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * @author Greg Korba <greg@codito.dev> * * @internal * * @coversNothing * * @group covers-nothing * * @large * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class InstallViaComposerTest extends AbstractSmokeTestCase { private ?Filesystem $fs; /** @var array<string, mixed> */ private array $currentCodeAsComposerDependency = [ 'repositories' => [ [ 'type' => 'path', 'url' => __DIR__.'/../..', 'options' => [ 'symlink' => false, ], ], ], 'require' => [ 'friendsofphp/php-cs-fixer' => '*@dev', ], ]; /** * @var list<string> */ private array $stepsToVerifyInstallation = [ // Confirm we can install. 'composer install -q', // Ensure that autoloader works. 'composer dump-autoload --optimize', 'php vendor/autoload.php', // Ensure basic commands work. 'vendor/bin/php-cs-fixer --version', 'vendor/bin/php-cs-fixer fix --help', ]; public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); if ('\\' === \DIRECTORY_SEPARATOR) { self::markTestIncomplete('This test is broken on Windows'); } try { CommandExecutor::create('php --version', __DIR__)->getResult(); } catch (\RuntimeException $e) { self::fail('Missing `php` env script. Details:'."\n".$e->getMessage()); } try { CommandExecutor::create('composer --version', __DIR__)->getResult(); } catch (\RuntimeException $e) { self::fail('Missing `composer` env script. Details:'."\n".$e->getMessage()); } try { CommandExecutor::create('composer check', __DIR__.'/../..')->getResult(); } catch (\RuntimeException $e) { self::fail('Composer check failed. Details:'."\n".$e->getMessage()); } } protected function setUp(): void { parent::setUp(); $this->fs = new Filesystem(); } protected function tearDown(): void { $this->fs = null; parent::tearDown(); } public function testInstallationViaPathIsPossible(): void { $tmpPath = $this->createFakeComposerProject($this->currentCodeAsComposerDependency); self::assertCommandsWork($this->stepsToVerifyInstallation, $tmpPath); $this->fs->remove($tmpPath); } // test that respects `export-ignore` from `.gitattributes` file public function testInstallationViaArtifactIsPossible(): void { // Composer Artifact Repository requires `zip` extension if (!\extension_loaded('zip')) { // We do not want to mark test as skipped, because we explicitly want to test this and `zip` is required self::fail('No zip extension available.'); } $tmpArtifactPath = tempnam(sys_get_temp_dir(), 'cs_fixer_tmp_'); unlink($tmpArtifactPath); $this->fs->mkdir($tmpArtifactPath); $fakeVersion = Preg::replace('/\-.+/', '', Application::VERSION, 1).'-alpha987654321'; $tmpPath = $this->createFakeComposerProject([ 'repositories' => [ [ 'type' => 'artifact', 'url' => $tmpArtifactPath, ], ], 'require' => [ 'friendsofphp/php-cs-fixer' => $fakeVersion, ], ]); $cwd = __DIR__.'/../..'; $stepsToInitializeArtifact = [ // Clone current version of project to new location, as we are going to modify it. // Warning! Only already committed changes will be cloned! "git clone --depth=1 . {$tmpArtifactPath}", ]; $stepsToPrepareArtifact = [ // Configure git user for new repo to not use global git user. // We need this, as global git user may not be set! 'git config user.name test && git config user.email test', // Adjust cloned project to expose version in `composer.json`. // Without that, it would not be possible to use it as Composer Artifact. "composer config version {$fakeVersion} && git add . && git commit --no-gpg-sign -m 'provide version'", // Create repo archive that will serve as Composer Artifact. 'git archive HEAD --format=zip -o archive.zip', // Drop the repo, keep the archive 'git rm -r . && rm -rf .git', ]; self::assertCommandsWork($stepsToInitializeArtifact, $cwd); self::assertCommandsWork($stepsToPrepareArtifact, $tmpArtifactPath); self::assertCommandsWork($this->stepsToVerifyInstallation, $tmpPath); $this->fs->remove($tmpPath); $this->fs->remove($tmpArtifactPath); } /** * @param list<string> $commands */ private static function assertCommandsWork(array $commands, string $cwd): void { foreach ($commands as $command) { self::assertSame(0, CommandExecutor::create($command, $cwd)->getResult()->getCode()); } } /** * @param array<string, mixed> $initialComposerFileState * * @return string Path to temporary directory containing Composer project */ private function createFakeComposerProject(array $initialComposerFileState): string { $tmpPath = tempnam(sys_get_temp_dir(), 'cs_fixer_tmp_'); if (false === $tmpPath) { throw new \RuntimeException('Creating directory for fake Composer project has failed.'); } unlink($tmpPath); $this->fs->mkdir($tmpPath); try { file_put_contents( $tmpPath.'/composer.json', json_encode($initialComposerFileState, \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT), ); } catch (\JsonException $e) { throw new \InvalidArgumentException( 'Initial Composer file state could not be saved as composer.json', $e->getCode(), $e, ); } return $tmpPath; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Smoke/StdinTest.php
tests/Smoke/StdinTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Smoke; use Keradus\CliExecutor\CommandExecutor; use PhpCsFixer\Preg; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @requires OS Linux|Darwin * * @coversNothing * * @group covers-nothing * * @large * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class StdinTest extends AbstractSmokeTestCase { public function testFixingStdin(): void { $cwd = __DIR__.'/../..'; $command = 'php php-cs-fixer fix --sequential --rules=@PSR2 --dry-run --diff --using-cache=no'; $inputFile = 'tests/Fixtures/Integration/set/@PSR2.test-in.php'; $fileResult = CommandExecutor::create("{$command} {$inputFile}", $cwd)->getResult(false); $stdinResult = CommandExecutor::create("{$command} - < {$inputFile}", $cwd)->getResult(false); self::assertSame($fileResult->getCode(), $stdinResult->getCode()); $expectedError = str_replace( 'Paths from configuration have been overridden by paths provided as command arguments.'."\n", '', $fileResult->getError(), ); self::assertSame($expectedError, $stdinResult->getError()); $fileResult = $this->unifyFooter($fileResult->getOutput()); $file = realpath($cwd).'/'.$inputFile; $path = str_replace('/', \DIRECTORY_SEPARATOR, $file); $fileResult = str_replace("\n--- ".$path."\n", "\n--- php://stdin\n", $fileResult); $fileResult = str_replace("\n+++ ".$path."\n", "\n+++ php://stdin\n", $fileResult); $fileResult = Preg::replace( '#/?'.preg_quote($inputFile, '#').'#', 'php://stdin', $fileResult, ); self::assertSame( $fileResult, $this->unifyFooter($stdinResult->getOutput()), ); } private function unifyFooter(string $output): string { return Preg::replace( '/Found \d+ of \d+ files that can be fixed in \d+\.\d+ seconds, \d+\.\d+ MB memory used/', 'Footer', $output, ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Smoke/AbstractSmokeTestCase.php
tests/Smoke/AbstractSmokeTestCase.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Smoke; use PhpCsFixer\Tests\TestCase; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @coversNothing * * @group covers-nothing * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ abstract class AbstractSmokeTestCase extends TestCase {}
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/UnavailableLinterExceptionTest.php
tests/Linter/UnavailableLinterExceptionTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\UnavailableLinterException; use PhpCsFixer\Tests\TestCase; /** * @author Andreas Möller <am@localheinz.com> * * @internal * * @covers \PhpCsFixer\Linter\UnavailableLinterException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class UnavailableLinterExceptionTest extends TestCase { public function testConstructorSetsValues(): void { $message = 'Never heard of that one, sorry!'; $code = 9_001; $previous = new \RuntimeException(); $exception = new UnavailableLinterException( $message, $code, $previous, ); self::assertSame($message, $exception->getMessage()); self::assertSame($code, $exception->getCode()); self::assertSame($previous, $exception->getPrevious()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/TokenizerLintingResultTest.php
tests/Linter/TokenizerLintingResultTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\LintingException; use PhpCsFixer\Linter\TokenizerLintingResult; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Linter\TokenizerLintingResult * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class TokenizerLintingResultTest extends TestCase { /** * @doesNotPerformAssertions */ public function testTokenizerLintingResultOK(): void { $result = new TokenizerLintingResult(); $result->check(); } public function testTokenizerLintingResultFailParseError(): void { $error = new \ParseError('syntax error, unexpected end of file, expecting \'{\'', 567); $line = __LINE__ - 1; $result = new TokenizerLintingResult($error); $this->expectException( LintingException::class, ); $this->expectExceptionMessage( \sprintf('Parse error: syntax error, unexpected end of file, expecting \'{\' on line %d.', $line), ); $this->expectExceptionCode( 567, ); $result->check(); } public function testTokenizerLintingResultFailCompileError(): void { $error = new \CompileError('Multiple access type modifiers are not allowed'); $line = __LINE__ - 1; $result = new TokenizerLintingResult($error); $this->expectException( LintingException::class, ); $this->expectExceptionMessage( \sprintf('Fatal error: Multiple access type modifiers are not allowed on line %d.', $line), ); $result->check(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/ProcessLintingResultTest.php
tests/Linter/ProcessLintingResultTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\LintingException; use PhpCsFixer\Linter\ProcessLintingResult; use PhpCsFixer\Tests\TestCase; use Symfony\Component\Process\Process; /** * @internal * * @covers \PhpCsFixer\Linter\ProcessLintingResult * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessLintingResultTest extends TestCase { public function testCheckOK(): void { $process = new class([]) extends Process { public function wait(?callable $callback = null): int { return 0; } public function isSuccessful(): bool { return true; } }; $result = new ProcessLintingResult($process); $result->check(); $this->expectNotToPerformAssertions(); } public function testCheckFail(): void { $process = new class([]) extends Process { public function wait(?callable $callback = null): int { return 0; } public function isSuccessful(): bool { return false; } public function getErrorOutput(): string { return 'PHP Parse error: syntax error, unexpected end of file, expecting \'{\' in test.php on line 4'; } public function getExitCode(): int { return 123; } }; $result = new ProcessLintingResult($process, 'test.php'); $this->expectException(LintingException::class); $this->expectExceptionMessage('Parse error: syntax error, unexpected end of file, expecting \'{\' on line 4.'); $this->expectExceptionCode(123); $result->check(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/ProcessLinterProcessBuilderTest.php
tests/Linter/ProcessLinterProcessBuilderTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\ProcessLinterProcessBuilder; use PhpCsFixer\Tests\TestCase; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\Linter\ProcessLinterProcessBuilder * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessLinterProcessBuilderTest extends TestCase { /** * @dataProvider providePrepareCommandOnPhpOnLinuxOrMacCases * * @requires OS Linux|Darwin */ public function testPrepareCommandOnPhpOnLinuxOrMac(string $executable, string $file, string $expected): void { $this->testPrepareCommand($executable, $file, $expected); } /** * @return iterable<string, array{string, string, string}> */ public static function providePrepareCommandOnPhpOnLinuxOrMacCases(): iterable { yield 'Linux-like' => ['php', 'foo.php', "'php' '-l' 'foo.php'"]; yield 'Windows-like' => ['C:\Program Files\php\php.exe', 'foo bar\baz.php', "'C:\\Program Files\\php\\php.exe' '-l' 'foo bar\\baz.php'"]; } /** * @dataProvider providePrepareCommandOnPhpOnWindowsCases * * @requires OS ^Win */ public function testPrepareCommandOnPhpOnWindows(string $executable, string $file, string $expected): void { $this->testPrepareCommand($executable, $file, $expected); } /** * @return iterable<string, array{string, string, string}> */ public static function providePrepareCommandOnPhpOnWindowsCases(): iterable { yield 'Linux-like' => ['php', 'foo.php', 'c:\tools\php\php.EXE -l foo.php']; yield 'Windows-like' => ['C:\Program Files\php\php.exe', 'foo bar\baz.php', '"C:\Program Files\php\php.exe" -l "foo bar\baz.php"']; } private function testPrepareCommand(string $executable, string $file, string $expected): void { $builder = new ProcessLinterProcessBuilder($executable); self::assertSame( $expected, $builder->build($file)->getCommandLine(), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/ProcessLinterTest.php
tests/Linter/ProcessLinterTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\ProcessLinter; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\Linter\ProcessLinter * @covers \PhpCsFixer\Linter\ProcessLintingResult * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class ProcessLinterTest extends AbstractLinterTestCase { public function testIsAsync(): void { self::assertTrue($this->createLinter()->isAsync()); } public function testSerialize(): void { $linter = new ProcessLinter(); $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Cannot serialize '.ProcessLinter::class); serialize($linter); } public function testUnserialize(): void { $this->expectException(\BadMethodCallException::class); $this->expectExceptionMessage('Cannot unserialize '.ProcessLinter::class); unserialize(self::createSerializedStringOfClassName(ProcessLinter::class)); } protected function createLinter(): LinterInterface { return new ProcessLinter(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/CachingLinterTest.php
tests/Linter/CachingLinterTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use org\bovigo\vfs\vfsStream; use PhpCsFixer\Linter\CachingLinter; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\LintingResultInterface; use PhpCsFixer\Tests\TestCase; /** * @author ntzm * * @internal * * @covers \PhpCsFixer\Linter\CachingLinter * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class CachingLinterTest extends TestCase { /** * @dataProvider provideIsAsyncCases */ public function testIsAsync(bool $isAsync): void { $sublinter = $this->createLinterDouble($isAsync, [], []); $linter = new CachingLinter($sublinter); self::assertSame($isAsync, $linter->isAsync()); } /** * @return iterable<int, array{bool}> */ public static function provideIsAsyncCases(): iterable { yield [true]; yield [false]; } public function testLintFileIsCalledOnceOnSameContent(): void { $fs = vfsStream::setup('root', null, [ 'foo.php' => '<?php echo "baz";', 'bar.php' => '<?php echo "baz";', 'baz.php' => '<?php echo "foobarbaz";', ]); $result1 = $this->createLintingResultDouble(); $result2 = $this->createLintingResultDouble(); $sublinter = $this->createLinterDouble( null, [ $fs->url().'/foo.php' => $result1, $fs->url().'/baz.php' => $result2, ], [], ); $linter = new CachingLinter($sublinter); self::assertSame($result1, $linter->lintFile($fs->url().'/foo.php')); self::assertSame($result1, $linter->lintFile($fs->url().'/foo.php')); self::assertSame($result1, $linter->lintFile($fs->url().'/bar.php')); self::assertSame($result2, $linter->lintFile($fs->url().'/baz.php')); } public function testLintSourceIsCalledOnceOnSameContent(): void { $result1 = $this->createLintingResultDouble(); $result2 = $this->createLintingResultDouble(); $sublinter = $this->createLinterDouble( null, [], [ '<?php echo "baz";' => $result1, '<?php echo "foobarbaz";' => $result2, ], ); $linter = new CachingLinter($sublinter); self::assertSame($result1, $linter->lintSource('<?php echo "baz";')); self::assertSame($result1, $linter->lintSource('<?php echo "baz";')); self::assertSame($result2, $linter->lintSource('<?php echo "foobarbaz";')); } /** * @param array<string, LintingResultInterface> $allowedLintFileCalls * @param array<string, LintingResultInterface> $allowedLintSourceCalls */ private function createLinterDouble(?bool $isAsync, array $allowedLintFileCalls, array $allowedLintSourceCalls): LinterInterface { return new class($isAsync, $allowedLintFileCalls, $allowedLintSourceCalls) implements LinterInterface { private ?bool $isAsync; /** @var array<string, LintingResultInterface> */ private array $allowedLintFileCalls; /** @var array<string, LintingResultInterface> */ private array $allowedLintSourceCalls; /** * @param array<string, LintingResultInterface> $allowedLintFileCalls * @param array<string, LintingResultInterface> $allowedLintSourceCalls */ public function __construct(?bool $isAsync, array $allowedLintFileCalls, array $allowedLintSourceCalls) { $this->isAsync = $isAsync; $this->allowedLintFileCalls = $allowedLintFileCalls; $this->allowedLintSourceCalls = $allowedLintSourceCalls; } public function isAsync(): bool { return $this->isAsync; } public function lintFile(string $path): LintingResultInterface { if (!isset($this->allowedLintFileCalls[$path])) { throw new \LogicException(\sprintf('File "%s" should not be linted.', $path)); } $result = $this->allowedLintFileCalls[$path]; unset($this->allowedLintFileCalls[$path]); return $result; } public function lintSource(string $source): LintingResultInterface { if (!isset($this->allowedLintSourceCalls[$source])) { throw new \LogicException(\sprintf('File "%s" should not be linted.', $source)); } $result = $this->allowedLintSourceCalls[$source]; unset($this->allowedLintSourceCalls[$source]); return $result; } }; } private function createLintingResultDouble(): LintingResultInterface { return new class implements LintingResultInterface { public function check(): void { throw new \LogicException('Not implemented.'); } }; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/TokenizerLinterTest.php
tests/Linter/TokenizerLinterTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\TokenizerLinter; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\Linter\TokenizerLinter * @covers \PhpCsFixer\Linter\TokenizerLintingResult * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class TokenizerLinterTest extends AbstractLinterTestCase { public function testIsAsync(): void { self::assertFalse($this->createLinter()->isAsync()); } protected function createLinter(): LinterInterface { return new TokenizerLinter(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/LintingExceptionTest.php
tests/Linter/LintingExceptionTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\LintingException; use PhpCsFixer\Tests\TestCase; /** * @author Andreas Möller <am@localheinz.com> * * @internal * * @covers \PhpCsFixer\Linter\LintingException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class LintingExceptionTest extends TestCase { public function testConstructorSetsValues(): void { $message = 'Cannot lint this, sorry!'; $code = 9_001; $previous = new \RuntimeException(); $exception = new LintingException( $message, $code, $previous, ); self::assertSame($message, $exception->getMessage()); self::assertSame($code, $exception->getCode()); self::assertSame($previous, $exception->getPrevious()); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/LinterTest.php
tests/Linter/LinterTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\Linter; use PhpCsFixer\Linter\LinterInterface; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @covers \PhpCsFixer\Linter\Linter * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class LinterTest extends AbstractLinterTestCase { public function testIsAsync(): void { self::assertSame(!class_exists(\CompileError::class), $this->createLinter()->isAsync()); } protected function createLinter(): LinterInterface { return new Linter(); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Linter/AbstractLinterTestCase.php
tests/Linter/AbstractLinterTestCase.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Linter; use PhpCsFixer\Linter\LinterInterface; use PhpCsFixer\Linter\LintingException; use PhpCsFixer\Tests\TestCase; use PhpCsFixer\Tokenizer\Token; use PhpCsFixer\Tokenizer\Tokens; /** * @author Dariusz Rumiński <dariusz.ruminski@gmail.com> * * @internal * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ abstract class AbstractLinterTestCase extends TestCase { abstract public function testIsAsync(): void; public function testLintingAfterTokenManipulation(): void { $linter = $this->createLinter(); $tokens = Tokens::fromCode("<?php \n#EOF\n"); $tokens->insertAt(1, new Token([\T_NS_SEPARATOR, '\\'])); $this->expectException(LintingException::class); $linter->lintSource($tokens->generateCode())->check(); } /** * @medium * * @dataProvider provideLintFileCases */ public function testLintFile(string $file, ?string $errorMessage = null): void { if (null !== $errorMessage) { $this->expectException(LintingException::class); $this->expectExceptionMessage($errorMessage); } else { $this->expectNotToPerformAssertions(); } $linter = $this->createLinter(); $linter->lintFile($file)->check(); } /** * @return iterable<int, array{0: string, 1?: string}> */ public static function provideLintFileCases(): iterable { yield [ __DIR__.'/../Fixtures/Linter/valid.php', ]; yield [ __DIR__.'/../Fixtures/Linter/invalid.php', \sprintf('Parse error: syntax error, unexpected %s on line 5.', \PHP_MAJOR_VERSION >= 8 ? 'token "echo"' : '\'echo\' (T_ECHO)'), ]; yield [ __DIR__.'/../Fixtures/Linter/multiple.php', 'Fatal error: Multiple access type modifiers are not allowed on line 4.', ]; } /** * @dataProvider provideLintSourceCases */ public function testLintSource(string $source, ?string $errorMessage = null): void { if (null !== $errorMessage) { $this->expectException(LintingException::class); $this->expectExceptionMessage($errorMessage); } else { $this->expectNotToPerformAssertions(); } $linter = $this->createLinter(); $linter->lintSource($source)->check(); } /** * @return iterable<int, array{0: string, 1?: string}> */ public static function provideLintSourceCases(): iterable { yield [ '<?php echo 123;', ]; yield [ '<?php print "line 2"; print "line 3"; print "line 4"; echo echo; ', \sprintf('Parse error: syntax error, unexpected %s on line 5.', \PHP_MAJOR_VERSION >= 8 ? 'token "echo"' : '\'echo\' (T_ECHO)'), ]; } abstract protected function createLinter(): LinterInterface; }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Documentation/FixerDocumentGeneratorTest.php
tests/Documentation/FixerDocumentGeneratorTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Documentation; use PhpCsFixer\Documentation\DocumentationLocator; use PhpCsFixer\Documentation\FixerDocumentGenerator; use PhpCsFixer\Fixer\Basic\BracesFixer; use PhpCsFixer\Fixer\ClassNotation\ModifierKeywordsFixer; use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; use PhpCsFixer\Fixer\FixerInterface; use PhpCsFixer\Fixer\LanguageConstruct\ClassKeywordFixer; use PhpCsFixer\Fixer\Strict\StrictParamFixer; use PhpCsFixer\FixerFactory; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Documentation\FixerDocumentGenerator * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class FixerDocumentGeneratorTest extends TestCase { /** * @dataProvider provideGenerateRuleSetsDocumentationCases */ public function testGenerateRuleSetsDocumentation(FixerInterface $fixer): void { $locator = new DocumentationLocator(); $generator = new FixerDocumentGenerator($locator); self::assertSame( file_get_contents($locator->getFixerDocumentationFilePath($fixer)), $generator->generateFixerDocumentation($fixer), ); } /** * @return iterable<int, array{FixerInterface}> */ public static function provideGenerateRuleSetsDocumentationCases(): iterable { yield [new BracesFixer()]; yield [new ClassKeywordFixer()]; yield [new HeaderCommentFixer()]; yield [new StrictParamFixer()]; yield [new ModifierKeywordsFixer()]; } public function testGenerateFixersDocumentationIndex(): void { $locator = new DocumentationLocator(); $generator = new FixerDocumentGenerator($locator); $fixerFactory = new FixerFactory(); $fixerFactory->registerBuiltInFixers(); $fixers = $fixerFactory->getFixers(); self::assertSame( file_get_contents($locator->getFixersDocumentationIndexFilePath()), $generator->generateFixersDocumentationIndex($fixers), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Documentation/DocumentationLocatorTest.php
tests/Documentation/DocumentationLocatorTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Documentation; use PhpCsFixer\Documentation\DocumentationLocator; use PhpCsFixer\Fixer\Casing\ConstantCaseFixer; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Documentation\DocumentationLocator * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class DocumentationLocatorTest extends TestCase { public function testFixersDocumentationDirectoryPath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/rules', (new DocumentationLocator())->getFixersDocumentationDirectoryPath(), ); } public function testFixersDocumentationIndexFilePath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/rules/index.rst', (new DocumentationLocator())->getFixersDocumentationIndexFilePath(), ); } public function testFixerDocumentationFilePath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/rules/casing/constant_case.rst', (new DocumentationLocator())->getFixerDocumentationFilePath(new ConstantCaseFixer()), ); } public function testFixerDocumentationFileRelativePath(): void { self::assertSame( 'casing/constant_case.rst', (new DocumentationLocator())->getFixerDocumentationFileRelativePath(new ConstantCaseFixer()), ); } public function testRuleSetsDocumentationDirectoryPath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/ruleSets', (new DocumentationLocator())->getRuleSetsDocumentationDirectoryPath(), ); } public function testRuleSetsDocumentationIndexFilePath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/ruleSets/index.rst', (new DocumentationLocator())->getRuleSetsDocumentationIndexFilePath(), ); } public function testRuleSetsDocumentationFilePath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/ruleSets/PhpCsFixerRisky.rst', (new DocumentationLocator())->getRuleSetsDocumentationFilePath('@PhpCsFixer:risky'), ); } public function testUsageFilePath(): void { self::assertSame( realpath(__DIR__.'/../..').'/doc/usage.rst', (new DocumentationLocator())->getUsageFilePath(), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Documentation/RstUtilsTest.php
tests/Documentation/RstUtilsTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Documentation; use PhpCsFixer\Documentation\RstUtils; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Documentation\RstUtils * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class RstUtilsTest extends TestCase { public function testToRst(): void { self::assertSame( <<<'TEXT' Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. TEXT, RstUtils::toRst( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', 4, ), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Documentation/RuleSetDocumentationGeneratorTest.php
tests/Documentation/RuleSetDocumentationGeneratorTest.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Documentation; use PhpCsFixer\Documentation\DocumentationLocator; use PhpCsFixer\Documentation\RuleSetDocumentationGenerator; use PhpCsFixer\FixerFactory; use PhpCsFixer\RuleSet\RuleSets; use PhpCsFixer\RuleSet\Sets\PERSet; use PhpCsFixer\RuleSet\Sets\SymfonySet; use PhpCsFixer\Tests\TestCase; /** * @internal * * @covers \PhpCsFixer\Documentation\RuleSetDocumentationGenerator * * @no-named-arguments Parameter names are not covered by the backward compatibility promise. */ final class RuleSetDocumentationGeneratorTest extends TestCase { /** * @dataProvider provideGenerateRuleSetsDocumentationCases */ public function testGenerateRuleSetsDocumentation(string $ruleSetName): void { $locator = new DocumentationLocator(); $generator = new RuleSetDocumentationGenerator($locator); $fixerFactory = new FixerFactory(); $fixerFactory->registerBuiltInFixers(); $fixers = $fixerFactory->getFixers(); self::assertSame( file_get_contents($locator->getRuleSetsDocumentationFilePath($ruleSetName)), $generator->generateRuleSetsDocumentation(RuleSets::getSetDefinition($ruleSetName), $fixers), ); } /** * @return iterable<int, array{string}> */ public static function provideGenerateRuleSetsDocumentationCases(): iterable { yield ['@PER']; yield ['@PhpCsFixer:risky']; } public function testGenerateRuleSetsDocumentationIndex(): void { $locator = new DocumentationLocator(); $generator = new RuleSetDocumentationGenerator($locator); self::assertSame( <<<'RST' =========================== List of Available Rule sets =========================== - `@PER <./PER.rst>`_ *(deprecated)* - `@Symfony <./Symfony.rst>`_ RST, $generator->generateRuleSetsDocumentationIndex([ $locator->getRuleSetsDocumentationFilePath('@PER') => new PERSet(), $locator->getRuleSetsDocumentationFilePath('@Symfony') => new SymfonySet(), ]), ); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/.php-cs-fixer.one-time-proxy.php
tests/Fixtures/.php-cs-fixer.one-time-proxy.php
<?php declare(strict_types=1); putenv('PHP_CS_FIXER_TESTS_ALLOW_ONE_TIME_SELF_CONFIG_USAGE=1'); $config = require __DIR__.'/../../.php-cs-fixer.dist.php'; putenv('PHP_CS_FIXER_TESTS_ALLOW_ONE_TIME_SELF_CONFIG_USAGE=0'); return $config;
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/.php-cs-fixer.custom.php
tests/Fixtures/.php-cs-fixer.custom.php
<?php /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ use PhpCsFixer\ConfigInterface; use PhpCsFixer\FailOnUnsupportedVersionConfigInterface; use PhpCsFixer\UnsupportedPhpVersionAllowedConfigInterface; /** * Custom config class/file for PHPUnit test. * * This class does NOT represent a good/sane configuration and is therefore NOT an example. * * @internal */ final class CustomConfig implements ConfigInterface, UnsupportedPhpVersionAllowedConfigInterface { /** * {@inheritdoc} */ public function getCacheFile(): ?string { return null; } /** * {@inheritdoc} */ public function getCustomFixers(): array { return array(); } /** * {@inheritdoc} */ public function getFinder(): iterable { return array(__FILE__); } /** * {@inheritdoc} */ public function getFormat(): string { return 'txt'; } /** * {@inheritdoc} */ public function getHideProgress(): bool { return false; } /** * {@inheritdoc} */ public function getIndent(): string { return ' '; } /** * {@inheritdoc} */ public function getLineEnding(): string { return "\n"; } /** * {@inheritdoc} */ public function getName(): string { return 'custom_config_test'; } /** * {@inheritdoc} */ public function getPhpExecutable(): ?string { return null; } /** * {@inheritdoc} */ public function getRiskyAllowed(): bool { return true; } /** * {@inheritdoc} */ public function getRules(): array { return array('concat_space' => array('spacing' => 'none')); } /** * {@inheritdoc} */ public function getUsingCache(): bool { return false; } /** * {@inheritdoc} */ public function registerCustomFixers(iterable $fixers): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setCacheFile(string $cacheFile): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setFinder(iterable $finder): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setFormat(string $format): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setHideProgress(bool $hideProgress): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setIndent(string $indent): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setLineEnding(string $lineEnding): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setPhpExecutable(?string $phpExecutable): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setRules(array $rules): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function setUsingCache(bool $usingCache): ConfigInterface { return $this; } /** * {@inheritdoc} */ public function getUnsupportedPhpVersionAllowed(): bool { return true; } /** * {@inheritdoc} */ public function setUnsupportedPhpVersionAllowed(bool $isUnsupportedPhpVersionAllowed): ConfigInterface { return $this; } } return new CustomConfig();
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/dummy-file.php
tests/Fixtures/dummy-file.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/.php-cs-fixer.vanilla.php
tests/Fixtures/.php-cs-fixer.vanilla.php
<?php return (new \PhpCsFixer\Config()) ->setFinder( \PhpCsFixer\Finder::create() ->in(__DIR__ . '/../../') ) ;
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/.php-cs-fixer.append-non-existing-file.php
tests/Fixtures/.php-cs-fixer.append-non-existing-file.php
<?php return (new PhpCsFixer\Config()) ->setFinder( PhpCsFixer\Finder::create() ->files() ->in(__DIR__.'/FinderDirectory') ->append(['/root/../../........////////i-do-not-exist']) ) ->setUsingCache(false) ;
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/TestRuleSet.php
tests/Fixtures/TestRuleSet.php
<?php declare(strict_types=1); /* * This file is part of PHP CS Fixer. * * (c) Fabien Potencier <fabien@symfony.com> * Dariusz Rumiński <dariusz.ruminski@gmail.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Fixtures; use PhpCsFixer\RuleSet\AbstractRuleSetDefinition; final class TestRuleSet extends AbstractRuleSetDefinition { public function getDescription(): string { return ''; } public function getRules(): array { return []; } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/empty.php
tests/Fixtures/empty.php
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/.php-cs-fixer.parallel.php
tests/Fixtures/.php-cs-fixer.parallel.php
<?php return (new \PhpCsFixer\Config()) ->setFinder( \PhpCsFixer\Finder::create() ->in(__DIR__ . '/../../') ) ->setParallelConfig(\PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) // @TODO 4.0 no need to call this manually ;
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/phpdocs.test-in.php
tests/Fixtures/Integration/misc/phpdocs.test-in.php
<?php class Foo { /** * @access public */ public $bar; /** * @type array $baz */ public $baz; /** * * FooBar * * @throws Exception * @param inTeGer $fo This is int. * * @param float $bar This is float. * @param int $b Test phpdoc_param_order * @param bool $a Test phpdoc_param_order * @return void * * * @custom */ public function fooBar ($a, $fo, $b, $bar, array $baz, $c, $qux) {} }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/issue_8828_c.test-out.php
tests/Fixtures/Integration/misc/issue_8828_c.test-out.php
<?php if (true) {
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
true
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/huge_array.test-out.php
tests/Fixtures/Integration/misc/huge_array.test-out.php
<?php // This file was auto-generated from sdk-root/src/data/ec2/2016-11-15/api-2.json
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
true
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/issue_8828_b.test-out.php
tests/Fixtures/Integration/misc/issue_8828_b.test-out.php
<?php if (true) {
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
true
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/line_ending,braces.test-in.php
tests/Fixtures/Integration/misc/line_ending,braces.test-in.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Coding standards demonstration. */ class FooBar { const SOME_CONST = 42; private $fooBar; /** * @param string $dummy Some argument description */ public function __construct($dummy) { $this->fooBar = $this->transformText($dummy); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/phpdocs.test-out.php
tests/Fixtures/Integration/misc/phpdocs.test-out.php
<?php class Foo { public $bar; /** * @var array */ public $baz; /** * FooBar. * * @param bool $a Test phpdoc_param_order * @param int $fo this is int * @param int $b Test phpdoc_param_order * @param float $bar this is float * @param mixed $c * @param mixed $qux * * @throws Exception * * @custom */ public function fooBar ($a, $fo, $b, $bar, array $baz, $c, $qux) {} }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/meta_insert_64566_tokens.test-in.php
tests/Fixtures/Integration/misc/meta_insert_64566_tokens.test-in.php
<?php /** * Xxxxxx xx XXX Xxxxx xluxxn xxx XXXXxXxxxn * @xxxxxxn 0.0x */ // // Xxxxxxxx `xxxxxx_xlx` // // `xxxxxx_xlx`.`x_uxxx` $x_uxxx = [ ['xx' => '0','x_nx' => '0','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xäxx','xxxnxxx' => 'Xxxxnx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxnn-Xxxüxx-Xxx. 00***','xxx_x' => '00000 Xxxxxxn','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxnxxxxxx@xxx.xx','xxxxx' => 'XXX Xllxäuxx Xxxuxxnx XxxX','xnx_x' => '','xxx_x' => '00000 Xxxxxxn','lxnx_x' => '','xxl_x' => '0000-00000000','xxx_x' => '','xxxxl_x' => 'x.xxxxx@xxx.xx','uxxxnxxx' => 'xxxxnx.xxxxx','xxxxxxxx' => 'xxxxxx','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => 'Xxxxnxxxn, Xxxuxxxxxxxxxxn','xxxnxxx_x' => '','xx_x' => '','xx_x' => 'xxx.xxx.xx','xxxxx_xxxxx' => 'XXX XxxX','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxnxxxlxunxxn','xxxxx_xnx' => 'Xxxxxxxxxnx 0','xxxxx_xxx' => 'Xxuxxxxxx','xxxxx_xxl' => '0000-0000000','xxxxx_xx' => 'xxx.xxx-xxxx.xx','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxnxxxxx','xxxl_xxxxx' => 'Xxxxxxxulxxnxlx, xxxxxxlxxxxx unx xuxxxxxxxx Xxlxxxunx xux xxx XxxxxXxxxnxx xx Xxxxlxxxx xux Lxuxxxnx unxxx xxx Xxxunxxxxxxxxxxxx','xxxl_xxxx' => 'Xlxxxxn Xxxx','xxxl_xxx' => '','xuxl_unx' => 'XXXX','xuxl_xxx' => 'Xlxxxnx','xuxl_lxnx' => 'Xxxlxxn','xuxl_xxx' => 'XX 0000/0000','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '0','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxx','xxxnxxx' => 'Xlxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xlxxxxxxxx. 0***','xxx_x' => '00000 Xxxxxxxnx***','lxnx_x' => '','xxl_x' => '000 / 00 000 000***','xxx_x' => '000 / 00 000 000***','xxxxl_x' => 'xxxxxx@xxxx.xx','xxxxx' => 'XXXX-Xxxlxxxx Xxxxxx Xxnxxxxxnx & Xxnxulxxnx','xnx_x' => 'Xlxxxxxxxx. 0','xxx_x' => '00000 Xxxxxxxnx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '000 / 00 000 000','xxx_x' => '000 / 00 000 000','xxxxl_x' => 'xxxxxx@xxxx.xx','uxxxnxxx' => 'xlxxn.xxxxxx','xxxxxxxx' => '0xlxxx','xxx' => '0000-00-00','xxxxl_x' => '0000 / 000 00 00','xxxxl_x' => '0000 / 000 00 00','xxx_x' => '','xxx_x' => 'Xxxxxäxxxxüxxxnxxx Xxxxllxxxxxxxx','xxxnxxx_x' => '','xx_x' => 'xxx.xxxx.xx','xx_x' => 'xxx.xxxx.xx','xxxxx_xxxxx' => 'XX Xxxxxn Xünxxxn','xxxxx_xxx' => 'Xxxnxxxxnx unx Xxxnxxxxxxxxnx','xxxxx_xxxn' => 'Xxxxxnx & Xxxxänxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxnxxxxx','xxxl_xxxxx' => 'Xxx Xxnxluxx xxx Xxxxxxx Xxxxxnx Xxxxxxxux xux xxx Xxxxxxxxxxlxxn - xxnx xxxxxxxxxxxx unx xxxxxxxxxx Xnxlxxx','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '0','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxäxnxx','xxxnxxx' => 'Xxxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxn.xxxxxnxx@xxxxx.xx','xxxxx' => 'xxxxx! xxxx','xnx_x' => 'Xxxxxxxxx. 0','xxx_x' => '00000 Xxxnxxuxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '000-000000-00','xxx_x' => '000-000000-00','xxxxl_x' => 'xxxxn.xxxxxnxx@xxxxx.xx','uxxxnxxx' => 'xxxxn.xxxxxnxx','xxxxxxxx' => 'xxxxn0000','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => 'Xxxxuxxxx','xxxnxxx_x' => 'Xxxxunx & Xxxnxxxxnx','xx_x' => 'xxx.xxxxxuxxxxxx.xx','xx_x' => 'xxx.xxxxx.xx','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxunx & Xxxnxxxxnx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxx','xxxl_xxxxx' => '','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => 'Xxxxxxnxxx Unxxxxxxxx Xxllxxx','xuxl_xxx' => 'Lxnxxn','xuxl_lxnx' => 'Xnxlxnx','xuxl_xxx' => '0','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '0','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxnxl','xxxnxxx' => 'Xxlxnxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxxx 000','xxx_x' => 'X-0000 Xünxxxx','lxnx_x' => 'Öxxxxxxxxx','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxlxnxx.xxxnxl@xxxxxxxnxx-xxxxxxxnxn.xxx','xxxxx' => 'Xxxxxxxnxx Xxxxxxxnxn XX','xnx_x' => 'Xxuxxxxx. 000','xxx_x' => 'X-0000 Xxxxxxxxn','lxnx_x' => 'Öxxxxxxxxx','xxl_x' => '0000-0000-00000-00','xxx_x' => '0000-0000-00000','xxxxl_x' => 'xxlxnxx.xxxnxl@xxxxxxxnxx-xxxxxxxnxn.xxx','uxxxnxxx' => 'xxlxnxx.xxxnxl','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000-00000','xxxxl_x' => '0000-000-0000000','xxx_x' => 'Xxxxxxxnx / Xxxxxux','xxx_x' => 'Xxxxuxxxxxn','xxxnxxx_x' => 'Xxuxxxxux','xx_x' => '','xx_x' => 'xxx.xxxxxxxnxx-xxxxxxxnxn.xxx','xxxxx_xxxxx' => 'Xxxx','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxxxx','xxxl_xxxxx' => 'xunxxnxxnxunx xx Xxuxxxxux','xxxl_xxxx' => '','xxxl_xxx' => 'Xxxxxxxx','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '0','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxxxnn','xxxnxxx' => 'Xxxxxxxx','xxxxl' => 'Xx.','xxxxxxnx' => '0000','xnx_x' => 'Xuxxxlxxxx. 00','xxx_x' => '00000 Nußlxxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xx.xxxxxxxxnn@xxxxxx-xxnxxx.xxx','xxxxx' => 'Xxxxxx Xxnxxx Nußlxxx XxxX','xnx_x' => 'Xxllxxxxxx Xxxxßx 000','xxx_x' => '00000 Nußlxxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '00000-00000','xxx_x' => '00000-000000','xxxxl_x' => 'xx.xxxxxxxxnn@xxxxxx-xxnxxx.xxx','uxxxnxxx' => 'xxxxxxxx.xxxxxxxxnn','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000000','xxxxl_x' => '0000-0000000','xxx_x' => '','xxx_x' => 'Xxxxxäxxxxüxxxx','xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx','xx_x' => 'xxx.xxxxxx-xxnxxx.xxx','xx_x' => 'xxx.xxxxxx-xxnxxx.xxx','xxxxx_xxxxx' => 'XXX - Xxxxxxxxxxnxl Xxnnxx Xxxxxxxx, UXX','xxxxx_xxx' => 'Xnxxxnxxxxnxl Xxxxxx','xxxxx_xxxn' => 'Xxxxxnx & Xxxxänxx','xxxxx_xnx' => '','xxxxx_xxx' => 'Xxlxxn Xxxx Xxlxnx','xxxxx_xxl' => '','xxxxx_xx' => 'xxxx://xxx.xxxxxnnxx.xxx','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx','xxxl_xxxxx' => 'Xxxxuxxxxxunxxn unx Xnxxxuxxnxx xxnxx Xxnxxxllxnx-xxnxxxxxxn xux xxxxlxxxxxxxn Xüxxunx xxnxx xulxxxunxxxxnxlxn Xxxxx- unx Xxxxxxxxxnlxxx','xxxl_xxxx' => 'Xxxnxx Xxuxx','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '0','x_nx' => '0','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxlx','xxxnxxx' => 'Xxxxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => '00 Xuxx Xxxx','xxx_x' => 'Xxxlx, Xxxxxx XX00 0XX','lxnx_x' => 'UX','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','xxxxx' => 'Xxxnxxx Xxxxx Xxlxxnxx Lxx.','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'x.xxxxxlx@xxxxxx.xx','uxxxnxxx' => 'xxxxxn.xxxxxlx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => '','xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx','xxxl_xxxxx' => '','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '0','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxxnxxx','xxxnxxx' => 'Xxlx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xülxxxxxxßx 00***','xxx_x' => '00000 Xünxxxn***','lxnx_x' => 'Xxuxxxxlxnx***','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxlx.xxxxxxxnxxx@x-xnlxnx.xx','xxxxx' => 'nxxx.xx','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','uxxxnxxx' => 'xxlx.xxxxxxxnxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => 'Xxxxxäxxxxüxxxx','xxxnxxx_x' => 'Xxxxxn','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxn','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx','xxxl_xxxxx' => '','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xülöx','xxxnxxx' => 'Xxxxnnxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xlxxnxxuxxxx Xxxx 00x','xxx_x' => '00000 Xuxxxuxx','lxnx_x' => 'NXX','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xx@xxlxxnxxxxx.nxx','xxxxx' => 'Xxlx & Xxxx Xuxxxnxxn XxxX & Xx. XX','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','uxxxnxxx' => 'xxxxnnxx.xuxlxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000000','xxxxl_x' => '','xxx_x' => '','xxx_x' => 'Xxxxnxüxxx/Xxxxxäxxxxüxxxx','xxxnxxx_x' => 'Xxnxxxxxx','xx_x' => 'xxx.xxlxxnxxxxx.nxx','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxunx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxx','xxxl_xxxxx' => 'Xxxxlxxxxxxxxxn xüx Xxu unx Xxxxxxx xxnxx Xxlxxnlxxx','xxxl_xxxx' => 'Xxxxx','xxxl_xxx' => '','xuxl_unx' => 'Xxxxxlxnx','xuxl_xxx' => '','xuxl_lxnx' => 'Xxxnxxn','xuxl_xxx' => '0.','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxx','xxxnxxx' => 'Xxxxxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxxxxßx 00***','xxx_x' => '00000 Xxxnxxuxx xx Xxxn***','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxxxn.xxxxx@xxx.xx***','xxxxx' => 'Xxxxxxxxxnx XX','xnx_x' => 'Xxxxxxxlxxx','xxx_x' => 'Xxxnxxuxx xx Xxxn','lxnx_x' => '','xxl_x' => '000/00000000***','xxx_x' => '','xxxxl_x' => 'xxxxxxn.xxxxx@xxxxxxxxxnx.xxx','uxxxnxxx' => 'xxxxxxn.xxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000 / 00 00 0 00***','xxxxl_x' => '0000 / 00 00 0 00***','xxx_x' => 'Xxxxxnxüxxunx','xxx_x' => 'Lxxxxx Xxxnxxxxnx','xxxnxxx_x' => '***','xx_x' => '','xx_x' => 'xxx.xxxxxxxxxnx.xxx','xxxxx_xxxxx' => '0. XXX Xxxnx 00, Xxuxxxxx Xxäxxx-Xxxxxn, XX. Xuxxl','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxnxxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx','xxxl_xxxxx' => 'Xxnxnxxxxunx xxn Xußxxllxxxxxxn - Xxnx Xnxlxxx unxxx xxxxnxxxxx Xxxxxxxxunx xxx Xxxnx XuxXxxxlxx','xxxl_xxxx' => 'Xxxxxxxxn Xlxxxxx','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxx','xxxnxxx' => 'Xxxxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxnnxxx 00','xxx_x' => '00000 Nüxnxxxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxxn_xxxxxxx@xxxxx.xxx','xxxxx' => 'xxxxxx-xxlxxxn XX','xnx_x' => 'xxx-Xxxxlxx Xxx. 0','xxx_x' => '00000 Xxxxxxxnxuxxxx','lxnx_x' => 'Xxxxxnx','xxl_x' => '00000 / 000000***','xxx_x' => '','xxxxl_x' => 'xxxxxn.xxxxxxx@xxxxxx.xxx','uxxxnxxx' => 'xxxxxn.xxxxxxx','xxxxxxxx' => 'xuxxx00','xxx' => '0000-00-00','xxxxl_x' => '0000/ 0000000***','xxxxl_x' => '','xxx_x' => 'XU Xxnnxx','xxx_x' => 'Xlxxxl Xxxxuxx Xxnxxxx Xxnnxx','xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => 'xxxxxx, Xxxxlxx Xxxnxx','xxxxx_xxx' => 'Xxxxxxxnx, Xxlxx','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx','xxxl_xxxxx' => 'Xnxäxxx xux Xxxxxxxxunx xxx Xxnxxxxxnxx xxxxxxxxxnxllxx Xnxxxxxuxlxxxxxlxx','xxxl_xxxx' => 'Xxxxxxxxn Xlxxxxx','xxxl_xxx' => '','xuxl_unx' => 'Xlxuxx Xxxnxxx','xuxl_xxx' => 'Lxxn','xuxl_lxnx' => 'Xxxnxx','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxxxxx','xxxnxxx' => 'Xxnnxnx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => '0000 Xxxxxxxx Xxxxx Xxx X','xxx_x' => 'Lxxx Xxxxxx, XX 00000','lxnx_x' => 'UXX','xxl_x' => '0000-0000000***','xxx_x' => '','xxxxl_x' => 'xxnnxnx.xxxxxxxxxx@xxx.xx***','xxxxx' => 'xxxxxx XX','xnx_x' => 'Xxx-Xxxxlxx-Xlxxx 0-0','xxx_x' => '00000 Xxxxxxxnxuxxxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '00000-000000','xxx_x' => '00000-000000***','xxxxl_x' => 'xxnnxnx.xxxxxxxxxx@xxxxxx.xxx','uxxxnxxx' => 'xxnnxnx.xxxxxxxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000000','xxxxl_x' => '','xxx_x' => 'Xxxxxxxnx Xxxxxxxxnx Xxxxxn XXXX','xxx_x' => 'Xxxxxxx Xxnxxxx Xxxxxxx','xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx','xx_x' => '','xx_x' => 'xxx.xxxxxx.xxx','xxxxx_xxxxx' => 'xxxxxx-Xxlxxxn XX','xxxxx_xxx' => 'xx xxxxxx','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => 'Xxxlx xx Xxxxxx','xxxxx_xxx' => 'Xxxxxxxnxuxxxx','xxxxx_xxl' => '','xxxxx_xx' => 'xxx.xxxxxx.xxx/xxxxuxxx/xxxxxxxx/xxnxxnx/','xxxxx_xux' => '- Xxxxxllunx Xxxxxnx Xxxxxx - Xxxxxxxäxxxuxxx - Xuxxxxüxxunx/Xuxxxxxunxxn xxn Xxxxläuxxn - Xxäxxnxxxxxnxn xxxxxllxn','xxxxx_xxx' => '- xxüxxxxxxx xxxxxxxn - Xxnxxxxx xu xxxxn xxnn xxlxxxxxx xxxn - xxxxxx xnxxxxxxxxn, xxlxxx Xxxxxxxx xn Xxxxx xxxxxn => nxxxx xlxnxlxnxx xn xxx Xxxxxxunx xxxxxxxxn: "Xuxxx Xxxxxxxux xx Xxxxxxx Xxxxxxxnx" => xxxxxx Xxxxuxx-, Xxxnx-, Xxxxxlxxxxxxxnx','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxx','xxxl_xxxxx' => 'Xxxx Xuxxxxxxxxxxn xx Lxuxxxxuxxxxxxxx - xxnx xnxxxxxxxxx Xnxlxxx xxx xx xxxxxx Xxxxxxxx','xxxl_xxxx' => 'Nxxxlx Xxxxxxx','xxxl_xxx' => '- xuxxx xxl xxxxnx Xxxxxnxxxxxxläxx xxxxxn xxxx xx Xxuxxxxxxnxx xxn Xxxx. xxxxnxxuxxxn ;-)','xuxl_unx' => 'Xxuxx Éxxlx Lxxnxxx xx Xxnxx - Xxxnxxxx / Xxux Xlxxx','xuxl_xxx' => 'Xxüxxxl','xuxl_lxnx' => 'Xxlxxxn','xuxl_xxx' => '0','xuxl_xx' => '','xuxl_xxx' => '- xxx xxxxnxxxx xxxxxxxuxxxxxxlxn: xxx Lxuxx xxnx nxxx unx xuxxxxxxxxnx xxn xxxx xu Xxxxnn xxnxxxxxxxn unx xxxxxxn unx xuxxx xxnx Xxxnunx xxxuxxx Xxüxxxl xxx xxnx xxxönx Xxxxx xux xxxnxn unx xxxxxxxxxxn xxxxxx xxxxn nux 0 Xxöxxx xxxx (Xxxnxxxxxxxxunxxxxn...) ','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxlx','xxxnxxx' => 'Xlxxxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxxxxlxxxxxxxx 00','xxx_x' => '00000 Xünxxxn','lxnx_x' => '','xxl_x' => '000-00000000','xxx_x' => '','xxxxl_x' => 'xlxxxx.xxxxxxlx@xxx.xx','xxxxx' => 'XXX','xnx_x' => 'Xünxxxnxxxxx. 0000x','xxx_x' => '00000 Xxxxnxnx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '000-000000000','xxx_x' => '000-000000000','xxxxl_x' => 'xlxxxx.xxxxxxlx@xxx.xx','uxxxnxxx' => 'xlxxxx.xxxxxxlx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000000','xxxxl_x' => '','xxx_x' => 'Xxxxxxxx-Xxnxxxxxnx','xxx_x' => 'Xxxxxxxxxlxnunx','xxxnxxx_x' => 'Xxxxxn','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxn','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx','xxxl_xxxxx' => 'Xxxxxxxxnxxxxnx xx Xxxxxxxllxxxxll','xxxl_xxxx' => 'Xx. Xxxxx Xuxn','xxxl_xxx' => '','xuxl_unx' => 'UXX XXXXX Xxnxxxllxxx','xuxl_xxx' => 'Xxnxxxllxxx','xuxl_lxnx' => 'Xxxnxxxxxx','xuxl_xxx' => '0000/0000','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxxnx','xxxnxxx' => 'Xlxux','xxxxl' => 'Xxxx. Xx.','xxxxxxnx' => '0000','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','xxxxx' => 'Unx Xxxxxuxx','xnx_x' => 'Xnxxxxux xüx Xxxxxxxxxxnxxxxxxxn Unxxxxx. Xxxxxuxx','xxx_x' => '00000 Xxxxxuxx','lxnx_x' => '','xxl_x' => '0000 / 000000','xxx_x' => '0000 / 000000','xxxxl_x' => 'xlxux.xxxxxxxnx@unx-xxxxxuxx.xx','uxxxnxxx' => 'xlxux.xxxxxxxnx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => '','xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx','xxxl_xxxxx' => '','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Ullxxxx','xxxnxxx' => 'Xxxxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxxnxxx 00','xxx_x' => '00000 Xxxnxxxxxuxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxxullxxxx@xxx.xx','xxxxx' => 'xxx Xxxxxxxxxxxxxunxx XxxX','xnx_x' => 'Xxnxlxxxxxxxx. 0','xxx_x' => '00000 Xxxxxuxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '0000 0000000','xxx_x' => '0000 0000000***','xxxxl_x' => 'ullxxxx@xxx-xnlxnx.xx','uxxxnxxx' => 'xxxxx.ullxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '00000 0000000','xxxxl_x' => '00000 0000000***','xxx_x' => 'Xxxxxxxnx/Xxxxxxxx','xxx_x' => '','xxxnxxx_x' => 'Xxnxxxxxx','xx_x' => '','xx_x' => 'xxx.xxx-xnlxnx.xx','xxxxx_xxxxx' => 'Xxxxnx Xxxxl/Xlxxxx&Xxxxxn/Xxxlxnxx Xäxxx-Xxxxxxxx','xxxxx_xxx' => 'Xxxxxxx Xxxxx / Xxxxxnxxxxl Xxxxlxn / Xxxxxxxnx','xxxxx_xxxn' => 'Xxuxxxxux','xxxxx_xnx' => '','xxxxx_xxx' => '00000 Xxx-Xxüxxxnxu / 00000 Xxxlxn / 00000 Xxxlxn','xxxxx_xxl' => '','xxxxx_xx' => 'xxx.xlxxxx-xxxxxn.xx/xxx.xxxlxnxxxxxxxxxxxxxxxx.xx','xxxxx_xux' => 'Xxxxnx Xxxxxx unx Xxx Xxx-Xxüxxxnxu: Xlxnunx, Xuxxxxüxxunx unx Xnxlxxx xxnxx Xxxxxxx-Xxxxxx xüx xxn Xxxxxxxxnxxxxxl / Xlxxxx & Xxxxxn: Xxnxxxxxxnxllx Xuxxxxxn xux Xäxxxxnxxxxxxxxn (Xxxxxxlxxxunxxxxxxxx, Xxxxxxxnxxxxxxx), Xxxnxxlxnunx xüx xxnx Xunxxnxxxxnxxxlxunx, Xäxxxxxxxxunx xx Xxxxx- unx Xxxxxxxx-Xüxx / Xxxlxnxx Xäxxx-Xxxxxxxx: Xnxxlxlxxxx Xxxxxxxxx xn xxx Xxxxxlxunx xxx Xuxxxxxxxxxxx (0000 Xuxxx x.x.), Xxxxxxunx unx Xuxxxxxunx xxx Xuxxx, Xxxxxxxnxxxxxxn xxnxx xünxxäxxxxn Xxxuxxxnxxx-Xxxnxx, Xunxxnxxxxxunx','xxxxx_xxx' => '***','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxx','xxxl_xxxxx' => 'Xxxxux xux Xxllnxxx - Xxxxxxx unx Xxnxxxxuxlxxxxxunx xxn Xxllnxxx xn xxx Xxxxllxxxx','xxxl_xxxx' => 'Xxxx. Xx. Xxxxx','xxxl_xxx' => '***','xuxl_unx' => 'Xxxxxxx Xxllxxx','xuxl_xxx' => 'Xxxxxxx','xuxl_lxnx' => 'Xnxlxnx','xuxl_xxx' => '0','xuxl_xx' => 'xxxx://xxx.xxxxxxx.xx.ux','xuxl_xxx' => '***','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xüxl','xxxnxxx' => 'Lxxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxnxxxxßx 00','xxx_x' => '00000 Xxxxxxxxn','lxnx_x' => 'Xxuxxxxlxnx***','xxl_x' => '','xxx_x' => '***','xxxxl_x' => 'xuxxl_l@xxxxxxl.xxx','xxxxx' => 'Xxuxxxxx Xxlx Xxxxx XxxX','xnx_x' => 'Xxxuxxxxxxx Xxnx 00','xxx_x' => '00000 Xxxxxxxxn','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '0000-000 00-000','xxx_x' => '0000-000 00-000','xxxxl_x' => 'lx@xxx.xxlx.xx','uxxxnxxx' => 'lxxx.xuxxl','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000000','xxxxl_x' => '0000-00 00 00 0***','xxx_x' => '***','xxx_x' => 'Lxxxxx Xxxnxxxxnx & Xxxxunxxxxxxn','xxxnxxx_x' => '','xx_x' => '***','xx_x' => 'xxx.xxlx.xx/xxx','xxxxx_xxxxx' => 'XXX Xxxux','xxxxx_xxx' => 'Xxxxxx- unx Öxxxnxlxxxxxxxxxxxxxx','xxxxx_xxxn' => 'Xxnxxxxxx','xxxxx_xnx' => 'Xxxuxlxxnx***','xxxxx_xxx' => 'Xuxnxxxn','xxxxx_xxl' => '***','xxxxx_xx' => 'xxx.xxx.xx; xxx.xxxxxxux.xxx','xxxxx_xux' => '***','xxxxx_xxx' => '***','xxxl_xxuxl' => 'Xxnxxxxx','xxxl_xxxxx' => 'Xunxxnxxnxunx unx Xxnxunxxxxxxxxxn xx xxxxnxxxxxxxn Xxlxxxxxx','xxxl_xxxx' => 'Xxxx. Xx. X. Xxxxx','xxxl_xxx' => '','xuxl_unx' => 'Xxxäxxxlä','xuxl_xxx' => 'Xxxäxxxlä***','xuxl_lxnx' => 'Xxnnlxnx','xuxl_xxx' => '0***','xuxl_xx' => 'xxx.xxu.xx/xnxxxxnx.xxxxl','xuxl_xxx' => '***','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xlxxxxx','xxxnxxx' => 'Xxxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxxxxxnxxxxßx 00','xxx_x' => '00000 Xxuxxxxnx','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxx@xlxxxxx.xxx','xxxxx' => '','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','uxxxnxxx' => 'xxxx.xlxxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => '','xxxnxxx_x' => '','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => 'X.L. Xxxx Xxxxxxxxxx XxxX','xxxxx_xxx' => 'Xxnxuxxx Xxxxuxxx','xxxxx_xxxn' => '','xxxxx_xnx' => '','xxxxx_xxx' => 'Xxxxxxxx xxx Xünxxxn','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => '','xxxl_xxxxx' => 'Xxxxxxußxxllunxxxnxxxxn xn xxx Xöxxx','xxxl_xxxx' => 'Xxxl.-Xxx. Xxxxxxn Xxlxnxx','xxxl_xxx' => '','xuxl_unx' => 'Unxxxxxxxxx xx Lxxn','xuxl_xxx' => 'Lxxn','xuxl_lxnx' => 'Xxxnxxn','xuxl_xxx' => 'XX 0000/0000','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxx','xxxnxxx' => 'Xxlxxx','xxxxl' => 'Xxxx. Xx.','xxxxxxnx' => '0','xnx_x' => 'Xnxxnxxx. 00x','xxx_x' => '00000 Xxxxxuxx','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxlxxx.xxxxxxx@unx-xxxxxuxx.xx','xxxxx' => 'Unxxxxxxxäx Xxxxxuxx','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','uxxxnxxx' => 'xxlxxx.xxxxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => '','xxx_x' => '','xxxnxxx_x' => '','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => '','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => '','xxxl_xxxxx' => '','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xlxxxxxx','xxxnxxx' => 'Xxxxxxl','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Lxuxnxxx Xx. 00','xxx_x' => '00000 Xünxxxn','lxnx_x' => 'X','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxlxxxxxx@xxx.xx','xxxxx' => 'XXX','xnx_x' => 'Xünxxxnxx Xxx. 000x','xxx_x' => '00000 Xxxxnxnx','lxnx_x' => 'X','xxl_x' => '000 00000 0000','xxx_x' => '000 00000 0000','xxxxl_x' => 'xxxxxxl.xlxxxxxx@xxx.xx','uxxxnxxx' => 'xxxxxxl.xlxxxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000 00 000 00','xxxxl_x' => '','xxx_x' => 'Xxxxxxxxxnxxxxxnx Xxxxxux','xxx_x' => '','xxxnxxx_x' => '','xx_x' => '','xx_x' => 'xxx.xxx.xx','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxnxxxxx','xxxl_xxxxx' => 'Xxxxxxnxxxünxunx xxnxx xxxxxxxxxllxn Xxxnxxx-Xxuxxxx','xxxl_xxxx' => 'Xxxx. Xx. Xxxxxxxxxx','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxux','xxxnxxx' => 'Xxxxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xx. Xxxxxxx-Xxx 00','xxx_x' => '00000 Unxxxxöxxxnx','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxxn.xxux@xxx.xx','xxxxx' => 'Xxuxxxxx Xxlxxxx XX','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','uxxxnxxx' => 'xxxxxn.xxux','xxxxxxxx' => '0xxxxx00','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => 'Xxxxxxxxxxxxnx, X0','xxx_x' => 'Xxxxxxxlxxxxxxn Xxxxxxxxxxxxnx','xxxnxxx_x' => 'Xxxxunx & Xxxnxxxxnx','xx_x' => '','xx_x' => '','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx','xxxl_xxxxx' => 'Xxxxxxnxxxxnx xnxxxnxxxxnxl xüxxxnxxx Xxxxx-Xußxxllxluxx','xxxl_xxxx' => 'Xxxx. Xx. Xlxux Xxxxxxxnx','xxxl_xxx' => '','xuxl_unx' => 'Unxxxxxxxà xx Xxxxnxx','xuxl_xxx' => 'Xxxxnxx','xuxl_lxnx' => 'Xxxlxxn/ Xxxxlxxn','xuxl_xxx' => '0 xnxxxxxxx, xlxxxxxxx xx xünxxxn xx Xuxlxnx','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '0','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xlxxxxx','xxxnxxx' => 'Xxxxxxxxn','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxxxxxnxxxxßx 00','xxx_x' => '00000 Xxuxxxxnx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xlxxxxx@xxxxulx.xxx','xxxxx' => 'XX Xlxxxxxxxxxxxnxxxxx Xxxäxx XxxX','xnx_x' => '','xxx_x' => '','lxnx_x' => '','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xlxxxxx@xxxxulx.xxx','uxxxnxxx' => 'xxxxxxxxn.xlxxxxx','xxxxxxxx' => '000000','xxx' => '0000-00-00','xxxxl_x' => '0000-0000000***','xxxxl_x' => '','xxx_x' => '','xxx_x' => 'Xxxxxäxxxxüxxxx','xxxnxxx_x' => 'Xxnxxxxxx','xx_x' => 'xxx.xlxxxxx.xxx***','xx_x' => 'xxx.xxxxulx.xxx','xxxxx_xxxxx' => 'XXX Xnx.','xxxxx_xxx' => 'Xnxxxnxxxxnxl Xxlxx','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => 'Xunxxnxxxn Xxxxx, XX','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx','xxxl_xxxxx' => 'Üxxxxxüxunx xxx xxxxxxxxxxlxxxxn Lxxxxunxxxäxxxxxxx xx Xxxxxxußxxll','xxxl_xxxx' => 'XX Xx. X. Xxnxx','xxxl_xxx' => '','xuxl_unx' => 'XNXXX','xuxl_xxx' => 'Xxxxxlxnx','xuxl_lxnx' => 'Xxxnxxn','xuxl_xxx' => '0 XX','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxlxxxxn','xxxnxxx' => 'Xxxxxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxxx Xxx. 00 / Xxx. 000','xxx_x' => 'XX-0000 Xux','lxnx_x' => 'Xxxxxxx','xxl_x' => '','xxx_x' => '','xxxxl_x' => '','xxxxx' => 'Xnxxxnx Xxxxxx & Xxxxx','xnx_x' => 'Xxxxxnxuxxx 0','xxx_x' => 'XX-0000 Xux','lxnx_x' => 'Xxxxxxx','xxl_x' => '+00-00-0000000','xxx_x' => '+00-00-0000000','xxxxl_x' => 'xxxxxx.xxlxxxxn@xnxxxnxxxxxxx.xxx','uxxxnxxx' => 'xxxxxx.xxlxxxxn','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '+00-00-0000000','xxxxl_x' => '+00-00-0000000','xxx_x' => 'Xxxxxxxnx','xxx_x' => 'Xxnxxx Xxnxxxx Xxxxxxxnx & Xxlxx','xxxnxxx_x' => 'Xxxxunx & Xxxnxxxxnx','xx_x' => '','xx_x' => 'xxx.xnxxxnxxxxxxx.xxx','xxxxx_xxxxx' => 'XXX','xxxxx_xxx' => 'Xxxxunxxxxxxxn','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx','xxxl_xxxxx' => 'Xxxxxlxxxx Xxxxnxlunx xxn Xxxxxxxxxxxxxxxn','xxxl_xxxx' => 'Xxxxxn Xlxxx','xxxl_xxx' => '','xuxl_unx' => 'XNXXX','xuxl_xxx' => 'Xxxxxlxnx','xuxl_lxnx' => 'Xxxnxxn','xuxl_xxx' => '0 XX','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxx','xxxnxxx' => 'Xxxlxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxxnxxxxxxxx. 00x***','xxx_x' => '00000 Xxlxnxxn***','lxnx_x' => 'Xxuxxxxlxnx***','xxl_x' => '+00(0)0000 00 00 000***','xxx_x' => '+00(0)0000 00 00 000***','xxxxl_x' => 'xxxlxx.xxxxxxx@xx-xxxxxxxnxxxxxnx.xxx','xxxxx' => 'Xuxx XX Xuxxlx Xxxxlxx Xxxxx','xnx_x' => 'Xüxxxuxxxx Xxxxßx 00','xxx_x' => '00000 Xxxxxxxnxuxxxx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '+00(0)0000-00 00 00','xxx_x' => '+00(0)0000-00 0 00 00','xxxxl_x' => 'xxxlxx.xxxxxxx@xuxx.xxx','uxxxnxxx' => 'xxxlxx.xxxxxxx','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '+00(0)000-000 00 00','xxxxl_x' => '','xxx_x' => 'Xxxlx Xxx','xxx_x' => 'Xxnxxxx Xxxxxxxxx Xlxnnxnx xnx Xuxxxxx','xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx','xx_x' => '','xx_x' => 'xxx.xuxx.xxx','xxxxx_xxxxx' => '','xxxxx_xxx' => '','xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx','xxxxx_xnx' => '','xxxxx_xxx' => '','xxxxx_xxl' => '','xxxxx_xx' => '','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx','xxxl_xxxxx' => '','xxxl_xxxx' => '','xxxl_xxx' => '','xuxl_unx' => '','xuxl_xxx' => '','xuxl_lxnx' => '','xuxl_xxx' => '','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxux','xxxnxxx' => 'Xxxxxxx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxlxxxxxxxxx.0***','xxx_x' => '00000 Xünxxxn***','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '','xxx_x' => '','xxxxl_x' => 'xxxxxxx.xxux@xxx.xx***','xxxxx' => 'XxxxxXxxxxx XxxX','xnx_x' => 'Xxxxxxxx Xxxxßx 00','xxx_x' => '00000 Unxxxxxxxxnx','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '000 0000-0','xxx_x' => '','xxxxl_x' => 'xxxxxxx.xxux@xxxxxxxxxxx.xxx','uxxxnxxx' => 'xxxxxxx.xxux','xxxxxxxx' => 'xxlx0xxx','xxx' => '0000-00-00','xxxxl_x' => '','xxxxl_x' => '','xxx_x' => 'xXxxxxxxx/Nxux Xxxxxn','xxx_x' => 'Xxnxxx Xnlxnx Xxxxxxxnx Xxnxxxx','xxxnxxx_x' => '','xx_x' => '','xx_x' => 'xxxx://xxx.xxxxxxxxxxx.xxx','xxxxx_xxxxx' => 'Xxxxxnxxx XxxxxXxxxxxxnx XxxX','xxxxx_xxx' => 'Xxxxxxxnx & Xxlxx','xxxxx_xxxn' => 'Xxxxxn','xxxxx_xnx' => 'Xxxxxxxxxxuxxxxxx 00','xxxxx_xxx' => '00000 Xxxxuxx','xxxxx_xxl' => '+00 00 000 000 00','xxxxx_xx' => 'xxxx://xxx.xxxxxnxxx.xx/xnxxx_unxxxnxxxxn.xxxl','xxxxx_xux' => '','xxxxx_xxx' => '','xxxl_xxuxl' => 'Xxnxxxxx','xxxl_xxxxx' => 'Xxxxxxunx xxn Xxxxxxxxxxx-Xxxxxxxxunxxunxxxnxxxxn','xxxl_xxxx' => 'Xxxxnx Xäxx','xxxl_xxx' => '','xuxl_unx' => 'XUX Xxxxxxnxn','xuxl_xxx' => 'Xxxxxxnxn','xuxl_lxnx' => 'Xxxnxxxxxx','xuxl_xxx' => 'XX 0000/0000','xuxl_xx' => '','xuxl_xxx' => '','xx_xxxxnn' => '0000','xx' => '0000-00-00 00:00:00','xxxnxxx' => NULL], ['xx' => '00','x_nx' => '00','xxxxux' => 'Xxxxlxxnx','nxxxnxxx' => 'Xxxxxxxnn','xxxnxxx' => 'Xxnx','xxxxl' => '','xxxxxxnx' => '0000','xnx_x' => 'Xxxlxxxxxnxx Xxxxßx 000','xxx_x' => '00000 Xünxxxn','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '000-00000000','xxx_x' => '','xxxxl_x' => 'xxnx.xxxxxxxnn@xxx.xx','xxxxx' => 'Xxxxxxxxxxx Xxxxx Xxxux','xnx_x' => 'Xxxxxxxxxx Xxxxßx 00-00','xxx_x' => '00000 Xünxxxn','lxnx_x' => 'Xxuxxxxlxnx','xxl_x' => '000-0000-0000','xxx_x' => '000-0000-0000','xxxxl_x' => 'xxxxxxxnn@lxxx.xxx.xx','uxxxnxxx' => 'xxnx.xxxxxxxnn','xxxxxxxx' => '00000000','xxx' => '0000-00-00','xxxxl_x' => '0000 - 00 00 000','xxxxl_x' => '0000-0000000','xxx_x' => 'Xxlxxx & Xxxxxlxx','xxx_x' => 'Xxxxlxxxxx Xxxxxxxxxxnxxx','xxxnxxx_x' => '','xx_x' => '','xx_x' => 'xxx.xxx.xx','xxxxx_xxxxx' => 'Xxxxxxx & Xxxxxx XxxX','xxxxx_xxx' => 'Xxxxxxxxx','xxxxx_xxxn' => 'Xxxxxunx','xxxxx_xnx' => 'Xxxxxnxxxxxxxxxßx 00 - 00','xxxxx_xxx' => '00000 Xxxnxxuxx','xxxxx_xxl' => '000 - 0000000 - 0','xxxxx_xx' => 'xxx.xuxxxxx.xx','xxxxx_xux' => 'Xxxxxxxxx, Xxxxxnxxxxxxxnxxxunx, Xxxxxxxxunx xxn Xxxxxxxxxxxunxxxxxxn xüx Xunxxn xxx Xxxxlxx Xxxxxlxx, Xlxxxxx xxx.','xxxxx_xxx' => '- XuX xxx xxnx xxx xxxxxn Xxxnxuxxn xx Xxxxxxx Xxxnxxxxnx/Xxxnxxxxxxxxnx - xüx Xxxxxnxlxxxxxn xx xxxxxn xxx Xxxxxxnxx Xxuxxnxx xxnxxxxxxxxn - xxxx xnxxxxxxxnxx Xunxxn Xxxxlxx Xxxxxlxx (Xxxxxxxx-Xxnx, xxxxx, Xxxxxlxx, Xxxx), Xxlxxxx, Xllxxnx, Xlxxxxx xxx.
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
true
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/line_ending,braces.test-out.php
tests/Fixtures/Integration/misc/line_ending,braces.test-out.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Coding standards demonstration. */ class FooBar { const SOME_CONST = 42; private $fooBar; /** * @param string $dummy Some argument description */ public function __construct($dummy) { $this->fooBar = $this->transformText($dummy); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/meta_insert_64566_tokens.test-out.php
tests/Fixtures/Integration/misc/meta_insert_64566_tokens.test-out.php
<?php /** * Xxxxxx xx XXX Xxxxx xluxxn xxx XXXXxXxxxn * @xxxxxxn 0.0x */ // // Xxxxxxxx `xxxxxx_xlx` // // `xxxxxx_xlx`.`x_uxxx` $x_uxxx = [ ['xx' => '0', 'x_nx' => '0', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xäxx', 'xxxnxxx' => 'Xxxxnx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxnn-Xxxüxx-Xxx. 00***', 'xxx_x' => '00000 Xxxxxxn', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxnxxxxxx@xxx.xx', 'xxxxx' => 'XXX Xllxäuxx Xxxuxxnx XxxX', 'xnx_x' => '', 'xxx_x' => '00000 Xxxxxxn', 'lxnx_x' => '', 'xxl_x' => '0000-00000000', 'xxx_x' => '', 'xxxxl_x' => 'x.xxxxx@xxx.xx', 'uxxxnxxx' => 'xxxxnx.xxxxx', 'xxxxxxxx' => 'xxxxxx', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => 'Xxxxnxxxn, Xxxuxxxxxxxxxxn', 'xxxnxxx_x' => '', 'xx_x' => '', 'xx_x' => 'xxx.xxx.xx', 'xxxxx_xxxxx' => 'XXX XxxX', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxnxxxlxunxxn', 'xxxxx_xnx' => 'Xxxxxxxxxnx 0', 'xxxxx_xxx' => 'Xxuxxxxxx', 'xxxxx_xxl' => '0000-0000000', 'xxxxx_xx' => 'xxx.xxx-xxxx.xx', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxnxxxxx', 'xxxl_xxxxx' => 'Xxxxxxxulxxnxlx, xxxxxxlxxxxx unx xuxxxxxxxx Xxlxxxunx xux xxx XxxxxXxxxnxx xx Xxxxlxxxx xux Lxuxxxnx unxxx xxx Xxxunxxxxxxxxxxxx', 'xxxl_xxxx' => 'Xlxxxxn Xxxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'XXXX', 'xuxl_xxx' => 'Xlxxxnx', 'xuxl_lxnx' => 'Xxxlxxn', 'xuxl_xxx' => 'XX 0000/0000', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '0', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxx', 'xxxnxxx' => 'Xlxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xlxxxxxxxx. 0***', 'xxx_x' => '00000 Xxxxxxxnx***', 'lxnx_x' => '', 'xxl_x' => '000 / 00 000 000***', 'xxx_x' => '000 / 00 000 000***', 'xxxxl_x' => 'xxxxxx@xxxx.xx', 'xxxxx' => 'XXXX-Xxxlxxxx Xxxxxx Xxnxxxxxnx & Xxnxulxxnx', 'xnx_x' => 'Xlxxxxxxxx. 0', 'xxx_x' => '00000 Xxxxxxxnx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '000 / 00 000 000', 'xxx_x' => '000 / 00 000 000', 'xxxxl_x' => 'xxxxxx@xxxx.xx', 'uxxxnxxx' => 'xlxxn.xxxxxx', 'xxxxxxxx' => '0xlxxx', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000 / 000 00 00', 'xxxxl_x' => '0000 / 000 00 00', 'xxx_x' => '', 'xxx_x' => 'Xxxxxäxxxxüxxxnxxx Xxxxllxxxxxxxx', 'xxxnxxx_x' => '', 'xx_x' => 'xxx.xxxx.xx', 'xx_x' => 'xxx.xxxx.xx', 'xxxxx_xxxxx' => 'XX Xxxxxn Xünxxxn', 'xxxxx_xxx' => 'Xxxnxxxxnx unx Xxxnxxxxxxxxnx', 'xxxxx_xxxn' => 'Xxxxxnx & Xxxxänxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxnxxxxx', 'xxxl_xxxxx' => 'Xxx Xxnxluxx xxx Xxxxxxx Xxxxxnx Xxxxxxxux xux xxx Xxxxxxxxxxlxxn - xxnx xxxxxxxxxxxx unx xxxxxxxxxx Xnxlxxx', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '0', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxäxnxx', 'xxxnxxx' => 'Xxxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxn.xxxxxnxx@xxxxx.xx', 'xxxxx' => 'xxxxx! xxxx', 'xnx_x' => 'Xxxxxxxxx. 0', 'xxx_x' => '00000 Xxxnxxuxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '000-000000-00', 'xxx_x' => '000-000000-00', 'xxxxl_x' => 'xxxxn.xxxxxnxx@xxxxx.xx', 'uxxxnxxx' => 'xxxxn.xxxxxnxx', 'xxxxxxxx' => 'xxxxn0000', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => 'Xxxxuxxxx', 'xxxnxxx_x' => 'Xxxxunx & Xxxnxxxxnx', 'xx_x' => 'xxx.xxxxxuxxxxxx.xx', 'xx_x' => 'xxx.xxxxx.xx', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxunx & Xxxnxxxxnx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxx', 'xxxl_xxxxx' => '', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => 'Xxxxxxnxxx Unxxxxxxxx Xxllxxx', 'xuxl_xxx' => 'Lxnxxn', 'xuxl_lxnx' => 'Xnxlxnx', 'xuxl_xxx' => '0', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '0', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxnxl', 'xxxnxxx' => 'Xxlxnxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxxx 000', 'xxx_x' => 'X-0000 Xünxxxx', 'lxnx_x' => 'Öxxxxxxxxx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxlxnxx.xxxnxl@xxxxxxxnxx-xxxxxxxnxn.xxx', 'xxxxx' => 'Xxxxxxxnxx Xxxxxxxnxn XX', 'xnx_x' => 'Xxuxxxxx. 000', 'xxx_x' => 'X-0000 Xxxxxxxxn', 'lxnx_x' => 'Öxxxxxxxxx', 'xxl_x' => '0000-0000-00000-00', 'xxx_x' => '0000-0000-00000', 'xxxxl_x' => 'xxlxnxx.xxxnxl@xxxxxxxnxx-xxxxxxxnxn.xxx', 'uxxxnxxx' => 'xxlxnxx.xxxnxl', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000-00000', 'xxxxl_x' => '0000-000-0000000', 'xxx_x' => 'Xxxxxxxnx / Xxxxxux', 'xxx_x' => 'Xxxxuxxxxxn', 'xxxnxxx_x' => 'Xxuxxxxux', 'xx_x' => '', 'xx_x' => 'xxx.xxxxxxxnxx-xxxxxxxnxn.xxx', 'xxxxx_xxxxx' => 'Xxxx', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxxxx', 'xxxl_xxxxx' => 'xunxxnxxnxunx xx Xxuxxxxux', 'xxxl_xxxx' => '', 'xxxl_xxx' => 'Xxxxxxxx', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '0', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxxxnn', 'xxxnxxx' => 'Xxxxxxxx', 'xxxxl' => 'Xx.', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xuxxxlxxxx. 00', 'xxx_x' => '00000 Nußlxxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xx.xxxxxxxxnn@xxxxxx-xxnxxx.xxx', 'xxxxx' => 'Xxxxxx Xxnxxx Nußlxxx XxxX', 'xnx_x' => 'Xxllxxxxxx Xxxxßx 000', 'xxx_x' => '00000 Nußlxxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '00000-00000', 'xxx_x' => '00000-000000', 'xxxxl_x' => 'xx.xxxxxxxxnn@xxxxxx-xxnxxx.xxx', 'uxxxnxxx' => 'xxxxxxxx.xxxxxxxxnn', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000000', 'xxxxl_x' => '0000-0000000', 'xxx_x' => '', 'xxx_x' => 'Xxxxxäxxxxüxxxx', 'xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xx_x' => 'xxx.xxxxxx-xxnxxx.xxx', 'xx_x' => 'xxx.xxxxxx-xxnxxx.xxx', 'xxxxx_xxxxx' => 'XXX - Xxxxxxxxxxnxl Xxnnxx Xxxxxxxx, UXX', 'xxxxx_xxx' => 'Xnxxxnxxxxnxl Xxxxxx', 'xxxxx_xxxn' => 'Xxxxxnx & Xxxxänxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => 'Xxlxxn Xxxx Xxlxnx', 'xxxxx_xxl' => '', 'xxxxx_xx' => 'xxxx://xxx.xxxxxnnxx.xxx', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx', 'xxxl_xxxxx' => 'Xxxxuxxxxxunxxn unx Xnxxxuxxnxx xxnxx Xxnxxxllxnx-xxnxxxxxxn xux xxxxlxxxxxxxn Xüxxunx xxnxx xulxxxunxxxxnxlxn Xxxxx- unx Xxxxxxxxxnlxxx', 'xxxl_xxxx' => 'Xxxnxx Xxuxx', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '0', 'x_nx' => '0', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxlx', 'xxxnxxx' => 'Xxxxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => '00 Xuxx Xxxx', 'xxx_x' => 'Xxxlx, Xxxxxx XX00 0XX', 'lxnx_x' => 'UX', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'xxxxx' => 'Xxxnxxx Xxxxx Xxlxxnxx Lxx.', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'x.xxxxxlx@xxxxxx.xx', 'uxxxnxxx' => 'xxxxxn.xxxxxlx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => '', 'xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx', 'xxxl_xxxxx' => '', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '0', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxxnxxx', 'xxxnxxx' => 'Xxlx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xülxxxxxxßx 00***', 'xxx_x' => '00000 Xünxxxn***', 'lxnx_x' => 'Xxuxxxxlxnx***', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxlx.xxxxxxxnxxx@x-xnlxnx.xx', 'xxxxx' => 'nxxx.xx', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'uxxxnxxx' => 'xxlx.xxxxxxxnxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => 'Xxxxxäxxxxüxxxx', 'xxxnxxx_x' => 'Xxxxxn', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxn', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx', 'xxxl_xxxxx' => '', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xülöx', 'xxxnxxx' => 'Xxxxnnxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xlxxnxxuxxxx Xxxx 00x', 'xxx_x' => '00000 Xuxxxuxx', 'lxnx_x' => 'NXX', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xx@xxlxxnxxxxx.nxx', 'xxxxx' => 'Xxlx & Xxxx Xuxxxnxxn XxxX & Xx. XX', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'uxxxnxxx' => 'xxxxnnxx.xuxlxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000000', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => 'Xxxxnxüxxx/Xxxxxäxxxxüxxxx', 'xxxnxxx_x' => 'Xxnxxxxxx', 'xx_x' => 'xxx.xxlxxnxxxxx.nxx', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxunx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxx', 'xxxl_xxxxx' => 'Xxxxlxxxxxxxxxn xüx Xxu unx Xxxxxxx xxnxx Xxlxxnlxxx', 'xxxl_xxxx' => 'Xxxxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'Xxxxxlxnx', 'xuxl_xxx' => '', 'xuxl_lxnx' => 'Xxxnxxn', 'xuxl_xxx' => '0.', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxx', 'xxxnxxx' => 'Xxxxxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxxxxßx 00***', 'xxx_x' => '00000 Xxxnxxuxx xx Xxxn***', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxxn.xxxxx@xxx.xx***', 'xxxxx' => 'Xxxxxxxxxnx XX', 'xnx_x' => 'Xxxxxxxlxxx', 'xxx_x' => 'Xxxnxxuxx xx Xxxn', 'lxnx_x' => '', 'xxl_x' => '000/00000000***', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxxn.xxxxx@xxxxxxxxxnx.xxx', 'uxxxnxxx' => 'xxxxxxn.xxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000 / 00 00 0 00***', 'xxxxl_x' => '0000 / 00 00 0 00***', 'xxx_x' => 'Xxxxxnxüxxunx', 'xxx_x' => 'Lxxxxx Xxxnxxxxnx', 'xxxnxxx_x' => '***', 'xx_x' => '', 'xx_x' => 'xxx.xxxxxxxxxnx.xxx', 'xxxxx_xxxxx' => '0. XXX Xxxnx 00, Xxuxxxxx Xxäxxx-Xxxxxn, XX. Xuxxl', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxnxxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx', 'xxxl_xxxxx' => 'Xxnxnxxxxunx xxn Xußxxllxxxxxxn - Xxnx Xnxlxxx unxxx xxxxnxxxxx Xxxxxxxxunx xxx Xxxnx XuxXxxxlxx', 'xxxl_xxxx' => 'Xxxxxxxxn Xlxxxxx', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxx', 'xxxnxxx' => 'Xxxxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxnnxxx 00', 'xxx_x' => '00000 Nüxnxxxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxn_xxxxxxx@xxxxx.xxx', 'xxxxx' => 'xxxxxx-xxlxxxn XX', 'xnx_x' => 'xxx-Xxxxlxx Xxx. 0', 'xxx_x' => '00000 Xxxxxxxnxuxxxx', 'lxnx_x' => 'Xxxxxnx', 'xxl_x' => '00000 / 000000***', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxn.xxxxxxx@xxxxxx.xxx', 'uxxxnxxx' => 'xxxxxn.xxxxxxx', 'xxxxxxxx' => 'xuxxx00', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000/ 0000000***', 'xxxxl_x' => '', 'xxx_x' => 'XU Xxnnxx', 'xxx_x' => 'Xlxxxl Xxxxuxx Xxnxxxx Xxnnxx', 'xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => 'xxxxxx, Xxxxlxx Xxxnxx', 'xxxxx_xxx' => 'Xxxxxxxnx, Xxlxx', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx', 'xxxl_xxxxx' => 'Xnxäxxx xux Xxxxxxxxunx xxx Xxnxxxxxnxx xxxxxxxxxnxllxx Xnxxxxxuxlxxxxxlxx', 'xxxl_xxxx' => 'Xxxxxxxxn Xlxxxxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'Xlxuxx Xxxnxxx', 'xuxl_xxx' => 'Lxxn', 'xuxl_lxnx' => 'Xxxnxx', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxxxxx', 'xxxnxxx' => 'Xxnnxnx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => '0000 Xxxxxxxx Xxxxx Xxx X', 'xxx_x' => 'Lxxx Xxxxxx, XX 00000', 'lxnx_x' => 'UXX', 'xxl_x' => '0000-0000000***', 'xxx_x' => '', 'xxxxl_x' => 'xxnnxnx.xxxxxxxxxx@xxx.xx***', 'xxxxx' => 'xxxxxx XX', 'xnx_x' => 'Xxx-Xxxxlxx-Xlxxx 0-0', 'xxx_x' => '00000 Xxxxxxxnxuxxxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '00000-000000', 'xxx_x' => '00000-000000***', 'xxxxl_x' => 'xxnnxnx.xxxxxxxxxx@xxxxxx.xxx', 'uxxxnxxx' => 'xxnnxnx.xxxxxxxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000000', 'xxxxl_x' => '', 'xxx_x' => 'Xxxxxxxnx Xxxxxxxxnx Xxxxxn XXXX', 'xxx_x' => 'Xxxxxxx Xxnxxxx Xxxxxxx', 'xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xx_x' => '', 'xx_x' => 'xxx.xxxxxx.xxx', 'xxxxx_xxxxx' => 'xxxxxx-Xxlxxxn XX', 'xxxxx_xxx' => 'xx xxxxxx', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => 'Xxxlx xx Xxxxxx', 'xxxxx_xxx' => 'Xxxxxxxnxuxxxx', 'xxxxx_xxl' => '', 'xxxxx_xx' => 'xxx.xxxxxx.xxx/xxxxuxxx/xxxxxxxx/xxnxxnx/', 'xxxxx_xux' => '- Xxxxxllunx Xxxxxnx Xxxxxx - Xxxxxxxäxxxuxxx - Xuxxxxüxxunx/Xuxxxxxunxxn xxn Xxxxläuxxn - Xxäxxnxxxxxnxn xxxxxllxn', 'xxxxx_xxx' => '- xxüxxxxxxx xxxxxxxn - Xxnxxxxx xu xxxxn xxnn xxlxxxxxx xxxn - xxxxxx xnxxxxxxxxn, xxlxxx Xxxxxxxx xn Xxxxx xxxxxn => nxxxx xlxnxlxnxx xn xxx Xxxxxxunx xxxxxxxxn: "Xuxxx Xxxxxxxux xx Xxxxxxx Xxxxxxxnx" => xxxxxx Xxxxuxx-, Xxxnx-, Xxxxxlxxxxxxxnx', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxx', 'xxxl_xxxxx' => 'Xxxx Xuxxxxxxxxxxn xx Lxuxxxxuxxxxxxxx - xxnx xnxxxxxxxxx Xnxlxxx xxx xx xxxxxx Xxxxxxxx', 'xxxl_xxxx' => 'Nxxxlx Xxxxxxx', 'xxxl_xxx' => '- xuxxx xxl xxxxnx Xxxxxnxxxxxxläxx xxxxxn xxxx xx Xxuxxxxxxnxx xxn Xxxx. xxxxnxxuxxxn ;-)', 'xuxl_unx' => 'Xxuxx Éxxlx Lxxnxxx xx Xxnxx - Xxxnxxxx / Xxux Xlxxx', 'xuxl_xxx' => 'Xxüxxxl', 'xuxl_lxnx' => 'Xxlxxxn', 'xuxl_xxx' => '0', 'xuxl_xx' => '', 'xuxl_xxx' => '- xxx xxxxnxxxx xxxxxxxuxxxxxxlxn: xxx Lxuxx xxnx nxxx unx xuxxxxxxxxnx xxn xxxx xu Xxxxnn xxnxxxxxxxn unx xxxxxxn unx xuxxx xxnx Xxxnunx xxxuxxx Xxüxxxl xxx xxnx xxxönx Xxxxx xux xxxnxn unx xxxxxxxxxxn xxxxxx xxxxn nux 0 Xxöxxx xxxx (Xxxnxxxxxxxxunxxxxn...) ', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxlx', 'xxxnxxx' => 'Xlxxxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxxxxlxxxxxxxx 00', 'xxx_x' => '00000 Xünxxxn', 'lxnx_x' => '', 'xxl_x' => '000-00000000', 'xxx_x' => '', 'xxxxl_x' => 'xlxxxx.xxxxxxlx@xxx.xx', 'xxxxx' => 'XXX', 'xnx_x' => 'Xünxxxnxxxxx. 0000x', 'xxx_x' => '00000 Xxxxnxnx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '000-000000000', 'xxx_x' => '000-000000000', 'xxxxl_x' => 'xlxxxx.xxxxxxlx@xxx.xx', 'uxxxnxxx' => 'xlxxxx.xxxxxxlx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000000', 'xxxxl_x' => '', 'xxx_x' => 'Xxxxxxxx-Xxnxxxxxnx', 'xxx_x' => 'Xxxxxxxxxlxnunx', 'xxxnxxx_x' => 'Xxxxxn', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxn', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx', 'xxxl_xxxxx' => 'Xxxxxxxxnxxxxnx xx Xxxxxxxllxxxxll', 'xxxl_xxxx' => 'Xx. Xxxxx Xuxn', 'xxxl_xxx' => '', 'xuxl_unx' => 'UXX XXXXX Xxnxxxllxxx', 'xuxl_xxx' => 'Xxnxxxllxxx', 'xuxl_lxnx' => 'Xxxnxxxxxx', 'xuxl_xxx' => '0000/0000', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxxnx', 'xxxnxxx' => 'Xlxux', 'xxxxl' => 'Xxxx. Xx.', 'xxxxxxnx' => '0000', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'xxxxx' => 'Unx Xxxxxuxx', 'xnx_x' => 'Xnxxxxux xüx Xxxxxxxxxxnxxxxxxxn Unxxxxx. Xxxxxuxx', 'xxx_x' => '00000 Xxxxxuxx', 'lxnx_x' => '', 'xxl_x' => '0000 / 000000', 'xxx_x' => '0000 / 000000', 'xxxxl_x' => 'xlxux.xxxxxxxnx@unx-xxxxxuxx.xx', 'uxxxnxxx' => 'xlxux.xxxxxxxnx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => '', 'xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx', 'xxxl_xxxxx' => '', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Ullxxxx', 'xxxnxxx' => 'Xxxxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxxnxxx 00', 'xxx_x' => '00000 Xxxnxxxxxuxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxullxxxx@xxx.xx', 'xxxxx' => 'xxx Xxxxxxxxxxxxxunxx XxxX', 'xnx_x' => 'Xxnxlxxxxxxxx. 0', 'xxx_x' => '00000 Xxxxxuxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '0000 0000000', 'xxx_x' => '0000 0000000***', 'xxxxl_x' => 'ullxxxx@xxx-xnlxnx.xx', 'uxxxnxxx' => 'xxxxx.ullxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '00000 0000000', 'xxxxl_x' => '00000 0000000***', 'xxx_x' => 'Xxxxxxxnx/Xxxxxxxx', 'xxx_x' => '', 'xxxnxxx_x' => 'Xxnxxxxxx', 'xx_x' => '', 'xx_x' => 'xxx.xxx-xnlxnx.xx', 'xxxxx_xxxxx' => 'Xxxxnx Xxxxl/Xlxxxx&Xxxxxn/Xxxlxnxx Xäxxx-Xxxxxxxx', 'xxxxx_xxx' => 'Xxxxxxx Xxxxx / Xxxxxnxxxxl Xxxxlxn / Xxxxxxxnx', 'xxxxx_xxxn' => 'Xxuxxxxux', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '00000 Xxx-Xxüxxxnxu / 00000 Xxxlxn / 00000 Xxxlxn', 'xxxxx_xxl' => '', 'xxxxx_xx' => 'xxx.xlxxxx-xxxxxn.xx/xxx.xxxlxnxxxxxxxxxxxxxxxx.xx', 'xxxxx_xux' => 'Xxxxnx Xxxxxx unx Xxx Xxx-Xxüxxxnxu: Xlxnunx, Xuxxxxüxxunx unx Xnxlxxx xxnxx Xxxxxxx-Xxxxxx xüx xxn Xxxxxxxxnxxxxxl / Xlxxxx & Xxxxxn: Xxnxxxxxxnxllx Xuxxxxxn xux Xäxxxxnxxxxxxxxn (Xxxxxxlxxxunxxxxxxxx, Xxxxxxxnxxxxxxx), Xxxnxxlxnunx xüx xxnx Xunxxnxxxxnxxxlxunx, Xäxxxxxxxxunx xx Xxxxx- unx Xxxxxxxx-Xüxx / Xxxlxnxx Xäxxx-Xxxxxxxx: Xnxxlxlxxxx Xxxxxxxxx xn xxx Xxxxxlxunx xxx Xuxxxxxxxxxxx (0000 Xuxxx x.x.), Xxxxxxunx unx Xuxxxxxunx xxx Xuxxx, Xxxxxxxnxxxxxxn xxnxx xünxxäxxxxn Xxxuxxxnxxx-Xxxnxx, Xunxxnxxxxxunx', 'xxxxx_xxx' => '***', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxx', 'xxxl_xxxxx' => 'Xxxxux xux Xxllnxxx - Xxxxxxx unx Xxnxxxxuxlxxxxxunx xxn Xxllnxxx xn xxx Xxxxllxxxx', 'xxxl_xxxx' => 'Xxxx. Xx. Xxxxx', 'xxxl_xxx' => '***', 'xuxl_unx' => 'Xxxxxxx Xxllxxx', 'xuxl_xxx' => 'Xxxxxxx', 'xuxl_lxnx' => 'Xnxlxnx', 'xuxl_xxx' => '0', 'xuxl_xx' => 'xxxx://xxx.xxxxxxx.xx.ux', 'xuxl_xxx' => '***', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xüxl', 'xxxnxxx' => 'Lxxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxnxxxxßx 00', 'xxx_x' => '00000 Xxxxxxxxn', 'lxnx_x' => 'Xxuxxxxlxnx***', 'xxl_x' => '', 'xxx_x' => '***', 'xxxxl_x' => 'xuxxl_l@xxxxxxl.xxx', 'xxxxx' => 'Xxuxxxxx Xxlx Xxxxx XxxX', 'xnx_x' => 'Xxxuxxxxxxx Xxnx 00', 'xxx_x' => '00000 Xxxxxxxxn', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '0000-000 00-000', 'xxx_x' => '0000-000 00-000', 'xxxxl_x' => 'lx@xxx.xxlx.xx', 'uxxxnxxx' => 'lxxx.xuxxl', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000000', 'xxxxl_x' => '0000-00 00 00 0***', 'xxx_x' => '***', 'xxx_x' => 'Lxxxxx Xxxnxxxxnx & Xxxxunxxxxxxn', 'xxxnxxx_x' => '', 'xx_x' => '***', 'xx_x' => 'xxx.xxlx.xx/xxx', 'xxxxx_xxxxx' => 'XXX Xxxux', 'xxxxx_xxx' => 'Xxxxxx- unx Öxxxnxlxxxxxxxxxxxxxx', 'xxxxx_xxxn' => 'Xxnxxxxxx', 'xxxxx_xnx' => 'Xxxuxlxxnx***', 'xxxxx_xxx' => 'Xuxnxxxn', 'xxxxx_xxl' => '***', 'xxxxx_xx' => 'xxx.xxx.xx; xxx.xxxxxxux.xxx', 'xxxxx_xux' => '***', 'xxxxx_xxx' => '***', 'xxxl_xxuxl' => 'Xxnxxxxx', 'xxxl_xxxxx' => 'Xunxxnxxnxunx unx Xxnxunxxxxxxxxxn xx xxxxnxxxxxxxn Xxlxxxxxx', 'xxxl_xxxx' => 'Xxxx. Xx. X. Xxxxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'Xxxäxxxlä', 'xuxl_xxx' => 'Xxxäxxxlä***', 'xuxl_lxnx' => 'Xxnnlxnx', 'xuxl_xxx' => '0***', 'xuxl_xx' => 'xxx.xxu.xx/xnxxxxnx.xxxxl', 'xuxl_xxx' => '***', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xlxxxxx', 'xxxnxxx' => 'Xxxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxxxxxnxxxxßx 00', 'xxx_x' => '00000 Xxuxxxxnx', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxx@xlxxxxx.xxx', 'xxxxx' => '', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'uxxxnxxx' => 'xxxx.xlxxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => '', 'xxxnxxx_x' => '', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => 'X.L. Xxxx Xxxxxxxxxx XxxX', 'xxxxx_xxx' => 'Xxnxuxxx Xxxxuxxx', 'xxxxx_xxxn' => '', 'xxxxx_xnx' => '', 'xxxxx_xxx' => 'Xxxxxxxx xxx Xünxxxn', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => '', 'xxxl_xxxxx' => 'Xxxxxxußxxllunxxxnxxxxn xn xxx Xöxxx', 'xxxl_xxxx' => 'Xxxl.-Xxx. Xxxxxxn Xxlxnxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'Unxxxxxxxxx xx Lxxn', 'xuxl_xxx' => 'Lxxn', 'xuxl_lxnx' => 'Xxxnxxn', 'xuxl_xxx' => 'XX 0000/0000', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxx', 'xxxnxxx' => 'Xxlxxx', 'xxxxl' => 'Xxxx. Xx.', 'xxxxxxnx' => '0', 'xnx_x' => 'Xnxxnxxx. 00x', 'xxx_x' => '00000 Xxxxxuxx', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxlxxx.xxxxxxx@unx-xxxxxuxx.xx', 'xxxxx' => 'Unxxxxxxxäx Xxxxxuxx', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'uxxxnxxx' => 'xxlxxx.xxxxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => '', 'xxxnxxx_x' => '', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => '', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => '', 'xxxl_xxxxx' => '', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xlxxxxxx', 'xxxnxxx' => 'Xxxxxxl', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Lxuxnxxx Xx. 00', 'xxx_x' => '00000 Xünxxxn', 'lxnx_x' => 'X', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxlxxxxxx@xxx.xx', 'xxxxx' => 'XXX', 'xnx_x' => 'Xünxxxnxx Xxx. 000x', 'xxx_x' => '00000 Xxxxnxnx', 'lxnx_x' => 'X', 'xxl_x' => '000 00000 0000', 'xxx_x' => '000 00000 0000', 'xxxxl_x' => 'xxxxxxl.xlxxxxxx@xxx.xx', 'uxxxnxxx' => 'xxxxxxl.xlxxxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000 00 000 00', 'xxxxl_x' => '', 'xxx_x' => 'Xxxxxxxxxnxxxxxnx Xxxxxux', 'xxx_x' => '', 'xxxnxxx_x' => '', 'xx_x' => '', 'xx_x' => 'xxx.xxx.xx', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxnxxxxx', 'xxxl_xxxxx' => 'Xxxxxxnxxxünxunx xxnxx xxxxxxxxxllxn Xxxnxxx-Xxuxxxx', 'xxxl_xxxx' => 'Xxxx. Xx. Xxxxxxxxxx', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxux', 'xxxnxxx' => 'Xxxxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xx. Xxxxxxx-Xxx 00', 'xxx_x' => '00000 Unxxxxöxxxnx', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxn.xxux@xxx.xx', 'xxxxx' => 'Xxuxxxxx Xxlxxxx XX', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'uxxxnxxx' => 'xxxxxn.xxux', 'xxxxxxxx' => '0xxxxx00', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => 'Xxxxxxxxxxxxnx, X0', 'xxx_x' => 'Xxxxxxxlxxxxxxn Xxxxxxxxxxxxnx', 'xxxnxxx_x' => 'Xxxxunx & Xxxnxxxxnx', 'xx_x' => '', 'xx_x' => '', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx', 'xxxl_xxxxx' => 'Xxxxxxnxxxxnx xnxxxnxxxxnxl xüxxxnxxx Xxxxx-Xußxxllxluxx', 'xxxl_xxxx' => 'Xxxx. Xx. Xlxux Xxxxxxxnx', 'xxxl_xxx' => '', 'xuxl_unx' => 'Unxxxxxxxà xx Xxxxnxx', 'xuxl_xxx' => 'Xxxxnxx', 'xuxl_lxnx' => 'Xxxlxxn/ Xxxxlxxn', 'xuxl_xxx' => '0 xnxxxxxxx, xlxxxxxxx xx xünxxxn xx Xuxlxnx', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '0', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xlxxxxx', 'xxxnxxx' => 'Xxxxxxxxn', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxxxxxnxxxxßx 00', 'xxx_x' => '00000 Xxuxxxxnx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xlxxxxx@xxxxulx.xxx', 'xxxxx' => 'XX Xlxxxxxxxxxxxnxxxxx Xxxäxx XxxX', 'xnx_x' => '', 'xxx_x' => '', 'lxnx_x' => '', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xlxxxxx@xxxxulx.xxx', 'uxxxnxxx' => 'xxxxxxxxn.xlxxxxx', 'xxxxxxxx' => '000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '0000-0000000***', 'xxxxl_x' => '', 'xxx_x' => '', 'xxx_x' => 'Xxxxxäxxxxüxxxx', 'xxxnxxx_x' => 'Xxnxxxxxx', 'xx_x' => 'xxx.xlxxxxx.xxx***', 'xx_x' => 'xxx.xxxxulx.xxx', 'xxxxx_xxxxx' => 'XXX Xnx.', 'xxxxx_xxx' => 'Xnxxxnxxxxnxl Xxlxx', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => 'Xunxxnxxxn Xxxxx, XX', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx', 'xxxl_xxxxx' => 'Üxxxxxüxunx xxx xxxxxxxxxxlxxxxn Lxxxxunxxxäxxxxxxx xx Xxxxxxußxxll', 'xxxl_xxxx' => 'XX Xx. X. Xxnxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'XNXXX', 'xuxl_xxx' => 'Xxxxxlxnx', 'xuxl_lxnx' => 'Xxxnxxn', 'xuxl_xxx' => '0 XX', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxlxxxxn', 'xxxnxxx' => 'Xxxxxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxxx Xxx. 00 / Xxx. 000', 'xxx_x' => 'XX-0000 Xux', 'lxnx_x' => 'Xxxxxxx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => '', 'xxxxx' => 'Xnxxxnx Xxxxxx & Xxxxx', 'xnx_x' => 'Xxxxxnxuxxx 0', 'xxx_x' => 'XX-0000 Xux', 'lxnx_x' => 'Xxxxxxx', 'xxl_x' => '+00-00-0000000', 'xxx_x' => '+00-00-0000000', 'xxxxl_x' => 'xxxxxx.xxlxxxxn@xnxxxnxxxxxxx.xxx', 'uxxxnxxx' => 'xxxxxx.xxlxxxxn', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '+00-00-0000000', 'xxxxl_x' => '+00-00-0000000', 'xxx_x' => 'Xxxxxxxnx', 'xxx_x' => 'Xxnxxx Xxnxxxx Xxxxxxxnx & Xxlxx', 'xxxnxxx_x' => 'Xxxxunx & Xxxnxxxxnx', 'xx_x' => '', 'xx_x' => 'xxx.xnxxxnxxxxxxx.xxx', 'xxxxx_xxxxx' => 'XXX', 'xxxxx_xxx' => 'Xxxxunxxxxxxxn', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxxxxxnx', 'xxxl_xxxxx' => 'Xxxxxlxxxx Xxxxnxlunx xxn Xxxxxxxxxxxxxxxn', 'xxxl_xxxx' => 'Xxxxxn Xlxxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'XNXXX', 'xuxl_xxx' => 'Xxxxxlxnx', 'xuxl_lxnx' => 'Xxxnxxn', 'xuxl_xxx' => '0 XX', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxxxxxx', 'xxxnxxx' => 'Xxxlxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxxnxxxxxxxx. 00x***', 'xxx_x' => '00000 Xxlxnxxn***', 'lxnx_x' => 'Xxuxxxxlxnx***', 'xxl_x' => '+00(0)0000 00 00 000***', 'xxx_x' => '+00(0)0000 00 00 000***', 'xxxxl_x' => 'xxxlxx.xxxxxxx@xx-xxxxxxxnxxxxxnx.xxx', 'xxxxx' => 'Xuxx XX Xuxxlx Xxxxlxx Xxxxx', 'xnx_x' => 'Xüxxxuxxxx Xxxxßx 00', 'xxx_x' => '00000 Xxxxxxxnxuxxxx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '+00(0)0000-00 00 00', 'xxx_x' => '+00(0)0000-00 0 00 00', 'xxxxl_x' => 'xxxlxx.xxxxxxx@xuxx.xxx', 'uxxxnxxx' => 'xxxlxx.xxxxxxx', 'xxxxxxxx' => '00000000', 'xxx' => '0000-00-00', 'xxxxl_x' => '+00(0)000-000 00 00', 'xxxxl_x' => '', 'xxx_x' => 'Xxxlx Xxx', 'xxx_x' => 'Xxnxxxx Xxxxxxxxx Xlxnnxnx xnx Xuxxxxx', 'xxxnxxx_x' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xx_x' => '', 'xx_x' => 'xxx.xuxx.xxx', 'xxxxx_xxxxx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxxn' => 'Xxxxxxxxxxxlxnxuxxxxx', 'xxxxx_xnx' => '', 'xxxxx_xxx' => '', 'xxxxx_xxl' => '', 'xxxxx_xx' => '', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxxx. Xx. Xxxlxxx', 'xxxl_xxxxx' => '', 'xxxl_xxxx' => '', 'xxxl_xxx' => '', 'xuxl_unx' => '', 'xuxl_xxx' => '', 'xuxl_lxnx' => '', 'xuxl_xxx' => '', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL], ['xx' => '00', 'x_nx' => '00', 'xxxxux' => 'Xxxxlxxnx', 'nxxxnxxx' => 'Xxux', 'xxxnxxx' => 'Xxxxxxx', 'xxxxl' => '', 'xxxxxxnx' => '0000', 'xnx_x' => 'Xxxlxxxxxxxxx.0***', 'xxx_x' => '00000 Xünxxxn***', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxxx.xxux@xxx.xx***', 'xxxxx' => 'XxxxxXxxxxx XxxX', 'xnx_x' => 'Xxxxxxxx Xxxxßx 00', 'xxx_x' => '00000 Unxxxxxxxxnx', 'lxnx_x' => 'Xxuxxxxlxnx', 'xxl_x' => '000 0000-0', 'xxx_x' => '', 'xxxxl_x' => 'xxxxxxx.xxux@xxxxxxxxxxx.xxx', 'uxxxnxxx' => 'xxxxxxx.xxux', 'xxxxxxxx' => 'xxlx0xxx', 'xxx' => '0000-00-00', 'xxxxl_x' => '', 'xxxxl_x' => '', 'xxx_x' => 'xXxxxxxxx/Nxux Xxxxxn', 'xxx_x' => 'Xxnxxx Xnlxnx Xxxxxxxnx Xxnxxxx', 'xxxnxxx_x' => '', 'xx_x' => '', 'xx_x' => 'xxxx://xxx.xxxxxxxxxxx.xxx', 'xxxxx_xxxxx' => 'Xxxxxnxxx XxxxxXxxxxxxnx XxxX', 'xxxxx_xxx' => 'Xxxxxxxnx & Xxlxx', 'xxxxx_xxxn' => 'Xxxxxn', 'xxxxx_xnx' => 'Xxxxxxxxxxuxxxxxx 00', 'xxxxx_xxx' => '00000 Xxxxuxx', 'xxxxx_xxl' => '+00 00 000 000 00', 'xxxxx_xx' => 'xxxx://xxx.xxxxxnxxx.xx/xnxxx_unxxxnxxxxn.xxxl', 'xxxxx_xux' => '', 'xxxxx_xxx' => '', 'xxxl_xxuxl' => 'Xxnxxxxx', 'xxxl_xxxxx' => 'Xxxxxxunx xxn Xxxxxxxxxxx-Xxxxxxxxunxxunxxxnxxxxn', 'xxxl_xxxx' => 'Xxxxnx Xäxx', 'xxxl_xxx' => '', 'xuxl_unx' => 'XUX Xxxxxxnxn', 'xuxl_xxx' => 'Xxxxxxnxn', 'xuxl_lxnx' => 'Xxxnxxxxxx', 'xuxl_xxx' => 'XX 0000/0000', 'xuxl_xx' => '', 'xuxl_xxx' => '', 'xx_xxxxnn' => '0000', 'xx' => '0000-00-00 00:00:00', 'xxxnxxx' => NULL],
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
true
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/issue_8828_generator.php
tests/Fixtures/Integration/misc/issue_8828_generator.php
<?php declare(strict_types=1); file_put_contents( __DIR__. '/issue_8828_a.test-out.php', '<?php if (true) { $foo = "'.str_repeat(' text $variable text ', 50_000).'"; }', ); file_put_contents( __DIR__. '/issue_8828_b.test-out.php', '<?php if (true) { $foo = "'.str_repeat(' text {$variable} text ', 50_000).'"; }', ); file_put_contents( __DIR__. '/issue_8828_c.test-out.php', // smaller sample to avoid memory issues in some environments '<?php if (true) { $foo = "'.str_repeat(' text ".$variable." text ', 25_000).'"; }', );
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/misc/issue_8828_a.test-out.php
tests/Fixtures/Integration/misc/issue_8828_a.test-out.php
<?php if (true) {
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
true
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/set/@PSR2_whitespaces.test-out.php
tests/Fixtures/Integration/set/@PSR2_whitespaces.test-out.php
<?php namespace Vendor\Package; use FooInterfaceA; use FooInterfaceB; use BarClass as Bar; use OtherVendor\OtherPackage\BazClass; class Foo extends Bar implements FooInterface { public $aaa = 1; public $bbb = 2; public function sampleFunction($a, $arg1, $arg2, $arg3, $foo, $b = null) { if ($a === $b) { bar(); } elseif ($a > $b) { $foo->bar($arg1); } else { BazClass::bar($arg2, $arg3); } } final public static function bar() { // method body } } class Aaa implements Bbb, Ccc, Ddd { }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/set/@DoctrineAnnotation.test-out.php
tests/Fixtures/Integration/set/@DoctrineAnnotation.test-out.php
<?php /** * @Bar * @Baz( * arg1="baz", * arg2={ * "baz": true * } * ) */ class Foo { }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/set/@PSR12_whitespaces.test-in.php
tests/Fixtures/Integration/set/@PSR12_whitespaces.test-in.php
<? namespace Vendor\Package; use \FooInterfaceA, FooInterfaceB; use \BarClass as Bar; use OtherVendor\OtherPackage\BazClass; class Foo extends Bar implements FooInterfaceA{ use FooTrait, BarTrait; var $aaa = 1, $bbb = 2; public function sampleFunction($a, $arg1, $arg2, $arg3, $foo, $b = null) { if ($a === $b) { bar(); } else if ($a > $b) { $foo->bar($arg1); } else { BazClass::bar($arg2, $arg3); } STATIC::baz(); } static public final function bar() { // method body } } class Aaa implements Bbb, Ccc, Ddd { } $a = new Foo; $b = (boolean) 1; $c = true ? 1 : 2; ?>
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/set/@PER-CS1x0-risky.test-out.php
tests/Fixtures/Integration/set/@PER-CS1x0-risky.test-out.php
<?php class Foo { public function bar($foo, $bar) { } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/set/@PHPUnit5x7Migration-risky.test-out.php
tests/Fixtures/Integration/set/@PHPUnit5x7Migration-risky.test-out.php
<?php use PHPUnit\Framework\Assert; use PHPUnit\Framework\BaseTestListener; use PHPUnit\Framework\TestListener; use PHPUnit_Aaa; use PHPUnit_Aaa_Bbb; use PHPUnit_Aaa_Bbb_Ccc; use PHPUnit_Aaa_Bbb_Ccc_Ddd; use PHPUnit_Aaa_Bbb_Ccc_Ddd_Eee; class FooTest extends \PHPUnit\Framework\TestCase { public function test_dedicate_assert($foo) { $this->assertNull($foo); $this->assertInternalType('array', $foo); $this->assertNan($foo); $this->assertIsReadable($foo); } /** * Foo. */ function test_php_unit_no_expectation_annotation_32() { $this->expectException(\FooException::class); $this->expectExceptionCode(123); bbb(); } /** * Foo. */ function test_php_unit_no_expectation_annotation_43() { $this->expectException(\FooException::class); $this->expectExceptionMessageRegExp('/foo.*$/'); $this->expectExceptionCode(123); ccc(); } public function test_mock_54() { $mock = $this->createMock("Foo"); } public function test_php_unit_expectation_52() { $this->expectException("RuntimeException"); $this->expectExceptionMessage("Msg"); $this->expectExceptionCode(123); } public function test_php_unit_expectation_56() { $this->expectException("RuntimeException"); $this->expectExceptionMessageRegExp("/Msg.*/"); $this->expectExceptionCode(123); } }
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false
PHP-CS-Fixer/PHP-CS-Fixer
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/63b024eaaf8a48445494964bd21a6c38c788f40f/tests/Fixtures/Integration/set/@PER-CS1x0.test-out.php
tests/Fixtures/Integration/set/@PER-CS1x0.test-out.php
<?php namespace Vendor\Package; use FooInterfaceA; use FooInterfaceB; use BarClass as Bar; use OtherVendor\OtherPackage\BazClass; use function foo; use const BAR; class Foo extends Bar implements FooInterfaceA { use FooTrait; use BarTrait; public $aaa = 1; public $bbb = 2; public function sampleFunction($a, $arg1, $arg2, $arg3, $foo, $b = null) { if ($a === $b) { bar(); } elseif ($a > $b) { $foo->bar($arg1); } else { BazClass::bar($arg2, $arg3); } static::baz(); } final public static function bar() { // method body } } class Aaa implements Bbb, Ccc, Ddd { } $a = new Foo(); $b = (bool) 1; $c = true ? (int) '1' : 2;
php
MIT
63b024eaaf8a48445494964bd21a6c38c788f40f
2026-01-04T15:02:54.911792Z
false