File tree 4 files changed +53
-22
lines changed
4 files changed +53
-22
lines changed Original file line number Diff line number Diff line change 8
8
* @since 1.0.0
9
9
* @author Nelson Martell <[email protected] >
10
10
*/
11
- class Example implements IDemo
11
+ class Example extends ExampleClass
12
12
{
13
- /**
14
- *
15
- * @var string
16
- */
17
- protected $ example = null ;
18
-
19
- public function __construct ($ example = 'demo ' )
20
- {
21
- $ this ->example = $ example ;
22
- }
23
-
24
- public function isReady ()
25
- {
26
- return $ this ->example !== null ;
27
- }
28
-
29
- protected function isDemo ()
30
- {
31
- return $ this ->example === 'demo ' ;
32
- }
13
+ use ExampleTrait;
33
14
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace NelsonMartell \VuePress \Demo ;
4
+
5
+ /**
6
+ * Example class.
7
+ *
8
+ * @since 1.0.0
9
+ * @author Nelson Martell <[email protected] >
10
+ */
11
+ class ExampleClass implements IDemo
12
+ {
13
+ /**
14
+ *
15
+ * @var string
16
+ */
17
+ protected $ example = null ;
18
+
19
+ public function __construct ($ example = 'demo ' )
20
+ {
21
+ $ this ->example = $ example ;
22
+ }
23
+
24
+ public function isReady ()
25
+ {
26
+ return $ this ->example !== null ;
27
+ }
28
+
29
+ final protected function isDemo ()
30
+ {
31
+ return $ this ->example === 'demo ' ;
32
+ }
33
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace NelsonMartell \VuePress \Demo ;
4
+
5
+ /**
6
+ * Example trait.
7
+ *
8
+ * @since 1.0.0
9
+ * @author Nelson Martell <[email protected] >
10
+ */
11
+ trait ExampleTrait
12
+ {
13
+ protected function explain ()
14
+ {
15
+ return 'Explanation ' ;
16
+ }
17
+ }
Original file line number Diff line number Diff line change 6
6
* An example function.
7
7
*
8
8
* @param int $index Index.
9
- * @param string|null $name Name.
9
+ * @param string|null $title Name.
10
10
*
11
11
* @return string
12
12
*
You can’t perform that action at this time.
0 commit comments