Skip to content

Commit

Permalink
Merge pull request #24 from Fabricio872/feature/fix-deprecations
Browse files Browse the repository at this point in the history
(MINOR) fixed deprecations dropped support for Symfony older than 6.1
  • Loading branch information
Fabricio872 authored Apr 17, 2023
2 parents 098bb55 + 05656c7 commit 9e99b1b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
"php": "^8.1",
"doctrine/annotations": "^1.13|^2.0",
"doctrine/orm": "^2.9",
"symfony/config": "^4.4|^5|^6.0",
"symfony/console": "^4.4|^5|^6.0",
"symfony/dependency-injection": "^4.4|^5|^6.0",
"symfony/dotenv": "^4.4|^5|^6.0",
"symfony/http-kernel": "^4.4|^5|^6.0",
"symfony/security-bundle": "^4.4|^5|^6.0",
"symfony/serializer": "^4.4|^5|^6.0",
"symfony/validator": "^4.4|^5|^6.0"
"symfony/config": "^6.1",
"symfony/console": "^6.1",
"symfony/dependency-injection": "^6.1",
"symfony/dotenv": "^6.1",
"symfony/http-kernel": "^6.1",
"symfony/security-bundle": "^6.1",
"symfony/serializer": "^6.1",
"symfony/validator": "^6.1"
},
"require-dev": {
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.9",
"rector/rector": "^0.15.16",
"symfony/phpunit-bridge": "^4.4|^5|^6.0",
"symfony/phpunit-bridge": "^6.1",
"symplify/easy-coding-standard": "^11.2.8"
},
"config": {
Expand Down
10 changes: 5 additions & 5 deletions src/Command/UserListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
use Fabricio872\RegisterCommand\Services\StaticMethods;
use Fabricio872\RegisterCommand\Services\UserEditor;
use Fabricio872\RegisterCommand\Services\UserEditorInterface;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(
name: 'user:list',
description: 'List all existing users',
)]
class UserListCommand extends AbstractList
{
protected static $defaultName = 'user:list';

protected static $defaultDescription = 'List all existing users';

/** @var array|object[] */
private ?array $userList = null;

protected function configure()
{
parent::configure();
$this->setDescription(self::$defaultDescription);
}

/**
Expand Down
12 changes: 5 additions & 7 deletions src/Command/UserRegisterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Fabricio872\RegisterCommand\Services\StaticMethods;
use ReflectionClass;
use ReflectionException;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -20,10 +21,12 @@
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;

#[AsCommand(
name: 'user:register',
description: 'Register new user',
)]
class UserRegisterCommand extends Command
{
protected static $defaultDescription = 'Register new user';

private ?SymfonyStyle $io = null;

/**
Expand All @@ -43,11 +46,6 @@ public function __construct(
parent::__construct();
}

protected function configure()
{
$this->setDescription(self::$defaultDescription);
}

/**
* @param InputInterface $input
* @param OutputInterface $output
Expand Down
3 changes: 1 addition & 2 deletions src/Services/Ask.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ public function getUserIdentifier(): string
}

/**
* @return string|array|int|float|null
* @throws ReflectionException
*/
public function ask(string $propertyName)
public function ask(string $propertyName): string|array|int|float|null
{
$userReflection = new ReflectionClass($this->userClassName);
$annotation = StaticMethods::getRegisterCommand($this->userClassName, $propertyName);
Expand Down

0 comments on commit 9e99b1b

Please sign in to comment.