Refactoring names

This commit is contained in:
Patrick Ward
2015-10-23 15:34:31 -04:00
parent 88118e8a4c
commit 61620bdcf1
4 changed files with 23 additions and 39 deletions

View File

@ -36,11 +36,11 @@ class Plugin extends PluginBase
public function boot()
{
// Service provider
App::register('\Sensory5\Shortcode\Classes\ShortcodeServiceProvider');
App::register('\Sensory5\Shortcode\Classes\ServiceProvider');
// Register alias
$alias = AliasLoader::getInstance();
$alias->alias('Shortcode', '\Sensory5\Shortcode\Classes\ShortcodeFacade');
$alias->alias('Shortcode', '\Sensory5\Shortcode\Classes\Facade');
// Enable shortcodes on all pages if requested
if (Settings::get('enable_on_render', false))

View File

@ -1,8 +1,8 @@
<?php namespace Sensory5\Shortcode\Classes;
use Illuminate\Support\Facades\Facade;
use October\Rain\Support\Facade as FacadeParent;
class ShortcodeFacade extends Facade
class Facade extends FacadeParent
{
/**
* Get the registered name of the component.

View File

@ -0,0 +1,19 @@
<?php namespace Sensory5\Shortcode\Classes;
use October\Rain\Support\ServiceProvider as ServiceProviderParent;
class ServiceProvider extends ServiceProviderParent
{
/**
* Register the service provider.
*/
public function register()
{
$this->app->bind('shortcode', function() {
return new Shortcode();
});
}
}

View File

@ -1,35 +0,0 @@
<?php namespace Sensory5\Shortcode\Classes;
use Illuminate\Support\ServiceProvider;
class ShortcodeServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*/
public function register()
{
$this->app['shortcode'] = $this->app->share(function ($app) {
return new Shortcode();
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('shortcode');
}
}