mirror of
https://github.com/pierre42100/comunic
synced 2025-06-23 02:25:18 +00:00
First commit
This commit is contained in:
32
developer/vendor/league/climate/src/Settings/SettingsImporter.php
vendored
Normal file
32
developer/vendor/league/climate/src/Settings/SettingsImporter.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user