/
uchi-pro
/
api-client-php
Обзор
Документация
Войти
/
uchi-pro
/
api-client-php
Код
Запросы
0
Пакеты
0
Релизы
3
Аналитика
master
src/Courses/LessonType.php
52 строки
1 KB
Andrey Gladyshev
feat: перевести проект на php 8.2. убрать устаревшие методы
31 май 2024, 13:00
31 май 2024, 13:00
5826891
Код
Авторство
О чём код?
<?php declare(strict_types=1); namespace UchiPro\Courses; class LessonType { public ?string $id = null; public ?string $title = null; public static function create($id, $title): self { $lesson = new self(); $lesson->id = $id; $lesson->title = $title; return $lesson; } public static function createLecture(): self { $lesson = new self(); $lesson->id = 'lecture'; $lesson->title = 'Лекция'; return $lesson; } public static function createQuiz(): self { $lesson = new self(); $lesson->id = 'quiz'; $lesson->title = 'Тестирование'; return $lesson; } public static function createEssay(): self { $lesson = new self(); $lesson->id = 'essay'; $lesson->title = 'Практическое задание'; return $lesson; } public static function createScorm(): self { $lesson = new self(); $lesson->id = 'scorm'; $lesson->title = 'Встраиваемый интерактивный урок'; return $lesson; } }