Skip to content

Commit

Permalink
Add choice for calling init without argument
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelbox committed Jun 4, 2024
1 parent c532e34 commit 23030f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
2.0.0
1.4.0
=====

* (bc) Renamed the call from `init-symfony` to `init symfony`.
* (bc) Renamed the call from `init-library` to `init library`.
* (feature) Rename the call from `init-symfony` to `init symfony`.
* (feature) Rename the call from `init-library` to `init library`.
* (feature) Add BC layer for old commands.
* (feature) Add choice for when calling `init` without or with invalid type.
* (internal) Refactored whole implementation.
* (internal) Run CI on Janus itself.

Expand Down
7 changes: 6 additions & 1 deletion src/Command/InitializeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ protected function execute (InputInterface $input, OutputInterface $output) : in

$type = $input->getArgument("type");

while (!\in_array($type, self::ALLOWED_TYPES, true))
if (!\in_array($type, self::ALLOWED_TYPES, true))
{
if (null !== $type)
{
$io->error("Used invalid type: {$type}");

Check failure on line 67 in src/Command/InitializeCommand.php

View workflow job for this annotation

GitHub Actions / build-test (8.3)

Part $type (mixed) of encapsed string cannot be cast to string.
}

$type = $io->choice("Please select the type to initialize", self::ALLOWED_TYPES);
}

Expand Down

0 comments on commit 23030f1

Please sign in to comment.