Skip to content

Commit db227a6

Browse files
committed
Merge pull request #3 from igormukhingmailcom/extendable-compiler
Made Compiler class extendable
2 parents b1edd01 + 0d66af2 commit db227a6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Compiler.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ class Compiler
3535
/**
3636
* @var string
3737
*/
38-
private $path;
38+
protected $path;
3939

4040
/**
4141
* @var array
4242
*/
43-
private $files = array();
43+
protected $files = array();
4444

4545
/**
4646
* @var array
4747
*/
48-
private $index = array();
48+
protected $index = array();
4949

5050
/**
5151
* Creates a Compiler instance.
@@ -171,7 +171,7 @@ public function addDirectory($directory, $exclude = null, $strip = true)
171171
$iterator = new \RecursiveIteratorIterator($iterator);
172172
foreach ($iterator as $file) {
173173
$virtualfile = substr($file->getPathName(), strlen($this->path) + 1);
174-
$this->files[$virtualfile] = [$file->getRealPath(), (bool) $strip];
174+
$this->addFile($virtualfile, $strip);
175175
}
176176
}
177177

@@ -263,7 +263,7 @@ protected function generateStub($name)
263263
* @param array $patterns
264264
* @return bool
265265
*/
266-
private function filter($path, array $patterns)
266+
protected function filter($path, array $patterns)
267267
{
268268
foreach ($patterns as $pattern) {
269269
if ($pattern[0] == '!' ? !fnmatch(substr($pattern, 1), $path) : fnmatch($pattern, $path)) {
@@ -280,7 +280,7 @@ private function filter($path, array $patterns)
280280
* @param string $source A PHP string
281281
* @return string The PHP string with the whitespace removed
282282
*/
283-
private function stripWhitespace($source)
283+
protected function stripWhitespace($source)
284284
{
285285
if (!function_exists('token_get_all')) {
286286
return $source;

0 commit comments

Comments
 (0)