-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProducts.php
More file actions
27 lines (23 loc) · 904 Bytes
/
Copy pathProducts.php
File metadata and controls
27 lines (23 loc) · 904 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
<?php
class Car {
public string $type = '';
public int $seats = 0;
public string $engine = '';
public bool $hasTripComputer = false;
public bool $hasGPS = false;
public function showSpecification(): string {
return "🚗 <strong>Автомобіль [{$this->type}]</strong>:<br>" .
"- Кількість місць: {$this->seats}<br>" .
"- Двигун: {$this->engine}<br>" .
"- Бортовий комп'ютер: " . ($this->hasTripComputer ? "Є" : "Немає") . "<br>" .
"- Навігація GPS: " . ($this->hasGPS ? "Є" : "Немає") . "<br>";
}
}
class Manual {
public string $type = '';
public string $content = '';
public function showManual(): string {
return "📖 <strong>Інструкція для [{$this->type}]</strong>:<br>" .
nl2br($this->content);
}
}