[Config] Add deprecation warning
If someone extends FileLoader and do not call the parent constructor a deprecation warning should be triggered.
This commit is contained in:
parent
17387fdc8e
commit
dbfca37703
@ -86,7 +86,12 @@ abstract class FileLoader extends Loader
|
|||||||
// we fallback to the current locator to keep BC
|
// we fallback to the current locator to keep BC
|
||||||
// as some some loaders do not call the parent __construct()
|
// as some some loaders do not call the parent __construct()
|
||||||
// @deprecated should be removed in 3.0
|
// @deprecated should be removed in 3.0
|
||||||
$locator = $loader->getLocator() ?: $this->locator;
|
$locator = $loader->getLocator();
|
||||||
|
if (null === $locator) {
|
||||||
|
@trigger_error('Not calling the parent constructor in '.get_class($loader).' which extends '.__CLASS__.' is deprecated since version 2.7 and will not be supported anymore in 3.0.', E_USER_DEPRECATED);
|
||||||
|
$locator = $this->locator;
|
||||||
|
}
|
||||||
|
|
||||||
$resource = $locator->locate($resource, $this->currentDir, false);
|
$resource = $locator->locate($resource, $this->currentDir, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user