-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from koenhoeijmakers/patch-1
Fix for #46 (and format code in the process).
- Loading branch information
Showing
6 changed files
with
225 additions
and
172 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor | ||
/.idea | ||
composer.phar | ||
composer.lock |
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
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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
<?php namespace willvincent\Feeds\Facades; | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class FeedsFacade extends Facade { | ||
namespace willvincent\Feeds\Facades; | ||
|
||
protected static function getFacadeAccessor() { | ||
return 'Feeds'; | ||
} | ||
use Illuminate\Support\Facades\Facade; | ||
|
||
class FeedsFacade extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
* | ||
* @throws \RuntimeException | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'Feeds'; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,47 +1,53 @@ | ||
<?php namespace willvincent\Feeds; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use willvincent\Feeds\FeedsFactory; | ||
|
||
class FeedsServiceProvider extends ServiceProvider { | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = true; | ||
|
||
public function boot() { | ||
$this->publishes([ | ||
__DIR__ . '/config/feeds.php' => config_path('feeds.php'), | ||
]); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() { | ||
$this->app->singleton('Feeds', function () { | ||
$config = config('feeds'); | ||
|
||
if (!$config) { | ||
throw new \RunTimeException('Feeds configuration not found. Please run `php artisan vendor:publish`'); | ||
} | ||
|
||
return new FeedsFactory($config); | ||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() { | ||
return ['Feeds']; | ||
} | ||
|
||
class FeedsServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = true; | ||
|
||
/** | ||
* Bootstrap any application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$this->publishes([ | ||
__DIR__ . '/config/feeds.php' => config_path('feeds.php'), | ||
]); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->singleton('Feeds', function () { | ||
$config = config('feeds'); | ||
|
||
if (! $config) { | ||
throw new \RunTimeException('Feeds configuration not found. Please run `php artisan vendor:publish`'); | ||
} | ||
|
||
return new FeedsFactory($config); | ||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return ['Feeds']; | ||
} | ||
} |
Oops, something went wrong.