Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some args optional. #1058

Merged
merged 1 commit into from
Apr 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions classes/phing/types/AbstractFileSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down