Skip to content
Snippets Groups Projects
Commit 3a7f4ef0 authored by catch's avatar catch
Browse files

More phpcs.

parent 694848fd
No related branches found
No related tags found
No related merge requests found
Pipeline #401007 passed with warnings
......@@ -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]);
......
......@@ -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 {
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment