Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Commit 8a0de23

Browse files
authored
Merge pull request #27 from kkobold/master
Laravel 7 and Symfony\Component\Process
2 parents 48959c0 + f08b823 commit 8a0de23

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/CredentialsServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function fixConfig()
3838
collect(Arr::dot(config()->all()))->filter(function ($item) {
3939
return is_string($item) && Str::startsWith($item, Credentials::CONFIG_PREFIX);
4040
})->map(function ($item, $key) {
41-
$item = str_replace_first(Credentials::CONFIG_PREFIX, '', $item);
41+
$item = Str::replaceFirst(Credentials::CONFIG_PREFIX, '', $item);
4242

4343
config()->set($key, credentials($item));
4444
});

src/EditCredentialsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function handle(Credentials $credentials)
4141

4242
$editor = env('EDITOR', 'vi');
4343

44-
$process = new Process($editor.' '.$meta['uri']);
44+
$process = new Process([$editor, $meta['uri']]);
4545

4646
$process->setTty(true);
4747
$process->mustRun();

src/helpers.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use BeyondCode\Credentials\Credentials;
4+
use Illuminate\Contracts\Container\BindingResolutionException;
45

56
if (! function_exists('credentials')) {
67
/**
@@ -13,14 +14,17 @@
1314
function credentials(string $key, $default = null)
1415
{
1516
$filename = config('credentials.file');
16-
1717
try {
1818
$credentials = app(Credentials::class);
1919
$credentials->load($filename);
2020

2121
return $credentials->get($key, $default);
22-
} catch (ReflectionException $e) {
23-
return Credentials::CONFIG_PREFIX.$key;
22+
23+
} catch (ReflectionException | BindingResolutionException $e) {
24+
25+
return Credentials::CONFIG_PREFIX . $key;
26+
2427
}
28+
2529
}
2630
}

0 commit comments

Comments
 (0)