22
33namespace QuickACG ;
44
5- use Example \Services \ApiTypes ;
6- use Example \Services \CodeGrantService ;
7- use Example \Services \ManifestService ;
8- use Example \Services \IRouterService ;
5+ use DocuSign \Services \ApiTypes ;
6+ use DocuSign \Services \CodeGrantService ;
7+ use DocuSign \Services \ManifestService ;
8+ use DocuSign \Services \IRouterService ;
99
1010class RouterService implements IRouterService
1111{
@@ -66,26 +66,26 @@ public function router(): void
6666
6767 switch ($ page ) {
6868 case 'select_api ' :
69- $ this ->ds_login ();
69+ $ this ->dsLogin ();
7070 break ;
7171 case 'ds_callback ' :
72- $ this ->ds_callback (); // See below in oauth section
72+ $ this ->dsCallback (); // See below in oauth section
7373 break ;
7474 case 'must_authenticate ' :
75- $ this ->ds_login ();
75+ $ this ->dsLogin ();
7676 break ;
7777 case 'ds_return ' :
7878 header ('Location: ' . '/public ' , true );
7979 break ;
8080 case 'eg001 ' :
8181 $ _SESSION ['API_TEXT ' ] = ManifestService::loadManifestData ($ GLOBALS ['DS_CONFIG ' ]['CodeExamplesManifest ' ]);
82- $ controller = '\Example \\' . $ this ->getController ($ page );
82+ $ controller = '\DocuSign \\' . $ this ->getController ($ page );
8383 new $ controller ($ page );
8484 break ;
8585 default :
8686 error_reporting (E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED );
8787 $ _SESSION ['API_TEXT ' ] = ManifestService::loadManifestData ($ GLOBALS ['DS_CONFIG ' ]['CodeExamplesManifest ' ]);
88- $ controller = '\Example \\' . $ this ->getController ($ page );
88+ $ controller = '\DocuSign \\' . $ this ->getController ($ page );
8989 new $ controller ($ page );
9090 break ;
9191 }
@@ -95,7 +95,7 @@ public function router(): void
9595 * @param int $buffer_min buffer time needed in minutes
9696 * @return boolean $ok true iff the user has an access token that will be good for another buffer min
9797 */
98- function ds_token_ok (int $ buffer_min = 10 ): bool
98+ function dsTokenOk (int $ buffer_min = 10 ): bool
9999 {
100100 $ areTokenAndExprirationSet = isset ($ _SESSION ['ds_access_token ' ]) && isset ($ _SESSION ['ds_expiration ' ]);
101101
@@ -116,7 +116,7 @@ public function getController($eg): string
116116 /**
117117 * Unset all items from the session
118118 */
119- function ds_logout_internal (): void
119+ function dsLogoutInternal (): void
120120 {
121121 foreach (self ::SESSION_VALUES as &$ sessionValue ) {
122122 if (isset ($ _SESSION [$ sessionValue ])) {
@@ -128,16 +128,16 @@ function ds_logout_internal(): void
128128 /**
129129 * DocuSign login handler
130130 */
131- function ds_login (): void
131+ function dsLogin (): void
132132 {
133- $ _SESSION ['api_type ' ] = ApiTypes::eSignature ;
133+ $ _SESSION ['api_type ' ] = ApiTypes::ESIGNATURE ;
134134 $ this ->authService ->login ();
135135 }
136136
137137 /**
138138 * Called via a redirect from DocuSign authentication service
139139 */
140- function ds_callback (): void
140+ function dsCallback (): void
141141 {
142142 # Save the redirect eg if present
143143 $ redirectUrl = false ;
@@ -149,7 +149,7 @@ function ds_callback(): void
149149 # reset the session
150150 $ tempAPIType = $ _SESSION ['api_type ' ];
151151 $ tempGrant = $ _SESSION ['auth_service ' ];
152- $ this ->ds_logout_internal ();
152+ $ this ->dsLogoutInternal ();
153153
154154 // Workaround for ACG apiTypePicker
155155 $ _SESSION ['api_type ' ] = $ tempAPIType ;
@@ -169,7 +169,7 @@ public function flash(string $msg): void
169169 /**
170170 * Checker for the CSRF token
171171 */
172- function check_csrf (): void
172+ function checkCsrf (): void
173173 {
174174 $ this ->authService ->checkToken ();
175175 }
0 commit comments