Skip to content

Upgrading phpro/grumphp 0.18 to 0.19

Breakingv0.18.1 → v0.19.1Breaking3New2Changed2Fixed3

BreakingUpgrade verdict

3 breaking changes.

  • The bin_dir and git_dir settings are gone; use the environment based system to customize paths instead.
  • GrumPHP no longer supports the old PHP-CS-Fixer version 1. The phpcsfixer task now targets the latest version, and phpcsfixer2 still works as an alias.
  • Two settings that only existed to speed up the old PHP-CS-Fixer version 1 are removed.
3 items need code or config changes

Adds amphp/amp ^2.4, amphp/parallel ^1.4, amphp/parallel-functions ^0.1.3, opis/closure ^3.5, psr/container ^1.0.

Breaking3
Removes the bin_dir and git_dir parameters, which were already removed since v0.16; paths are now customized via an environment based system.
bin_dirgit_dir
Drops support for PHP-CS-Fixer v1; the phpcsfixer task now loads the latest PHP-CS-Fixer and a phpcsfixer2 alias is provided.
phpcsfixerphpcsfixer2
Removes the process_async_limit and process_async_wait parameters used for running PHP-CS-Fixer v1 in parallel.
process_async_limitprocess_async_wait

Generated by DepDelta from published PHP source. Not mixed with prose notes.

  • changed: class FilesCollection extends ArrayCollection → class FilesCollection extends ArrayCollection implements \Serializable
  • added: method FilesCollection.serialize(): string
  • added: method FilesCollection.unserialize($serialized): void
  • added: method TasksCollection.groupByPriority(): array
  • removed: class GrumPHP
  • removed: constructor GrumPHP(ContainerInterface $container)
  • removed: method GrumPHP.getAdditionalInfo(): ?string
  • removed: method GrumPHP.getAsciiContentPath(string $resource): ?string
  • removed: method GrumPHP.getGitHookVariables(): array
  • removed: method GrumPHP.getHooksDir(): ?string
  • removed: method GrumPHP.getHooksPreset(): string
  • removed: method GrumPHP.getProcessAsyncLimit(): int
  • removed: method GrumPHP.getProcessAsyncWaitTime(): int
  • removed: method GrumPHP.getProcessTimeout(): ?float
  • removed: method GrumPHP.getTestSuites(): TestSuiteCollection
  • removed: method GrumPHP.hideCircumventionTip(): bool
  • removed: method GrumPHP.ignoreUnstagedChanges(): bool
  • removed: method GrumPHP.stopOnFailure(): bool
  • added: class Configuration implements ConfigurationInterface
  • added: class GrumPHPExtension extends Extension
  • added: method Configuration.getConfigTreeBuilder(): TreeBuilder
  • added: method GrumPHPExtension.getAlias()
  • added: method GrumPHPExtension.getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface
  • added: method GrumPHPExtension.load(array $configs, ContainerBuilder $container): void
  • removed: method PhpParserCompilerPass.markServiceAsPrototype(Definition $definition): void
  • added: class AsciiConfig
  • added: class FixerConfig
  • added: class GitStashConfig
  • added: class HooksConfig
  • added: class ParallelConfig
  • added: class ProcessConfig
  • added: class RunnerConfig
  • added: constructor AsciiConfig(?array $asciiConfig)
  • added: constructor FixerConfig(bool $enabled, bool $fixByDefault)
  • added: constructor GitStashConfig(bool $ignoreUnstagedChanges)
  • added: constructor HooksConfig(?string $dir, string $preset, array $variables)
  • added: constructor ParallelConfig(bool $enabled, int $maxWorkers)
  • added: constructor ProcessConfig(?float $timeout)
  • added: constructor RunnerConfig(bool $stopOnFailure, bool $hideCircumventionTip, ?string $additionalInfo)
  • added: method AsciiConfig.fetchResource(string $resource): ?string
  • added: method FixerConfig.fixByDefault(): bool
  • added: method FixerConfig.isEnabled(): bool
  • added: method GitStashConfig.ignoreUnstagedChanges(): bool
  • added: method HooksConfig.getDir(): ?string
  • added: method HooksConfig.getPreset(): string
  • added: method HooksConfig.getVariables(): array
  • added: method ParallelConfig.getMaxWorkers(): int
  • added: method ParallelConfig.isEnabled(): bool
  • added: method ProcessConfig.getTimeout(): ?float
  • added: method RunnerConfig.getAdditionalInfo(): ?string
  • added: method RunnerConfig.hideCircumventionTip(): bool
  • added: method RunnerConfig.stopOnFailure(): bool
  • added: static method FixerConfig.fromArray(array $config): self
  • added: static method ParallelConfig.fromArray(array $config): self
  • removed: constructor ApplicationConfigurator(GrumPHP $config, iterable $helpers)
  • removed: protected method RunCommand.getRegisteredFiles(): FilesCollection
  • removed: protected method RunCommand.taskRunner(): TaskRunnerHelper
  • removed: protected property RunCommand.grumPHP
  • removed: protected property RunCommand.registeredFilesLocator
  • changed: constructor RunCommand(GrumPHP $config, RegisteredFiles $registeredFilesLocator) → constructor RunCommand(TestSuiteCollection $testSuites, RegisteredFiles $registeredFilesLocator, TaskRunner $taskRunner)
  • added: const RunCommand.EXIT_CODE_NOK
  • added: const RunCommand.EXIT_CODE_OK
  • removed: protected method CommitMsgCommand.taskRunner(): TaskRunnerHelper
  • removed: protected method PreCommitCommand.taskRunner(): TaskRunnerHelper
  • removed: protected property CommitMsgCommand.changedFilesLocator
  • removed: protected property CommitMsgCommand.grumPHP
  • removed: protected property InitCommand.config
  • removed: protected property InitCommand.filesystem
  • removed: protected property InitCommand.input
  • removed: protected property PreCommitCommand.changedFilesLocator
  • removed: protected property PreCommitCommand.grumPHP
  • changed: constructor CommitMsgCommand(GrumPHP $config, ChangedFiles $changedFilesLocator, Filesystem $filesystem, Paths $paths) → constructor CommitMsgCommand(TestSuiteCollection $testSuites, ChangedFiles $changedFilesLocator, TaskRunner $taskRunner, Filesystem $filesystem, Paths $paths)
  • changed: constructor InitCommand(GrumPHP $config, Filesystem $filesystem, ProcessBuilder $processBuilder, Paths $paths) → constructor InitCommand(HooksConfig $hooksConfig, Filesystem $filesystem, ProcessBuilder $processBuilder, Paths $paths)
  • changed: constructor PreCommitCommand(GrumPHP $config, ChangedFiles $changedFilesLocator) → constructor PreCommitCommand(TestSuiteCollection $testSuites, ChangedFiles $changedFilesLocator, TaskRunner $taskRunner)
  • added: const CommitMsgCommand.EXIT_CODE_NOK
  • added: const CommitMsgCommand.EXIT_CODE_OK
  • added: const PreCommitCommand.EXIT_CODE_NOK
  • added: const PreCommitCommand.EXIT_CODE_OK
  • removed: class TaskRunnerHelper extends Helper
  • removed: const TaskRunnerHelper.CODE_ERROR
  • removed: const TaskRunnerHelper.CODE_SUCCESS
  • removed: const TaskRunnerHelper.HELPER_NAME
  • removed: constructor TaskRunnerHelper(GrumPHP $config, TaskRunner $taskRunner, EventDispatcher $eventDispatcher, AsciiLocator $asciiLocator)
  • removed: method TaskRunnerHelper.getName(): string
  • removed: method TaskRunnerHelper.run(OutputInterface $output, TaskRunnerContext $context): int
  • removed: class ProgressSubscriber implements EventSubscriberInterface
  • removed: constructor ProgressSubscriber(OutputInterface $output)
  • removed: method ProgressSubscriber.advanceProgress(TaskEvent $event): void
  • removed: method ProgressSubscriber.createProgressBar(int $totalTasks): ProgressBar
  • removed: method ProgressSubscriber.finishProgress(RunnerEvent $runnerEvent): void
  • removed: method ProgressSubscriber.onTaskProgress(TaskEvent $task, string $event): void
  • removed: method ProgressSubscriber.startProgress(RunnerEvent $event): void
  • removed: static method ProgressSubscriber.getSubscribedEvents(): array
  • changed: constructor StashUnstagedChangesSubscriber(GrumPHP $grumPHP, GitRepository $repository, IOInterface $io) → constructor StashUnstagedChangesSubscriber(GitStashConfig $config, GitRepository $repository, IOInterface $io)
  • added: class DeprecatedException extends RuntimeException
  • added: class FixerException extends RuntimeException
  • added: class ParallelException extends RuntimeException
  • added: static method DeprecatedException.directParameterConfiguration(string $key): self
  • added: static method FixerException.fromProcess(Process $process): self
  • added: static method ParallelException.fromThrowable(\Throwable $error)
  • added: static method ParallelException.fromVerboseThrowable(\Throwable $error)
  • added: class FixResult
  • added: class FixerUpper
  • added: constructor FixerUpper(IOInterface $IO, FixerConfig $config)
  • added: method FixResult.error(): ?\Throwable
  • added: method FixResult.ok(): bool
  • added: method FixResult.result()
  • added: method FixerUpper.fix(TaskResultCollection $results): void
  • added: static method FixResult.failed(\Throwable $error): self
  • added: static method FixResult.success($result): self
  • added: class FixableProcessProvider
  • added: static method FixableProcessProvider.provide(string $command, array $successExitCodes = …): callable
  • removed: method PhpcsFormatter.formatErrorMessage(ProcessArgumentsCollection $defaultArguments, ProcessBuilder $processBuilder): string
  • removed: method PhpcsFormatter.getSuggestedFilesFromJson(array $json): array
  • added: class ESLintFormatter implements ProcessFormatterInterface
  • added: method ESLintFormatter.format(Process $process): string
  • added: method ESLintFormatter.formatErrorMessage(string $message, string $suggestion): string
  • added: method PhpcsFormatter.formatManualFixingOutput(Process $fixProcess): string
  • added: method PhpcsFormatter.getSuggestedFiles(): array
  • removed: class NullIO implements IOInterface
  • removed: method NullIO.isDebug(): bool
  • removed: method NullIO.isDecorated(): bool
  • removed: method NullIO.isInteractive(): bool
  • removed: method NullIO.isVerbose(): bool
  • removed: method NullIO.isVeryVerbose(): bool
  • removed: method NullIO.write(array $messages, bool $newline = …): void
  • removed: method NullIO.writeError(array $messages, bool $newline = …): void
  • changed: class ConsoleIO implements IOInterface → class ConsoleIO implements IOInterface, \Serializable
  • added: method ConsoleIO.colorize(array $messages, string $color): array
  • added: method ConsoleIO.section(): ConsoleSectionOutput
  • added: method ConsoleIO.serialize()
  • added: method ConsoleIO.style(): StyleInterface
  • added: method ConsoleIO.unserialize($serialized)
  • added: method IOInterface.colorize(array $messages, string $color): array
  • added: method IOInterface.section(): ConsoleSectionOutput
  • added: method IOInterface.style(): StyleInterface
  • removed: static method YamlLinter.supportsFlags(): bool
  • removed: static method YamlLinter.supportsTagsWithoutColon(): bool
  • changed: constructor AsciiLocator(GrumPHP $config, Filesystem $filesystem, Paths $paths) → constructor AsciiLocator(AsciiConfig $config, Filesystem $filesystem, Paths $paths)
  • added: class VisitorContainer implements ContainerInterface
  • added: constructor VisitorContainer(array $instances)
  • added: method VisitorContainer.get($id): NodeVisitor
  • added: method VisitorContainer.has($id): bool
  • removed: class AsyncProcessRunner
  • removed: constructor AsyncProcessRunner(GrumPHP $config)
  • removed: method AsyncProcessRunner.run(array $processes): void
  • changed: constructor ProcessBuilder(GrumPHP $config, ExternalCommand $externalCommandLocator, IOInterface $io) → constructor ProcessBuilder(ExternalCommand $externalCommandLocator, IOInterface $io, ProcessConfig $config)
  • removed: const TaskResult.FAILED
  • removed: const TaskResult.NONBLOCKING_FAILED
  • removed: const TaskResult.PASSED
  • removed: const TaskResult.SKIPPED
  • removed: method TaskRunnerContext.hasTasks(): bool
  • removed: method TaskRunnerContext.setSkipSuccessOutput(bool $skipSuccessOutput): void
  • removed: method TaskRunnerContext.setTestSuite(?TestSuiteInterface $testSuite): void
  • changed: constructor TaskRunner(TasksCollection $tasks, GrumPHP $grumPHP, EventDispatcherInterface $eventDispatcher) → constructor TaskRunner(TasksCollection $tasks, MiddlewareStack $middleware)
  • changed: constructor TaskRunnerContext(ContextInterface $taskContext, TestSuiteInterface $testSuite = …, array $tasks = …) → constructor TaskRunnerContext(ContextInterface $taskContext, TestSuiteInterface $testSuite = …, array $taskNames = …)
  • changed: method TaskRunnerContext.getTasks(): array → method TaskRunnerContext.getTasks(): TasksCollection
  • added: class FixableTaskResult implements TaskResultInterface
  • added: class MiddlewareStack
  • added: const TaskResultInterface.FAILED
  • added: const TaskResultInterface.NONBLOCKING_FAILED
  • added: const TaskResultInterface.PASSED
  • added: const TaskResultInterface.SKIPPED
  • added: constructor FixableTaskResult(TaskResultInterface $result, callable $fixer)
  • added: constructor MiddlewareStack(RunnerMiddlewareInterface ...$middlewares)
  • added: final class MemoizedTaskResultMap
  • added: method FixableTaskResult.fix(): FixResult
  • added: method FixableTaskResult.getContext(): ContextInterface
  • added: method FixableTaskResult.getMessage(): string
  • added: method FixableTaskResult.getResultCode(): int
  • added: method FixableTaskResult.getTask(): TaskInterface
  • added: method FixableTaskResult.hasFailed(): bool
  • added: method FixableTaskResult.isBlocking(): bool
  • added: method FixableTaskResult.isPassed(): bool
  • added: method FixableTaskResult.isSkipped(): bool
  • added: method MemoizedTaskResultMap.contains(string $taskName): bool
  • added: method MemoizedTaskResultMap.get(string $taskName): ?TaskResultInterface
  • added: method MemoizedTaskResultMap.onResult(TaskResultInterface $result): void
  • added: method MiddlewareStack.handle(TaskRunnerContext $context): TaskResultCollection
  • added: method TaskResult.isSkipped(): bool
  • added: method TaskResultInterface.hasFailed(): bool
  • added: method TaskResultInterface.isSkipped(): bool
  • added: method TaskRunnerContext.getTaskNames(): array
  • added: method TaskRunnerContext.hasTaskNames(): bool
  • added: method TaskRunnerContext.withSkippedSuccessOutput(bool $skipSuccessOutput): self
  • added: method TaskRunnerContext.withTasks(TasksCollection $tasks): self
  • added: static method MiddlewareStack.fromIterable(iterable $middlewares): self
  • added: class EventDispatchingRunnerMiddleware implements RunnerMiddlewareInterface
  • added: class FixCodeMiddleware implements RunnerMiddlewareInterface
  • added: class GroupByPriorityMiddleware implements RunnerMiddlewareInterface
  • added: class HandleRunnerMiddleware implements RunnerMiddlewareInterface
  • added: class ReportingRunnerMiddleware implements RunnerMiddlewareInterface
  • added: class ReportingTasksSectionRunnerMiddleware implements RunnerMiddlewareInterface
  • added: class TasksFilteringRunnerMiddleware implements RunnerMiddlewareInterface
  • added: constructor EventDispatchingRunnerMiddleware(EventDispatcherInterface $eventDispatcher)
  • added: constructor FixCodeMiddleware(FixerUpper $fixerUpper)
  • added: constructor GroupByPriorityMiddleware(IOInterface $IO, RunnerConfig $config)
  • added: constructor HandleRunnerMiddleware(TaskHandler $taskHandler, RunnerConfig $config)
  • added: constructor ReportingRunnerMiddleware(RunnerReporter $reporter)
  • added: constructor ReportingTasksSectionRunnerMiddleware(TaskResultsReporter $reporter)
  • added: interface RunnerMiddlewareInterface
  • added: method EventDispatchingRunnerMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method FixCodeMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method GroupByPriorityMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method HandleRunnerMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method ReportingRunnerMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method ReportingTasksSectionRunnerMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method RunnerMiddlewareInterface.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: method TasksFilteringRunnerMiddleware.handle(TaskRunnerContext $context, callable $next): TaskResultCollection
  • added: class PoolFactory
  • added: constructor PoolFactory(ParallelConfig $config)
  • added: method PoolFactory.create(): Pool
  • added: class MultiPromise
  • added: static method MultiPromise.cancelable(array $promises, callable $shouldCancel): Promise
  • added: class RunnerReporter
  • added: class TaskResultsReporter
  • added: constructor RunnerReporter(IOInterface $IO, AsciiLocator $asciiLocator, RunnerConfig $config)
  • added: constructor TaskResultsReporter(IOInterface $IO, MemoizedTaskResultMap $taskResultMap)
  • added: method RunnerReporter.finish(TaskRunnerContext $context, TaskResultCollection $results): void
  • added: method RunnerReporter.start(TaskRunnerContext $context): void
  • added: method TaskResultsReporter.report(TaskRunnerContext $context): void
  • added: method TaskResultsReporter.runInSection(callable $actionsInSection)
  • added: class TaskHandler
  • added: constructor TaskHandler(TaskHandlerMiddlewareInterface ...$handlers)
  • added: method TaskHandler.handle(TaskInterface $task, TaskRunnerContext $runnerContext): Promise
  • added: static method TaskHandler.fromIterable(iterable $handlers): self
  • added: class ErrorHandlingTaskHandlerMiddleware implements TaskHandlerMiddlewareInterface
  • added: class EventDispatchingTaskHandlerMiddleware implements TaskHandlerMiddlewareInterface
  • added: class MemoizedResultsTaskHandlerMiddleware implements TaskHandlerMiddlewareInterface
  • added: class NonBlockingTaskHandlerMiddleware implements TaskHandlerMiddlewareInterface
  • added: class ParallelProcessingMiddleware implements TaskHandlerMiddlewareInterface
  • added: class ReportingTaskHandlerMiddleware implements TaskHandlerMiddlewareInterface
  • added: constructor EventDispatchingTaskHandlerMiddleware(EventDispatcherInterface $eventDispatcher)
  • added: constructor MemoizedResultsTaskHandlerMiddleware(MemoizedTaskResultMap $resultMap)
  • added: constructor ParallelProcessingMiddleware(ParallelConfig $config, PoolFactory $poolFactory, IOInterface $IO)
  • added: constructor ReportingTaskHandlerMiddleware(TaskResultsReporter $reporter)
  • added: interface TaskHandlerMiddlewareInterface
  • added: method ErrorHandlingTaskHandlerMiddleware.handle(TaskInterface $task, TaskRunnerContext $runnerContext, callable $next): Promise
  • added: method EventDispatchingTaskHandlerMiddleware.handle(TaskInterface $task, TaskRunnerContext $runnerContext, callable $next): Promise
  • added: method MemoizedResultsTaskHandlerMiddleware.handle(TaskInterface $task, TaskRunnerContext $runnerContext, callable $next): Promise
  • added: method NonBlockingTaskHandlerMiddleware.handle(TaskInterface $task, TaskRunnerContext $runnerContext, callable $next): Promise
  • added: method ParallelProcessingMiddleware.handle(TaskInterface $task, TaskRunnerContext $runnerContext, callable $next): Promise
  • added: method ReportingTaskHandlerMiddleware.handle(TaskInterface $task, TaskRunnerContext $runnerContext, callable $next): Promise
  • added: method TaskHandlerMiddlewareInterface.handle(TaskInterface $task, TaskRunnerContext $runnercontext, callable $next): Promise
  • removed: abstract class AbstractPhpCsFixerTask implements TaskInterface
  • removed: class PhpCsFixerV2 extends AbstractExternalTask
  • removed: constructor AbstractPhpCsFixerTask(ProcessBuilder $processBuilder, AsyncProcessRunner $processRunner, PhpCsFixerFormatter $formatter)
  • removed: method AbstractPhpCsFixerTask.canRunInContext(ContextInterface $context): bool
  • removed: method AbstractPhpCsFixerTask.getConfig(): TaskConfigInterface
  • removed: method AbstractPhpCsFixerTask.withConfig(TaskConfigInterface $config): TaskInterface
  • removed: method PhpCsFixerV2.canRunInContext(ContextInterface $context): bool
  • removed: method PhpCsFixerV2.run(ContextInterface $context): TaskResultInterface
  • removed: protected method AbstractPhpCsFixerTask.runOnAllFiles(ContextInterface $context, ProcessArgumentsCollection $arguments): TaskResult
  • removed: protected method AbstractPhpCsFixerTask.runOnChangedFiles(ContextInterface $context, ProcessArgumentsCollection $arguments, FilesCollection $files): TaskResult
  • removed: protected method Phpcs.addArgumentsFromConfig(ProcessArgumentsCollection $arguments, array $config): ProcessArgumentsCollection
  • removed: protected property AbstractPhpCsFixerTask.config
  • removed: protected property AbstractPhpCsFixerTask.formatter
  • removed: protected property AbstractPhpCsFixerTask.processBuilder
  • removed: protected property AbstractPhpCsFixerTask.processRunner
  • removed: static method PhpCsFixerV2.getConfigurableOptions(): OptionsResolver
  • changed: class PhpCsFixer extends AbstractPhpCsFixerTask → class PhpCsFixer extends AbstractExternalTask
  • added: class ESLint extends AbstractExternalTask
  • added: method ESLint.canRunInContext(ContextInterface $context): bool
  • added: method ESLint.run(ContextInterface $context): TaskResultInterface
  • added: method PhpCsFixer.canRunInContext(ContextInterface $context): bool
  • added: protected property ESLint.formatter
  • added: protected property JsonLint.linter
  • added: protected property PhpCsFixer.formatter
  • added: protected property PhpParser.parser
  • added: protected property Phpcs.formatter
  • added: protected property XmlLint.linter
  • added: protected property YamlLint.linter
  • added: static method ESLint.getConfigurableOptions(): OptionsResolver