1 | <?php |
||
7 | class Stub |
||
8 | { |
||
9 | /** |
||
10 | * Create a new stub instance. |
||
11 | * |
||
12 | * @param $properties |
||
13 | */ |
||
14 | public function __construct($properties) |
||
18 | |||
19 | /** |
||
20 | * Author name. |
||
21 | * |
||
22 | * @return string |
||
23 | */ |
||
24 | public function authorName() |
||
28 | |||
29 | /** |
||
30 | * Author email. |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | public function authorMail() |
||
38 | |||
39 | /** |
||
40 | * Name in lowercase. |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function nameLowerCase() |
||
48 | |||
49 | /** |
||
50 | * Name in StudlyCase. |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | public function nameStudlyCase() |
||
58 | |||
59 | /** |
||
60 | * Name in UPPERCASE. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | public function nameUpperCase() |
||
68 | |||
69 | /** |
||
70 | * OAuth Version. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function oauthVersion() |
||
78 | |||
79 | /** |
||
80 | * Scopes. |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | public function scopes() |
||
96 | |||
97 | /** |
||
98 | * Request Token Url. |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | public function requestTokenUrl() |
||
106 | |||
107 | /** |
||
108 | * Authorize Url. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function authorizeUrl() |
||
116 | |||
117 | /** |
||
118 | * Access Token Url. |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | public function accessTokenUrl() |
||
126 | |||
127 | /** |
||
128 | * User Info Url. |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | public function userDetailsUrl() |
||
136 | |||
137 | /** |
||
138 | * @return array |
||
139 | */ |
||
140 | public function toArray() |
||
156 | } |
||
157 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: