Skip to content

Commit 89535fb

Browse files
committed
Filter/ExactMatch: rename a private property
Follow up on PR 202. There has been some discussion in ticket 198 about the future names of the methods which are associated with the properties and as one of the methods will get a rename, this commit anticipates on that by renaming the property which will capture the return value of the method to be in line with that change. As the property is `private`, this is a change which doesn't affect the API and is therefore non-breaking. The method renames will be handled in separate PRs as those are in the public API. See 198, 199 and 203.
1 parent e419a21 commit 89535fb

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/Filters/ExactMatch.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* An abstract filter class for checking files and folders against exact matches.
44
*
5-
* Supports both allowed files and blocked files.
5+
* Supports both allowed files and disallowed files.
66
*
77
* @author Greg Sherwood <[email protected]>
88
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)
@@ -21,12 +21,12 @@ abstract class ExactMatch extends Filter
2121
*
2222
* @var array
2323
*/
24-
private $blockedFiles = null;
24+
private $disallowedFiles = null;
2525

2626
/**
2727
* A list of files to include.
2828
*
29-
* If the allowed files list is empty, only files in the blocked files list will be excluded.
29+
* If the allowed files list is empty, only files in the disallowed files list will be excluded.
3030
*
3131
* @var array
3232
*/
@@ -36,7 +36,7 @@ abstract class ExactMatch extends Filter
3636
/**
3737
* Check whether the current element of the iterator is acceptable.
3838
*
39-
* If a file is both blocked and allowed, it will be deemed unacceptable.
39+
* If a file is both disallowed and allowed, it will be deemed unacceptable.
4040
*
4141
* @return bool
4242
*/
@@ -46,8 +46,8 @@ public function accept()
4646
return false;
4747
}
4848

49-
if ($this->blockedFiles === null) {
50-
$this->blockedFiles = $this->getblacklist();
49+
if ($this->disallowedFiles === null) {
50+
$this->disallowedFiles = $this->getblacklist();
5151
}
5252

5353
if ($this->allowedFiles === null) {
@@ -56,13 +56,13 @@ public function accept()
5656

5757
$filePath = Util\Common::realpath($this->current());
5858

59-
// If file is both blocked and allowed, the blocked files list takes precedence.
60-
if (isset($this->blockedFiles[$filePath]) === true) {
59+
// If file is both disallowed and allowed, the disallowed files list takes precedence.
60+
if (isset($this->disallowedFiles[$filePath]) === true) {
6161
return false;
6262
}
6363

64-
if (empty($this->allowedFiles) === true && empty($this->blockedFiles) === false) {
65-
// We are only checking a blocked files list, so everything else should be allowed.
64+
if (empty($this->allowedFiles) === true && empty($this->disallowedFiles) === false) {
65+
// We are only checking a disallowed files list, so everything else should be allowed.
6666
return true;
6767
}
6868

@@ -74,16 +74,16 @@ public function accept()
7474
/**
7575
* Returns an iterator for the current entry.
7676
*
77-
* Ensures that the blocked files list and the allowed files list are preserved so they don't have
77+
* Ensures that the disallowed files list and the allowed files list are preserved so they don't have
7878
* to be generated each time.
7979
*
8080
* @return \RecursiveIterator
8181
*/
8282
public function getChildren()
8383
{
8484
$children = parent::getChildren();
85-
$children->blockedFiles = $this->blockedFiles;
86-
$children->allowedFiles = $this->allowedFiles;
85+
$children->disallowedFiles = $this->disallowedFiles;
86+
$children->allowedFiles = $this->allowedFiles;
8787
return $children;
8888

8989
}//end getChildren()

0 commit comments

Comments
 (0)