-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterface-Segregation.php
More file actions
39 lines (31 loc) · 963 Bytes
/
Copy pathInterface-Segregation.php
File metadata and controls
39 lines (31 loc) · 963 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
31
32
33
34
35
36
37
38
39
<?php
interface PrinterInterface {
public function printDocument($document);
}
interface ScannerInterface {
public function scanDocument();
}
interface MultiFunctionDeviceInterface extends PrinterInterface, ScannerInterface {
public function faxDocument($document);
}
class MultiFunctionPrinter implements MultiFunctionDeviceInterface {
public function printDocument($document) {
// Implementation for printing the document
}
public function scanDocument() {
// Implementation for scanning the document
}
public function faxDocument($document) {
// Implementation for faxing the document
}
}
class SimplePrinter implements PrinterInterface {
public function printDocument($document) {
// Implementation for printing the document
}
}
class SimpleScanner implements ScannerInterface {
public function scanDocument() {
// Implementation for scanning the document
}
}