Completed
Pull Request — master (#102)
by Litera
10:11 queued 01:46
created
phpinfo.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@
 block discarded – undo
13 13
   	  	//define('ROOT_DIR', "/home/www/poutnicikolin.cz/subdomains/dev/admin/");
14 14
 		define('HTTP_DIR','http://'.$_SERVER['HTTP_HOST']."/vodni/srazvs/");
15 15
 		//echo ROOT_DIR;
16
-  		}
17
-	else {
16
+  		} else {
18 17
 		 define('ROOT_DIR',$_SERVER['DOCUMENT_ROOT'].'/vodni/srazvs/');
19 18
 		 define('HTTP_DIR','http://'.$_SERVER['HTTP_HOST'].'/vodni/');
20 19
 		 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,35 +2,35 @@
 block discarded – undo
2 2
 
3 3
 //pokud jsem na vyvojovem stroji
4 4
 $ISDEV = ($_SERVER["SERVER_NAME"] == 'localhost'
5
-		 )?true:false;
5
+		 ) ?true:false;
6 6
 
7 7
 if($ISDEV)
8 8
 	{
9 9
 	//vyvojova masina
10
-	if ($_SERVER["SERVER_NAME"] == 'vodni.poutnicikolin.cz')
10
+	if($_SERVER["SERVER_NAME"] == 'vodni.poutnicikolin.cz')
11 11
 		{
12 12
 		//define('ROOT_DIR',"../");
13 13
   	  	//define('ROOT_DIR', "/home/www/poutnicikolin.cz/subdomains/dev/admin/");
14
-		define('HTTP_DIR','http://'.$_SERVER['HTTP_HOST']."/vodni/srazvs/");
14
+		define('HTTP_DIR', 'http://' . $_SERVER['HTTP_HOST'] . "/vodni/srazvs/");
15 15
 		//echo ROOT_DIR;
16 16
   		}
17 17
 	else {
18
-		 define('ROOT_DIR',$_SERVER['DOCUMENT_ROOT'].'/vodni/srazvs/');
19
-		 define('HTTP_DIR','http://'.$_SERVER['HTTP_HOST'].'/vodni/');
18
+		 define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/vodni/srazvs/');
19
+		 define('HTTP_DIR', 'http://' . $_SERVER['HTTP_HOST'] . '/vodni/');
20 20
 		 }
21 21
 	}
22 22
 //ostra masina
23 23
 else {
24 24
 	// na ostrem stroji musi byt vzdy za ROOT_DIR slash "/"
25
-	define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT'].'/srazvs/');
26
-	define('HTTP_DIR', 'http://'.$_SERVER['HTTP_HOST'].'/');
25
+	define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/srazvs/');
26
+	define('HTTP_DIR', 'http://' . $_SERVER['HTTP_HOST'] . '/');
27 27
 	echo "ostrej<br />";
28 28
 }
29 29
 
30
-echo $_SERVER['DOCUMENT_ROOT']."<BR />";
31
-echo $_SERVER['HTTP_HOST']."<br />";
32
-echo ROOT_DIR."<br />";
33
-echo HTTP_DIR."<br />";
30
+echo $_SERVER['DOCUMENT_ROOT'] . "<BR />";
31
+echo $_SERVER['HTTP_HOST'] . "<br />";
32
+echo ROOT_DIR . "<br />";
33
+echo HTTP_DIR . "<br />";
34 34
 
35 35
 phpinfo();
36 36
 ?>
Please login to merge, or discard this patch.
inc/access.inc.php 2 patches
Braces   +21 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,12 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(isset($_POST['login'])) $login = $_POST['login'];
4
-else $login = "";
5
-if(isset($_POST['passwd'])) $passwd = $_POST['passwd'];
6
-else $passwd = "";
7
-if(isset($_POST['cms'])) $cms = $_POST['cms'];
8
-elseif(isset($_GET['cms'])) $cms = $_GET['cms'];
9
-else $cms = "";
3
+if(isset($_POST['login'])) {
4
+	$login = $_POST['login'];
5
+} else {
6
+	$login = "";
7
+}
8
+if(isset($_POST['passwd'])) {
9
+	$passwd = $_POST['passwd'];
10
+} else {
11
+	$passwd = "";
12
+}
13
+if(isset($_POST['cms'])) {
14
+	$cms = $_POST['cms'];
15
+} elseif(isset($_GET['cms'])) {
16
+	$cms = $_GET['cms'];
17
+} else {
18
+	$cms = "";
19
+}
10 20
 
11 21
 //odhlaseni uzivatele
12 22
 if($cms == "logout") {
@@ -33,8 +43,9 @@  discard block
 block discarded – undo
33 43
 	}
34 44
 	header("Location: ".HTTP_DIR."admin/");
35 45
 	exit('Session Not Exists');
46
+} else {
47
+	$_SESSION['user']["logged"] = true;
36 48
 }
37
-else $_SESSION['user']["logged"] = true;
38 49
 
39 50
 if(isset($_SESSION['user']['logged']) && ($_SESSION['user']['logged'] == true)) {
40 51
 	// neverim session z jineho systemu, takze overuju, jestli jsou udaje pravdive
@@ -46,8 +57,7 @@  discard block
 block discarded – undo
46 57
 	if($user) {
47 58
 		if($_SESSION[SESSION_PREFIX.'password'] != $user['password']) {
48 59
 			Tracy\Debugger::log('Access: bad password!', Tracy\Debugger::ERROR);
49
-		}
50
-		else {
60
+		} else {
51 61
 			$nologin = false;
52 62
 			// znovuobnovim pocitani casu
53 63
 			$_SESSION['user']['access_time'] = time();
@@ -61,8 +71,7 @@  discard block
 block discarded – undo
61 71
 	} else {
62 72
 		Tracy\Debugger::log('Access: user data does not exist!', Tracy\Debugger::ERROR);
63 73
 	}
64
-}
65
-else {
74
+} else {
66 75
 	session_unset();
67 76
 	session_destroy();
68 77
 	header("Location: ".HTTP_DIR."admin/");
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	session_unset();
15 15
 	session_destroy();
16 16
 	//a presmeruji na homepage
17
-	header("Location: ".HTTP_DIR."login.php");
17
+	header("Location: " . HTTP_DIR . "login.php");
18 18
 	//ukoncim
19 19
 	exit;
20 20
 }
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 $nologin = true;
26 26
 //dd(isset($_SESSION) && (!isset($_SESSION[SESSION_PREFIX.'user'])) || !isset($_SESSION[SESSION_PREFIX.'password']));
27 27
 //kontrola casove existence session a delky jeji necinnosti
28
-if(isset($_SESSION) && (!isset($_SESSION[SESSION_PREFIX.'user']) || !isset($_SESSION[SESSION_PREFIX.'password']))) {
28
+if(isset($_SESSION) && (!isset($_SESSION[SESSION_PREFIX . 'user']) || !isset($_SESSION[SESSION_PREFIX . 'password']))) {
29 29
 	$_SESSION['user']["logged"] = false;
30 30
 	session_unset();
31 31
 	if(session_id()) {
32 32
 		session_destroy();
33 33
 	}
34
-	header("Location: ".HTTP_DIR."admin/");
34
+	header("Location: " . HTTP_DIR . "admin/");
35 35
 	exit('Session Not Exists');
36 36
 }
37 37
 else $_SESSION['user']["logged"] = true;
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 	if(!isset($database)) {
42 42
 		$database = $this->database;
43 43
 	}
44
-	$user = $database->table('sunlight-users')->where('id', $_SESSION[SESSION_PREFIX.'user'])->fetch();
44
+	$user = $database->table('sunlight-users')->where('id', $_SESSION[SESSION_PREFIX . 'user'])->fetch();
45 45
 
46 46
 	if($user) {
47
-		if($_SESSION[SESSION_PREFIX.'password'] != $user['password']) {
47
+		if($_SESSION[SESSION_PREFIX . 'password'] != $user['password']) {
48 48
 			Tracy\Debugger::log('Access: bad password!', Tracy\Debugger::ERROR);
49 49
 		}
50 50
 		else {
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 			$_SESSION['user']['access_time'] = time();
54 54
 		}
55 55
 
56
-		$uid = $_SESSION[SESSION_PREFIX.'user'];
56
+		$uid = $_SESSION[SESSION_PREFIX . 'user'];
57 57
 		// 20 slunda || 19 dytta || 7 pavlik || 105 liska || 21 Pumpa || 155 jantikjanouch || 165 OVAMysak || 46 Luca || 2 hvezdar || 178 cednik || 182 tester || 179 koblizek
58
-		if(($uid != 19) && ($uid != 7) && ($uid != 105) && ($uid != 21) && ($uid != 20) && ($uid != 155) && ($uid != 165) && ($uid != 46) && ($uid != 2) && ($uid != 13) && ($uid != 178) && ($uid != 182) && ($uid != 179)){
59
-			header("Location: ".HTTP_DIR."admin/");
58
+		if(($uid != 19) && ($uid != 7) && ($uid != 105) && ($uid != 21) && ($uid != 20) && ($uid != 155) && ($uid != 165) && ($uid != 46) && ($uid != 2) && ($uid != 13) && ($uid != 178) && ($uid != 182) && ($uid != 179)) {
59
+			header("Location: " . HTTP_DIR . "admin/");
60 60
 		}
61 61
 	} else {
62 62
 		Tracy\Debugger::log('Access: user data does not exist!', Tracy\Debugger::ERROR);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 else {
66 66
 	session_unset();
67 67
 	session_destroy();
68
-	header("Location: ".HTTP_DIR."admin/");
68
+	header("Location: " . HTTP_DIR . "admin/");
69 69
 	exit('User Is Not Logged');
70 70
 }
71 71
 
Please login to merge, or discard this patch.
app/models/MealModel.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 	/**
65 65
 	 * @param  integer $visitorId
66 66
 	 * @param  array   $data
67
-	 * @return ActiveRow
67
+	 * @return integer|null
68 68
 	 */
69 69
 	public function update($visitorId, array $data)
70 70
 	{
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 			->where('visitor', $visitorId)
101 101
 			->fetchAll();
102 102
 
103
-		if(!$result){
103
+		if(!$result) {
104 104
 			$meals .= "<div class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</div>\n";
105 105
 		} else {
106
-			foreach($result as $mealData){
107
-				$meals .= "<div class='block'>".$mealData['fry_dinner'].", ".$mealData['sat_breakfast']." - ".$mealData['sat_lunch']." : ".$mealData['sat_dinner']."</div>\n";
106
+			foreach($result as $mealData) {
107
+				$meals .= "<div class='block'>" . $mealData['fry_dinner'] . ", " . $mealData['sat_breakfast'] . " - " . $mealData['sat_lunch'] . " : " . $mealData['sat_dinner'] . "</div>\n";
108 108
 
109 109
 			}
110 110
 		}
@@ -130,21 +130,21 @@  discard block
 block discarded – undo
130 130
 		$yesNoArray = array('ne', 'ano');
131 131
 
132 132
 		$htmlSelect = '';
133
-		foreach(static::$dayMeal as $title => $varName){
133
+		foreach(static::$dayMeal as $title => $varName) {
134 134
 			if(preg_match('/breakfast/', $varName))	$mealIcon = 'breakfast';
135 135
 			if(preg_match('/lunch/', $varName))		$mealIcon = 'lunch';
136 136
 			if(preg_match('/dinner/', $varName))	$mealIcon = 'dinner';
137 137
 
138
-			$htmlSelect .= "<span style='display:block;font-size:11px;'>".$title.":</span>\n";
139
-			$htmlSelect .= "<img style='width:18px;' src='".IMG_DIR."icons/".$mealIcon.".png' />\n";
140
-			$htmlSelect .= "<select ".$disabled." style='width:195px; font-size:11px;margin-left:5px;' name='".$varName."'>\n";
138
+			$htmlSelect .= "<span style='display:block;font-size:11px;'>" . $title . ":</span>\n";
139
+			$htmlSelect .= "<img style='width:18px;' src='" . IMG_DIR . "icons/" . $mealIcon . ".png' />\n";
140
+			$htmlSelect .= "<select " . $disabled . " style='width:195px; font-size:11px;margin-left:5px;' name='" . $varName . "'>\n";
141 141
 
142
-			foreach ($yesNoArray as $key){
143
-				if($key == $mealsValue[$varName]){
142
+			foreach($yesNoArray as $key) {
143
+				if($key == $mealsValue[$varName]) {
144 144
 					$selected = "selected";
145 145
 				}
146 146
 				else $selected = "";
147
-				$htmlSelect .= "<option value='".$key."' ".$selected.">".$key."</option>";
147
+				$htmlSelect .= "<option value='" . $key . "' " . $selected . ">" . $key . "</option>";
148 148
 			}
149 149
 			$htmlSelect .= "</select><br />\n";
150 150
 		}
Please login to merge, or discard this patch.
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -131,9 +131,15 @@  discard block
 block discarded – undo
131 131
 
132 132
 		$htmlSelect = '';
133 133
 		foreach(static::$dayMeal as $title => $varName){
134
-			if(preg_match('/breakfast/', $varName))	$mealIcon = 'breakfast';
135
-			if(preg_match('/lunch/', $varName))		$mealIcon = 'lunch';
136
-			if(preg_match('/dinner/', $varName))	$mealIcon = 'dinner';
134
+			if(preg_match('/breakfast/', $varName)) {
135
+				$mealIcon = 'breakfast';
136
+			}
137
+			if(preg_match('/lunch/', $varName)) {
138
+				$mealIcon = 'lunch';
139
+			}
140
+			if(preg_match('/dinner/', $varName)) {
141
+				$mealIcon = 'dinner';
142
+			}
137 143
 
138 144
 			$htmlSelect .= "<span style='display:block;font-size:11px;'>".$title.":</span>\n";
139 145
 			$htmlSelect .= "<img style='width:18px;' src='".IMG_DIR."icons/".$mealIcon.".png' />\n";
@@ -142,8 +148,9 @@  discard block
 block discarded – undo
142 148
 			foreach ($yesNoArray as $key){
143 149
 				if($key == $mealsValue[$varName]){
144 150
 					$selected = "selected";
151
+				} else {
152
+					$selected = "";
145 153
 				}
146
-				else $selected = "";
147 154
 				$htmlSelect .= "<option value='".$key."' ".$selected.">".$key."</option>";
148 155
 			}
149 156
 			$htmlSelect .= "</select><br />\n";
Please login to merge, or discard this patch.
app/models/SettingsModel.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 
33 33
 	/**
34
-	 * @return	Nette\Database\Table\ActiveRow
34
+	 * @return	\Nette\Database\IRow[]
35 35
 	 */
36 36
 	public function allOrFail()
37 37
 	{
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 *
50 50
 	 * @param	string 	$subject 	e-mail subject
51 51
 	 * @param	string	$message 	e-mail message
52
-	 * @return	string 				error code
52
+	 * @return	integer 				error code
53 53
 	 */
54 54
 	public function modifyMailJSON($type, $subject, $message)
55 55
 	{
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	}
84 84
 
85 85
 	/**
86
-	 * @return ActiveRow
86
+	 * @return \Nette\Database\IRow[]
87 87
 	 */
88 88
 	public function all()
89 89
 	{
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	/**
109 109
 	 * @param  array  $data
110 110
 	 * @param  string $name
111
-	 * @return ActiveRow
111
+	 * @return integer|null
112 112
 	 */
113 113
 	public function updateByName(array $data, $name)
114 114
 	{
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use App\Models\BaseModel;
6 6
 use Nette\Utils\Json;
7 7
 use Nette\Database\Context;
8
-use Tracy\Debugger;
9 8
 use \Exception;
10 9
 
11 10
 /**
Please login to merge, or discard this patch.
app/presenters/BasePresenter.php 4 patches
Doc Comments   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -211,6 +211,8 @@  discard block
 block discarded – undo
211 211
 	 * @param	string	name
212 212
 	 * @param	mixed	value
213 213
 	 * @param	var		variable that match with value
214
+	 * @param string $name
215
+	 * @param integer $value
214 216
 	 * @return	string	html of chceck box
215 217
 	 */
216 218
 	protected function renderHtmlCheckBox($name, $value, $checked_variable)
@@ -266,7 +268,7 @@  discard block
 block discarded – undo
266 268
 	}
267 269
 
268 270
 	/**
269
-	 * @return Container
271
+	 * @return Nette\DI\Container
270 272
 	 */
271 273
 	protected function getContainer()
272 274
 	{
@@ -405,6 +407,10 @@  discard block
 block discarded – undo
405 407
 		return $this->getModel()->updateBy('guid', $guid, $data);
406 408
 	}
407 409
 
410
+	/**
411
+	 * @param string $key
412
+	 * @param integer $minutes
413
+	 */
408 414
 	public function remember($key, $minutes, \Closure $callback)
409 415
 	{
410 416
 		// If the item exists in the cache we will just return this immediately
@@ -447,7 +453,7 @@  discard block
 block discarded – undo
447 453
 	}
448 454
 
449 455
 	/**
450
-	 * @return string
456
+	 * @return boolean
451 457
 	 */
452 458
 	protected function getDebugMode()
453 459
 	{
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Presenters;
4 4
 
5
-use Nette,
6
-	App\Model;
7
-use Nette\Utils\Strings;
5
+use Nette;
6
+use App\Model;
8 7
 use Nette\Http\Request;
9 8
 use App\Models\SunlightModel;
10 9
 use Nette\Caching\Cache;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * category ID
156 156
 	 * @var integer
157 157
 	 */
158
-	protected $itemId = NULL;
158
+	protected $itemId = null;
159 159
 
160 160
 	/**
161 161
 	 * action what to do
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * database connection
198 198
 	 * @var string
199 199
 	 */
200
-	protected $database = NULL;
200
+	protected $database = null;
201 201
 
202 202
 	/**
203 203
 	 * debug mode
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	];
49 49
 
50 50
 	protected $hours = [
51
-		0 => "00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"
51
+		0 => "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"
52 52
 	];
53 53
 
54 54
 	protected $minutes = [
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			$this->setBacklink($backlink);
81 81
 		}
82 82
 
83
-		if($meetingId){
83
+		if($meetingId) {
84 84
 			$_SESSION['meetingID'] = $meetingId;
85 85
 		} elseif(!isset($_SESSION['meetingID'])) {
86 86
 			$meeting = $this->getContainer()->getService('meeting');
@@ -121,16 +121,16 @@  discard block
 block discarded – undo
121 121
 		$template->expDir = EXP_DIR;
122 122
 		$template->meetDir = MEET_DIR;
123 123
 
124
-		$template->categories = $this->remember('categories:all', 10, function () {
124
+		$template->categories = $this->remember('categories:all', 10, function() {
125 125
 			return $this->getContainer()->getService('category')->all();
126 126
 		});
127 127
 
128
-		if(isset($_SESSION[SESSION_PREFIX.'user'])) {
129
-			$template->user = $this->getSunlight()->findUser($_SESSION[SESSION_PREFIX.'user']);
128
+		if(isset($_SESSION[SESSION_PREFIX . 'user'])) {
129
+			$template->user = $this->getSunlight()->findUser($_SESSION[SESSION_PREFIX . 'user']);
130 130
 		}
131 131
 		$template->meeting = $meeting->getPlaceAndYear($_SESSION['meetingID']);
132 132
 		$template->menuItems = $meeting->getMenuItems();
133
-		$template->meeting_heading	= $meeting->getRegHeading();
133
+		$template->meeting_heading = $meeting->getRegHeading();
134 134
 		$template->meetingId = $this->getMeetingId();
135 135
 		$template->backlinkUrl = $this->getBacklinkUrl();
136 136
 		$template->backlink = $this->getBacklink();
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		} else {
222 222
 			$checked = '';
223 223
 		}
224
-		$html_checkbox = "<input name='".$name."' type='checkbox' value='".$value."' ".$checked." />";
224
+		$html_checkbox = "<input name='" . $name . "' type='checkbox' value='" . $value . "' " . $checked . " />";
225 225
 
226 226
 		return $html_checkbox;
227 227
 	}
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 		$names = explode(',', $item->tutor);
233 233
 
234 234
 		$i = 0;
235
-		foreach ($mails as $mail) {
235
+		foreach($mails as $mail) {
236 236
 			$mail = trim($mail);
237 237
 			$name = trim($names[$i]);
238 238
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	// zaheshovane udaje, aby se nedali jen tak ziskat data z databaze
246 246
 	protected function formKeyHash($id, $meetingId)
247 247
 	{
248
-		return ((int)$id . $meetingId) * 116 + 39147;
248
+		return ((int) $id . $meetingId) * 116 + 39147;
249 249
 	}
250 250
 
251 251
 	/**
@@ -411,12 +411,12 @@  discard block
 block discarded – undo
411 411
 		// If the item exists in the cache we will just return this immediately
412 412
 		// otherwise we will execute the given Closure and cache the result
413 413
 		// of that execution for the given number of minutes in storage.
414
-		if (! is_null($data = $this->getCache()->load($key))) {
414
+		if(!is_null($data = $this->getCache()->load($key))) {
415 415
 			$items = [];
416 416
 
417 417
 			foreach($data as $item) {
418 418
 				$object = new \stdClass();
419
-				foreach ($item as $key => $value) {
419
+				foreach($item as $key => $value) {
420 420
 					$object->$key = $value;
421 421
 				}
422 422
 				$items[] = $object;
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 
428 428
 		$data = $callback();
429 429
 		$serialized = [];
430
-		foreach ($data as $item) {
430
+		foreach($data as $item) {
431 431
 			$serialized[] = $item->toArray();
432 432
 		}
433 433
 
Please login to merge, or discard this patch.
app/presenters/BlockPresenter.php 4 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -300,6 +300,8 @@
 block discarded – undo
300 300
 	 * @param	array	content of slect box
301 301
 	 * @param	var		variable that match selected option
302 302
 	 * @param	string	inline styling
303
+	 * @param string $name
304
+	 * @param string $inline_style
303 305
 	 * @return	string	html of select box
304 306
 	 */
305 307
 	private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL)
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	/**
24 24
 	 * @var integer
25 25
 	 */
26
-	private $blockId = NULL;
26
+	private $blockId = null;
27 27
 
28 28
 	/**
29 29
 	 * @var Emailer
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 	 * @param	string	inline styling
303 303
 	 * @return	string	html of select box
304 304
 	 */
305
-	private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL)
305
+	private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = null)
306 306
 	{
307
-		if(isset($inline_style) && $inline_style != NULL){
307
+		if(isset($inline_style) && $inline_style != null){
308 308
 			$style = " style='".$inline_style."'";
309 309
 		} else {
310 310
 			$style = "";
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$template->day_roll = $this->renderHtmlSelectBox('day', $this->days, null, 'width:172px;');
61 61
 		$template->hour_roll = $this->renderHtmlSelectBox('start_hour', $this->hours, date('H'));
62 62
 		$template->minute_roll = $this->renderHtmlSelectBox('start_minute', $this->minutes, date('i'));
63
-		$template->end_hour_roll = $this->renderHtmlSelectBox('end_hour', $this->hours, date('H')+1);
63
+		$template->end_hour_roll = $this->renderHtmlSelectBox('end_hour', $this->hours, date('H') + 1);
64 64
 		$template->end_minute_roll = $this->renderHtmlSelectBox('end_minute', $this->minutes, date('i'));
65 65
 		// is program block check box
66 66
 		$template->program_checkbox = $this->renderHtmlCheckBox('program', 1, 0);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 			Debugger::log('Destroying of block successfull, result: ' . json_encode($result), Debugger::INFO);
174 174
 			$this->flashMessage('Položka byla úspěšně smazána.', 'ok');
175 175
 		} catch(Exception $e) {
176
-			Debugger::log('Destroying of block failed, result: ' .  $e->getMessage(), Debugger::ERROR);
176
+			Debugger::log('Destroying of block failed, result: ' . $e->getMessage(), Debugger::ERROR);
177 177
 			$this->flashMessage('Destroying of block failed, result: ' . $e->getMessage(), 'error');
178 178
 		}
179 179
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			Debugger::log('Sending email to block tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO);
197 197
 			$this->flashMessage('Email lektorovi byl odeslán..', 'ok');
198 198
 		} catch(Exception $e) {
199
-			Debugger::log('Sending email to block tutor failed, result: ' .  $e->getMessage(), Debugger::ERROR);
199
+			Debugger::log('Sending email to block tutor failed, result: ' . $e->getMessage(), Debugger::ERROR);
200 200
 			$this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error');
201 201
 		}
202 202
 
@@ -304,19 +304,19 @@  discard block
 block discarded – undo
304 304
 	 */
305 305
 	private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL)
306 306
 	{
307
-		if(isset($inline_style) && $inline_style != NULL){
308
-			$style = " style='".$inline_style."'";
307
+		if(isset($inline_style) && $inline_style != NULL) {
308
+			$style = " style='" . $inline_style . "'";
309 309
 		} else {
310 310
 			$style = "";
311 311
 		}
312
-		$html_select = "<select name='".$name."'".$style.">";
313
-		foreach ($select_content as $key => $value) {
312
+		$html_select = "<select name='" . $name . "'" . $style . ">";
313
+		foreach($select_content as $key => $value) {
314 314
 			if($key == $selected_option) {
315 315
 				$selected = 'selected';
316 316
 			} else {
317 317
 				$selected = '';
318 318
 			}
319
-			$html_select .= "<option value='".$key."' ".$selected.">".$value."</option>";
319
+			$html_select .= "<option value='" . $key . "' " . $selected . ">" . $value . "</option>";
320 320
 		}
321 321
 		$html_select .= '</select>';
322 322
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Presenters;
4 4
 
5
-use Nette\Database\Context;
6 5
 use Tracy\Debugger;
7 6
 use App\Services\Emailer;
8 7
 use App\Models\BlockModel;
Please login to merge, or discard this patch.
app/presenters/VisitorPresenter.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	}
197 197
 
198 198
 	/**
199
-	 * @param  integer|string $ids
199
+	 * @param  integer|string $id
200 200
 	 * @return void
201 201
 	 */
202 202
 	public function actionPay($id)
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	}
219 219
 
220 220
 	/**
221
-	 * @param  string|interger $ids
221
+	 * @param  string|interger $id
222 222
 	 * @return void
223 223
 	 */
224 224
 	public function actionAdvance($id)
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	}
362 362
 
363 363
 	/**
364
-	 * @return Latte
364
+	 * @return \Nette\Application\UI\ITemplate
365 365
 	 */
366 366
 	protected function createMailTemplate()
367 367
 	{
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use App\Models\MealModel;
9 9
 use App\Services\Emailer;
10 10
 use App\Services\VisitorService;
11
-use Nette\Utils\Strings;
12 11
 use Tracy\Debugger;
13 12
 use Exception;
14 13
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 			$guid = $this->getVisitorService()->create($postData);
100 100
 			$result = $this->sendRegistrationSummary($postData, $guid);
101 101
 
102
-			Debugger::log('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO);
102
+			Debugger::log('Creation of visitor(' . $guid . ') successfull, result: ' . json_encode($result), Debugger::INFO);
103 103
 			$this->flashMessage('Účastník(' . $guid . ') byl úspěšně vytvořen.', 'ok');
104 104
 		} catch(Exception $e) {
105
-			Debugger::log('Creation of visitor('. $guid .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
105
+			Debugger::log('Creation of visitor(' . $guid . ') failed, result: ' . $e->getMessage(), Debugger::ERROR);
106 106
 			$this->flashMessage('Creation of visitor failed, result: ' . $e->getMessage(), 'error');
107 107
 		}
108 108
 
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
 
127 127
 			//$result = $this->sendRegistrationSummary($visitor, $guid);
128 128
 
129
-			Debugger::log('Modification of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
129
+			Debugger::log('Modification of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO);
130 130
 			$this->flashMessage('Účastník(' . $id . ') byl úspěšně upraven.', 'ok');
131 131
 		} catch(Exception $e) {
132
-			Debugger::log('Modification of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
132
+			Debugger::log('Modification of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR);
133 133
 			$this->flashMessage('Modification of visitor failed, result: ' . $e->getMessage(), 'error');
134 134
 		}
135 135
 
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 		try {
146 146
 			$result = $this->getVisitorService()->delete($id);
147 147
 
148
-			Debugger::log('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
148
+			Debugger::log('Destroying of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO);
149 149
 			$this->flashMessage('Položka byla úspěšně smazána', 'ok');
150 150
 		} catch(Exception $e) {
151
-			Debugger::log('Destroying of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
151
+			Debugger::log('Destroying of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR);
152 152
 			$this->flashMessage('Destroying of visitor failed, result: ' . $e->getMessage(), 'error');
153 153
 		}
154 154
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			Debugger::log('E-mail was send successfully, result: ' . json_encode($result), Debugger::INFO);
185 185
 			$this->flashMessage('E-mail byl úspěšně odeslán', 'ok');
186 186
 		} catch(Exception $e) {
187
-			Debugger::log('Sending of e-mail failed, result: ' .  $e->getMessage(), Debugger::ERROR);
187
+			Debugger::log('Sending of e-mail failed, result: ' . $e->getMessage(), Debugger::ERROR);
188 188
 			$this->flashMessage('Sending of e-mail failed, result: ' . $e->getMessage(), 'error');
189 189
 		}
190 190
 
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
 	{
246 246
 		try {
247 247
 			$result = $this->getModel()->checked($id, '1');
248
-			Debugger::log('Check of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
248
+			Debugger::log('Check of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO);
249 249
 			$this->flashMessage('Položka byla úspěšně zkontrolována', 'ok');
250 250
 		} catch(Exception $e) {
251
-			Debugger::log('Check of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
251
+			Debugger::log('Check of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR);
252 252
 			$this->flashMessage('Check of visitor failed, result: ' . $e->getMessage(), 'error');
253 253
 		}
254 254
 
@@ -265,10 +265,10 @@  discard block
 block discarded – undo
265 265
 	{
266 266
 		try {
267 267
 			$result = $this->getModel()->checked($id, 0);
268
-			Debugger::log('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO);
268
+			Debugger::log('Uncheck of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO);
269 269
 			$this->flashMessage('Položka byla nastavena jako nekontrolována', 'ok');
270 270
 		} catch(Exception $e) {
271
-			Debugger::log('Uncheck of visitor('. $id .') failed, result: ' .  $e->getMessage(), Debugger::ERROR);
271
+			Debugger::log('Uncheck of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR);
272 272
 			$this->flashMessage('Uncheck of visitor failed, result: ' . $e->getMessage(), 'error');
273 273
 		}
274 274
 
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 	protected function sendRegistrationSummary(array $visitor, $guid)
382 382
 	{
383 383
 		$recipient = [
384
-			$visitor['email'] => $visitor['name']. ' ' . $visitor['surname'],
384
+			$visitor['email'] => $visitor['name'] . ' ' . $visitor['surname'],
385 385
 		];
386 386
 
387 387
 		$code4bank = $this->getVisitorService()->calculateCode4Bank($visitor);
Please login to merge, or discard this patch.
app/router/RouterFactory.php 1 patch
Unused Use Statements   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Routers;
4 4
 
5
-use Nette,
6
-	Nette\Application\Routers\RouteList,
7
-	Nette\Application\Routers\Route,
8
-	Nette\Application\Routers\SimpleRouter;
5
+use Nette;
6
+use Nette\Application\Routers\RouteList;
7
+use Nette\Application\Routers\Route;
9 8
 
10 9
 
11 10
 /**
Please login to merge, or discard this patch.
app/services/BaseService.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	/**
69 69
 	 * Save value to local storage
70 70
 	 *
71
-	 * @param   mixed  $id
71
+	 * @param   string  $id
72 72
 	 * @param   mixed  $val
73 73
 	 * @return  mixed
74 74
 	 */
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	/**
85 85
 	 * Get object from local storage
86 86
 	 *
87
-	 * @param   string|int   $id
87
+	 * @param   string   $id
88 88
 	 * @return  mixed|FALSE
89 89
 	 */
90 90
 	protected function load($id)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	protected function save($id, $val)
76 76
 	{
77
-		if ($this->useCache) {
77
+		if($this->useCache) {
78 78
 			self::$storage[$id] = $val;
79 79
 		}
80 80
 		return $val;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	protected function load($id)
91 91
 	{
92
-		if ($this->useCache && array_key_exists($id, self::$storage)) {
92
+		if($this->useCache && array_key_exists($id, self::$storage)) {
93 93
 			return self::$storage[$id];
94 94
 		}
95 95
 		return FALSE;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * Use local storage (cache)?
30 30
 	 * @var bool
31 31
 	 */
32
-	private $useCache = TRUE;
32
+	private $useCache = true;
33 33
 
34 34
 
35 35
 	/**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * Construct
44 44
 	 */
45
-	public function __construct(Skautis $skautIS = NULL)
45
+	public function __construct(Skautis $skautIS = null)
46 46
 	{
47 47
 		$this->skautis = $skautIS;
48 48
 		self::$storage = array();
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		if ($this->useCache && array_key_exists($id, self::$storage)) {
93 93
 			return self::$storage[$id];
94 94
 		}
95
-		return FALSE;
95
+		return false;
96 96
 	}
97 97
 
98 98
 }
Please login to merge, or discard this patch.