v1.1.0
Full Changelog: v1.0.0...v1.1.0
New
Superglobals
Superglobals (including $GLOBALS) can be accessed read-only.
// $GLOBALS
Novara::Globals::GLOBALS();
// $_GET
Novara::Globals::GET();
// ...Autoloading with novarity enforcement
By default Novara itself will autoload with enforcement.
Your own project can easily set up an autoloader thanks to the \Novara\Base\Autoloader\Loader class.
Spreading
Reuse a value across multiple calls without creating a dedicated variable.
// This variable infested block:
$unnecessaryVariable = SomeService::getWhatever(); // Buffer to not call getWhatever() thrice
doAThing($unnecessaryVariable);
doAnotherThing($unnecessaryVariable);
if ($unnecessaryVariable > 100) {
echo 'Wow!';
}
// becomes utter beauty:
Novara::Call::spread(
SomeService::getWhatever(),
doAThing(...),
doAnotherThing(...),
fn () => func_get_arg(0) > 100 && print 'Wow!',
);ⓘ
spread()will returntrueif all calls return a truthy value, otherwisefalse.