1 | <?php |
||
13 | class Usher |
||
14 | { |
||
15 | const DEFAULT_MAX_TRIES = 100000; |
||
16 | |||
17 | /** @var int */ |
||
18 | protected $maxTries; |
||
19 | |||
20 | /** @var \SixtyNine\Cloud\SimpleMask */ |
||
21 | protected $mask; |
||
22 | |||
23 | /** @var \SixtyNine\Cloud\Placer\PlacerInterface */ |
||
24 | protected $placer; |
||
25 | |||
26 | /** @var \SixtyNine\Cloud\FontMetrics */ |
||
27 | protected $metrics; |
||
28 | |||
29 | /** |
||
30 | * @param int $imgWidth |
||
31 | * @param int $imgHeight |
||
32 | * @param PlacerInterface $placer |
||
33 | * @param FontMetrics $metrics |
||
34 | * @param int $maxTries |
||
35 | */ |
||
36 | 4 | public function __construct( |
|
50 | |||
51 | /** |
||
52 | * @param string $word |
||
53 | * @param string $font |
||
54 | * @param int $size |
||
55 | * @param int $angle |
||
56 | * @return bool|Box |
||
57 | */ |
||
58 | 4 | public function getPlace($word, $font, $size, $angle) |
|
71 | |||
72 | /** |
||
73 | * Search a free place for a new box. |
||
74 | * @param \SixtyNine\Cloud\Model\Box $bounds |
||
75 | * @param \SixtyNine\Cloud\Model\Box $box |
||
76 | * @return bool|Box |
||
77 | */ |
||
78 | 4 | protected function searchPlace(Box $bounds, Box $box) |
|
108 | } |
||
109 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: