1 | <?php |
||
4 | class AssetTimestamper |
||
5 | { |
||
6 | |||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | public $base_path; |
||
11 | |||
12 | |||
13 | /** |
||
14 | * Timestamp format to use. |
||
15 | * |
||
16 | * @see http://php.net/manual/de/function.date.php |
||
17 | * @var string |
||
18 | */ |
||
19 | public $format = 'YmdHis'; |
||
20 | |||
21 | /** |
||
22 | * Separator sign that preceeds the timestamp |
||
23 | * @var string |
||
24 | */ |
||
25 | public $separator = '.'; |
||
26 | |||
27 | |||
28 | /** |
||
29 | * @param string $base_path Optional: Base path, default: Current work dir. |
||
|
|||
30 | * @uses $base_path |
||
31 | */ |
||
32 | 55 | public function __construct( $base_path = null ) |
|
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | * @uses $base_path |
||
40 | */ |
||
41 | 15 | public function getBasePath() |
|
45 | |||
46 | /** |
||
47 | * @param string $asset Asset URL |
||
48 | * @return string Timestamped Asset URL |
||
49 | * @uses $base_path |
||
50 | */ |
||
51 | 40 | public function __invoke( $asset ) |
|
76 | |||
77 | |||
78 | /** |
||
79 | * @param string $asset Asset path |
||
80 | * @param string $real_file Real file path |
||
81 | * @return string The timestamped asset file name |
||
82 | */ |
||
83 | 20 | public function buildTimestampedPath($asset, $real_file) |
|
104 | } |
||
105 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.