# Assert Class Reference
[Widely used base classes and interfaces]

Widely used assertions. More...

Inheritance diagram for Assert:
[legend]

List of all members.

## Static Public Member Functions

static | isTrue ($boolean, $message=null)
static | isFalse ($boolean, $message=null)
static | isNotFalse ($boolean, $message=null)
static | isNull ($variable, $message=null)
static | isEmpty ($variable, $message=null)
static | isNotEmpty ($variable, $message=null)
static | isIndexExists ($array, $key, $message=null)
static | isNotNull ($variable, $message=null)
static | isScalar ($variable, $message=null)
static | isArray ($variable, $message=null)
static | isNotEmptyArray (&$variable, $message=null)
static | isInteger ($variable, $message=null)
static | isPositiveInteger ($variable, $message=null)
static | isFloat ($variable, $message=null)
static | isString ($variable, $message=null)
static | isBoolean ($variable, $message=null)
static | isTernaryBase ($variable, $message=null)
static | brothers ($first, $second, $message=null)
static | isEqual ($first, $second, $message=null)
static | isNotEqual ($first, $second, $message=null)
static | isSame ($first, $second, $message=null)
static | isNotSame ($first, $second, $message=null)
static | isTypelessEqual ($first, $second, $message=null)
static | isLesser ($first, $second, $message=null)
static | isGreater ($first, $second, $message=null)
static | isLesserOrEqual ($first, $second, $message=null)
static | isGreaterOrEqual ($first, $second, $message=null)
static | isInstance ($first, $second, $message=null)
static | classExists ($className, $message=null)
static | methodExists ($object, $method, $message=null)
static | isUnreachable ($message= 'unreachable code reached')
static | checkInteger ($value)
| exceptionless methods
static | checkFloat ($value)
static | checkScalar ($value)
static | dumpArgument ($argument)
static | dumpOppositeArguments ($first, $second)

## Detailed Description

Widely used assertions.

Definition at line 17 of file Assert.class.php.

## Member Function Documentation

static Assert::brothers | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 171 of file Assert.class.php.

Referenced by DiffieHellmanParameters::__construct(), DiffieHellmanKeyPair::makeSharedKey(), NamedTree::setParent(), and IdentifiableTree::setParent().

static Assert::checkFloat | ( | $ | value | ) | `[static]`

Definition at line 291 of file Assert.class.php.

Referenced by Memcached::store().

static Assert::checkInteger | ( | $ | value | ) | `[static]`

exceptionless methods

Definition at line 282 of file Assert.class.php.

Referenced by Time::__construct(), SyntaxErrorException::__toString(), IdentifiablePrimitive::castNumber(), PrimitiveIdentifierList::import(), PrimitiveEnumerationList::import(), and LiteDialect::quoteValue().

static Assert::checkScalar | ( | $ | value | ) | `[static]`

Definition at line 299 of file Assert.class.php.

Referenced by PrimitiveIdentifierList::import().

static Assert::classExists | ( | $ | className,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 259 of file Assert.class.php.

Referenced by RedirectToView::__construct(), PropertyPath::__construct(), DalayedDropDaoWorker::dropWith(), PrimitiveIdentifier::of(), PrimitiveForm::of(), PrimitiveEnumeration::of(), PrimitivePolymorphicIdentifier::ofBase(), ProtoDAO::processPath(), VoodooDaoWorker::setDefaultHandler(), SemaphorePool::setDefaultLocker(), Cache::setDefaultWorker(), Primitive::spawn(), and LightMetaProperty::toValue().

static Assert::dumpArgument | ( | $ | argument | ) | `[static]`

Definition at line 304 of file Assert.class.php.

Referenced by PrototypedSoapClient::call(), and PrototypedBuilder::cloneBuilder().

static Assert::dumpOppositeArguments | ( | $ | first,
|  | $ | second |
| ) |  |  | `[static]`

Definition at line 309 of file Assert.class.php.

static Assert::isArray | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 91 of file Assert.class.php.

Referenced by ScopeSetter::__construct(), FullText::__construct(), ApplicationUrl::addApplicationScope(), CurlHttpClient::addRequest(), ApplicationUrl::addUserScope(), CurlHttpClient::argumentsToString(), Session::arrayAssign(), InsertOrUpdateQuery::arraySet(), VoodooDaoWorker::cacheListByQuery(), SmartDaoWorker::cacheListByQuery(), CacheDaoWorker::cacheListByQuery(), ApplicationUrl::cleanHref(), ArrayUtils::columnFromSet(), ArrayUtils::countNonemptyValues(), ArrayUtils::flatToDimensional(), ArrayUtils::getMirrorValues(), PrimitiveFormsList::importValue(), isIndexExists(), isNotEmptyArray(), PrototypedBuilder::makeList(), ArrayUtils::mergeRecursiveUnique(), ArrayUtils::mergeUnique(), PostgresDialect::prepareFullText(), MyDialect::prepareFullText(), Csv::render(), UnifiedContainer::save(), ApplicationUrl::scopeHref(), PrimitiveFile::setAllowedMimeTypes(), Csv::setArray(), PrimitiveMultiList::setDefault(), PrototypedBuilder::setLimitedPropertiesList(), UnifiedContainer::setList(), ContentTypeHeader::setParametersList(), PrimitiveIdentifierList::setValue(), and PrimitiveEnumerationList::setValue().

static Assert::isBoolean | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 149 of file Assert.class.php.

Referenced by UnifiedContainer::__construct(), Criteria::fetchCollection(), HtmlTokenizer::lowercaseAttributes(), HtmlTokenizer::lowercaseTags(), RedirectView::setBuildArrays(), SgmlOpenTag::setEmpty(), RedirectView::setFalseAsUnset(), CurlHttpClient::setFollowLocation(), DoctypeDeclaration::setInline(), CurlHttpClient::setNoBody(), TimeIntervalsGenerator::setOverlapped(), DoctypeDeclaration::setPublic(), Criteria::setSilent(), Cdata::setStrict(), and HtmlTokenizer::suppressWhitespaces().

static Assert::isEmpty | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 51 of file Assert.class.php.

static Assert::isEqual | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 179 of file Assert.class.php.

Referenced by IntervalUnit::__construct(), PrototypedSoapClient::call(), ClassUtils::copyProperties(), IntervalUnit::countInRange(), AbstractProtoClass::endPrefetch(), FormBuilder::fillOwn(), MathUtils::getCovariance(), TextUtils::hex2Binary(), PrimitiveEnumeration::importValue(), IntervalUnit::truncate(), and EntityProto::validateList().

static Assert::isFalse | ( | $ | boolean,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 27 of file Assert.class.php.

Referenced by ProjectionChain::add(), PlainForm::add(), DBTable::addColumn(), MultiPrefixPhpViewResolver::addPrefix(), MetaConfiguration::addSource(), DBSchema::addTable(), MetaConfiguration::checkSanity(), LogicUtils::getOpenPoint(), LogicUtils::getOpenRange(), MetaConfiguration::load(), MetaConfiguration::makeProperty(), MetaConfiguration::processClasses(), MultiPrefixPhpViewResolver::resolveViewName(), CarefulDatabaseRunner::run(), and DateRange::split().

static Assert::isFloat | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 133 of file Assert.class.php.

Referenced by FloatRange::__construct(), PrimitiveFloat::checkNumber(), FloatType::setDefault(), FloatRange::setMax(), and FloatRange::setMin().

static Assert::isGreater | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 227 of file Assert.class.php.

Referenced by SortHelper::sort().

static Assert::isGreaterOrEqual | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 243 of file Assert.class.php.

Referenced by SimpleAggregateCache::guessLabel().

static Assert::isIndexExists | ( | $ | array,
|  | $ | key,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 67 of file Assert.class.php.

References isArray().

Referenced by PrototypedBuilder::cloneInnerBuilder(), MultiPrefixPhpViewResolver::disablePrefix(), OqlQueryParameter::evaluate(), MultiPrefixPhpViewResolver::isPrefixDisabled(), and PrototypedBuilder::setLimitedPropertiesList().

Here is the call graph for this function:

static Assert::isInstance | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 251 of file Assert.class.php.

References ClassUtils::isInstanceOf().

Referenced by UnifiedContainer::__construct(), FormMutator::__construct(), FormGetter::__construct(), FormExporter::__construct(), DTOGetter::__construct(), GoogleChartLineStyle::addStyle(), GoogleChartLabelStyle::addStyle(), PrototypedSoapClient::call(), OqlWhereClause::checkExpression(), OqlHavingClause::checkExpression(), PrototypedBuilder::cloneInnerBuilder(), ImmutableObjectComparator::compare(), DateObjectComparator::compare(), IpRange::contains(), IpNetwork::contains(), PrototypedSoapClient::convertSoapFault(), Criteria::dropProjectionByType(), PrimitivePolymorphicIdentifier::export(), FormBuilder::fillOwn(), DateUtils::getAgeByBirthDate(), ArrayUtils::getIdsArray(), PrimitiveIdentifier::import(), PrimitiveIdentifier::importValue(), PrimitiveFormsList::importValue(), PrimitiveIdentifier::of(), PrimitiveEnumeration::of(), PrimitivePolymorphicIdentifier::ofBase(), Primitive::prototyped(), Primitive::prototypedIdentifier(), TextFileSender::send(), DaoSynchronizer::setMaster(), TextFileSender::setQueue(), TextFileReceiver::setQueue(), DaoSynchronizer::setSlave(), PrimitivePolymorphicIdentifier::setValue(), PrimitiveIdentifierList::setValue(), PrimitiveEnumerationList::setValue(), and EntityProto::validate().

Here is the call graph for this function:

static Assert::isInteger | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 109 of file Assert.class.php.

Referenced by IpNetwork::__construct(), Range::__construct(), PrimitiveInteger::checkNumber(), IdentifiablePrimitive::checkNumber(), PrimitiveIdentifierList::importValue(), PrimitiveEnumerationList::importValue(), SelectQuery::limit(), QueryCombination::limit(), Form::markCustom(), HeaderUtils::sendContentLength(), ChartLabelStyle::setDataSetIndex(), IntegerType::setDefault(), Range::setMax(), Cookie::setMaxAge(), Range::setMin(), DataType::setPrecision(), DataType::setScale(), MetaClassProperty::setSize(), and DataType::setSize().

static Assert::isLesser | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 219 of file Assert.class.php.

static Assert::isLesserOrEqual | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 235 of file Assert.class.php.

static Assert::isNotEmpty | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 59 of file Assert.class.php.

Referenced by GenericDAO::getById().

static Assert::isNotEmptyArray | ( | &$ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 99 of file Assert.class.php.

References isArray().

Referenced by ProtoDAO::fetchCollections(), ControllersCollection::handleRequest(), CurlHttpClient::multiSend(), SortHelper::sort(), GoogleChartLineStyle::toString(), GoogleChartLabelStyle::toString(), and GoogleChartColor::toString().

Here is the call graph for this function:

static Assert::isNotEqual | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 187 of file Assert.class.php.

static Assert::isNotFalse | ( | $ | boolean,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 35 of file Assert.class.php.

Referenced by FileOutputStream::__construct().

static Assert::isNotNull | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 77 of file Assert.class.php.

Referenced by PrototypedSoapClient::__construct(), HtmlTokenizer::attrNameState(), HtmlTokenizer::attrValueState(), PrimitiveIdentifier::dao(), MultiPrefixPhpViewResolver::disablePrefix(), CountProjection::getFunction(), ProxyController::getRequestGetter(), TextFileSender::getStream(), TextFileReceiver::getStream(), HtmlTokenizer::insideTagState(), DaoIterator::loadNextChunk(), CurlHttpClient::makeHandle(), CurlHttpClient::makeResponse(), HtmlTokenizer::makeTag(), HtmlAssembler::makeTag(), StorableDAO::merge(), ArgumentParser::parse(), OqlParser::parse(), ApplicationUrl::poorReference(), PropertyProjection::process(), GroupByPropertyProjection::process(), AggregateProjection::process(), ProtoDAO::processPath(), DirectoryContext::rebind(), TextFileReceiver::receive(), Csv::render(), HtmlTokenizer::reset(), HtmlTokenizer::setupTag(), IdentifiablePrimitive::setValue(), HtmlTokenizer::startTagState(), OqlQueryExpressionClause::toLogic(), Criteria::toSelectQuery(), GoogleChartSolidFill::toString(), GoogleChartData::toString(), GoogleChart::toString(), ChartLabelStyle::toString(), StorableDAO::unite(), ArgumentParser::validate(), and HtmlTokenizer::waitingEqualSignState().

static Assert::isNotSame | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 203 of file Assert.class.php.

static Assert::isNull | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 43 of file Assert.class.php.

Referenced by HtmlTokenizer::attrNameState(), HtmlTokenizer::attrValueState(), PrototypedSoapClient::call(), HtmlTokenizer::cdataState(), HtmlTokenizer::commentState(), HtmlTokenizer::endTagState(), HtmlTokenizer::inlineTagState(), HtmlTokenizer::insideTagState(), HtmlTokenizer::makeTag(), HtmlTokenizer::outsideTagState(), Socket::setHost(), LogLevel::setId(), FetchStrategy::setId(), RequestType::setId(), Socket::setPort(), HtmlTokenizer::setupTag(), HtmlTokenizer::startTagState(), and HtmlTokenizer::waitingEqualSignState().

static Assert::isPositiveInteger | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 122 of file Assert.class.php.

Referenced by OqlQueryParameter::evaluate(), MathUtils::getAverage(), MtRandomSource::getBytes(), FileRandomSource::getBytes(), MathUtils::getStandardDeviationP(), SelectQuery::limit(), QueryCombination::limit(), GoogleChartSize::setHeight(), CropFilter::setLength(), ChartLabelStyle::setSize(), CropFilter::setStart(), and GoogleChartSize::setWidth().

static Assert::isSame | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 195 of file Assert.class.php.

Referenced by GenericDAO::checkObjectType().

static Assert::isScalar | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 83 of file Assert.class.php.

Referenced by IdentifiablePrimitive::checkNumber(), GenericDAO::getById(), and PrimitiveIdentifierList::importValue().

static Assert::isString | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 141 of file Assert.class.php.

Referenced by StringInputStream::__construct(), PropertyPath::__construct(), Time::__construct(), PrimitiveFile::addAllowedMimeType(), RegulatedForm::addRule(), FullTextUtils::makeFullTextQuery(), OqlParser::parse(), StripTagsFilter::setAllowableTags(), StringType::setDefault(), Cookie::setDomain(), LogRecord::setMessage(), Cookie::setPath(), RouterRegexpRule::setReverse(), and OqlTokenizer::tokenize().

static Assert::isTernaryBase | ( | $ | variable,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 157 of file Assert.class.php.

Referenced by PrimitiveTernary::importValue(), InsertOrUpdateQuery::setBoolean(), PrimitiveArray::setFetchMode(), and Ternary::setValue().

static Assert::isTrue | ( | $ | boolean,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 19 of file Assert.class.php.

Referenced by Color::__construct(), FileRandomSource::__construct(), HtmlAssembler::__construct(), DirectoryMutator::__construct(), ClassProjection::__construct(), Criteria::__construct(), ExtractPart::__construct(), InExpression::__construct(), DBTable::addUniques(), OpenIdConsumer::associate(), HtmlTokenizer::attrNameState(), HtmlTokenizer::attrValueState(), LogicalChain::block(), VoodooDaoWorker::cacheListByQuery(), SmartDaoWorker::cacheListByQuery(), CacheDaoWorker::cacheListByQuery(), PrototypedSoapClient::call(), MetaConfiguration::checkClassSanity(), LiteDialect::checkColumn(), MetaConfiguration::checkRecursion(), MetaConfiguration::checkSanity(), ClassUtils::checkStaticMethod(), DateRange::checkType(), PrimitiveDateRange::checkType(), PrimitiveDate::checkType(), DateRange::clip(), PrototypedBuilder::cloneBuilder(), SortHelper::compare(), Socket::connect(), ClassUtils::copyNotNullProperties(), OpenIdConsumer::doContinue(), HtmlTokenizer::doctypeTagState(), DaoMoveHelper::down(), HtmlTokenizer::endTagState(), HtmlTokenizer::externalTagState(), Criteria::fetchCollection(), ProtoDAO::fetchCollections(), PropertyPath::fetchHelpers(), ClassUtils::fillNullProperties(), FormUtils::form2object(), AbstractProtoClass::forwardPrimitive(), CodeGenerator::generateOneSymbol(), PlainForm::getActualChoiceValue(), PlainForm::getChoiceValue(), MimeMail::getEncodedBody(), MimeMail::getHeaders(), Singleton::getInstance(), ArrayUtils::getMirrorValues(), GoogleChartDataSet::getStepSize(), PgSQL::getTableInfo(), MySQL::getTableInfo(), PrimitiveTime::importValue(), PrimitiveHstore::importValue(), PrimitiveForm::importValue(), HtmlTokenizer::insideTagState(), LightMetaProperty::isBuildable(), DateRange::isNeighbour(), MetaConfiguration::load(), MimePart::loadBodyFromFile(), GmpBigInteger::make(), DirectoryToObjectBinder::make(), OpenIdConsumer::makeCheckIdRequest(), Date::makeFromWeek(), MetaConfiguration::makeProperty(), GmpBigIntegerFactory::makeRandom(), FormUtils::object2form(), PrimitiveDateRange::of(), PrimitiveClass::of(), PlainList::offsetSet(), IndexedList::offsetSet(), MetaConfiguration::processClasses(), MetaConfiguration::processIncludes(), ProtoDAO::processPath(), Sequenceless::query(), SimplePhpView::render(), CommandChain::run(), CarefulDatabaseRunner::run(), ScopeSetter::set(), DTOSetter::set(), UnifiedContainer::setCriteria(), InetType::setDefault(), PrimitiveTime::setDefault(), PrimitiveMultiList::setDefault(), PrimitiveList::setDefault(), Time::setHour(), GoogleChartAxis::setInterval(), PrimitiveTime::setMax(), PrimitiveIdentifier::setMethodName(), PrimitiveTime::setMin(), Time::setMinute(), DataType::setPrecision(), DBColumn::setReference(), DataType::setScale(), Time::setSecond(), DataType::setSize(), DataType::setTimezoned(), DataType::setUnsigned(), PrimitiveTime::setValue(), PrimitiveRange::setValue(), PrimitiveForm::setValue(), IdentifiablePrimitive::setValue(), ModelAndView::setView(), DaoUtils::swap(), OneToManyLinkedLazy::sync(), ManyToManyLinkedLazy::sync(), TruncateQuery::toDialectString(), SQLFunction::toDialectString(), QuerySkeleton::toDialectStringField(), SQLChain::toMapped(), DaoMoveHelper::up(), TidyValidator::validateContent(), PartViewer::view(), and HtmlTokenizer::waitingEqualSignState().

static Assert::isTypelessEqual | ( | $ | first,
|  | $ | second,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 211 of file Assert.class.php.

Referenced by StorableDAO::unite().

static Assert::isUnreachable | ( | $ | message = `'unreachable code reached'` | ) | `[static]`

Definition at line 275 of file Assert.class.php.

Referenced by PeclMemcached::append(), LogicalChain::calculateBoolean(), OpenIdConsumer::checkAuthentication(), MetaConfiguration::checkClassSanity(), SharedMemory::delete(), PeclMemcached::delete(), PrototypedEditor::doAdd(), OpenIdConsumer::doContinue(), PrototypedEditor::doDrop(), PrototypedEditor::doSave(), PrototypedEditor::doTake(), TruncateQuery::dumpTargets(), SystemFiveLocker::get(), SharedMemory::get(), PeclMemcached::get(), PrimitiveEnumeration::getList(), TransparentDaoWorker::getListByQuery(), MethodMappedController::handleRequest(), ExplodedPrimitive::import(), ComplexPrimitive::import(), PrimitiveNoValue::importValue(), RubberFileSystem::operate(), HtmlTokenizer::outsideTagState(), CustomizableDaoSynchronizer::run(), CarefulDatabaseRunner::run(), PrimitiveNoValue::setDefaultValue(), PrimitiveNoValue::setRawValue(), PrimitiveNoValue::setValue(), SharedMemory::store(), PeclMemcached::store(), LogicalChain::toBoolean(), MessageSegmentHandler::touch(), FileSystemSegmentHandler::touch(), IntervalUnit::truncate(), and FileSystemSegmentHandler::unlink().

static Assert::methodExists | ( | $ | object,
|  | $ | method,
|  | $ | message = `null` |
| ) |  |  | `[static]`

Definition at line 267 of file Assert.class.php.

Referenced by CustomizableDaoSynchronizer::delete(), and DaoIterator::key().

The documentation for this class was generated from the following file:

- core/Base/Assert.class.php