Skip to content

Commit 019a93c

Browse files
authored
fix(console): Fix console arguments (hopefully) (#59)
* chore(project): Remove unused namespaces * chore(filesystem): Use namespace when extending FilesystemServiceProvider to remain uniform with the rest of the project
1 parent 7056a80 commit 019a93c

File tree

8 files changed

+7
-16
lines changed

8 files changed

+7
-16
lines changed

src/Acorn/Application.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Illuminate\Container\Container;
66
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
77
use Illuminate\Support\Collection;
8-
use Illuminate\Support\ServiceProvider;
98
use Illuminate\Support\Str;
109
use Roots\Acorn\Concerns\Application as LaravelApplication;
1110
use Roots\Acorn\Concerns\Bindings;

src/Acorn/Bootstrap/Console.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public function bootstrap(Application $app)
2727
if ($this->app->runningInConsole() && class_exists('WP_CLI')) {
2828
WP_CLI::add_command('acorn', function () {
2929
$config = WP_CLI::get_configurator();
30-
[$args] = $config->parse_args($_SERVER['argv']);
30+
$args = array_slice($_SERVER['argv'], 1);
3131

32-
if (preg_match('/' . $config::ALIAS_REGEX . '/', $args[1])) {
33-
array_splice($args, 1, 1);
32+
if (preg_match('/' . $config::ALIAS_REGEX . '/', $args[0])) {
33+
$args = array_slice($args, 1);
3434
}
3535

3636
$this->app->singleton(
@@ -43,7 +43,7 @@ public function bootstrap(Application $app)
4343
$kernel->commands();
4444

4545
$status = $kernel->handle(
46-
$input = new \Symfony\Component\Console\Input\ArgvInput(array_slice($args, 1)),
46+
$input = new \Symfony\Component\Console\Input\ArgvInput($args),
4747
new \Symfony\Component\Console\Output\ConsoleOutput()
4848
);
4949

src/Acorn/Concerns/Application.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Roots\Acorn\Concerns;
44

55
use Illuminate\Support\Arr;
6-
use Illuminate\Support\Collection;
76
use Illuminate\Support\ServiceProvider;
87
use Illuminate\Support\Str;
98

src/Acorn/Concerns/Bindings.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
namespace Roots\Acorn\Concerns;
44

55
use Illuminate\Config\Repository as ConfigRepository;
6-
use Illuminate\Contracts\Foundation\Application;
7-
use Illuminate\Log\LogManager;
86
use Illuminate\Support\Composer;
9-
use Roots\Acorn\Contracts\Binder;
10-
use Zend\Diactoros\Response as PsrResponse;
117

128
trait Bindings
139
{

src/Acorn/Exceptions/Handler/PrettyPageHandler.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
use WP;
66
use WP_Query;
77
use WP_Post;
8-
use Whoops\Exception\Formatter;
9-
use Whoops\Handler\Handler;
108
use Whoops\Handler\PrettyPageHandler as PrettyPageHandlerBase;
11-
use Whoops\Util\Misc;
129
use Illuminate\Support\Collection;
1310

1411
class PrettyPageHandler extends PrettyPageHandlerBase

src/Acorn/Filesystem/FilesystemServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Roots\Acorn\Filesystem;
44

5-
class FilesystemServiceProvider extends \Illuminate\Filesystem\FilesystemServiceProvider
5+
use Illuminate\Filesystem\FilesystemServiceProvider as FilesystemServiceProviderBase;
6+
7+
class FilesystemServiceProvider extends FilesystemServiceProviderBase
68
{
79
/**
810
* Register the Filesystem natively inside of the provider.

src/Acorn/Sage/SageServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Roots\Acorn\Sage;
44

5-
use Roots\Acorn\Config;
65
use Roots\Acorn\Sage\Sage;
76
use Roots\Acorn\Sage\ViewFinder;
87
use Roots\Acorn\ServiceProvider;

src/Acorn/View/Composers/Concerns/Cacheable.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Roots\Acorn\View\Composers\Concerns;
44

55
use Illuminate\Support\Facades\Cache;
6-
use Illuminate\View\View;
76

87
use function Roots\cache;
98

0 commit comments

Comments
 (0)