Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Preliminary step: extracted superclass

  • Loading branch information...
commit 7f2e843a5a0e2c455fe209f28e8b1786e9a5875b 1 parent 5064516
Giorgio Sironi authored January 19, 2012

Showing 1 changed file with 7 additions and 13 deletions. Show diff stats Hide diff stats

  1. 20  FormTemplateMethod.php
20  FormTemplateMethod.php
@@ -16,34 +16,28 @@ public function testAnArticleTweet()
16 16
     }
17 17
 }
18 18
 
19  
-class VideoTweet
  19
+class Tweet
20 20
 {
21  
-    private $url;
22  
-    private $title;
  21
+    protected $url;
  22
+    protected $title;
23 23
 
24 24
     public function __construct($url, $title)
25 25
     {
26 26
         $this->url = $url;
27 27
         $this->title = $title;
28 28
     }
  29
+}
29 30
 
  31
+class VideoTweet extends Tweet
  32
+{
30 33
     public function __toString()
31 34
     {
32 35
         return "Check out this video: $this->title $this->url";
33 36
     }
34 37
 }
35 38
 
36  
-class ArticleTweet
  39
+class ArticleTweet extends Tweet
37 40
 {
38  
-    private $url;
39  
-    private $title;
40  
-
41  
-    public function __construct($url, $title)
42  
-    {
43  
-        $this->url = $url;
44  
-        $this->title = $title;
45  
-    }
46  
-
47 41
     public function __toString()
48 42
     {
49 43
         return "RT @DZone: $this->title $this->url";

0 notes on commit 7f2e843

Please sign in to comment.
Something went wrong with that request. Please try again.