Passed
Pull Request — master (#18)
by Florian
02:20
created

ApiController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 3
c 2
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A organisationsAction() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the vseth-semesterly-reports project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Controller;
13
14
use App\Controller\Base\BaseApiController;
15
use App\Entity\Organisation;
16
use Symfony\Component\Routing\Annotation\Route;
17
18
/**
19
 * @Route("/api")
20
 */
21
class ApiController extends BaseApiController
22
{
23
    /**
24
     * @Route("/organisations", name="api_organisations")
25
     *
26
     * @return \Symfony\Component\HttpFoundation\Response
27
     */
28
    public function organisationsAction()
29
    {
30
        /** @var Organisation[] $organisations */
31
        $organisations = $this->getDoctrine()->getRepository(Organisation::class)->findActive();
32
33
        return $this->returnOrganisations($organisations);
34
    }
35
}
36