Releases: yannoff/console
2.3.2
2.3.1
Features
- Added new
--bash-compoption
Commits
- c0428e3 [documentation] Add version
2.3.0upgrade notes - 0ab369a [documentation] Fix phpdoc comments
- 9ed79a2 [documentation] Add API Reference build script
- 3d77cc1 [documentation] Remove old API reference files
- e2ed5e5 [documentation] Add new API reference tree
- ceddf1a [documentation] API Ref: add method overrides
- 1e49015 [documentation] Update doc generator binary name
- 6098302 [Command] Add bash completion main option
2.3.0
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
2.2.2
2.2.1
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
2.2.0
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::CRinstead ofFormatter::CR - Use
ASCII::LFinstead ofFormatter::LF - Use
ASCII::CRLFinstead ofFormatter::CRLF - Use
ASCII::TABinstead ofFormatter::TAB - Use
ASCII::STABinstead ofFormatter::STAB - Use
Application::PADinstead ofFormatter::PAD
Changelog
2.1.0
Version 2.1.0 released
Upgrading from 2.0.0
The whole stream handling methods have been rehomed in IOHelper
- The
StreamAwaresuper 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)
Version 2.0.0 released ! 🚀
Upgrading from version 1.x
StreamAwareTrait have been removed, in favor of IOHelper
StreamAwareTrait::ioread()is replaced byIOHelper::read()StreamAwareTrait::iowrite()is replaced byIOHelper::write()StreamAwareTrait::ioerror()is replaced byIOHelper::error()
Command::errorln() and Command::writeln() have been removed
- Use
error()instead oferrorln() - Use
write()instead ofwriteln()
FormatterFactory have been removed
- Use
Registry::get()ifIOHelperstream 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 ofCommand::getVerbosity() - Use
Verbosity::set()instead ofCommand::setVerbosity()