本文整理汇总了PHP中Assert::isNotNull方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::isNotNull方法的具体用法?PHP Assert::isNotNull怎么用?PHP Assert::isNotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert
的用法示例。
在下文中一共展示了Assert::isNotNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toString
public function toString()
{
Assert::isNotNull($this->encoding, 'Data encdoing Required.');
$boundString = null;
$dataStrings = $bounds = array();
if ($this->dataScaling) {
$boundString = '&' . GoogleChartDataScaling::getParamName() . '=';
}
if ($this->normalize) {
$this->normalize();
}
foreach ($this->sets as $set) {
$this->encoding->setMaxValue($set->getMax() + 1);
$dataStrings[] = $this->encoding->encode($set);
if ($this->dataScaling) {
$bounds[] = $set->getMin() . ',' . $set->getMax();
}
}
if ($this->dataScaling) {
$boundString .= implode(',', $bounds);
}
$dataString = implode('|', $dataStrings);
$encodingString = $this->encoding->toString();
return $this->name . '=' . $encodingString . $dataString . $boundString;
}
示例2: setValue
/**
* @throws WrongArgumentException
* @return IdentifiablePrimitive
**/
public function setValue($value)
{
$className = $this->className;
Assert::isNotNull($this->className);
Assert::isTrue($value instanceof $className);
return parent::setValue($value);
}
示例3: rebind
public function rebind($name, $object)
{
Assert::isNotNull($object);
$this->map[$name] = $object;
$this->reverseMap[spl_object_hash($object)] = $name;
return $this;
}
示例4: unite
public function unite(Identifiable $object, Identifiable $old)
{
Assert::isNotNull($object->getId());
Assert::isTypelessEqual($object->getId(), $old->getId(), 'cannot merge different objects');
$query = OSQL::update($this->getTable());
foreach ($this->getProtoClass()->getPropertyList() as $property) {
$getter = $property->getGetter();
if ($property->getClassName() === null) {
$changed = $old->{$getter}() !== $object->{$getter}();
} else {
/**
* way to skip pointless update and hack for recursive
* comparsion.
**/
$changed = $old->{$getter}() !== $object->{$getter}() || $old->{$getter}() != $object->{$getter}();
}
if ($changed) {
$property->fillQuery($query, $object);
}
}
if (!$query->getFieldsCount()) {
return $object;
}
$this->targetizeUpdateQuery($query, $object);
return $this->doInject($query, $object);
}
示例5: getStream
private function getStream()
{
if (!$this->stream) {
Assert::isNotNull($this->queue->getFileName());
$this->stream = FileOutputStream::create($this->queue->getFileName(), true);
}
return $this->stream;
}
示例6: getRequestGetter
public function getRequestGetter()
{
Assert::isNotNull($this->requestType);
if (!$this->requestGetter) {
$this->requestGetter = self::$requestGetterMap[$this->requestType->getId()];
}
return $this->requestGetter;
}
示例7: getStream
/**
* @return FileInputStream
**/
private function getStream()
{
if (!$this->stream) {
Assert::isNotNull($this->queue->getFileName());
$this->stream = FileInputStream::create($this->queue->getFileName())->seek($this->queue->getOffset());
}
return $this->stream;
}
示例8: validate
/**
* @return ArgumentParser
**/
public function validate()
{
Assert::isNotNull($this->result);
$this->form->import($this->result);
if ($errors = $this->form->getErrors()) {
throw new WrongArgumentException("\nArguments wrong:\n" . print_r($errors, true));
}
return $this;
}
示例9: disablePrefix
/**
* @return MultiPrefixPhpViewResolver
**/
public function disablePrefix($alias = null, $disabled = true)
{
if (!$alias) {
$alias = $this->lastAlias;
}
Assert::isNotNull($alias, 'nothing to disable');
Assert::isIndexExists($this->prefixes, $alias, 'no such alias: ' . $alias);
$this->disabled[$alias] = $disabled;
return $this;
}
示例10: parse
/**
* @return OqlQueryClause
**/
public function parse($string = null)
{
if ($string === null) {
Assert::isNotNull($this->tokenizer);
} else {
Assert::isString($string);
$this->tokenizer = new OqlTokenizer($string);
}
$this->state = self::INITIAL_STATE;
$this->oqlObject = $this->makeOqlObject();
$this->parentheses = 0;
while ($this->state != self::FINAL_STATE) {
$this->state = $this->handleState();
}
$this->checkParentheses();
return $this->oqlObject;
}
示例11: render
public function render($forceQuotes = false)
{
Assert::isNotNull($this->separator);
$csvString = null;
foreach ($this->data as $row) {
Assert::isArray($row);
$rowString = null;
foreach ($row as $value) {
if ($forceQuotes || preg_match(self::QUOTE_REQUIRED_PATTERN, $value)) {
$value = self::QUOTE . mb_ereg_replace(self::QUOTE, self::QUOTE . self::QUOTE, $value) . self::QUOTE;
}
$rowString .= ($rowString ? $this->separator : null) . $value;
}
$csvString .= $rowString . self::CRLF;
}
return $csvString;
}
示例12: makeTag
public static function makeTag(SgmlToken $tag)
{
if ($tag instanceof Cdata) {
$result = $tag->getData();
} elseif ($tag instanceof SgmlIgnoredTag) {
Assert::isNotNull($tag->getId());
$result = '<' . $tag->getId() . $tag->getCdata()->getData() . $tag->getEndMark() . '>';
} elseif ($tag instanceof SgmlOpenTag) {
Assert::isNotNull($tag->getId());
$attributes = self::getAttributes($tag);
$result = '<' . $tag->getId() . ($attributes ? ' ' . $attributes : null) . ($tag->isEmpty() ? '/' : null) . '>';
} elseif ($tag instanceof SgmlEndTag) {
$result = '</' . $tag->getId() . '>';
} else {
throw new WrongArgumentException("don't know how to assemble tag class '" . get_class($tag) . "'");
}
return $result;
}
示例13: merge
public function merge(Identifiable $object, $cacheOnly = true)
{
Assert::isNotNull($object->getId());
$this->checkObjectType($object);
$old = Cache::worker($this)->getCachedById($object->getId());
if (!$old) {
// unlikely
if ($cacheOnly) {
return $this->save($object);
} else {
$old = Cache::worker($this)->getById($object->getId());
}
}
if ($object === $old) {
return $this->save($object);
}
return $this->unite($object, $old);
}
示例14: toString
public function toString()
{
$url = self::BASE_URL;
Assert::isNotNull($this->type);
$parameters[] = $this->type->toString();
Assert::isNotNull($this->size);
$parameters[] = $this->size->toString();
Assert::isNotNull($this->color);
$parameters[] = $this->color->toString();
Assert::isNotNull($this->data);
$parameters[] = $this->data->toString();
if ($this->legend) {
$parameters[] = $this->legend->toString();
}
if ($this->label) {
$parameters[] = $this->label->toString();
}
if ($this->title) {
$parameters[] = $this->title->toString();
}
if ($this->fillers->hasFillers()) {
$parameters[] = $this->fillers->toString();
}
$url .= implode('&', $parameters);
return $url;
}
示例15: getFunction
/**
* @return SQLFunction
**/
protected function getFunction(Criteria $criteria, JoinCapableQuery $query)
{
Assert::isNotNull($this->property);
return SQLFunction::create('count', $this->property ? $criteria->getDao()->guessAtom($this->property, $query) : $criteria->getDao()->getIdName());
}