Test Failed
Branch devel (807472)
by Litera
06:16
created

VisitorPresenter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 15

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 7
dl 17
loc 17
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\Http\Request;
12
use Nette\Utils\Strings;
13
use Tracy\Debugger;
14
use Exception;
15
16
/**
17
 * Visitor controller
18
 *
19
 * This file handles the retrieval and serving of visitors
20
 *
21
 * @author Tomas Litera
22
 * @copyright 2013-06-12 <[email protected]>
23
 * @package srazvs
24
 */
25
class VisitorPresenter extends BasePresenter
26
{
27
28
	const TEMPLATE_DIR = __DIR__ . '/../templates/visitor/';
29
	const TEMPLATE_EXT = 'latte';
30
31
	/**
32
	 * @var Emailer
33
	 */
34
	protected $emailer;
35
36
	/**
37
	 * @var MealModel
38
	 */
39
	protected $mealModel;
40
41
	/**
42
	 * @var BlockModel
43
	 */
44
	protected $blockModel;
45
46
	/**
47
	 * @var MeetingModel
48
	 */
49
	protected $meetingModel;
50
51
	/**
52
	 * @var VisitorSErvice
53
	 */
54
	protected $visitorService;
55
56
	/**
57
	 * @param VisitorModel $visitors
58
	 * @param MealModel    $meals
59
	 * @param BlockModel   $blocks
60
	 * @param MeetingModel $meetings
61
	 * @param Emailer      $emailer
62
	 * @param Request      $request
63
	 */
64 View Code Duplication
	public function __construct(
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...
65
		VisitorModel $visitors,
66
		MealModel $meals,
67
		BlockModel $blocks,
68
		MeetingModel $meetings,
69
		Emailer $emailer,
70
		VisitorService $visitor,
71
		Request $request
72
	) {
73
		$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...
74
		$this->setMealModel($meals);
75
		$this->setBlockModel($blocks);
76
		$this->setMeetingModel($meetings);
77
		$this->setEmailer($emailer);
78
		$this->setVisitorService($visitor);
79
		$this->setRequest($request);
80
	}
81
82
	/**
83
	 * @return void
84
	 */
85
	public function startup()
86
	{
87
		parent::startup();
88
89
		$this->getMeetingModel()->setMeetingId($this->getMeetingId());
90
	}
91
92
	/**
93
	 * Process data from form
94
	 *
95
	 * @return void
96
	 */
97 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...
98
	{
99
		try {
100
			$postData = $this->getRequest()->getPost();
101
			$postData['meeting'] = $this->getMeetingId();
102
103
			$guid = $this->getVisitorService()->create($postData);
104
			$result = $this->sendRegistrationSummary($postData, $guid);
105
106
			Debugger::log('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO);
107
			$this->flashMessage('Účastník(' . $guid . ') byl úspěšně upraven.', 'ok');
108
		} catch(Exception $e) {
109
			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...
110
			$this->flashMessage('Creation of visitor failed, result: ' . $e->getMessage(), 'error');
111
		}
112
113
		$this->redirect('Visitor:listing');
114
	}
115
116
	/**
117
	 * Process data from editing
118
	 *
119
	 * @param  integer 	$id
120
	 * @return void
121
	 */
122 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...
123
	{
124
		try {
125
			$postData = $this->getRequest()->getPost();
126
			$postData['meeting'] = $this->getMeetingId();
127
			$postData['visitor'] = $id;
128
129
			$result = $this->getVisitorService()->update($id, $postData);
130
131
			//$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...
132
133
			Debugger::log('Modification of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
134
			$this->flashMessage('Účastník(' . $id . ') byl úspěšně upraven.', 'ok');
135
		} catch(Exception $e) {
136
			Debugger::log('Modification of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
137
			$this->flashMessage('Modification of visitor failed, result: ' . $e->getMessage(), 'error');
138
		}
139
140
		$this->redirect('Visitor:listing');
141
	}
142
143
	/**
144
	 * @param  int  $id
145
	 * @return void
146
	 */
147 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...
148
	{
149
		try {
150
			$result = $this->getVisitorService()->delete($id);
151
152
			Debugger::log('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
153
			$this->flashMessage('Položka byla úspěšně smazána', 'ok');
154
		} catch(Exception $e) {
155
			Debugger::log('Destroying of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
156
			$this->flashMessage('Destroying of visitor failed, result: ' . $e->getMessage(), 'error');
157
		}
158
159
		$this->redirect('Visitor:listing');
160
	}
161
162
	/**
163
	 * Prepare mass mail form
164
	 *
165
	 * @return void
166
	 */
167
	public function actionSend()
168
	{
169
		try {
170
			$request = $this->getRequest();
171
			$subject = $request->getPost('subject', '');
172
			$message = $request->getPost('message', '');
173
			$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...
174
			// fill bcc name and address
175
			$bcc = array_combine($bcc, $bcc);
176
177
			$mailParameters = $this->getContainer()->parameters['mail'];
178
			$recipient = [
179
				$mailParameters['senderAddress'] => $mailParameters['senderName'],
180
			];
181
182
			$template = $this->createMailTemplate();
183
			$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...
184
			$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...
185
186
			$result = $this->getEmailer()->sendMail($recipient, $subject, (string) $template, $bcc);
187
188
			Debugger::log('E-mail was send successfully, result: ' . json_encode($result), Debugger::INFO);
189
			$this->flashMessage('E-mail byl úspěšně odeslán', 'ok');
190
		} catch(Exception $e) {
191
			Debugger::log('Sending of e-mail failed, result: ' .  $e->getMessage(), Debugger::ERROR);
192
			$this->flashMessage('Sending of e-mail failed, result: ' . $e->getMessage(), 'error');
193
		}
194
195
		$this->redirect('Visitor:listing');
196
	}
197
198
	/**
199
	 * @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...
200
	 * @return void
201
	 */
202 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...
203
	{
204
		try {
205
			$visitor = $this->getModel();
206
			$visitor->payCharge($id, 'cost');
207
			$recipients = $visitor->getRecipients($id);
208
			$this->getEmailer()->sendPaymentInfo($recipients, 'advance');
209
210
			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...
211
			$this->flashMessage('Platba byla zaplacena.', 'ok');
212
		} catch(Exception $e) {
213
			Debugger::log('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR);
214
			$this->flashMessage('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error');
215
		}
216
217
		$this->redirect('Visitor:listing');
218
	}
219
220
	/**
221
	 * @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...
222
	 * @return void
223
	 */
224 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...
225
	{
226
		try {
227
			$visitor = $this->getModel();
228
			$visitor->payCharge($id, 'advance');
229
			$recipients = $visitor->getRecipients($id);
230
			$this->getEmailer()->sendPaymentInfo($recipients, 'advance');
231
232
			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...
233
			$this->flashMessage('Záloha byla zaplacena.', 'ok');
234
		} catch(Exception $e) {
235
			Debugger::log('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR);
236
			$this->flashMessage('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error');
237
		}
238
239
		$this->redirect('Visitor:listing');
240
	}
241
242
	/**
243
	 * Set item as checked by id
244
	 *
245
	 * @param  integer $id
246
	 * @return void
247
	 */
248 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...
249
	{
250
		try {
251
			$result = $this->getModel()->checked($id, '1');
252
			Debugger::log('Check of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
253
			$this->flashMessage('Položka byla úspěšně zkontrolována', 'ok');
254
		} catch(Exception $e) {
255
			Debugger::log('Check of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
256
			$this->flashMessage('Check of visitor failed, result: ' . $e->getMessage(), 'error');
257
		}
258
259
		$this->redirect('Visitor:listing');
260
	}
261
262
	/**
263
	 * Set item as unchecked by id
264
	 *
265
	 * @param  integer $id
266
	 * @return void
267
	 */
268 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...
269
	{
270
		try {
271
			$result = $this->getModel()->checked($id, 0);
272
			Debugger::log('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
273
			$this->flashMessage('Položka byla nastavena jako nekontrolována', 'ok');
274
		} catch(Exception $e) {
275
			Debugger::log('Uncheck of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
276
			$this->flashMessage('Uncheck of visitor failed, result: ' . $e->getMessage(), 'error');
277
		}
278
279
		$this->redirect('Visitor:listing');
280
	}
281
282
	/**
283
	 * Prepare page for new item
284
	 *
285
	 * @return void
286
	 */
287
	public function renderNew()
288
	{
289
		$template = $this->getTemplate();
290
291
		$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...
292
		$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...
293
		$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...
294
		$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...
295
		$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...
296
		$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...
297
		$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...
298
		$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...
299
		$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...
300
		$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...
301
		$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...
302
		$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...
303
		$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...
304
	}
305
306
	/**
307
	 * @param  integer $id
308
	 * @return void
309
	 */
310
	public function renderEdit($id)
311
	{
312
		$visitor = $this->getModel()->findById($id);
313
		$meals = $this->getMealModel()->findByVisitorId($id);
314
315
		$template = $this->getTemplate();
316
317
		$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...
318
		$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...
319
		$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...
320
		$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...
321
		$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...
322
		$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...
323
		$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...
324
		$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...
325
		$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...
326
		$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...
327
		$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...
328
		$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...
329
		$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...
330
		$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...
331
	}
332
333
	/**
334
	 * Prepare mass mail form
335
	 *
336
	 * @return void
337
	 */
338
	public function renderMail()
339
	{
340
		$ids = $this->getRequest()->getPost('checker');
341
342
		$template = $this->getTemplate();
343
		$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...
344
	}
345
346
347
	/**
348
	 * @return void
349
	 */
350
	public function renderListing()
351
	{
352
		$search = $this->getRequest()->getQuery('search');
353
354
		$model = $this->getModel();
355
356
		$template = $this->getTemplate();
357
		$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...
358
		$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...
359
		$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...
360
		$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...
361
	}
362
363
	/**
364
	 * @return Latte
365
	 */
366
	protected function createMailTemplate()
367
	{
368
		$template = $this->createTemplate();
369
		$template->setFile(
370
			sprintf(
371
				'%s%s.%s',
372
				self::TEMPLATE_DIR,
373
				'mail_body',
374
				self::TEMPLATE_EXT
375
			)
376
		);
377
378
		return $template;
379
	}
380
381
	/**
382
	 * @param  array   $visitor
383
	 * @return boolean
384
	 */
385
	protected function sendRegistrationSummary(array $visitor, $guid)
386
	{
387
		$recipient = [
388
			$visitor['email'] => $visitor['name']. ' ' . $visitor['surname'],
389
		];
390
391
		$code4bank = $this->calculateCode4Bank($visitor);
392
		$result = $this->getEmailer()->sendRegistrationSummary($recipient, $guid, $code4bank);
393
394
		return $result;
395
	}
396
397
	/**
398
	 * @param  array $data
399
	 * @return string
400
	 */
401
	protected function calculateCode4Bank(array $data)
402
	{
403
		return Strings::toAscii(
404
			mb_substr($data['name'], 0, 1, 'utf-8')
405
			. mb_substr($data['surname'], 0, 1, 'utf-8')
406
			. mb_substr($data['birthday'], 2, 2)
407
		);
408
	}
409
410
	/**
411
	 * @return MeetingModel
412
	 */
413
	protected function getMeetingModel()
414
	{
415
		return $this->meetingModel;
416
	}
417
418
	/**
419
	 * @param  MeetingModel $model
420
	 * @return $this
421
	 */
422
	protected function setMeetingModel(MeetingModel $model)
423
	{
424
		$this->meetingModel = $model;
425
426
		return $this;
427
	}
428
429
	/**
430
	 * @return Emailer
431
	 */
432
	protected function getEmailer()
433
	{
434
		return $this->emailer;
435
	}
436
437
	/**
438
	 * @param  Emailer $emailer
439
	 * @return $this
440
	 */
441
	protected function setEmailer(Emailer $emailer)
442
	{
443
		$this->emailer = $emailer;
444
445
		return $this;
446
	}
447
448
	/**
449
	 * @return MealModel
450
	 */
451
	protected function getMealModel()
452
	{
453
		return $this->mealModel;
454
	}
455
456
	/**
457
	 * @param  MealModel $model
458
	 * @return $this
459
	 */
460
	protected function setMealModel(MealModel $model)
461
	{
462
		$this->mealModel = $model;
463
464
		return $this;
465
	}
466
467
	/**
468
	 * @return BlockModel
469
	 */
470
	protected function getBlockModel()
471
	{
472
		return $this->blockModel;
473
	}
474
475
	/**
476
	 * @param  BlockModel $model
477
	 * @return $this
478
	 */
479
	protected function setBlockModel(BlockModel $model)
480
	{
481
		$this->blockModel = $model;
482
483
		return $this;
484
	}
485
486
	/**
487
	 * @return VisitorService
488
	 */
489
	protected function getVisitorService()
490
	{
491
		return $this->visitorService;
492
	}
493
494
	/**
495
	 * @param  VisitorService $service
496
	 * @return $this
497
	 */
498
	protected function setVisitorService(VisitorService $service)
499
	{
500
		$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...
501
502
		return $this;
503
	}
504
505
}
506