mirror of
https://github.com/pierre42100/comunic
synced 2025-06-22 10:05:20 +00:00
33 lines
645 B
PHP
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);
|
|
}
|
|
}
|
|
}
|