Completed
Pull Request — devel (#146)
by Litera
22:56 queued 29s
created
app/components/Forms/LoginForm.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@  discard block
 block discarded – undo
27 27
 	protected $meetingModel;
28 28
 
29 29
 	/**
30
-	 * @param ProvinceModel $model
31 30
 	 */
32 31
 	public function __construct(
33 32
 		AnnotationService $annotation,
@@ -49,7 +48,7 @@  discard block
 block discarded – undo
49 48
 
50 49
 	/**
51 50
 	 * @param  array $defaults
52
-	 * @return AnnotationForm
51
+	 * @return LoginForm
53 52
 	 */
54 53
 	public function setDefaults(array $defaults = []): AnnotationForm
55 54
 	{
Please login to merge, or discard this patch.
app/presenters/BasePresenter.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 
5 5
 use App\Components\INavbarRightControlFactory;
6 6
 use App\Components\NavbarRightControl;
7
-use Nette,
8
-	App\Model;
7
+use Nette;
8
+use App\Model;
9 9
 use Nette\Utils\ArrayHash;
10 10
 use App\Models\SunlightModel;
11 11
 use Nette\Caching\Cache;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -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,7 +121,7 @@  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
 /*
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 */
132 132
 		$template->meeting = $meeting->getPlaceAndYear($_SESSION['meetingID']);
133 133
 		$template->menuItems = $meeting->getMenuItems();
134
-		$template->meeting_heading	= $meeting->getRegHeading();
134
+		$template->meeting_heading = $meeting->getRegHeading();
135 135
 		$template->meetingId = $this->getMeetingId();
136 136
 		//$template->backlinkUrl = $this->getBacklinkUrl();
137 137
 		$template->backlink = $this->getBacklink();
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
 		$i = 0;
217 217
 		$recipient = [];
218
-		foreach ($mails as $mail) {
218
+		foreach($mails as $mail) {
219 219
 			$mail = trim($mail);
220 220
 			$name = trim($names[$i]);
221 221
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	// zaheshovane udaje, aby se nedali jen tak ziskat data z databaze
231 231
 	protected function formKeyHash($id, $meetingId)
232 232
 	{
233
-		return ((int)$id . $meetingId) * 116 + 39147;
233
+		return ((int) $id . $meetingId) * 116 + 39147;
234 234
 	}
235 235
 
236 236
 	/**
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
 		// If the item exists in the cache we will just return this immediately
379 379
 		// otherwise we will execute the given Closure and cache the result
380 380
 		// of that execution for the given number of minutes in storage.
381
-		if (! is_null($data = $this->getCache()->load($key))) {
381
+		if(!is_null($data = $this->getCache()->load($key))) {
382 382
 			$items = [];
383 383
 
384 384
 			foreach($data as $item) {
385 385
 				$object = new \stdClass();
386
-				foreach ($item as $key => $value) {
386
+				foreach($item as $key => $value) {
387 387
 					$object->$key = $value;
388 388
 				}
389 389
 				$items[] = $object;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
 		$data = $callback();
396 396
 		$serialized = [];
397
-		foreach ($data as $item) {
397
+		foreach($data as $item) {
398 398
 			$serialized[] = $item->toArray();
399 399
 		}
400 400
 
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 	{
516 516
 		$message = 'Nemáte oprávnění pro tuto stránku. Prosím, přihlašte se nebo požádejte administrátora.';
517 517
 		$this->flashFailure($message);
518
-		$this->error($message, Nette\Http\IResponse::S403_FORBIDDEN );
518
+		$this->error($message, Nette\Http\IResponse::S403_FORBIDDEN);
519 519
 	}
520 520
 
521 521
 	/**
Please login to merge, or discard this patch.
app/services/Skautis/SkautisService.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	/**
71 71
 	 * Save value to local storage
72 72
 	 *
73
-	 * @param   mixed  $id
73
+	 * @param   string  $id
74 74
 	 * @param   mixed  $val
75 75
 	 * @return  mixed
76 76
 	 */
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	/**
87 87
 	 * Get object from local storage
88 88
 	 *
89
-	 * @param   string|int   $id
89
+	 * @param   string   $id
90 90
 	 * @return  mixed|FALSE
91 91
 	 */
92 92
 	protected function load($id)
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 
100 100
 	/**
101
-	 * @return Skautis\Skautis
101
+	 * @return Skautis
102 102
 	 */
103 103
 	public function getSkautis(): Skautis
104 104
 	{
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	}
107 107
 
108 108
 	/**
109
-	 * @param Skautis\Skautis $skautis
109
+	 * @param Skautis $skautis
110 110
 	 * @return self
111 111
 	 */
112 112
 	public function setSkautis(Skautis $skautis): self
Please login to merge, or discard this patch.
app/services/Skautis/UserService.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@
 block discarded – undo
147 147
 	 * Check if login session is still valid
148 148
 	 *
149 149
 	 * @param   void
150
-	 * @return  type
150
+	 * @return  boolean
151 151
 	 */
152 152
 	public function isLoggedIn()
153 153
 	{
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 class UserService extends SkautisService
11 11
 {
12 12
 
13
-    /**
14
-     * @return \Skautis\User
15
-     */
13
+	/**
14
+	 * @return \Skautis\User
15
+	 */
16 16
 	public function getUser(): User
17 17
 	{
18 18
 		return $this->getSkautis()->getUser();
Please login to merge, or discard this patch.
app/services/UserService.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
 	}
133 133
 
134 134
 	/**
135
-	 * @param  UserRepository $userRepository
135
+	 * @param  UserRepository $repository
136 136
 	 * @return self
137 137
 	 */
138 138
 	public function setUserRepository(UserRepository $repository): self
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -47,17 +47,17 @@
 block discarded – undo
47 47
 
48 48
 		$credentials = null;
49 49
 		if($socialLogin) {
50
-            $credentials = new CredentialsEntity();
51
-            $credentials->id = $socialLogin->user->id;
52
-            $credentials->guid = $socialLogin->user->guid;
53
-            $credentials->login = $socialLogin->user->login;
54
-            $credentials->role = $socialLogin->user->is_admin ? 'admin' : 'guest';
55
-            $credentials->name = $socialLogin->user->person->name;
56
-            $credentials->surname = $socialLogin->user->person->surname;
57
-            $credentials->nick = $socialLogin->user->person->nick;
58
-            $credentials->birthday = $socialLogin->user->person->birthday;
59
-            $credentials->email = $socialLogin->user->person->email;
60
-        }
50
+			$credentials = new CredentialsEntity();
51
+			$credentials->id = $socialLogin->user->id;
52
+			$credentials->guid = $socialLogin->user->guid;
53
+			$credentials->login = $socialLogin->user->login;
54
+			$credentials->role = $socialLogin->user->is_admin ? 'admin' : 'guest';
55
+			$credentials->name = $socialLogin->user->person->name;
56
+			$credentials->surname = $socialLogin->user->person->surname;
57
+			$credentials->nick = $socialLogin->user->person->nick;
58
+			$credentials->birthday = $socialLogin->user->person->birthday;
59
+			$credentials->email = $socialLogin->user->person->email;
60
+		}
61 61
 
62 62
 		return $credentials;
63 63
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@
 block discarded – undo
29 29
 		SocialLoginRepository $socialLoginRepository,
30 30
 		PersonRepository $personRepository,
31 31
 		UserRepository $userRepository
32
-	)
33
-	{
32
+	) {
34 33
 		$this->setSocialLoginRepository($socialLoginRepository);
35 34
 		$this->setPersonRepository($personRepository);
36 35
 		$this->setUserRepository($userRepository);
Please login to merge, or discard this patch.
app/services/Skautis/Authenticator.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,19 +31,19 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	private $userRepository;
33 33
 
34
-    /**
35
-     * @var AuthService
36
-     */
34
+	/**
35
+	 * @var AuthService
36
+	 */
37 37
 	private $skautisAuthService;
38 38
 
39
-    /**
40
-     * @var \App\Services\SkautIS\UserService
41
-     */
39
+	/**
40
+	 * @var \App\Services\SkautIS\UserService
41
+	 */
42 42
 	private $skautisUserService;
43 43
 
44
-    /**
45
-     * @var UserService
46
-     */
44
+	/**
45
+	 * @var UserService
46
+	 */
47 47
 	private $userService;
48 48
 
49 49
 	public function __construct(
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$userDetail = $this->skautisUserService->getPersonalDetail();
72 72
 		$token = $userDetail->ID;
73 73
 
74
-        $user = $this->userService->findByProviderAndToken('skautis', $token);
74
+		$user = $this->userService->findByProviderAndToken('skautis', $token);
75 75
 		if(!$user) {
76 76
 			$userDetail = $this->skautisUserService->getPersonalDetail();
77 77
 			$user = $this->userService->createAccount($token, $userDetail);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			$user = $this->userService->createAccount($token, $userDetail);
78 78
 		}
79 79
 
80
-		return new Identity($user->id, $user->role,  ['username' => $user->nick]);
80
+		return new Identity($user->id, $user->role, ['username' => $user->nick]);
81 81
 	}
82 82
 
83 83
 	/**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	protected function guardSkautisLoggedIn()
87 87
 	{
88
-		if (!$this->skautisUserService->isLoggedIn()) {
88
+		if(!$this->skautisUserService->isLoggedIn()) {
89 89
 			throw new AuthenticationException('Nemáte platné přihlášení do skautISu!');
90 90
 		}
91 91
 	}
Please login to merge, or discard this patch.
app/components/NavbarRight/Control.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	public function render($backlink)
29 29
 	{
30 30
 		$template = $this->getTemplate();
31
-		$template->setFile(__DIR__ . './templates/'.self::TEMPLATE_NAME.'.'.self::TEMPLATE_EXT);
31
+		$template->setFile(__DIR__ . './templates/' . self::TEMPLATE_NAME . '.' . self::TEMPLATE_EXT);
32 32
 		$template->user = $this->getUser();
33 33
 		$template->page = $this->getPresenter()->getName();
34 34
 		$template->backlink = $backlink;
Please login to merge, or discard this patch.
app/components/Forms/Factories/ILoginFormFactory.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 interface ILoginFormFactory
11 11
 {
12 12
 
13
-    /**
14
-     * @return \App\Forms\LoginForm
15
-     */
16
-    public function create(): LoginForm;
13
+	/**
14
+	 * @return \App\Forms\LoginForm
15
+	 */
16
+	public function create(): LoginForm;
17 17
 
18 18
 }
Please login to merge, or discard this patch.
app/components/INavbarRightControlFactory.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 interface INavbarRightControlFactory
11 11
 {
12 12
 
13
-    /**
14
-     * @return \App\Components\NavbarRightControl
15
-     */
16
-    public function create(): NavbarRightControl;
13
+	/**
14
+	 * @return \App\Components\NavbarRightControl
15
+	 */
16
+	public function create(): NavbarRightControl;
17 17
 
18 18
 }
Please login to merge, or discard this patch.