Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function __construct($name = null, SfFinder $finder = null) |
||
41 | { |
||
42 | // Create finder if not given |
||
43 | if ($finder === null) { |
||
44 | $finder = new SfFinder; |
||
45 | } |
||
46 | |||
47 | // Set name if given |
||
48 | if (!empty($name)) { |
||
49 | $finder->name($name); |
||
50 | } |
||
51 | |||
52 | // Sort by name |
||
53 | $finder->sortByName(); |
||
54 | |||
55 | // Set the finder |
||
56 | $this->setFinder($finder); |
||
57 | } |
||
58 | |||
98 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.