Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryan Thompson
committed
Dec 8, 2015
1 parent
80f23e4
commit 86e96bf
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php namespace Anomaly\SettingsModule\Setting\Command; | ||
|
||
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface; | ||
use Illuminate\Contracts\Bus\SelfHandling; | ||
|
||
/** | ||
* Class GetSetting | ||
* | ||
* @link http://anomaly.is/streams-platform | ||
* @author AnomalyLabs, Inc. <hello@anomaly.is> | ||
* @author Ryan Thompson <ryan@anomaly.is> | ||
* @package Anomaly\SettingsModule\Setting\Plugin\Command | ||
*/ | ||
class GetSetting implements SelfHandling | ||
{ | ||
|
||
/** | ||
* The setting key. | ||
* | ||
* @var string | ||
*/ | ||
protected $key; | ||
|
||
/** | ||
* Create a new GetSetting instance. | ||
* | ||
* @param $key | ||
*/ | ||
public function __construct($key) | ||
{ | ||
$this->key = $key; | ||
} | ||
|
||
/** | ||
* Handle the command. | ||
* | ||
* @param SettingRepositoryInterface $settings | ||
* @return \Anomaly\SettingsModule\Setting\Contract\SettingInterface|null | ||
*/ | ||
public function handle(SettingRepositoryInterface $settings) | ||
{ | ||
return $settings->get($this->key); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters