1 | <?php |
||
29 | trait CopyBasedIntroduction |
||
30 | { |
||
31 | use Copy; |
||
32 | use Introduction { |
||
33 | Introduction::getIntroduction as private internalGetIntroduction; |
||
34 | } |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Get introduction. |
||
39 | * |
||
40 | * If an introduction hasn't been set, the first {@see $copyIntroWordCount |
||
41 | * X words} from the {@see getCopy copy} are returned. |
||
42 | * |
||
43 | * @param string $ellipse |
||
44 | * @return string |
||
45 | */ |
||
46 | 19 | public function getIntroduction($ellipse = "...") |
|
47 | { |
||
48 | 19 | $intro = $this->internalGetIntroduction(); |
|
|
|||
49 | |||
50 | 19 | if ($intro === null && ($copy = $this->getCopy()) !== null) { |
|
51 | 3 | $copy = trim(strip_tags($this->getCopy())); |
|
52 | |||
53 | 3 | if ( ! empty($copy)) { |
|
54 | 3 | $intro = $this->truncateWords($copy, $ellipse); |
|
55 | 3 | } |
|
56 | 3 | } |
|
57 | |||
58 | 19 | return $intro; |
|
59 | } |
||
60 | |||
61 | |||
62 | /** |
||
63 | * @param string $copy |
||
64 | * @param string $ellipse |
||
65 | * @return mixed |
||
66 | */ |
||
67 | 3 | protected function truncateWords($copy, $ellipse) |
|
82 | } |
||
83 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.