forked from assembler-institute/oop-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobileLibs.php
51 lines (39 loc) · 1.04 KB
/
mobileLibs.php
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
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//we set namespace name
namespace Lib;
// External library interface with same name as main one
interface mobileApp {
// Interfaces cannot have properties
// All interface methods must be public
public static function showSplashScreen();
public static function getData();
public static function showData();
}
// External library classes with also same name
class assemblerApp implements mobileApp{
const APPNAME = 'LIB APP';
public static $data;
public static function showSplashScreen()
{
echo "@@@ " . self::APPNAME . " @@@";
}
public static function getData()
{
self::$data = self::APPNAME . " " . Internet::connectInternet();
}
public static function showData()
{
echo self::$data;
}
public static function exitApp()
{
echo "@@@ BYE " . self::APPNAME . " BYE @@@";
}
}
class Internet {
const SERVER = '122.23.4.9';
public static function connectInternet()
{
return "connecting to " . self::SERVER . "...";
}
}