-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathPhotoCertificateGenerator.php
More file actions
30 lines (22 loc) · 936 Bytes
/
PhotoCertificateGenerator.php
File metadata and controls
30 lines (22 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
declare(strict_types=1);
namespace App\TemplateMethod;
use App\TemplateMethod\Component\StudentDto;
/**
* Class PhotoCertificateGenerator
* @package App\TemplateMethod
*/
class PhotoCertificateGenerator extends CertificateGenerator
{
protected function generateCertificate(StudentDto $studentDto): string
{
$completedAt = $studentDto->getCompletedAt()->format('Y-m-d');
$this->notifyStudentBySms($studentDto->getPhoneNumber(), $studentDto->getName());
return "[PHOTOGRAPHY] Student {$studentDto->getName()} completed the course {$studentDto->getCourseName()} on {$completedAt}";
}
protected function sendCertificateByEmail(StudentDto $studentDto, string $certificateString): void
{
dump("Email sent to {$studentDto->getEmail()} with certificate: {$certificateString}");
$this->notifyStudentBySms($studentDto->getPhoneNumber(), $studentDto->getName());
}
}