本文整理汇总了PHP中Assert::isBoolean方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::isBoolean方法的具体用法?PHP Assert::isBoolean怎么用?PHP Assert::isBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert
的用法示例。
在下文中一共展示了Assert::isBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($title = null, $block = false)
{
Assert::isScalarOrNull($title);
Assert::isBoolean($block);
$this->title = $title;
$this->block = $block;
}
示例2: setPublic
/**
* @return DoctypeDeclaration
**/
public function setPublic($isPublic)
{
Assert::isBoolean($isPublic);
$this->public = $isPublic;
$this->inline = false;
return $this;
}
示例3: __construct
/**
* @param boolean whether to use include path or not
* @param boolean whether to allow pre-scanning technique or not. PreScan is important for
* huge and distributed class locations
*/
function __construct($useIncludePath = true, $allowPreScan = false)
{
Assert::isBoolean($allowPreScan);
$this->allowPreScan = $allowPreScan;
parent::__construct($useIncludePath);
$this->setExtension(PHOEBIUS_TYPE_EXTENSION);
}
示例4: getParameterList
function getParameterList($requiredOnly = true)
{
Assert::isBoolean($requiredOnly);
if ($requiredOnly && $this->isOptional) {
return array();
}
return array($this->name);
}
示例5: __construct
public function __construct(Identifiable $parent, GenericDAO $dao, $lazy = true)
{
Assert::isBoolean($lazy);
$this->parent = $parent;
$this->lazy = $lazy;
$this->dao = $dao;
Assert::isInstance($dao->getObjectName(), 'Identifiable');
$this->comparator = SerializedObjectComparator::me();
}
示例6: validateAgainstCustom
/**
* Performs validation against custom parameters (convention, and even processor).
* Please consider, how methods with the long list of arguments are formatted.
* @param $target object to validate
* @param $somethingElse boolean something else argument
* @return CodingStyleValidator itself
*/
function validateAgainstCustom(IConvention $convention, CodingStyleProcessor $processor, $target, $somethingElse = true)
{
// do not forget to check custom arguments against their expected type
Assert::isTrue(is_object($target));
Assert::isBoolean($somethingElse);
$this->convention = $convention;
$this->processor = $processor->setTarget($target)->setSomethingElse($somethingElse);
$this->runValidation();
return $this;
}
示例7: __construct
/**
* @param string $filepath path to the file that should be presented in response
* @param string $filename optional name of the file to be specified in the response
* @param string $contentType optional content type of the file to be specified in the response
* @param boolean $unlinkOnFinish whether to remove the file when response is finished
*/
function __construct($filepath, $filename = null, $contentType = null, $unlinkOnFinish = false)
{
Assert::isTrue(is_file($filepath));
Assert::isScalarOrNull($filename);
Assert::isScalarOrNull($contentType);
Assert::isBoolean($unlinkOnFinish);
$this->filepath = $filepath;
$this->filename = $filename ? $filename : basename($filepath);
$this->contentType = $contentType;
$this->unlinkOnFileFlush = $unlinkOnFinish;
}
示例8: __construct
/**
* @param string $name name of the property
* @param array list of database field names
* @param OrmPropertyType property type
* @param false property visibility
* @param boolean whether the property unique or not
*/
function __construct($name, array $fields, OrmPropertyType $type, OrmPropertyVisibility $visibility, AssociationMultiplicity $multiplicity, $isUnique = false, $isIdentifier = false)
{
Assert::isScalar($name);
Assert::isBoolean($isUnique);
Assert::isBoolean($isIdentifier);
$this->name = $name;
Assert::isTrue(sizeof($fields) == $type->getColumnCount(), 'wrong DB field count');
$this->fields = $fields;
$this->type = $type;
$this->visibility = $visibility;
$this->multiplicity = $multiplicity;
$this->isUnique = $isUnique;
$this->isIdentifier = $isIdentifier;
}
示例9: setBuildArrays
/**
* @return RedirectView
**/
public function setBuildArrays($really)
{
Assert::isBoolean($really);
$this->buildArrays = $really;
return $this;
}
示例10: resolveClassPath
/**
* Resolves the file path containing the requested class. Firstly, searches withing the cache
* provided by {@link InternalSegmentCache}, then invokes the path scanner and comparer
* provided by a descendant class
* @param string $classname
* @param boolean $checkIfExists
* @return string|null returns the absolute path to the file containing the requested class
* or NULL if such file not found
*/
private function resolveClassPath($classname, $checkIfExists, $useCacheOnly = false)
{
Assert::isScalar($classname);
Assert::isBoolean($checkIfExists);
if (isset($this->foundClasspaths[$classname])) {
return $this->foundClasspaths[$classname];
}
$classpath = null;
if ($this->isCached($classname)) {
$classpath = $this->getCached($classname);
if ($checkIfExists && $classpath) {
if (!file_exists($classpath)) {
$this->uncache($classname);
$classpath = null;
}
}
}
if (!$classpath && !$useCacheOnly) {
$classpath = $this->scanClassPaths($classname);
if ($classpath) {
$this->cache($classname, $classpath);
}
}
if ($classpath) {
$this->foundClasspaths[$classname] = $classpath;
}
return $classpath;
}
示例11: getSqlBooleanValue
function getSqlBooleanValue($value)
{
Assert::isBoolean($value);
return $value ? 't' : 'f';
}
示例12: setOverlapped
public function setOverlapped($overlapped = true)
{
Assert::isBoolean($overlapped);
$this->overlapped = $overlapped === true;
return $this;
}
示例13: setNoBody
/**
* @param $really boolean
* @return CurlHttpClient
**/
public function setNoBody($really)
{
Assert::isBoolean($really);
$this->noBody = $really;
return $this;
}
示例14: invokeResolvers
private function invokeResolvers($classname, $useCacheOnly)
{
Assert::isBoolean($useCacheOnly);
foreach ($this->resolvers as $resolver) {
$result = $resolver->loadClassFile($classname, $useCacheOnly);
if ($result && ($classpath = $resolver->getClassPath($classname, true))) {
$this->classPaths[] = $classpath;
break;
}
}
return TypeUtils::isDefined($classname);
}
示例15: lowercaseTags
/**
* @return HtmlTokenizer
**/
public function lowercaseTags($isLowercaseTags)
{
Assert::isBoolean($isLowercaseTags);
$this->lowercaseTags = $isLowercaseTags;
return $this;
}