GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — user-entity ( 6db575...67b804 )
by Luis Ramón
02:52
created

getTrackingByWorkdayAndActivity()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 2
eloc 9
nc 2
nop 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class TrackingRepository extends EntityRepository
8
{
9
    public function getTrackingByWorkdayAndActivity(Workday $workday, Activity $activity)
10
    {
11
        $tracking = $this->findOneBy(['workday' => $workday, 'activity' => $activity]);
12
13
        if (null === $tracking) {
14
            $tracking = new Tracking();
15
            $tracking
16
                ->setWorkday($workday)
17
                ->setActivity($activity)
18
                ->setHours(0.0);
19
        }
20
21
        return $tracking;
22
    }
23
    
24
    public function updateTrackingByWorkday(Workday $workday)
25
    {
26
        foreach ($workday->getAgreement()->getActivities() as $activity) {
27
            $this->getTrackingByWorkdayAndActivity($workday, $activity);
28
        }
29
    }
30
}
31