@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function broadcastOn() |
39 | 39 | { |
40 | - return []; |
|
40 | + return [ ]; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function broadcastOn() |
39 | 39 | { |
40 | - return []; |
|
40 | + return [ ]; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -8,7 +8,6 @@ discard block |
||
8 | 8 | |
9 | 9 | namespace Leo108\CAS\Http\Controllers; |
10 | 10 | |
11 | -use Illuminate\Support\Str; |
|
12 | 11 | use Leo108\CAS\Contracts\TicketLocker; |
13 | 12 | use Leo108\CAS\Repositories\TicketRepository; |
14 | 13 | use Leo108\CAS\Exceptions\CAS\CasException; |
@@ -19,7 +18,6 @@ discard block |
||
19 | 18 | use Leo108\CAS\Responses\JsonAuthenticationSuccessResponse; |
20 | 19 | use Leo108\CAS\Responses\XmlAuthenticationFailureResponse; |
21 | 20 | use Leo108\CAS\Responses\XmlAuthenticationSuccessResponse; |
22 | -use SimpleXMLElement; |
|
23 | 21 | |
24 | 22 | class ValidateController extends Controller |
25 | 23 | { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->ticketRepository->invalidTicket($record); |
121 | 121 | $this->unlockTicket($ticket); |
122 | 122 | |
123 | - $attr = $returnAttr ? $record->user->getCASAttributes() : []; |
|
123 | + $attr = $returnAttr ? $record->user->getCASAttributes() : [ ]; |
|
124 | 124 | |
125 | 125 | return $this->successResponse($record->user->getName(), $format, $attr); |
126 | 126 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @param string|null $pgt |
134 | 134 | * @return Response |
135 | 135 | */ |
136 | - protected function successResponse($username, $format, $attributes, $proxies = [], $pgt = null) |
|
136 | + protected function successResponse($username, $format, $attributes, $proxies = [ ], $pgt = null) |
|
137 | 137 | { |
138 | 138 | if (strtoupper($format) === 'JSON') { |
139 | 139 | $resp = app(JsonAuthenticationSuccessResponse::class); |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | public function showLogin(Request $request) |
54 | 54 | { |
55 | 55 | $service = $request->get('service', ''); |
56 | - $errors = []; |
|
56 | + $errors = [ ]; |
|
57 | 57 | if (!empty($service)) { |
58 | 58 | //service not found in white list |
59 | 59 | if (!$this->serviceRepository->isUrlValid($service)) { |
60 | - $errors[] = (new CasException(CasException::INVALID_SERVICE))->getCasMsg(); |
|
60 | + $errors[ ] = (new CasException(CasException::INVALID_SERVICE))->getCasMsg(); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | //must not be transparent |
73 | 73 | if ($request->get('warn') === 'true' && !empty($service)) { |
74 | 74 | $query = $request->query->all(); |
75 | - unset($query['warn']); |
|
75 | + unset($query[ 'warn' ]); |
|
76 | 76 | $url = cas_route('login_page', $query); |
77 | 77 | |
78 | 78 | return $this->loginInteraction->showLoginWarnPage($request, $url, $service); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | try { |
102 | 102 | $ticket = $this->ticketRepository->applyTicket($user, $serviceUrl); |
103 | 103 | } catch (CasException $e) { |
104 | - return $this->loginInteraction->redirectToHome([$e->getCasMsg()]); |
|
104 | + return $this->loginInteraction->redirectToHome([ $e->getCasMsg() ]); |
|
105 | 105 | } |
106 | 106 | $finalUrl = $serviceUrl.($query ? '&' : '?').'ticket='.$ticket->ticket; |
107 | 107 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function __construct() |
25 | 25 | { |
26 | - $this->data = ['serviceResponse' => ['authenticationFailure' => []]]; |
|
26 | + $this->data = [ 'serviceResponse' => [ 'authenticationFailure' => [ ] ] ]; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function setFailure($code, $description) |
35 | 35 | { |
36 | - $this->data['serviceResponse']['authenticationFailure']['code'] = $code; |
|
37 | - $this->data['serviceResponse']['authenticationFailure']['description'] = $description; |
|
36 | + $this->data[ 'serviceResponse' ][ 'authenticationFailure' ][ 'code' ] = $code; |
|
37 | + $this->data[ 'serviceResponse' ][ 'authenticationFailure' ][ 'description' ] = $description; |
|
38 | 38 | |
39 | 39 | return $this; |
40 | 40 | } |
@@ -96,6 +96,6 @@ |
||
96 | 96 | return $this->node->addChild('cas:authenticationSuccess'); |
97 | 97 | } |
98 | 98 | |
99 | - return $authNodes[0]; |
|
99 | + return $authNodes[ 0 ]; |
|
100 | 100 | } |
101 | 101 | } |
@@ -23,33 +23,33 @@ |
||
23 | 23 | */ |
24 | 24 | public function __construct() |
25 | 25 | { |
26 | - $this->data = ['serviceResponse' => ['authenticationSuccess' => []]]; |
|
26 | + $this->data = [ 'serviceResponse' => [ 'authenticationSuccess' => [ ] ] ]; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function setUser($user) |
30 | 30 | { |
31 | - $this->data['serviceResponse']['authenticationSuccess']['user'] = $user; |
|
31 | + $this->data[ 'serviceResponse' ][ 'authenticationSuccess' ][ 'user' ] = $user; |
|
32 | 32 | |
33 | 33 | return $this; |
34 | 34 | } |
35 | 35 | |
36 | 36 | public function setProxies($proxies) |
37 | 37 | { |
38 | - $this->data['serviceResponse']['authenticationSuccess']['proxies'] = $proxies; |
|
38 | + $this->data[ 'serviceResponse' ][ 'authenticationSuccess' ][ 'proxies' ] = $proxies; |
|
39 | 39 | |
40 | 40 | return $this; |
41 | 41 | } |
42 | 42 | |
43 | 43 | public function setAttributes($attributes) |
44 | 44 | { |
45 | - $this->data['serviceResponse']['authenticationSuccess']['attributes'] = $attributes; |
|
45 | + $this->data[ 'serviceResponse' ][ 'authenticationSuccess' ][ 'attributes' ] = $attributes; |
|
46 | 46 | |
47 | 47 | return $this; |
48 | 48 | } |
49 | 49 | |
50 | 50 | public function setProxyGrantingTicket($ticket) |
51 | 51 | { |
52 | - $this->data['serviceResponse']['authenticationSuccess']['proxyGrantingTicket'] = $ticket; |
|
52 | + $this->data[ 'serviceResponse' ][ 'authenticationSuccess' ][ 'proxyGrantingTicket' ] = $ticket; |
|
53 | 53 | |
54 | 54 | return $this; |
55 | 55 | } |
@@ -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 | } |