Skip to content

Releases: yannoff/console

2.3.0

09 Mar 20:38
Compare
Choose a tag to compare

Release notes

Features

Improvement in exceptions handling

  • All exception are now handled and rendered properly in Application::run() method
  • Calling a command without all mandatory arguments now raise an error message

Breaking changes

The new StreamAware interface may conflict with version 2.0 StreamAware abstract class.

Changelog

  • a60241e [chore:legal] Update license copyright end year
  • 7ea1dcc [refactor] Rework main exception handling

2.2.2

30 Oct 15:33
Compare
Choose a tag to compare

Version 2.2.2 Release Notes

Changelog

  • da1464c [chore] Add php minimum version requirement
  • ac45b6a [Formatter] Consolidate tag parsing engine

2.2.1

28 Oct 15:59
Compare
Choose a tag to compare

Version 2.2.1 has been released 🚀

Fix: Added support for nested styles in formatter input

The PosixFormatter::format() now correctly interprets contents with nested tags, provided the Dick congruence is respected.

Example:

This is a <bold>well-formed expression with a <yellow>nested</yellow> style</bold>

Changelog

  • 6dc3cbf [documentation] Add version 2.2.0 upgrade notes
  • c11f303 [Formatter] Support pseudo-tags nesting

2.2.0

26 Oct 08:53
Compare
Choose a tag to compare

Version 2.2.0 has been released 🚀

New feature: Closure support

As an alternative to extending the base command and implementing the execute() method, the code to be executed at runtime may now be passed as a Closure to the Command constructor.

As a consequence, the Command class is not anymore abstract and can be instanciated directly.

$command = new Command('hello', function() {
    $this->stdout->write('Hello World !');
    return 0;
}

Deprecations

The Formatter character sequences constants will be soon removed, in favor of the ASCII class constants

  • Use ASCII::CR instead of Formatter::CR
  • Use ASCII::LF instead of Formatter::LF
  • Use ASCII::CRLF instead of Formatter::CRLF
  • Use ASCII::TAB instead of Formatter::TAB
  • Use ASCII::STAB instead of Formatter::STAB
  • Use Application::PAD instead of Formatter::PAD

Changelog

  • 3a248b5 [documentation] Fix 2.1.0 upgrade note links
  • 1c082b2 [I/O] Implement ASCII constants class
  • 7980595 [documentation] Update 2.0.0 upgrade notes
  • 2885503 [chore] Remove Command::deprecate() method
  • 0109808 [logic] Implement closure support

2.1.0

15 Oct 17:22
Compare
Choose a tag to compare

Version 2.1.0 released

Upgrading from 2.0.0

The whole stream handling methods have been rehomed in IOHelper

  • The StreamAware super class have been removed
  • The stream pseudo-properties are now handled by the trait's __get() method

To implement a proper __get() method in a class which uses the trait, one will have to import IOHelper::__get() as an alias.

class Acme
{
    use IOHelper {
        __get as __stream_get;
    }
    
    // Implement proper magic getter
    public function __get($name)
    {
        // Put user-defined logic here
        if ($name == 'foo') {
            return 'bar';
        }
        // ...
    
        // Call the trait method then
        return $this->__stream_get($name);
    }
}

2.0.0 (GA)

01 Oct 08:07
Compare
Choose a tag to compare

Version 2.0.0 released ! 🚀

Upgrading from version 1.x

StreamAwareTrait have been removed, in favor of IOHelper

⚠️ Classes using IOHelper must extend StreamAware

  • StreamAwareTrait::ioread() is replaced by IOHelper::read()
  • StreamAwareTrait::iowrite() is replaced by IOHelper::write()
  • StreamAwareTrait::ioerror() is replaced by IOHelper::error()

Command::errorln() and Command::writeln() have been removed

  • Use error() instead of errorln()
  • Use write() instead of writeln()

FormatterFactory have been removed

  • Use Registry::get() if IOHelper stream properties are available
  • Use new PosixFormatter() otherwise (eg. when in a static context)

Formatter classes are not anymore injected in Application & Command

  • Now formatters are stored in an application-wide FormatterRegistry
  • The formatter is picked by output methods at each call, allowing for a better context detection (pipe, reg file, tty...)

Verbosity level is now stored in the main $level publicly accessible static property

  • Use Verbosity::get() instead of Command::getVerbosity()
  • Use Verbosity::set() instead of Command::setVerbosity()

1.6.1

29 Sep 16:54
Compare
Choose a tag to compare
  • 2bf68e9 [runtime] Fix PHP 8.2 deprecations
  • 20fafd7 [chore] Prepare version 2.0.0 upgrade

1.6.0

24 Sep 18:16
Compare
Choose a tag to compare
  • 48ab41e [documentation] Pimp introduction
  • e7ef089 [Streams] Avoid locking stdin when no input

1.5.0

16 Sep 18:40
Compare
Choose a tag to compare
  • 9e921ea [application] Hide system commands from help
  • a85b986 [demo] Mute PHP deprecation warnings
  • 510d052 [application] Improve mono-command apps support
  • 90b210b [github/ci] Remove pull_request event listener
  • b0b94ee [application] Fix mono-command name getter

1.4.0

07 Feb 13:24
Compare
Choose a tag to compare
  • c908379 [github/ci] Add php 8.2 smoke test
  • 5c3177f [chore:legal] Update license copyright end year
  • 236bad8 [Command] Implement basic verbosity support