Skip to content

Commit b48d620

Browse files
authored
Pint (#86)
Co-authored-by: jasonvarga <[email protected]>
1 parent aeb6aae commit b48d620

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

src/Concerns/RunsCommands.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,19 @@ trait RunsCommands
99
/**
1010
* Run the given command.
1111
*
12-
* @param string $command
13-
* @param string|null $workingPath
14-
* @param bool $disableOutput
1512
* @return Process
1613
*/
17-
protected function runCommand(string $command, string $workingPath = null, bool $disableOutput = false)
14+
protected function runCommand(string $command, ?string $workingPath = null, bool $disableOutput = false)
1815
{
1916
return $this->runCommands([$command], $workingPath, $disableOutput);
2017
}
2118

2219
/**
2320
* Run the given commands.
2421
*
25-
* @param array $commands
26-
* @param string|null $workingPath
27-
* @param bool $disableOutput
2822
* @return Process
2923
*/
30-
protected function runCommands(array $commands, string $workingPath = null, bool $disableOutput = false)
24+
protected function runCommands(array $commands, ?string $workingPath = null, bool $disableOutput = false)
3125
{
3226
if (! $this->output->isDecorated()) {
3327
$commands = array_map(function ($value) {

src/NewCommand.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
use Symfony\Component\Process\Process;
2424

2525
use function Laravel\Prompts\confirm;
26-
use function Laravel\Prompts\error;
2726
use function Laravel\Prompts\intro;
28-
use function Laravel\Prompts\multiselect;
2927
use function Laravel\Prompts\select;
3028
use function Laravel\Prompts\suggest;
3129
use function Laravel\Prompts\text;
@@ -681,14 +679,14 @@ protected function installSsg()
681679
}
682680

683681
$this->output->write(PHP_EOL);
684-
intro("Installing the Static Site Generator addon...");
682+
intro('Installing the Static Site Generator addon...');
685683

686684
$statusCode = (new Please($this->output))
687685
->cwd($this->absolutePath)
688-
->run("install:ssg");
686+
->run('install:ssg');
689687

690688
if ($statusCode !== 0) {
691-
throw new RuntimeException("There was a problem installing the Static Site Generator addon!");
689+
throw new RuntimeException('There was a problem installing the Static Site Generator addon!');
692690
}
693691

694692
return $this;
@@ -830,8 +828,6 @@ protected function initializeGitRepository()
830828

831829
/**
832830
* Check if Git is installed.
833-
*
834-
* @return bool
835831
*/
836832
protected function isGitInstalled(): bool
837833
{
@@ -844,8 +840,6 @@ protected function isGitInstalled(): bool
844840

845841
/**
846842
* Return the local machine's default Git branch if set or default to `main`.
847-
*
848-
* @return string
849843
*/
850844
protected function defaultBranch(): string
851845
{
@@ -927,8 +921,6 @@ protected function pushToGithub()
927921

928922
/**
929923
* Check if GitHub's GH CLI tool is installed.
930-
*
931-
* @return bool
932924
*/
933925
protected function isGhInstalled(): bool
934926
{
@@ -998,11 +990,11 @@ protected function askToEnableStatamicPro()
998990
$this->pro = confirm(
999991
label: 'Do you want to enable Statamic Pro?',
1000992
default: true,
1001-
hint: "Statamic Pro is required for some features. Like Multi-site, the Git integration, and more."
993+
hint: 'Statamic Pro is required for some features. Like Multi-site, the Git integration, and more.'
1002994
);
1003995

1004996
if ($this->pro) {
1005-
$this->output->write(" Before your site goes live, you will need to purchase a license on <info>statamic.com</info>.".PHP_EOL.PHP_EOL);
997+
$this->output->write(' Before your site goes live, you will need to purchase a license on <info>statamic.com</info>.'.PHP_EOL.PHP_EOL);
1006998
}
1007999

10081000
return $this;
@@ -1073,7 +1065,7 @@ protected function askToSpreadJoy()
10731065
}
10741066

10751067
$response = select('Would you like to spread the joy of Statamic by starring the repo?', [
1076-
$yes = "Absolutely",
1068+
$yes = 'Absolutely',
10771069
$no = 'Maybe later',
10781070
], $no);
10791071

src/Please.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ class Please
1313

1414
/**
1515
* Instantiate Statamic `please` command wrapper.
16-
*
17-
* @param OutputInterface $output
1816
*/
1917
public function __construct(OutputInterface $output)
2018
{

src/UpdateCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ protected function configure()
3030
/**
3131
* Execute the command.
3232
*
33-
* @param InputInterface $input
34-
* @param OutputInterface $output
3533
* @return int
3634
*/
3735
protected function execute(InputInterface $input, OutputInterface $output)

src/VersionCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ protected function configure()
2323
/**
2424
* Execute the command.
2525
*
26-
* @param InputInterface $input
27-
* @param OutputInterface $output
2826
* @return int
2927
*/
3028
protected function execute(InputInterface $input, OutputInterface $output)

0 commit comments

Comments
 (0)