Last active
May 6, 2019 23:24
-
-
Save illmatix/9032a017bc3afd6e472b936af6402f70 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| namespace MyProject\Facades; | |
| use Illuminate\Support\ServiceProvider; | |
| use Illuminate\Support\Facades\Facade as BaseFacade; | |
| use Volume; | |
| use Trend; | |
| class Indicator | |
| { | |
| protected $volume; | |
| protected $trend; | |
| public function __construct(Volume $volume, Trend $trend) | |
| { | |
| $this->volume = $volume; | |
| $this->trend = $trend; | |
| } | |
| public function volume() { | |
| return $this->volume->sma(); | |
| } | |
| public function trend() { | |
| return $this->trend->sma(); | |
| } | |
| } | |
| class Facade extends BaseFacade | |
| { | |
| protected static function getFacadeAccessor() | |
| { | |
| return 'indicator'; | |
| } | |
| } | |
| class IndicatorServiceProvider extends ServiceProvider | |
| { | |
| /** | |
| * Boot the service provider. | |
| */ | |
| public function boot() | |
| { | |
| } | |
| /** | |
| * Register the service provider. | |
| */ | |
| public function register() | |
| { | |
| $this->app->singleton('indicator', function ($app) { | |
| return App::make(Indicator::class); | |
| }); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment