diff --git a/modules/lms_certificate_fillpdf/src/Controller/CertificateController.php b/modules/lms_certificate_fillpdf/src/Controller/CertificateController.php index a1c4a76c73b420e92d88c8166563b7d4552f23f8..0a0acf18ccc28a5991aaf314fdf1f8707d58da83 100644 --- a/modules/lms_certificate_fillpdf/src/Controller/CertificateController.php +++ b/modules/lms_certificate_fillpdf/src/Controller/CertificateController.php @@ -17,6 +17,9 @@ use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\HttpKernelInterface; +/** + * Handles certificates for courses. + */ class CertificateController extends ControllerBase { public function __construct( @@ -37,6 +40,9 @@ class CertificateController extends ControllerBase { ); } + /** + * Generates a certificate given a group. + */ public function getCertificate(GroupInterface $group): Response { // Re-use the fillpdf controller to generate the merged PDF form // certificate. The controller relies on query arguments from the current @@ -60,6 +66,9 @@ class CertificateController extends ControllerBase { return $response; } + /** + * Access callback. + */ public function access(GroupInterface $group): AccessResult { $access_result = AccessResult::allowedIf(!$group->get('certificate')->isEmpty())->addCacheableDependency($group); $course_status = $this->trainingManager->loadCourseStatus($group, $this->currentUser(), ['status' => CourseStatusInterface::STATUS_PASSED]); diff --git a/modules/lms_certificate_fillpdf/src/Hook/LmsCertificateFillPdfHooks.php b/modules/lms_certificate_fillpdf/src/Hook/LmsCertificateFillPdfHooks.php index 9e47a880b55fbf571a6f707d978cc4e7817bf6b5..a5997c30818dbde3ca354dd96fe53a852fca33a6 100644 --- a/modules/lms_certificate_fillpdf/src/Hook/LmsCertificateFillPdfHooks.php +++ b/modules/lms_certificate_fillpdf/src/Hook/LmsCertificateFillPdfHooks.php @@ -11,6 +11,9 @@ use Drupal\Core\Entity\EntityTypeInterface; */ class LmsCertificateFillPdfHooks { + /** + * Implements hook_entity_bundle_info_alter(). + */ #[Hook('entity_bundle_field_info_alter')] public function entityBundleFieldInfoAlter(array &$fields, EntityTypeInterface $entity_type, string $bundle): void { diff --git a/src/BundleFieldDefinition.php b/src/BundleFieldDefinition.php index 790c576c90f31efab9695c0c3ddfbcb9cec0d2bd..b7cd9e032ee18e7e9cd00d4a2a9edc967d3be61c 100644 --- a/src/BundleFieldDefinition.php +++ b/src/BundleFieldDefinition.php @@ -9,8 +9,8 @@ use Drupal\Core\Field\BaseFieldDefinition; /** * Provides a field definition class for bundle fields. * - * @see https://git.drupalcode.org/project/entity/-/blob/8.x-1.x/src/BundleFieldDefinition.php?ref_type=heads - * @see https://www.drupal.org/node/2280639 + * @see https://git.drupalcode.org/project/entity/-/blob/8.x-1.x/src/BundleFieldDefinition.php?ref_type=heads. + * @see https://www.drupal.org/node/2280639. */ class BundleFieldDefinition extends BaseFieldDefinition {