| Conditions | 5 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function shareUrl() |
||
| 11 | { |
||
| 12 | $data = $this->page->get(array('title', 'twitterUser')); |
||
| 13 | $text = isset($data['title']) ? trim($data['title']) : ''; |
||
| 14 | |||
| 15 | if (!empty($data['twitterUser']) && (strpos($text, $data['twitterUser']) === false)) { |
||
| 16 | if (strrpos($text, '.', -1)) { |
||
| 17 | $text = substr($text, 0, -1); |
||
| 18 | } |
||
| 19 | |||
| 20 | $text .= ' via '.$data['twitterUser']; |
||
| 21 | } |
||
| 22 | |||
| 23 | return $this->buildUrl( |
||
| 24 | 'https://twitter.com/intent/tweet', |
||
| 25 | array('url'), |
||
| 26 | array('text' => $text) |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 53 |