-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from gsteel/boolean-int-mask
Boolean filter constructor should accept int mask of types
- Loading branch information
Showing
4 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LaminasTest\Filter\StaticAnalysis; | ||
|
||
use Laminas\Filter; | ||
|
||
final class BooleanFilterChecks | ||
{ | ||
public function constructorAcceptsSingleTypeConstant(): Filter\Boolean | ||
{ | ||
return new Filter\Boolean(Filter\Boolean::TYPE_FLOAT); | ||
} | ||
|
||
public function constructorAcceptsListOfConstants(): Filter\Boolean | ||
{ | ||
return new Filter\Boolean([ | ||
Filter\Boolean::TYPE_EMPTY_ARRAY, | ||
Filter\Boolean::TYPE_FALSE_STRING, | ||
]); | ||
} | ||
|
||
public function constructorAcceptsIntMaskOfConstants(): Filter\Boolean | ||
{ | ||
return new Filter\Boolean(Filter\Boolean::TYPE_ALL ^ Filter\Boolean::TYPE_FLOAT); | ||
} | ||
|
||
public function constructorAcceptsNamedType(): Filter\Boolean | ||
{ | ||
return new Filter\Boolean('localized'); | ||
} | ||
|
||
public function constructorAcceptsOptionsArray(): Filter\Boolean | ||
{ | ||
return new Filter\Boolean([ | ||
'type' => Filter\Boolean::TYPE_FALSE_STRING | Filter\Boolean::TYPE_FLOAT, | ||
'casting' => false, | ||
]); | ||
} | ||
} |