authx - Simplify service declaration
authorTim Otten <totten@civicrm.org>
Wed, 29 Mar 2023 05:35:10 +0000 (22:35 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 29 Mar 2023 05:35:10 +0000 (22:35 -0700)
ext/authx/Civi/Authx/CheckCredential.php
ext/authx/authx.php

index 61368f84e3a198f9cba8c31e0867d2f73c3c0c4f..7d2ded378eb43bf894afd9a25f96c9b6321638eb 100644 (file)
 
 namespace Civi\Authx;
 
+use Civi\Core\Service\AutoService;
 use Civi\Crypto\Exception\CryptoException;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
 /**
  * This class is a small collection of common/default credential checkers.
+ *
+ * @service authx.credentials
  */
-class CheckCredential implements EventSubscriberInterface {
+class CheckCredential extends AutoService implements EventSubscriberInterface {
 
   /**
    * Listener priority for handling credential format of 'Basic' with
index c3ebc11746dd25f4484f72fb2cd72bf03c0d4aff..432afe1d893e25f051027f91557db48bb4bb01d2 100644 (file)
@@ -5,13 +5,6 @@ require_once 'authx.civix.php';
 use CRM_Authx_ExtensionUtil as E;
 // phpcs:enable
 
-
-function authx_civicrm_container(\Symfony\Component\DependencyInjection\ContainerBuilder $container) {
-  $container->register('authx_credentials', '\Civi\Authx\CheckCredential')
-    ->addTag('kernel.event_subscriber')
-    ->setPublic(TRUE);
-}
-
 /**
  * Perform a system login.
  *