Passed
Push — develop ( 43df78...c9630b )
by BENARD
12:26
created

InsertTeamDataProvider::getSchedule()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\DwhBundle\Scheduler;
6
7
use Symfony\Component\Scheduler\Attribute\AsSchedule;
8
use Symfony\Component\Scheduler\RecurringMessage;
9
use Symfony\Component\Scheduler\Schedule;
10
use Symfony\Component\Scheduler\ScheduleProviderInterface;
11
use VideoGamesRecords\DwhBundle\Scheduler\Message\UpdateTable;
12
13
#[AsSchedule]
14
class InsertTeamDataProvider implements ScheduleProviderInterface
15
{
16
    public function getSchedule(): Schedule
17
    {
18
        $message = new UpdateTable();
19
        $message->setTarget('team');
20
21
        return $this->schedule ??= (new Schedule())
0 ignored issues
show
Bug Best Practice introduced by
The property schedule does not exist on VideoGamesRecords\DwhBun...\InsertTeamDataProvider. Did you maybe forget to declare it?
Loading history...
22
            ->with(
23
                RecurringMessage::cron(
24
                    '5 0 * * *',
25
                    $message
26
                )
27
            );
28
    }
29
}
30