Completed
Push — master ( 8d2de8...1ce70a )
by Litera
17s
created

VisitorPresenter::startup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Presenters;
4
5
use App\Models\MeetingModel;
6
use App\Models\VisitorModel;
7
use App\Models\BlockModel;
8
use App\Models\MealModel;
9
use App\Services\Emailer;
10
use App\Services\VisitorService;
11
use Nette\Utils\Strings;
12
use Tracy\Debugger;
13
use Exception;
14
15
/**
16
 * Visitor controller
17
 *
18
 * This file handles the retrieval and serving of visitors
19
 *
20
 * @author Tomas Litera
21
 * @copyright 2013-06-12 <[email protected]>
22
 * @package srazvs
23
 */
24
class VisitorPresenter extends BasePresenter
25
{
26
27
	const TEMPLATE_DIR = __DIR__ . '/../templates/visitor/';
28
	const TEMPLATE_EXT = 'latte';
29
30
	/**
31
	 * @var Emailer
32
	 */
33
	protected $emailer;
34
35
	/**
36
	 * @var MealModel
37
	 */
38
	protected $mealModel;
39
40
	/**
41
	 * @var BlockModel
42
	 */
43
	protected $blockModel;
44
45
	/**
46
	 * @var MeetingModel
47
	 */
48
	protected $meetingModel;
49
50
	/**
51
	 * @var VisitorSErvice
52
	 */
53
	protected $visitorService;
54
55
	/**
56
	 * @param VisitorModel $visitors
57
	 * @param MealModel    $meals
58
	 * @param BlockModel   $blocks
59
	 * @param MeetingModel $meetings
60
	 * @param Emailer      $emailer
61
	 */
62
	public function __construct(
63
		VisitorModel $visitors,
64
		MealModel $meals,
65
		BlockModel $blocks,
66
		MeetingModel $meetings,
67
		Emailer $emailer,
68
		VisitorService $visitor
69
	) {
70
		$this->setModel($visitors);
0 ignored issues
show
Documentation introduced by
$visitors is of type object<App\Models\VisitorModel>, but the function expects a object<App\Model>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
71
		$this->setMealModel($meals);
72
		$this->setBlockModel($blocks);
73
		$this->setMeetingModel($meetings);
74
		$this->setEmailer($emailer);
75
		$this->setVisitorService($visitor);
76
	}
77
78
	/**
79
	 * @return void
80
	 */
81
	public function startup()
82
	{
83
		parent::startup();
84
85
		$this->getMeetingModel()->setMeetingId($this->getMeetingId());
86
	}
87
88
	/**
89
	 * Process data from form
90
	 *
91
	 * @return void
92
	 */
93 View Code Duplication
	public function actionCreate()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
94
	{
95
		try {
96
			$postData = $this->getHttpRequest()->getPost();
97
			$postData['meeting'] = $this->getMeetingId();
98
99
			$guid = $this->getVisitorService()->create($postData);
100
			$result = $this->sendRegistrationSummary($postData, $guid);
101
102
			Debugger::log('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO);
103
			$this->flashMessage('Účastník(' . $guid . ') byl úspěšně vytvořen.', 'ok');
104
		} catch(Exception $e) {
105
			Debugger::log('Creation of visitor('. $guid .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
0 ignored issues
show
Bug introduced by
The variable $guid 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...
106
			$this->flashMessage('Creation of visitor failed, result: ' . $e->getMessage(), 'error');
107
		}
108
109
		$this->redirect('Visitor:listing');
110
	}
111
112
	/**
113
	 * Process data from editing
114
	 *
115
	 * @param  integer 	$id
116
	 * @return void
117
	 */
118 View Code Duplication
	public function actionUpdate($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
119
	{
120
		try {
121
			$postData = $this->getHttpRequest()->getPost();
122
			$postData['meeting'] = $this->getMeetingId();
123
			$postData['visitor'] = $id;
124
125
			$result = $this->getVisitorService()->update($id, $postData);
126
127
			//$result = $this->sendRegistrationSummary($visitor, $guid);
0 ignored issues
show
Unused Code Comprehensibility introduced by
65% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
128
129
			Debugger::log('Modification of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
130
			$this->flashMessage('Účastník(' . $id . ') byl úspěšně upraven.', 'ok');
131
		} catch(Exception $e) {
132
			Debugger::log('Modification of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
133
			$this->flashMessage('Modification of visitor failed, result: ' . $e->getMessage(), 'error');
134
		}
135
136
		$this->redirect('Visitor:listing');
137
	}
138
139
	/**
140
	 * @param  int  $id
141
	 * @return void
142
	 */
143 View Code Duplication
	public function actionDelete($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
144
	{
145
		try {
146
			$result = $this->getVisitorService()->delete($id);
147
148
			Debugger::log('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
149
			$this->flashMessage('Položka byla úspěšně smazána', 'ok');
150
		} catch(Exception $e) {
151
			Debugger::log('Destroying of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
152
			$this->flashMessage('Destroying of visitor failed, result: ' . $e->getMessage(), 'error');
153
		}
154
155
		$this->redirect('Visitor:listing');
156
	}
157
158
	/**
159
	 * Prepare mass mail form
160
	 *
161
	 * @return void
162
	 */
163
	public function actionSend()
164
	{
165
		try {
166
			$request = $this->getHttpRequest();
167
			$subject = $request->getPost('subject', '');
168
			$message = $request->getPost('message', '');
169
			$bcc = explode(',', preg_replace("/\s+/", "", $request->getPost('recipients', '')));
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /\s+/ does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
170
			// fill bcc name and address
171
			$bcc = array_combine($bcc, $bcc);
172
173
			$mailParameters = $this->getContainer()->parameters['mail'];
174
			$recipient = [
175
				$mailParameters['senderAddress'] => $mailParameters['senderName'],
176
			];
177
178
			$template = $this->createMailTemplate();
179
			$template->subject = $subject;
0 ignored issues
show
Bug introduced by
Accessing subject 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...
180
			$template->message = $message;
0 ignored issues
show
Bug introduced by
Accessing message 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...
181
182
			$result = $this->getEmailer()->sendMail($recipient, $subject, (string) $template, $bcc);
183
184
			Debugger::log('E-mail was send successfully, result: ' . json_encode($result), Debugger::INFO);
185
			$this->flashMessage('E-mail byl úspěšně odeslán', 'ok');
186
		} catch(Exception $e) {
187
			Debugger::log('Sending of e-mail failed, result: ' .  $e->getMessage(), Debugger::ERROR);
188
			$this->flashMessage('Sending of e-mail failed, result: ' . $e->getMessage(), 'error');
189
		}
190
191
		$this->redirect('Visitor:listing');
192
	}
193
194
	/**
195
	 * @param  integer|string $ids
0 ignored issues
show
Bug introduced by
There is no parameter named $ids. 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...
196
	 * @return void
197
	 */
198 View Code Duplication
	public function actionPay($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
199
	{
200
		try {
201
			$visitor = $this->getModel();
202
			$visitor->payCharge($id, 'cost');
203
			$recipients = $visitor->getRecipients($id);
204
			$this->getEmailer()->sendPaymentInfo($recipients, 'advance');
205
206
			Debugger::log('Visitor: Action pay for id ' . $id . ' successfull, result: ' . $e->getMessage(), Debugger::INFO);
0 ignored issues
show
Bug introduced by
The variable $e seems only to be defined at a later point. Did you maybe move this code here without moving the variable definition?

This error can happen if you refactor code and forget to move the variable initialization.

Let’s take a look at a simple example:

function someFunction() {
    $x = 5;
    echo $x;
}

The above code is perfectly fine. Now imagine that we re-order the statements:

function someFunction() {
    echo $x;
    $x = 5;
}

In that case, $x would be read before it is initialized. This was a very basic example, however the principle is the same for the found issue.

Loading history...
207
			$this->flashMessage('Platba byla zaplacena.', 'ok');
208
		} catch(Exception $e) {
209
			Debugger::log('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR);
210
			$this->flashMessage('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error');
211
		}
212
213
		$this->redirect('Visitor:listing');
214
	}
215
216
	/**
217
	 * @param  string|interger $ids
0 ignored issues
show
Bug introduced by
There is no parameter named $ids. 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...
218
	 * @return void
219
	 */
220 View Code Duplication
	public function actionAdvance($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
221
	{
222
		try {
223
			$visitor = $this->getModel();
224
			$visitor->payCharge($id, 'advance');
225
			$recipients = $visitor->getRecipients($id);
226
			$this->getEmailer()->sendPaymentInfo($recipients, 'advance');
227
228
			Debugger::log('Visitor: Action advance for id ' . $id . ' successfull, result: ' . $e->getMessage(), Debugger::INFO);
0 ignored issues
show
Bug introduced by
The variable $e seems only to be defined at a later point. Did you maybe move this code here without moving the variable definition?

This error can happen if you refactor code and forget to move the variable initialization.

Let’s take a look at a simple example:

function someFunction() {
    $x = 5;
    echo $x;
}

The above code is perfectly fine. Now imagine that we re-order the statements:

function someFunction() {
    echo $x;
    $x = 5;
}

In that case, $x would be read before it is initialized. This was a very basic example, however the principle is the same for the found issue.

Loading history...
229
			$this->flashMessage('Záloha byla zaplacena.', 'ok');
230
		} catch(Exception $e) {
231
			Debugger::log('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR);
232
			$this->flashMessage('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error');
233
		}
234
235
		$this->redirect('Visitor:listing');
236
	}
237
238
	/**
239
	 * Set item as checked by id
240
	 *
241
	 * @param  integer $id
242
	 * @return void
243
	 */
244 View Code Duplication
	public function actionChecked($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
245
	{
246
		try {
247
			$result = $this->getModel()->checked($id, '1');
248
			Debugger::log('Check of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
249
			$this->flashMessage('Položka byla úspěšně zkontrolována', 'ok');
250
		} catch(Exception $e) {
251
			Debugger::log('Check of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
252
			$this->flashMessage('Check of visitor failed, result: ' . $e->getMessage(), 'error');
253
		}
254
255
		$this->redirect('Visitor:listing');
256
	}
257
258
	/**
259
	 * Set item as unchecked by id
260
	 *
261
	 * @param  integer $id
262
	 * @return void
263
	 */
264 View Code Duplication
	public function actionUnchecked($id)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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...
265
	{
266
		try {
267
			$result = $this->getModel()->checked($id, 0);
268
			Debugger::log('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
269
			$this->flashMessage('Položka byla nastavena jako nekontrolována', 'ok');
270
		} catch(Exception $e) {
271
			Debugger::log('Uncheck of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
272
			$this->flashMessage('Uncheck of visitor failed, result: ' . $e->getMessage(), 'error');
273
		}
274
275
		$this->redirect('Visitor:listing');
276
	}
277
278
	/**
279
	 * Prepare page for new item
280
	 *
281
	 * @return void
282
	 */
283
	public function renderNew()
284
	{
285
		$template = $this->getTemplate();
286
287
		$template->heading = 'nový účastník';
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...
288
		$template->error_name = '';
0 ignored issues
show
Bug introduced by
Accessing error_name 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...
289
		$template->error_surname = '';
0 ignored issues
show
Bug introduced by
Accessing error_surname 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->error_nick = '';
0 ignored issues
show
Bug introduced by
Accessing error_nick 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->error_email = '';
0 ignored issues
show
Bug introduced by
Accessing error_email 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
		$template->error_postal_code = '';
0 ignored issues
show
Bug introduced by
Accessing error_postal_code 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...
293
		$template->error_group_num = '';
0 ignored issues
show
Bug introduced by
Accessing error_group_num 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...
294
		$template->error_bill = '';
0 ignored issues
show
Bug introduced by
Accessing error_bill 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...
295
		$template->error_cost = '';
0 ignored issues
show
Bug introduced by
Accessing error_cost 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...
296
		$template->province = $this->getMeetingModel()->renderHtmlProvinceSelect(null);
0 ignored issues
show
Bug introduced by
Accessing province 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...
297
		$template->meals = $this->getMealModel()->renderHtmlMealsSelect(null, null);
0 ignored issues
show
Bug introduced by
Accessing meals 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...
Deprecated Code introduced by
The method App\Models\MealModel::renderHtmlMealsSelect() has been deprecated with message: Render HTML Meals <select>

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
298
		$template->cost = $this->getMeetingModel()->getPrice('cost');
0 ignored issues
show
Bug introduced by
Accessing cost 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...
299
		$template->programSwitcher = $this->getModel()->renderProgramSwitcher($this->getMeetingId(), null);
0 ignored issues
show
Bug introduced by
Accessing programSwitcher 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...
300
	}
301
302
	/**
303
	 * @param  integer $id
304
	 * @return void
305
	 */
306
	public function renderEdit($id)
307
	{
308
		$visitor = $this->getModel()->findById($id);
309
		$meals = $this->getMealModel()->findByVisitorId($id);
310
311
		$template = $this->getTemplate();
312
313
		$template->heading = 'úprava účastníka';
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...
314
		$template->error_name = '';
0 ignored issues
show
Bug introduced by
Accessing error_name 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...
315
		$template->error_surname = '';
0 ignored issues
show
Bug introduced by
Accessing error_surname 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...
316
		$template->error_nick = '';
0 ignored issues
show
Bug introduced by
Accessing error_nick 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...
317
		$template->error_email = '';
0 ignored issues
show
Bug introduced by
Accessing error_email 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...
318
		$template->error_postal_code = '';
0 ignored issues
show
Bug introduced by
Accessing error_postal_code 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...
319
		$template->error_group_num = '';
0 ignored issues
show
Bug introduced by
Accessing error_group_num 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...
320
		$template->error_bill = '';
0 ignored issues
show
Bug introduced by
Accessing error_bill 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...
321
		$template->error_cost = '';
0 ignored issues
show
Bug introduced by
Accessing error_cost 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...
322
		$template->province = $this->getMeetingModel()->renderHtmlProvinceSelect($visitor->province);
0 ignored issues
show
Bug introduced by
Accessing province 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...
323
		$template->meals = $this->getMealModel()->renderHtmlMealsSelect($meals, null);
0 ignored issues
show
Bug introduced by
Accessing meals 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...
Deprecated Code introduced by
The method App\Models\MealModel::renderHtmlMealsSelect() has been deprecated with message: Render HTML Meals <select>

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
324
		$template->cost = $this->getMeetingModel()->getPrice('cost');
0 ignored issues
show
Bug introduced by
Accessing cost 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...
325
		$template->programSwitcher = $this->getModel()->renderProgramSwitcher($this->getMeetingId(), $id);
0 ignored issues
show
Bug introduced by
Accessing programSwitcher 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...
326
		$template->data = $visitor;
0 ignored issues
show
Bug introduced by
Accessing data 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...
327
	}
328
329
	/**
330
	 * Prepare mass mail form
331
	 *
332
	 * @return void
333
	 */
334
	public function renderMail()
335
	{
336
		$ids = $this->getHttpRequest()->getPost('checker');
337
338
		$template = $this->getTemplate();
339
		$template->recipientMailAddresses = $this->getModel()->getSerializedMailAddress($ids);
0 ignored issues
show
Bug introduced by
Accessing recipientMailAddresses 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...
340
	}
341
342
343
	/**
344
	 * @return void
345
	 */
346
	public function renderListing()
347
	{
348
		$search = $this->getHttpRequest()->getQuery('search');
349
350
		$model = $this->getModel();
351
352
		$template = $this->getTemplate();
353
		$template->render = $model->setSearch($search)->all();
0 ignored issues
show
Bug introduced by
Accessing render 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...
354
		$template->visitorCount = $model->getCount();
0 ignored issues
show
Bug introduced by
Accessing visitorCount 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...
355
		$template->meetingPrice	= $this->getMeetingModel()->getPrice('cost');
0 ignored issues
show
Bug introduced by
Accessing meetingPrice 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...
356
		$template->search = $search;
0 ignored issues
show
Bug introduced by
Accessing search 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...
357
	}
358
359
	/**
360
	 * @return Latte
361
	 */
362
	protected function createMailTemplate()
363
	{
364
		$template = $this->createTemplate();
365
		$template->setFile(
366
			sprintf(
367
				'%s%s.%s',
368
				self::TEMPLATE_DIR,
369
				'mail_body',
370
				self::TEMPLATE_EXT
371
			)
372
		);
373
374
		return $template;
375
	}
376
377
	/**
378
	 * @param  array   $visitor
379
	 * @return boolean
380
	 */
381
	protected function sendRegistrationSummary(array $visitor, $guid)
382
	{
383
		$recipient = [
384
			$visitor['email'] => $visitor['name']. ' ' . $visitor['surname'],
385
		];
386
387
		$code4bank = $this->getVisitorService()->calculateCode4Bank($visitor);
388
		$result = $this->getEmailer()->sendRegistrationSummary($recipient, $guid, $code4bank);
389
390
		return $result;
391
	}
392
393
	/**
394
	 * @return MeetingModel
395
	 */
396
	protected function getMeetingModel()
397
	{
398
		return $this->meetingModel;
399
	}
400
401
	/**
402
	 * @param  MeetingModel $model
403
	 * @return $this
404
	 */
405
	protected function setMeetingModel(MeetingModel $model)
406
	{
407
		$this->meetingModel = $model;
408
409
		return $this;
410
	}
411
412
	/**
413
	 * @return Emailer
414
	 */
415
	protected function getEmailer()
416
	{
417
		return $this->emailer;
418
	}
419
420
	/**
421
	 * @param  Emailer $emailer
422
	 * @return $this
423
	 */
424
	protected function setEmailer(Emailer $emailer)
425
	{
426
		$this->emailer = $emailer;
427
428
		return $this;
429
	}
430
431
	/**
432
	 * @return MealModel
433
	 */
434
	protected function getMealModel()
435
	{
436
		return $this->mealModel;
437
	}
438
439
	/**
440
	 * @param  MealModel $model
441
	 * @return $this
442
	 */
443
	protected function setMealModel(MealModel $model)
444
	{
445
		$this->mealModel = $model;
446
447
		return $this;
448
	}
449
450
	/**
451
	 * @return BlockModel
452
	 */
453
	protected function getBlockModel()
454
	{
455
		return $this->blockModel;
456
	}
457
458
	/**
459
	 * @param  BlockModel $model
460
	 * @return $this
461
	 */
462
	protected function setBlockModel(BlockModel $model)
463
	{
464
		$this->blockModel = $model;
465
466
		return $this;
467
	}
468
469
	/**
470
	 * @return VisitorService
471
	 */
472
	protected function getVisitorService()
473
	{
474
		return $this->visitorService;
475
	}
476
477
	/**
478
	 * @param  VisitorService $service
479
	 * @return $this
480
	 */
481
	protected function setVisitorService(VisitorService $service)
482
	{
483
		$this->visitorService = $service;
0 ignored issues
show
Documentation Bug introduced by
It seems like $service of type object<App\Services\VisitorService> is incompatible with the declared type object<App\Presenters\VisitorSErvice> of property $visitorService.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
484
485
		return $this;
486
	}
487
488
}
489