House style requires concatenation in examples
parent
5fe37357a2
commit
56ffa407f1
|
@ -83,10 +83,8 @@ and command-line executable commands.
|
||||||
- PHP classes containing defined callbacks must be autoloadable via Composer's
|
- PHP classes containing defined callbacks must be autoloadable via Composer's
|
||||||
autoload functionality.
|
autoload functionality.
|
||||||
- If a defined callback relies on functions defined outside of a class, the
|
- If a defined callback relies on functions defined outside of a class, the
|
||||||
callback must explicitly require the composer autoloader. If used in a
|
callback itself is responsible for loading the appropriate files, as no files
|
||||||
context where`vendor/autoload.php` might not yet exist (such as during a
|
are autoloaded during Composer commands.
|
||||||
`pre-install` or `pre-update` command), the callback should explicitly require
|
|
||||||
whatever files within your root package it needs to execute successfully.
|
|
||||||
|
|
||||||
Script definition example:
|
Script definition example:
|
||||||
|
|
||||||
|
@ -130,7 +128,7 @@ class MyClass
|
||||||
public static function postAutoloadDump(Event $event)
|
public static function postAutoloadDump(Event $event)
|
||||||
{
|
{
|
||||||
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
|
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
|
||||||
require "$vendorDir/autoload.php";
|
require $vendorDir . '/autoload.php';
|
||||||
|
|
||||||
some_function_from_an_autoloaded_file();
|
some_function_from_an_autoloaded_file();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue