Switch to PSR-4, fix CS and update service provider

This commit is contained in:
James Brooks
2015-12-22 09:34:30 +00:00
parent d961509341
commit c2ec458b2c
40 changed files with 753 additions and 723 deletions

56
src/SearchyServiceProvider.php Executable file
View File

@ -0,0 +1,56 @@
<?php
namespace TomLingham\Searchy;
use Illuminate\Support\ServiceProvider;
class SearchyServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*/
public function register()
{
//
}
/**
* Registers searchy.
*/
public function registerSearchy()
{
$this->app->bindShared('searchy', function ($app) {
return new SearchBuilder($app['config']);
});
}
/**
* Loads the configuration file.
*/
public function setupConfig()
{
$source = realpath(__DIR__.'/../config/searchy.php');
if (class_exists('Illuminate\Foundation\Application', false)) {
$this->publishes([$source => config_path('searchy.php')]);
}
$this->mergeConfigFrom($source, 'searchy');
}
/**
* Boot the service provider.
*/
public function boot()
{
$this->setupConfig();
$this->registerSearchy();
}
}