Files
comunic/developer/vendor/league/climate/src/Settings/SettingsImporter.php
Pierre Hubert 990540b2b9 First commit
2016-11-19 12:08:12 +01:00

33 lines
645 B
PHP

<?php
namespace League\CLImate\Settings;
trait SettingsImporter
{
/**
* Dictates any settings that a class may need access to
*
* @return array
*/
public function settings()
{
return [];
}
/**
* Import the setting into the class
*
* @param \League\CLImate\Settings\SettingsInterface $setting
*/
public function importSetting($setting)
{
$short_name = basename(str_replace('\\', '/', get_class($setting)));
$method = 'importSetting' . $short_name;
if (method_exists($this, $method)) {
$this->$method($setting);
}
}
}