7.3 adds plugins: a library can ship its translators, resolvers and augmenters together with the wiring, and a project names the plugin rather than repeating that wiring. Plugins configure the spec pipeline and are not used in classic mode.
One change affects what a build reports. Changed output in 7.3 has the details.
Changed output
Result::isValid(),log(),warnings()anderrors()include what the source scan, the resolvers and skipped classes log. An error logged there now makesisValid()false, as it already made the CLI exit with an error (#2360)
New
- Plugins. A class implementing
Contracts\PluginInterfaceconfigures the builder throughBuilder\Hooks: the resolver, augmenters, mergers, attribute factory and contributions. The component namer, type resolver, compiler and version stay with whoever runs the build.Builder::withPlugins()takes plugin classes, classes mapped to their settings, or instances, and runs them in the order given. An invalid entry is skipped and logged as an error. On the command line,--pluginadds a plugin built without settings (#2360, docs) - Logger in the constructor.
new Builder($logger)takes the PSR-3 logger. A plugin implementingLoggerAwareInterfacegets it (#2360)
Changed
Builder::$loggerholds, andBuilder::getLogger()returns, aCollectingLoggerthat forwards to the logger the builder is given. A subclass assigning its own logger to$loggerwraps it first,new CollectingLogger($logger). A subclass overridinggetLogger()declaresCollectingLoggeras its return type (#2360, docs)
Deprecated, removed in 8.0
Builder::setLogger(). Pass the logger to the constructor. What plugins log inwithPlugins()beforesetLogger()is called does not reach the logger (#2360)
Docs
What's Changed
- docs(Guide): add #2335's changes to Changed output in 7.2 by @DerManoMann in #2359
- feat(Builder): let plugins configure the builder by @DerManoMann in #2360
Full Changelog: 7.2.0...7.3.0