1 | <?php namespace BestServedCold\PhalueObjects; |
||
12 | class File extends ValueObject |
||
13 | { |
||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | protected $timeout; |
||
18 | |||
19 | /** |
||
20 | * @var bool |
||
21 | */ |
||
22 | protected $mustExist; |
||
23 | |||
24 | /** |
||
25 | * File constructor. |
||
26 | * @param array $value |
||
27 | * @param bool $mustExist |
||
28 | * @param int $timeout |
||
29 | */ |
||
30 | 10 | public function __construct($value, $mustExist = true, $timeout = 10) |
|
36 | |||
37 | /** |
||
38 | * @return bool |
||
39 | */ |
||
40 | 6 | public function exists() |
|
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | 5 | public function getContents() |
|
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public function getExtension() |
|
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | 1 | public function getDirectoryName() |
|
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | 1 | public function getFileName() |
|
78 | |||
79 | /** |
||
80 | * @return VOString |
||
81 | */ |
||
82 | 1 | public function toVOString() |
|
86 | |||
87 | /** |
||
88 | * @return Xml |
||
89 | */ |
||
90 | 1 | public function toXml() |
|
94 | |||
95 | /** |
||
96 | * @return Json |
||
97 | */ |
||
98 | 1 | public function toJson() |
|
102 | |||
103 | /** |
||
104 | * @return Yaml |
||
105 | */ |
||
106 | 1 | public function toYaml() |
|
110 | } |
||
111 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.