| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function register() |
||
| 17 | { |
||
| 18 | $this->app->singleton('encrypter.sodium', function ($app) { |
||
| 19 | $config = $app->make('config')->get('app'); |
||
| 20 | |||
| 21 | if (Str::startsWith($key = $this->key($config), 'base64:')) { |
||
| 22 | $key = base64_decode(substr($key, 7)); |
||
| 23 | } |
||
| 24 | |||
| 25 | return new Encrypter($key); |
||
| 26 | }); |
||
| 27 | |||
| 28 | $this->app->alias('encrypter.sodium', Encrypter::class); |
||
| 29 | } |
||
| 50 |