Completed
Push — master ( 118c60...254398 )
by Litera
03:47
created

ProgramPresenter::setProgramRepository()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
rs 9.4285
1
<?php
2
3
namespace App\Presenters;
4
5
use App\Components\CategoryStylesControl;
6
use App\Components\Forms\Factories\IProgramFormFactory;
7
use App\Components\Forms\ProgramForm;
8
use App\Components\IProgramOverviewControl;
9
use App\Components\ProgramOverviewControl;
10
use App\Components\PublicProgramOverviewControl;
11
use App\Components\ProgramVisitorsControl;
12
use App\Models\BlockModel;
13
use App\Models\MeetingModel;
14
use App\Repositories\ProgramRepository;
15
use App\Services\Emailer;
16
use Nette\Utils\ArrayHash;
17
use Tracy\Debugger;
18
use Exception;
19
20
/**
21
 * Program controller
22
 *
23
 * This file handles the retrieval and serving of blocks
24
 *
25
 * @created 2013-06-05
26
 * @author Tomas Litera <[email protected]>
27
 */
28
class ProgramPresenter extends BasePresenter
29
{
30
31
	/**
32
	 * @var integer
33
	 */
34
	private $programId = null;
35
36
	/**
37
	 * @var Emailer
38
	 */
39
	private $emailer;
40
41
	/**
42
	 * @var BlockModel
43
	 */
44
	private $blockModel;
45
46
	/**
47
	 * @var MeetingModel
48
	 */
49
	private $meetingModel;
50
51
	/**
52
	 * @var ProgramRepository
53
	 */
54
	private $programRepository;
55
56
	/**
57
	 * @var IProgramFormFactory
58
	 */
59
	private $programFormFactory;
60
61
	/**
62
	 * @var ProgramOverviewControl
63
	 */
64
	private $programOverview;
65
66
	/**
67
	 * @var CategoryStylesControl
68
	 */
69
	private $categoryStyles;
70
71
	/**
72
	 * @var ProgramVisitorsControl
73
	 */
74
	private $programVisitors;
75
76
	/**
77
	 * Prepare model classes and get meeting id
78
	 */
79
	public function __construct(
80
		Emailer $emailer,
81
		BlockModel $blockModel,
82
		MeetingModel $meetingModel,
83
		ProgramRepository $programRepository,
84
		PublicProgramOverviewControl $publicProgramOverview,
85
		CategoryStylesControl $categoryStyles,
86
		ProgramVisitorsControl $programVisitors
87
	) {
88
		$this->setEmailer($emailer);
89
		$this->setBlockModel($blockModel);
90
		$this->setMeetingModel($meetingModel);
91
		$this->setProgramRepository($programRepository);
92
		$this->setProgramOverviewControl($publicProgramOverview);
93
		$this->setCategoryStylesControl($categoryStyles);
94
		$this->setProgramVisitorsControl($programVisitors);
95
	}
96
97
	/**
98
	 * @param  IProgramFormFactory $factory
99
	 */
100
	public function injectProgramFormFactory(IProgramFormFactory $factory)
101
	{
102
		$this->programFormFactory = $factory;
103
	}
104
105
	/**
106
	 * @return void
107
	 */
108
	public function startup()
109
	{
110
		parent::startup();
111
112
		$meetingId = $this->getMeetingId();
113
		$this->getProgramRepository()->setMeetingId($meetingId);
114
		$this->getMeetingModel()->setMeetingId($meetingId);
115
		$this->getBlockModel()->setMeetingId($meetingId);
116
	}
117
118
	/**
119
	 * Stores program into storage
120
	 *
121
	 * @param  Nette\Utils\ArrayHash  $program
122
	 * @return boolean
123
	 */
124
	public function actionCreate(ArrayHash $program)
125
	{
126
		try {
127
			$this->logInfo('Storing new program.');
128
129
			$result = $this->getProgramRepository()->create($program);
130
131
			$this->logInfo('Storing of new program with data %s successfull, result: %s', [
132
				json_encode($program),
133
				json_encode($result),
134
			]);
135
136
			$this->flashSuccess('Položka byla úspěšně vytvořena');
137
		} catch(Exception $e) {
138
			$this->logError('Creation of program with data %s failed, result: %s', [
139
				json_encode($data),
0 ignored issues
show
Bug introduced by
The variable $data does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
140
				$e->getMessage()
141
			]);
142
143
			$this->flashError('Položku se nepodařilo vytvořit.');
144
		}
145
146
		return $result;
0 ignored issues
show
Bug introduced by
The variable $result does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
147
	}
148
149
	/**
150
	 * Updates program in storage
151
	 *
152
	 * @param  int                    $id
153
	 * @param  Nette\Utils\ArrayHash  $program
154
	 * @return boolean
155
	 */
156
	public function actionUpdate(int $id, ArrayHash $program)
157
	{
158
		try {
159
			$this->logInfo('Updating program(%s).', [$id]);
160
161
			$result = $this->getProgramRepository()->update($id, $program);
162
163
			$this->logInfo('Updating of program(%s) with data %s successfull, result: %s', [
164
				$id,
165
				json_encode($program),
166
				json_encode($result),
167
			]);
168
169
			$this->flashSuccess('Položka byla úspěšně upravena');
170
		} catch(Exception $e) {
171
			$this->logError('Updating of program(%s) failed, result: %s', [
172
				$program->guid,
173
				$e->getMessage(),
174
			]);
175
176
			$this->flashError('Položku se nepodařilo upravit.');
177
		}
178
179
		return $result;
0 ignored issues
show
Bug introduced by
The variable $result does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
180
	}
181
182
	/**
183
	 * @param  integer  $id
184
	 * @return void
185
	 */
186
	public function actionDelete($id)
187
	{
188
		try {
189
			$result = $this->getProgramRepository()->delete($id);
190
191
			$this->logInfo('Destroying of program successfull, result: %s', [
192
				json_encode($result)
193
			]);
194
			$this->flashSuccess('Položka byla úspěšně smazána.');
195
		} catch(Exception $e) {
196
			$this->logError('Destroying of program failed, result: %s', [
197
				$e->getMessage()
198
			]);
199
			$this->flashError('Smazání programu se nezdařilo, result: %s', [
0 ignored issues
show
Unused Code introduced by
The call to ProgramPresenter::flashError() has too many arguments starting with array($e->getMessage()).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
200
				$e->getMessage()
201
			]);
202
		}
203
204
		$this->redirect('Program:listing');
205
	}
206
207
	/**
208
	 * @return void
209
	 */
210
	public function actionMail($id)
211
	{
212
		try {
213
			$tutors = $this->getProgramRepository()->findTutor($id);
214
			$recipients = $this->parseTutorEmail($tutors);
215
216
			$this->getEmailer()->tutor($recipients, $tutors->guid, 'program');
217
218
			$this->logInfo('Sending email to program tutor successfull, result: %s, %s', [
219
				json_encode($recipients),
220
				$tutors->guid
221
			]);
222
			$this->flashSuccess('Email lektorovi byl odeslán.');
223
		} catch(Exception $e) {
224
			$this->logError('Sending email to program tutor failed, result: %s', [
225
				$e->getMessage()
226
			]);
227
			$this->flashError('Email lektorovi nebyl odeslán, result: %s', [
0 ignored issues
show
Unused Code introduced by
The call to ProgramPresenter::flashError() has too many arguments starting with array($e->getMessage()).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
228
				$e->getMessage()
229
			]);
230
		}
231
232
		$this->redirect('Program:edit', $id);
233
	}
234
235
	/**
236
	 * View public program
237
	 *
238
	 * @return void
239
	 */
240
	public function renderPublic()
241
	{
242
		$this->getMeetingModel()->setRegistrationHandlers($this->getMeetingId());
243
244
		$template = $this->getTemplate();
245
		$template->meeting_heading = $this->getMeetingModel()->getRegHeading();
0 ignored issues
show
Bug introduced by
Accessing meeting_heading on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
246
			////otevirani a uzavirani prihlasovani
247
		if(($this->getMeetingModel()->getRegOpening() < time()) || $this->getDebugMode()) {
248
			$template->display_program = true;
0 ignored issues
show
Bug introduced by
Accessing display_program on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
249
		} else {
250
			$template->display_program = false;
0 ignored issues
show
Bug introduced by
Accessing display_program on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
251
		}
252
		$template->page_title = 'Srazy VS - veřejný program';
0 ignored issues
show
Bug introduced by
Accessing page_title on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
253
		$template->style = 'table { border-collapse:separate; width:100%; }
0 ignored issues
show
Bug introduced by
Accessing style on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
254
				td { .width:100%; text-align:center; padding:0px; }
255
				td.day { border:1px solid black; background-color:#777777; width:80px; }
256
				td.time { background-color:#cccccc; width:80px; }';
257
	}
258
259
	/**
260
	 * @return void
261
	 */
262
	public function renderListing()
263
	{
264
		$template = $this->getTemplate();
265
		$template->programs = $this->getProgramRepository()->all();
0 ignored issues
show
Bug introduced by
Accessing programs on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
266
		$template->mid = $this->meetingId;
0 ignored issues
show
Bug introduced by
Accessing mid on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
267
		$template->heading = $this->heading;
0 ignored issues
show
Bug introduced by
Accessing heading on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
268
	}
269
270
	/**
271
	 * @return void
272
	 */
273
	public function renderNew()
274
	{
275
		$template = $this->getTemplate();
276
		$template->heading = 'nový program';
0 ignored issues
show
Bug introduced by
Accessing heading on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
277
	}
278
279
	/**
280
	 * @param  integer $id
281
	 * @return void
282
	 */
283
	public function renderEdit($id)
284
	{
285
		$this->programId = $id;
286
		$program = $this->getProgramRepository()->find($id);
287
288
		$template = $this->getTemplate();
289
		$template->heading = 'úprava programu';
0 ignored issues
show
Bug introduced by
Accessing heading on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
290
		$template->program = $program;
0 ignored issues
show
Bug introduced by
Accessing program on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
291
		$template->id = $id;
0 ignored issues
show
Bug introduced by
Accessing id on the interface Nette\Application\UI\ITemplate suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
292
293
		$this['programForm']->setDefaults($program);
294
	}
295
296
	/**
297
	 * @return ProgramForm
298
	 */
299
	protected function createComponentProgramForm(): ProgramForm
300
	{
301
		$control = $this->programFormFactory->create();
302
		$control->setMeetingId($this->getMeetingId());
303 View Code Duplication
		$control->onProgramSave[] = function(ProgramForm $control, $program) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
304
			//$guid = $this->getParameter('guid');
305
			$id = $this->getParameter('id');
306
307
			$this->setBacklinkFromArray($program);
308
309
			if($id) {
310
				$this->actionUpdate($id, $program);
311
			} else {
312
				$this->actionCreate($program);
313
			}
314
315
			$this->redirect($this->getBacklink() ?: 'Program:listing');
316
		};
317
318
		$control->onProgramReset[] = function(ProgramForm $control, $program) {
319
			$this->setBacklinkFromArray($program);
320
321
			$this->redirect($this->getBacklink() ?: 'Program:listing');
322
		};
323
324
		return $control;
325
	}
326
327
	/**
328
	 * @return AProgramOverviewControl
329
	 */
330
	protected function createComponentProgramOverview(): IProgramOverviewControl
331
	{
332
		return $this->programOverview->setMeetingId($this->getMeetingId());
333
	}
334
335
	/**
336
	 * @return CategoryStylesControl
337
	 */
338
	protected function createComponentCategoryStyles(): CategoryStylesControl
339
	{
340
		return $this->categoryStyles;
341
	}
342
343
	/**
344
	 * @return ProgramVisitorsControl
345
	 */
346
	protected function createComponentProgramVisitors(): ProgramVisitorsControl
347
	{
348
		return $this->programVisitors;
349
	}
350
351
	/**
352
	 * @param  ProgramOverviewControl $control
353
	 * @return $this
354
	 */
355
	protected function setProgramOverviewControl(IProgramOverviewControl $control)
356
	{
357
		$this->programOverview = $control;
0 ignored issues
show
Documentation Bug introduced by
$control is of type object<App\Components\IProgramOverviewControl>, but the property $programOverview was declared to be of type object<App\Components\ProgramOverviewControl>. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
358
359
		return $this;
360
	}
361
362
	/**
363
	 * @return Emailer
364
	 */
365
	protected function getEmailer(): Emailer
366
	{
367
		return $this->emailer;
368
	}
369
370
	/**
371
	 * @param  Emailer $emailer
372
	 * @return self
373
	 */
374
	protected function setEmailer(Emailer $emailer): self
375
	{
376
		$this->emailer = $emailer;
377
378
		return $this;
379
	}
380
381
	/**
382
	 * @return BlockModel
383
	 */
384
	protected function getBlockModel(): BlockModel
385
	{
386
		return $this->blockModel;
387
	}
388
389
	/**
390
	 * @param  BlockModel $blockModel
391
	 * @return self
392
	 */
393
	protected function setBlockModel(BlockModel $blockModel): self
394
	{
395
		$this->blockModel = $blockModel;
396
397
		return $this;
398
	}
399
400
	/**
401
	 * @return MeetingModel
402
	 */
403
	protected function getMeetingModel(): MeetingModel
404
	{
405
		return $this->meetingModel;
406
	}
407
408
	/**
409
	 * @param  MeetingModel $model
410
	 * @return $this
411
	 */
412
	protected function setMeetingModel(MeetingModel $model): self
413
	{
414
		$this->meetingModel = $model;
415
416
		return $this;
417
	}
418
419
	/**
420
	 * @return ProgramRepository
421
	 */
422
	protected function getProgramRepository(): ProgramRepository
423
	{
424
		return $this->programRepository;
425
	}
426
427
	/**
428
	 * @param  ProgramRepository $model
0 ignored issues
show
Bug introduced
There is no parameter named $model. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
429
	 * @return $this
430
	 */
431
	protected function setProgramRepository(ProgramRepository $repository):self
432
	{
433
		$this->programRepository = $repository;
434
435
		return $this;
436
	}
437
438
	/**
439
	 * @param CategoryStylesControl $control
440
	 *
441
	 * @return self
442
	 */
443
	public function setCategoryStylesControl(CategoryStylesControl $control): self
444
	{
445
		$this->categoryStyles = $control;
446
447
		return $this;
448
	}
449
450
	/**
451
	 * @param  ProgramVisitorsControl $control
452
	 * @return self
453
	 */
454
	public function setProgramVisitorsControl(ProgramVisitorsControl $control): self
455
	{
456
		$this->programVisitors = $control;
457
458
		return $this;
459
	}
460
461
}
462