1 | <?php namespace Tuiter; |
||
7 | final class TweetCollection |
||
8 | { |
||
9 | /** |
||
10 | * @var Tweet[] |
||
11 | */ |
||
12 | private $tweets; |
||
13 | |||
14 | /** |
||
15 | * @param Tweet[] $tweets |
||
16 | */ |
||
17 | public function __construct(array $tweets) |
||
21 | |||
22 | /** |
||
23 | * @param bool $are |
||
24 | * |
||
25 | * @return TweetCollection |
||
26 | */ |
||
27 | public function retweets($are = true) |
||
33 | |||
34 | /** |
||
35 | * @param bool $are |
||
36 | * |
||
37 | * @return TweetCollection |
||
38 | */ |
||
39 | public function replies($are = true) |
||
45 | |||
46 | /** |
||
47 | * @param $date |
||
48 | * @param bool $show |
||
49 | * |
||
50 | * @return TweetCollection |
||
51 | */ |
||
52 | public function before($date, $show = true) |
||
60 | |||
61 | /** |
||
62 | * @param $date |
||
63 | * |
||
64 | * @return TweetCollection |
||
65 | */ |
||
66 | public function after($date) |
||
70 | |||
71 | /** |
||
72 | * @param $startDate |
||
73 | * @param $endDate |
||
74 | * |
||
75 | * @return TweetCollection |
||
76 | */ |
||
77 | public function between($startDate, $endDate) |
||
87 | |||
88 | /** |
||
89 | * @param $text |
||
90 | * @param bool $contains |
||
91 | * |
||
92 | * @return TweetCollection |
||
93 | */ |
||
94 | public function contains($text, $contains = true) |
||
100 | |||
101 | /** |
||
102 | * @param $text |
||
103 | * @param bool $contains |
||
104 | * |
||
105 | * @return TweetCollection |
||
106 | */ |
||
107 | public function containsInUrl($text, $contains = true) |
||
115 | |||
116 | /** |
||
117 | * @return int |
||
118 | */ |
||
119 | public function count() |
||
123 | |||
124 | /** |
||
125 | * @return Tweet[] |
||
126 | */ |
||
127 | public function get() |
||
131 | |||
132 | /** |
||
133 | * @param callable $filter |
||
134 | * |
||
135 | * @return TweetCollection |
||
136 | */ |
||
137 | public function filter(callable $filter) |
||
143 | |||
144 | /** |
||
145 | * @param $date |
||
146 | * |
||
147 | * @return \DateTime |
||
148 | */ |
||
149 | private function formatDate($date) |
||
153 | |||
154 | } |
||
155 |