Skip to content

0.4.0

Pre-release
Pre-release

Choose a tag to compare

@theofidry theofidry released this 19 Feb 09:38
· 136 commits to main since this release
6f9cae8

Features

  • Add support for Composer 2.2 (#20)
  • Add support for Symfony 6 (#21)
  • Add AppTester which is a variant of the Symfony ApplicationTester
  • Add various Psalm support improvements (#23, #28, #44)
  • Switch to a more elaborate and type-safe system (#25, #27, #30, #33, #34, #35, #36, #41, #42, #45, #46, #47, #48, #49, #50). The old API is still available but deprecated [Soft BC Break]:
// Before
function (\Fidry\Console\IO $io): bool {
    return $io->getBooleanArgument('my-arg');
}

// After
function (\Fidry\Console\Input\IO $io): bool {
    return $io->getArgument('my-arg')->asBoolean();
}
  • Move IO from the Fidry\Console namespace to Fidry\Console\Input. The old class is still available for BC. (#37) [Soft BC break]
  • Rename ConsoleAssert into InputAssert (#29) and enrich InputAssert [Soft BC Break] (the class was marked as @private)

Note: support for PHP7.4 and 8.0 is planned to be dropped for the next release.

Migration

From 0.3.x to 0.4.x, there is no hard BC break. In other words, unless you were relying on classes marked as @private or @internal, nothing should break.

Nonetheless deprecations have been introduced. The following guide is about taking care of those:

  • Replace imports of Fidry\Console\IO to Fidry\Console\Input\IO
  • Replace usages of $io->get*Argument('arg-name') to $io->getArgument('arg-name')->as*()
  • Replace usages of $io->get*Option('option-name') to $io->getOption('option-name')->as*()