Passed
Push — master ( 59378c...401bc9 )
by Anthony
02:32
created

FosUserRepository::findAllUserNoArchived()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 9.4285
1
<?php
2
3
namespace Ribs\RibsAdminBundle\Repository;
4
5
use Doctrine\ORM\EntityRepository;
1 ignored issue
show
Bug introduced by
The type Doctrine\ORM\EntityRepository was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Ribs\RibsAdminBundle\Entity\User;
7
8
class FosUserRepository extends EntityRepository
9
{
10
	/**
11
	 * @param User $current_account
12
	 * @return array function that return a list of all users that are not archived and different of current accout
13
	 */
14
	public function findAllUserNoArchived(User $current_account): array
15
	{
16
		$query = $this->getEntityManager()->createQuery("SELECT fu FROM RibsAdminBundle:FosUser fu
17
			  JOIN RibsAdminBundle:User u  WITH fu.user = u
18
			  WHERE u.archived = false and u != :current_account
19
		")->setParameter("current_account", $current_account);
20
		
21
		return $query->getResult();
22
	}
23
}