@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | public function __get(string $name): mixed |
55 | 55 | { |
56 | - if (! array_key_exists($name, $this->config)) { |
|
56 | + if (!array_key_exists($name, $this->config)) { |
|
57 | 57 | throw new \InvalidArgumentException("Invalid config name: {$name}"); |
58 | 58 | } |
59 | 59 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - if (! $flag) { |
|
35 | + if (!$flag) { |
|
36 | 36 | return false; |
37 | 37 | } |
38 | 38 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | public function applyTicket(UserModel $user, string $pgtUrl, array $proxies = []): PGTicket |
65 | 65 | { |
66 | 66 | $service = $this->serviceRepository->getServiceByUrl($pgtUrl); |
67 | - if ($service === null || ! $service->allow_proxy) { |
|
67 | + if ($service === null || !$service->allow_proxy) { |
|
68 | 68 | throw new CasException(CasException::UNAUTHORIZED_SERVICE_PROXY); |
69 | 69 | } |
70 | 70 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | return $record; |
89 | 89 | } |
90 | 90 | |
91 | - protected function getAvailableTicket(int $totalLength): string|false |
|
91 | + protected function getAvailableTicket(int $totalLength): string | false |
|
92 | 92 | { |
93 | 93 | return $this->ticketGenerator->generate( |
94 | 94 | $totalLength, |
@@ -97,7 +97,7 @@ |
||
97 | 97 | * @param string $prefix |
98 | 98 | * @return string|false |
99 | 99 | */ |
100 | - protected function getAvailableTicket(int $totalLength, string $prefix): string|false |
|
100 | + protected function getAvailableTicket(int $totalLength, string $prefix): string | false |
|
101 | 101 | { |
102 | 102 | return $this->ticketGenerator->generate( |
103 | 103 | $totalLength, |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return new Response('no'); |
59 | 59 | } |
60 | 60 | |
61 | - if (! $this->lockTicket($ticket)) { |
|
61 | + if (!$this->lockTicket($ticket)) { |
|
62 | 62 | return new Response('no'); |
63 | 63 | } |
64 | 64 | |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | ); |
143 | 143 | } |
144 | 144 | |
145 | - if (! $this->lockTicket($ticket)) { |
|
145 | + if (!$this->lockTicket($ticket)) { |
|
146 | 146 | return $this->authFailureResponse(CasException::INTERNAL_ERROR, 'try to lock ticket failed', $format); |
147 | 147 | } |
148 | 148 | |
149 | 149 | $record = $this->ticketRepository->getByTicket($ticket); |
150 | 150 | |
151 | 151 | try { |
152 | - if ($record === null || (! $allowProxy && $record->isProxy())) { |
|
152 | + if ($record === null || (!$allowProxy && $record->isProxy())) { |
|
153 | 153 | throw new CasException(CasException::INVALID_TICKET, 'ticket is not valid'); |
154 | 154 | } |
155 | 155 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | try { |
185 | 185 | $pgTicket = $this->pgTicketRepository->applyTicket($user, $pgtUrl, $proxies); |
186 | 186 | $iou = $this->ticketGenerator->generateOne(app(CasConfig::class)->pg_ticket_iou_len, 'PGTIOU-'); |
187 | - if (! $this->pgtCaller->call($pgtUrl, $pgTicket->ticket, $iou)) { |
|
187 | + if (!$this->pgtCaller->call($pgtUrl, $pgTicket->ticket, $iou)) { |
|
188 | 188 | $iou = null; |
189 | 189 | } |
190 | 190 | } catch (CasException $e) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $serviceUrl = $this->getStrFromRequest($request, 'service', ''); |
45 | 45 | $errors = []; |
46 | 46 | |
47 | - if ($serviceUrl !== '' && ! $this->serviceRepository->isUrlValid($serviceUrl)) { |
|
47 | + if ($serviceUrl !== '' && !$this->serviceRepository->isUrlValid($serviceUrl)) { |
|
48 | 48 | $errors[] = (new CasException(CasException::INVALID_SERVICE))->getCasMsg(); |
49 | 49 | } |
50 | 50 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | $serviceUrl = $this->getStrFromRequest($request, 'service', ''); |
83 | 83 | |
84 | - if ($serviceUrl !== '' && ! $this->serviceRepository->isUrlValid($serviceUrl)) { |
|
84 | + if ($serviceUrl !== '' && !$this->serviceRepository->isUrlValid($serviceUrl)) { |
|
85 | 85 | return $this->loginInteraction->redirectToHome([(new CasException(CasException::INVALID_SERVICE))->getCasMsg()]); |
86 | 86 | } |
87 | 87 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $this->app->singleton(CasConfig::class, function (): CasConfig { |
22 | 22 | $config = config('cas'); |
23 | 23 | |
24 | - if (! is_array($config)) { |
|
24 | + if (!is_array($config)) { |
|
25 | 25 | throw new \RuntimeException('Invalid CAS config'); |
26 | 26 | } |
27 | 27 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $this->mergeConfigFrom(__DIR__.'/../config/cas.php', 'cas'); |
51 | 51 | |
52 | - if (! $this->app->routesAreCached()) { |
|
52 | + if (!$this->app->routesAreCached()) { |
|
53 | 53 | $this->registerRoutes(); |
54 | 54 | } |
55 | 55 | } |