-
Notifications
You must be signed in to change notification settings - Fork 38
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 #145 from ARCANEDEV/update-package
Updating the package
- Loading branch information
Showing
20 changed files
with
155 additions
and
186 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,7 +1,5 @@ | ||
language: php | ||
|
||
sudo: false | ||
|
||
php: | ||
- 7.2 | ||
- 7.3 | ||
|
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
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
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 was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -8,8 +8,6 @@ | |
* | ||
* @package Arcanedev\Localization\Middleware | ||
* @author ARCANEDEV <[email protected]> | ||
* | ||
* @todo: Refactoring | ||
*/ | ||
class LocaleSessionRedirect extends Middleware | ||
{ | ||
|
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,20 +1,23 @@ | ||
<?php namespace Arcanedev\Localization\Providers; | ||
|
||
use Arcanedev\Localization\Contracts\LocalesManager as LocalesManagerContract; | ||
use Arcanedev\Localization\Contracts\Negotiator as NegotiatorContract; | ||
use Arcanedev\Localization\Contracts\RouteTranslator as RouteTranslatorContract; | ||
use Arcanedev\Localization\Utilities\LocalesManager; | ||
use Arcanedev\Localization\Utilities\Negotiator; | ||
use Arcanedev\Localization\Utilities\RouteTranslator; | ||
use Arcanedev\Support\ServiceProvider; | ||
use Arcanedev\Localization\Contracts\{ | ||
LocalesManager as LocalesManagerContract, | ||
Localization as LocalizationContract, | ||
Negotiator as NegotiatorContract, | ||
RouteTranslator as RouteTranslatorContract | ||
}; | ||
use Arcanedev\Localization\Localization; | ||
use Arcanedev\Localization\Utilities\{LocalesManager, Negotiator, RouteTranslator}; | ||
use Arcanedev\Support\Providers\ServiceProvider; | ||
use Illuminate\Contracts\Support\DeferrableProvider; | ||
|
||
/** | ||
* Class UtilitiesServiceProvider | ||
* Class DeferredServicesProvider | ||
* | ||
* @package Arcanedev\Localization\Providers | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class UtilitiesServiceProvider extends ServiceProvider | ||
class DeferredServicesProvider extends ServiceProvider implements DeferrableProvider | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
|
@@ -24,10 +27,9 @@ class UtilitiesServiceProvider extends ServiceProvider | |
/** | ||
* Register the service provider. | ||
*/ | ||
public function register() | ||
public function register(): void | ||
{ | ||
parent::register(); | ||
|
||
$this->registerLocalization(); | ||
$this->registerRouteTranslator(); | ||
$this->registerLocalesManager(); | ||
$this->registerLocaleNegotiator(); | ||
|
@@ -41,25 +43,32 @@ public function register() | |
public function provides() | ||
{ | ||
return [ | ||
LocalizationContract::class, | ||
RouteTranslatorContract::class, | ||
LocalesManagerContract::class, | ||
NegotiatorContract::class, | ||
]; | ||
} | ||
|
||
/* ----------------------------------------------------------------- | ||
| Utilities | ||
| Services | ||
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Register Localization. | ||
*/ | ||
private function registerLocalization() | ||
{ | ||
$this->singleton(LocalizationContract::class, Localization::class); | ||
} | ||
|
||
/** | ||
* Register RouteTranslator utility. | ||
*/ | ||
private function registerRouteTranslator() | ||
{ | ||
$this->singleton(RouteTranslatorContract::class, function ($app) { | ||
return new RouteTranslator($app['translator']); | ||
}); | ||
$this->singleton(RouteTranslatorContract::class, RouteTranslator::class); | ||
} | ||
|
||
/** | ||
|
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
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
Oops, something went wrong.