@@ -91,6 +91,6 @@ |
||
| 91 | 91 | { |
| 92 | 92 | $content = $this->removeXmlFirstLine($this->node->asXML()); |
| 93 | 93 | |
| 94 | - return new Response($content, 200, ['Content-Type' => 'application/xml']); |
|
| 94 | + return new Response($content, 200, [ 'Content-Type' => 'application/xml' ]); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | \ No newline at end of file |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function toResponse() |
| 24 | 24 | { |
| 25 | - return new Response(json_encode($this->data), 200, ['Content-Type' => 'application/json']); |
|
| 25 | + return new Response(json_encode($this->data), 200, [ 'Content-Type' => 'application/json' ]); |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | ]; |
| 7 | 7 | |
| 8 | 8 | if (config('cas.middleware.common')) { |
| 9 | - $options['middleware'] = config('cas.middleware.common'); |
|
| 9 | + $options[ 'middleware' ] = config('cas.middleware.common'); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | Route::group( |
| 13 | 13 | $options, |
| 14 | - function () { |
|
| 14 | + function() { |
|
| 15 | 15 | $auth = config('cas.middleware.auth'); |
| 16 | 16 | $p = config('cas.router.name_prefix'); |
| 17 | 17 | Route::get('login', 'SecurityController@showLogin')->name($p.'login.get'); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | return $this->authFailureResponse($e->getCasErrorCode(), $e->getMessage(), $format); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $proxies = []; |
|
| 192 | + $proxies = [ ]; |
|
| 193 | 193 | if ($record->isProxy()) { |
| 194 | 194 | $proxies = $record->proxies; |
| 195 | 195 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - $attr = $returnAttr ? $record->user->getCASAttributes() : []; |
|
| 216 | + $attr = $returnAttr ? $record->user->getCASAttributes() : [ ]; |
|
| 217 | 217 | |
| 218 | 218 | return $this->authSuccessResponse($record->user->getName(), $format, $attr, $proxies, $iou); |
| 219 | 219 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * @param string|null $pgt |
| 227 | 227 | * @return Response |
| 228 | 228 | */ |
| 229 | - protected function authSuccessResponse($username, $format, $attributes, $proxies = [], $pgt = null) |
|
| 229 | + protected function authSuccessResponse($username, $format, $attributes, $proxies = [ ], $pgt = null) |
|
| 230 | 230 | { |
| 231 | 231 | if (strtoupper($format) === 'JSON') { |
| 232 | 232 | $resp = app(JsonAuthenticationSuccessResponse::class); |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | protected $table = 'cas_proxy_granting_tickets'; |
| 32 | 32 | public $timestamps = false; |
| 33 | - protected $fillable = ['ticket', 'pgt_url', 'proxies', 'expire_at', 'created_at']; |
|
| 33 | + protected $fillable = [ 'ticket', 'pgt_url', 'proxies', 'expire_at', 'created_at' ]; |
|
| 34 | 34 | |
| 35 | 35 | public function getProxiesAttribute() |
| 36 | 36 | { |
| 37 | - $ret = json_decode($this->attributes['proxies'], true); |
|
| 37 | + $ret = json_decode($this->attributes[ 'proxies' ], true); |
|
| 38 | 38 | if (!$ret) { |
| 39 | - return []; |
|
| 39 | + return [ ]; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return $ret; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function setProxiesAttribute($value) |
| 46 | 46 | { |
| 47 | - $this->attributes['proxies'] = json_encode($value); |
|
| 47 | + $this->attributes[ 'proxies' ] = json_encode($value); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function isExpired() |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | protected $table = 'cas_tickets'; |
| 32 | 32 | public $timestamps = false; |
| 33 | - protected $fillable = ['ticket', 'service_url', 'proxies', 'expire_at', 'created_at']; |
|
| 33 | + protected $fillable = [ 'ticket', 'service_url', 'proxies', 'expire_at', 'created_at' ]; |
|
| 34 | 34 | |
| 35 | 35 | public function getProxiesAttribute() |
| 36 | 36 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return null; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - return json_decode($this->attributes['proxies'], true); |
|
| 41 | + return json_decode($this->attributes[ 'proxies' ], true); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public function setProxiesAttribute($value) |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | if ($this->id && !$this->isProxy()) { |
| 47 | 47 | return; |
| 48 | 48 | } |
| 49 | - $this->attributes['proxies'] = json_encode($value); |
|
| 49 | + $this->attributes[ 'proxies' ] = json_encode($value); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function isExpired() |
@@ -66,6 +66,6 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function isProxy() |
| 68 | 68 | { |
| 69 | - return !is_null($this->attributes['proxies']); |
|
| 69 | + return !is_null($this->attributes[ 'proxies' ]); |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @throws CasException |
| 52 | 52 | * @return \Leo108\CAS\Models\Ticket |
| 53 | 53 | */ |
| 54 | - public function applyTicket(UserModel $user, $serviceUrl, $proxies = []) |
|
| 54 | + public function applyTicket(UserModel $user, $serviceUrl, $proxies = [ ]) |
|
| 55 | 55 | { |
| 56 | 56 | $service = $this->serviceRepository->getServiceByUrl($serviceUrl); |
| 57 | 57 | if (!$service) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | return $this->ticketGenerator->generate( |
| 112 | 112 | $totalLength, |
| 113 | 113 | $prefix, |
| 114 | - function ($ticket) { |
|
| 114 | + function($ticket) { |
|
| 115 | 115 | return $this->getByTicket($ticket, false); |
| 116 | 116 | }, |
| 117 | 117 | 10 |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @return PGTicket |
| 69 | 69 | * @throws CasException |
| 70 | 70 | */ |
| 71 | - public function applyTicket(UserModel $user, $pgtUrl, $proxies = []) |
|
| 71 | + public function applyTicket(UserModel $user, $pgtUrl, $proxies = [ ]) |
|
| 72 | 72 | { |
| 73 | 73 | $service = $this->serviceRepository->getServiceByUrl($pgtUrl); |
| 74 | 74 | if (!$service || !$service->allow_proxy) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | return $this->ticketGenerator->generate( |
| 105 | 105 | $totalLength, |
| 106 | 106 | 'PGT-', |
| 107 | - function ($ticket) { |
|
| 107 | + function($ticket) { |
|
| 108 | 108 | return $this->getByTicket($ticket, false); |
| 109 | 109 | }, |
| 110 | 110 | 10 |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $flag = false; |
| 27 | 27 | for ($i = 0; $i < $maxRetry; $i++) { |
| 28 | 28 | $ticket = $this->generateOne($totalLength, $prefix); |
| 29 | - if (!call_user_func_array($checkFunc, [$ticket])) { |
|
| 29 | + if (!call_user_func_array($checkFunc, [ $ticket ])) { |
|
| 30 | 30 | $flag = true; |
| 31 | 31 | break; |
| 32 | 32 | } |