Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bump deps #1163

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
394 changes: 200 additions & 194 deletions composer.lock

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions spec/Process/ProcessBuilderSpec.php
Original file line number Diff line number Diff line change
@@ -84,6 +84,17 @@ public function getMatchers(): array
{
return [
'beQuoted' => function ($subject, $string) {
if ('\\' === DIRECTORY_SEPARATOR) {
if ($subject !== $string) {
throw new FailureException(sprintf(
'Expected %s, got %s.',
$string,
$subject
));
}
return true;
}

$regex = sprintf('{^([\'"])%s\1$}', preg_quote($string));
if (!preg_match($regex, $subject)) {
throw new FailureException(sprintf(
11 changes: 11 additions & 0 deletions spec/Process/ProcessFactorySpec.php
Original file line number Diff line number Diff line change
@@ -42,6 +42,17 @@ public function getMatchers(): array
{
return [
'beQuoted' => function ($subject, $string) {
if ('\\' === DIRECTORY_SEPARATOR) {
if ($subject !== $string) {
throw new FailureException(sprintf(
'Expected %s, got %s.',
$string,
$subject
));
}
return true;
}

$regex = sprintf('{^([\'"])%s\1$}', preg_quote($string));
if (!preg_match($regex, $subject)) {
throw new FailureException(sprintf(
4 changes: 2 additions & 2 deletions src/Configuration/Loader/DistFileLoader.php
Original file line number Diff line number Diff line change
@@ -18,12 +18,12 @@ public function __construct(LoaderInterface $loader)
$this->loader = $loader;
}

public function load(mixed $resource, string $type = null): mixed
public function load(mixed $resource, ?string $type = null): mixed
{
return $this->loader->load($resource, $type);
}

public function supports(mixed $resource, string $type = null): bool
public function supports(mixed $resource, ?string $type = null): bool
{
if (!\is_string($resource)) {
return false;
2 changes: 1 addition & 1 deletion src/Console/Command/ConfigureCommand.php
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ protected function buildConfiguration(InputInterface $input, OutputInterface $ou
];
}

protected function createQuestionString(string $question, string $default = null, string $separator = ':'): string
protected function createQuestionString(string $question, ?string $default = null, string $separator = ':'): string
{
return null !== $default ?
sprintf('<fg=green>%s</fg=green> [<fg=yellow>%s</fg=yellow>]%s ', $question, $default, $separator) :
2 changes: 1 addition & 1 deletion src/Event/Dispatcher/Bridge/SymfonyEventDispatcher.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public function __construct($eventDispatcher)
$this->dispatcher = $eventDispatcher;
}

public function dispatch(Event $event, string $name = null): void
public function dispatch(Event $event, ?string $name = null): void
{
$interfacesImplemented = class_implements($this->dispatcher);
if (in_array(SymfonyEventDispatcherContract::class, $interfacesImplemented, true)) {
2 changes: 1 addition & 1 deletion src/Event/Dispatcher/EventDispatcherInterface.php
Original file line number Diff line number Diff line change
@@ -8,5 +8,5 @@

interface EventDispatcherInterface
{
public function dispatch(Event $event, string $name = null): void;
public function dispatch(Event $event, ?string $name = null): void;
}
2 changes: 1 addition & 1 deletion src/Parser/Php/Configurator/TraverserConfigurator.php
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ public function registerVisitorId(string $alias, string $visitorId): void
/**
* @throws \GrumPHP\Exception\RuntimeException
*/
public function registerStandardEnabledVisitor(string $alias, array $visitorOptions = null): void
public function registerStandardEnabledVisitor(string $alias, ?array $visitorOptions = null): void
{
if (array_key_exists($alias, $this->standardEnabledVisitors)) {
throw new RuntimeException(
2 changes: 1 addition & 1 deletion src/Process/ProcessBuilder.php
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ public function __construct(ExternalCommand $externalCommandLocator, IOInterface
*/
public function createArgumentsForCommand(
string $command,
callable $pathManipulator = null
?callable $pathManipulator = null
): ProcessArgumentsCollection {
$executable = $this->externalCommandLocator->locate($command);
$manipulatedExecutable = $pathManipulator ? $pathManipulator($executable) : $executable;
2 changes: 1 addition & 1 deletion src/Runner/TaskRunnerContext.php
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ class TaskRunnerContext
*/
public function __construct(
ContextInterface $taskContext,
TestSuiteInterface $testSuite = null,
?TestSuiteInterface $testSuite = null,
array $taskNames = []
) {
$this->taskContext = $taskContext;
16 changes: 9 additions & 7 deletions test/E2E/AbstractE2ETestCase.php
Original file line number Diff line number Diff line change
@@ -73,6 +73,8 @@ protected function initializeGitSubModule(string $gitPath, string $submodulePath
$process = new Process(
[
$this->executableFinder->find('git'),
'-c',
'protocol.file.allow=always',
'submodule',
'add',
'-f',
@@ -174,7 +176,7 @@ protected function mergeComposerConfig(string $composerFile, array $config, $rec
$this->dumpFile($composerFile, json_encode($newSource, $flags));
}

protected function ensureHooksExist(string $gitPath = null, string $containsPattern = '{grumphp}')
protected function ensureHooksExist(?string $gitPath = null, string $containsPattern = '{grumphp}')
{
$gitPath = $gitPath ?: $this->rootDir;
$hooks = ['pre-commit', 'commit-msg'];
@@ -346,7 +348,7 @@ protected function installComposer(string $path, array $arguments = [])
$this->runCommand('install composer', $process);
}

protected function commitAll(string $gitPath = null)
protected function commitAll(?string $gitPath = null)
{
$gitPath = $gitPath ?: $this->rootDir;
$git = $this->executableFinder->find('git');
@@ -362,7 +364,7 @@ protected function commitAll(string $gitPath = null)
* --all: Tell the command to automatically stage files that have been modified and deleted,
* but new files you have not told Git about are not affected.
*/
protected function commitModifiedAndDeleted(string $gitPath = null)
protected function commitModifiedAndDeleted(?string $gitPath = null)
{
$gitPath = $gitPath ?: $this->rootDir;
$git = $this->executableFinder->find('git');
@@ -382,7 +384,7 @@ protected function runGrumphp(string $projectPath, string $vendorPath = './vendo
{
$projectPath = $this->relativeRootPath($projectPath);
$process = new Process(
[$vendorPath.'/bin/grumphp', 'run', '-vvv'],
[$this->executableFinder->find('php'), $vendorPath.'/bin/grumphp', 'run', '-vvv'],
$projectPath
);

@@ -396,7 +398,7 @@ protected function runGrumphpWithConfig(string $projectPath, string $grumphpFile
$projectPath = $this->relativeRootPath($projectPath);
$this->runCommand('grumphp run with config',
new Process(
[$vendorPath.'/bin/grumphp', 'run', '-vvv', '--config='.$grumphpFile],
[$this->executableFinder->find('php'), $vendorPath.'/bin/grumphp', 'run', '-vvv', '--config='.$grumphpFile],
$projectPath
)
);
@@ -407,7 +409,7 @@ protected function runGrumphpInfo(string $projectPath, $vendorPath = './vendor')
$projectPath = $this->relativeRootPath($projectPath);
$this->runCommand('grumphp info',
new Process(
[$vendorPath.'/bin/grumphp'],
[$this->executableFinder->find('php'), $vendorPath.'/bin/grumphp'],
$projectPath
)
);
@@ -418,7 +420,7 @@ protected function initializeGrumphpGitHooksWithConfig(string $grumphpFile, $ven
$this->runCommand(
'grumphp git:init',
new Process(
[$vendorPath.'/bin/grumphp', 'git:init', '--config='.$grumphpFile],
[$this->executableFinder->find('php'), $vendorPath.'/bin/grumphp', 'git:init', '--config='.$grumphpFile],
$this->rootDir
)
);
2 changes: 1 addition & 1 deletion test/E2E/GitHookParametersTest.php
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ function it_can_specify_hook_exec_command_with_additional_arguments()

$this->installComposer($this->rootDir);

$hookPattern = sprintf('{[\'"]%s[\'"] [\'"]-d date\.timezone=Europe/Brussels[\'"]}', preg_quote($php));
$hookPattern = sprintf('{([\'"]?)%s([\'"]?) [\'"]-d date\.timezone=Europe/Brussels[\'"]}', preg_quote($php));
$this->ensureHooksExist($this->rootDir, $hookPattern);

$this->enableValidatePathsTask($grumphpFile, $this->rootDir);