Completed
Push — master ( aa1e6e...0c8670 )
by Julito
13:30
created

CToolRepository   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A saveResource() 0 1 1
A saveUpload() 0 3 1
A getResources() 0 2 1
A getTitleColumn() 0 2 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Repository;
5
6
use APY\DataGridBundle\Grid\Column\Column;
7
use APY\DataGridBundle\Grid\Grid;
8
use Chamilo\CoreBundle\Entity\Course;
9
use Chamilo\CoreBundle\Entity\Resource\ResourceNode;
10
use Chamilo\CoreBundle\Entity\Session;
11
use Chamilo\CoreBundle\Repository\ResourceRepository;
12
use Chamilo\CoreBundle\Repository\ResourceRepositoryInterface;
13
use Chamilo\CourseBundle\Entity\CGroupInfo;
14
use Chamilo\UserBundle\Entity\User;
15
use Symfony\Component\Form\FormInterface;
16
use Symfony\Component\HttpFoundation\File\UploadedFile;
17
18
final class CToolRepository extends ResourceRepository implements ResourceRepositoryInterface
19
{
20
    public function getResources(User $user, ResourceNode $parentNode, Course $course = null, Session $session = null, CGroupInfo $group = null)
21
    {
22
23
    }
24
25
    public function saveUpload(UploadedFile $file)
26
    {
27
        return false;
28
    }
29
30
    public function saveResource(FormInterface $form, $course, $session, $fileType) {
31
32
    }
33
34
    public function getTitleColumn(Grid $grid): Column
35
    {
36
37
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return APY\DataGridBundle\Grid\Column\Column. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
38
39
}
40