diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 739eaa3..6608991 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, bcmath, intl, exif, iconv, fileinfo coverage: none - name: Setup problem matchers diff --git a/src/Console/Commands/MakeRequest.php b/src/Console/Commands/MakeRequest.php index 68c6242..74020fd 100644 --- a/src/Console/Commands/MakeRequest.php +++ b/src/Console/Commands/MakeRequest.php @@ -52,7 +52,7 @@ class MakeRequest extends MakeCommand protected function getOptions(): array { return [ - ['method', null, InputOption::VALUE_REQUIRED, 'the method of the request'], + ['method', 'm', InputOption::VALUE_REQUIRED, 'the method of the request'], ]; } @@ -83,7 +83,7 @@ protected function afterPromptingForMissingArguments(InputInterface $input, Outp protected function buildClass($name): MakeRequest|string { $stub = $this->files->get($this->getStub()); - $stub = $this->replaceMethod($stub, $this->option('method')); + $stub = $this->replaceMethod($stub, $this->option('method') ?? 'GET'); return $this->replaceNamespace($stub, $name)->replaceClass($stub, $name); } @@ -91,7 +91,7 @@ protected function buildClass($name): MakeRequest|string /** * Replace the method for the stub */ - protected function replaceMethod($stub, $name): string + protected function replaceMethod(string $stub, string $name): string { return str_replace('{{ method }}', $name, $stub); }