1 | <?php |
||
10 | class FileContainer |
||
11 | { |
||
12 | const TYPE_UNKNOWN = 'unknown'; |
||
13 | const TYPE_COMPASS = 'compass'; |
||
14 | const TYPE_SASS = 'sass'; |
||
15 | const TYPE_SCSS = 'scss'; |
||
16 | const TYPE_LESS = 'less'; |
||
17 | static $supportedTypes = [ |
||
|
|||
18 | self::TYPE_COMPASS, |
||
19 | self::TYPE_SASS, |
||
20 | self::TYPE_SCSS, |
||
21 | self::TYPE_LESS |
||
22 | ]; |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $sourcePath; |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $outputPath; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $sourceContent; |
||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $parsedContent; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $type; |
||
43 | |||
44 | /** |
||
45 | * @param string $sourcePath |
||
46 | * @param string $outputPath |
||
47 | */ |
||
48 | public function __construct($sourcePath, $outputPath) |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getOutputPath() |
||
61 | |||
62 | /** |
||
63 | * @param string $path |
||
64 | * |
||
65 | * @return File |
||
66 | */ |
||
67 | public function setOutputPath($path) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getSourceContent() |
||
81 | |||
82 | /** |
||
83 | * @param string $content |
||
84 | * |
||
85 | * @return File |
||
86 | */ |
||
87 | public function setSourceContent($content) |
||
93 | |||
94 | /** |
||
95 | * @return File |
||
96 | * @throws FileException |
||
97 | */ |
||
98 | public function setSourceContentFromSourcePath() |
||
104 | |||
105 | /** |
||
106 | * @return string |
||
107 | * @throws FileException |
||
108 | */ |
||
109 | protected function readSourceContentByPath() |
||
117 | |||
118 | public function getSourcePath() |
||
122 | |||
123 | /** |
||
124 | * @param string $path |
||
125 | * |
||
126 | * @return File |
||
127 | */ |
||
128 | public function setSourcePath($path) |
||
135 | |||
136 | /** |
||
137 | * @return string |
||
138 | */ |
||
139 | public function getParsedContent() |
||
143 | |||
144 | /** |
||
145 | * @param string $content |
||
146 | * |
||
147 | * @return File |
||
148 | */ |
||
149 | public function setParsedContent($content) |
||
155 | |||
156 | /** |
||
157 | * @return string |
||
158 | */ |
||
159 | public function getType() |
||
163 | |||
164 | /** |
||
165 | * @param string $type |
||
166 | * |
||
167 | * @return File |
||
168 | */ |
||
169 | public function setType($type) |
||
175 | |||
176 | /** |
||
177 | * @param string $path |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | protected function detectSourceTypeFromPath($path) |
||
189 | } |
||
190 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.