1 | <?php |
||
24 | class Extension extends AbstractPathModifier |
||
25 | { |
||
26 | /** |
||
27 | * The extension to use for URI modification |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $extension; |
||
32 | |||
33 | /** |
||
34 | * New instance |
||
35 | * |
||
36 | * @param string $extension |
||
37 | */ |
||
38 | 9 | public function __construct($extension) |
|
42 | |||
43 | /** |
||
44 | * filter and validate the extension to use |
||
45 | * |
||
46 | * @param string $extension |
||
47 | * |
||
48 | * @throws InvalidArgumentException if the extension is not valid |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | 9 | protected function filterExtension($extension) |
|
64 | |||
65 | /** |
||
66 | * Return a new instance with a different extension to use |
||
67 | * |
||
68 | * DEPRECATION WARNING! This method will be removed in the next major point release |
||
69 | * |
||
70 | * @deprecated deprecated since version 4.1 |
||
71 | * |
||
72 | * @param string $extension |
||
73 | * |
||
74 | * @return self |
||
75 | */ |
||
76 | public function withExtension($extension) |
||
83 | |||
84 | /** |
||
85 | * Modify a URI part |
||
86 | * |
||
87 | * @param string $str the URI part string representation |
||
88 | * |
||
89 | * @return string the modified URI part string representation |
||
90 | */ |
||
91 | 6 | protected function modify($str) |
|
95 | } |
||
96 |