From f80e9828a9f24e16ac62247f60505dbc0aaf2ad0 Mon Sep 17 00:00:00 2001 From: Siad Ardroumli Date: Fri, 19 Apr 2019 13:19:16 +0200 Subject: [PATCH] Made some args optional. --- classes/phing/types/AbstractFileSet.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/classes/phing/types/AbstractFileSet.php b/classes/phing/types/AbstractFileSet.php index 1ab8cee633..65bc9c27e1 100644 --- a/classes/phing/types/AbstractFileSet.php +++ b/classes/phing/types/AbstractFileSet.php @@ -79,6 +79,7 @@ public function __construct($fileset = null) $this->selectorsList = $fileset->selectorsList; $this->expandSymbolicLinks = $fileset->expandSymbolicLinks; $this->errorOnMissingDir = $fileset->errorOnMissingDir; + $this->setProject($fileset->getProject()); } $this->defaultPatterns = new PatternSet(); @@ -89,7 +90,7 @@ public function __construct($fileset = null) * * @var boolean */ - public function setExpandSymbolicLinks($expandSymbolicLinks) + public function setExpandSymbolicLinks(bool $expandSymbolicLinks) { if ($this->isReference()) { throw $this->tooManyAttributes(); @@ -141,8 +142,12 @@ public function setDir($dir) * @return mixed * @throws BuildException */ - public function getDir(Project $p) + public function getDir(Project $p = null) { + if ($p === null) { + $p = $this->getProject(); + } + if ($this->isReference()) { return $this->getRef($p)->getDir($p); } @@ -316,8 +321,12 @@ public function setCaseSensitive($isCaseSensitive) * @throws BuildException * @return \DirectoryScanner */ - public function getDirectoryScanner(Project $p) + public function getDirectoryScanner(Project $p = null) { + if ($p === null) { + $p = $this->getProject(); + } + if ($this->isReference()) { $o = $this->getRef($p); @@ -351,8 +360,12 @@ public function getDirectoryScanner(Project $p) * @param Project $p * @throws BuildException */ - protected function setupDirectoryScanner(DirectoryScanner $ds, Project $p) + protected function setupDirectoryScanner(DirectoryScanner $ds, Project $p = null) { + if ($p === null) { + $p = $this->getProject(); + } + if ($this->isReference()) { $this->getRef($p)->setupDirectoryScanner($ds, $p); return;