Skip to content

Commit 36c8261

Browse files
committed
adding type hinting and fixed imports
1 parent 694c4dc commit 36c8261

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/AppBundle/Command/DeleteUserCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
namespace AppBundle\Command;
1313

14+
use AppBundle\Entity\User;
1415
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1516
use Symfony\Component\Console\Input\InputArgument;
1617
use Symfony\Component\Console\Input\InputInterface;
17-
use Symfony\Component\Console\Input\InputOption;
1818
use Symfony\Component\Console\Output\OutputInterface;
1919
use Symfony\Component\Console\Question\Question;
2020
use Doctrine\Common\Persistence\ObjectManager;
@@ -109,6 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
109109
$this->usernameValidator($username);
110110

111111
$repository = $this->entityManager->getRepository('AppBundle:User');
112+
/** @var User $user */
112113
$user = $repository->findOneByUsername($username);
113114

114115
if (null === $user) {

src/AppBundle/Command/ListUsersCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace AppBundle\Command;
1313

14+
use AppBundle\Entity\User;
15+
use Doctrine\Common\Persistence\ObjectManager;
1416
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1517
use Symfony\Component\Console\Helper\Table;
1618
use Symfony\Component\Console\Input\InputInterface;
@@ -88,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8890
$users = $this->entityManager->getRepository('AppBundle:User')->findBy(array(), array('id' => 'DESC'), $maxResults);
8991

9092
// Doctrine query returns an array of objects and we need an array of plain arrays
91-
$usersAsPlainArrays = array_map(function ($user) {
93+
$usersAsPlainArrays = array_map(function (User $user) {
9294
return array($user->getId(), $user->getUsername(), $user->getEmail(), implode(', ', $user->getRoles()));
9395
}, $users);
9496

src/AppBundle/Repository/PostRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace AppBundle\Repository;
1313

1414
use Doctrine\ORM\EntityRepository;
15-
use AppBundle\Entity\Post;
1615

1716
/**
1817
* This custom Doctrine repository contains some methods which are useful when

0 commit comments

Comments
 (0)