@@ -149,7 +149,7 @@ public function setAuthenticator(IAuthenticator $handler)
149149 final public function getAuthenticator (): ?IAuthenticator
150150 {
151151 if (func_num_args ()) {
152- trigger_error (__METHOD__ . '() parameter $throw is deprecated, use hasAuthenticator () ' , E_USER_DEPRECATED );
152+ trigger_error (__METHOD__ . '() parameter $throw is deprecated, use getAuthenticatorIfExists () ' , E_USER_DEPRECATED );
153153 $ throw = func_get_arg (0 );
154154 }
155155 if (($ throw ?? true ) && !$ this ->authenticator ) {
@@ -159,6 +159,15 @@ final public function getAuthenticator(): ?IAuthenticator
159159 }
160160
161161
162+ /**
163+ * Returns authentication handler.
164+ */
165+ final public function getAuthenticatorIfExists (): ?IAuthenticator
166+ {
167+ return $ this ->authenticator ;
168+ }
169+
170+
162171 /**
163172 * Does the authentication exist?
164173 */
@@ -260,7 +269,7 @@ public function setAuthorizator(IAuthorizator $handler)
260269 final public function getAuthorizator (): ?IAuthorizator
261270 {
262271 if (func_num_args ()) {
263- trigger_error (__METHOD__ . '() parameter $throw is deprecated, use hasAuthorizator () ' , E_USER_DEPRECATED );
272+ trigger_error (__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists () ' , E_USER_DEPRECATED );
264273 $ throw = func_get_arg (0 );
265274 }
266275 if (($ throw ?? true ) && !$ this ->authorizator ) {
@@ -270,6 +279,15 @@ final public function getAuthorizator(): ?IAuthorizator
270279 }
271280
272281
282+ /**
283+ * Returns current authorization handler.
284+ */
285+ final public function getAuthorizatorIfExists (): ?IAuthorizator
286+ {
287+ return $ this ->authorizator ;
288+ }
289+
290+
273291 /**
274292 * Does the authorization exist?
275293 */
0 commit comments