本文整理汇总了PHP中Assert::isFalse方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::isFalse方法的具体用法?PHP Assert::isFalse怎么用?PHP Assert::isFalse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert
的用法示例。
在下文中一共展示了Assert::isFalse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSlotId
/**
* @return Autoloader
*/
function setSlotId($slotId)
{
Assert::isScalar($slotId);
Assert::isFalse($this->isInitialized, 'too late to set slotId: already initialized');
$this->slotId = $slotId;
return $this;
}
示例2: add
/**
* @throws WrongArgumentException
* @return Form
**/
public function add(BasePrimitive $prm)
{
$name = $prm->getName();
Assert::isFalse(isset($this->primitives[$name]), 'i am already exists!');
$this->primitives[$name] = $prm;
return $this;
}
示例3: __construct
function __construct($key)
{
//TODO ClientRequest
Assert::isFalse(headers_sent() || Response::isFinished(), 'Yup! Headers are already sent so the storage cannot work properly.');
ob_start();
$this->basekey = $key . Session::userSupertag(true);
$this->key = $this->sign($key);
}
示例4: getOpenPoint
/**
* @throws WrongArgumentException
* @return LogicalChain
**/
public static function getOpenPoint($left, $right, $point)
{
Assert::isFalse($point === null, 'how can i build logic from emptyness?');
$point = new DBValue($point);
$chain = new LogicalChain();
$chain->expOr(Expression::orBlock(Expression::andBlock(Expression::notNull($left), Expression::notNull($right), Expression::between($point, $left, $right)), Expression::andBlock(Expression::isNull($left), Expression::ltEq($point, $right)), Expression::andBlock(Expression::isNull($right), Expression::ltEq($left, $point)), Expression::andBlock(Expression::isNull($left), Expression::isNull($right))));
return $chain;
}
示例5: toHtml
function toHtml(array $htmlAttributes = array())
{
Assert::isFalse(isset($htmlAttributes['name']));
Assert::isFalse(isset($htmlAttributes['multiple']));
$htmlAttributes['name'] = $this->getName() . '[]';
$htmlAttributes['multiple'] = 'multiple';
return HtmlUtil::getContainer('select', $htmlAttributes, join("", $this->getOptions()));
}
示例6: addTable
/**
* @throws WrongArgumentException
* @return DBSchema
**/
public function addTable(DBTable $table)
{
$name = $table->getName();
Assert::isFalse(isset($this->tables[$name]), "table '{$name}' already exist");
$this->tables[$table->getName()] = $table;
$this->order[] = $name;
return $this;
}
示例7: addColumn
/**
* @throws WrongArgumentException
* @return DBTable
**/
public function addColumn(DBColumn $column)
{
$name = $column->getName();
Assert::isFalse(isset($this->columns[$name]), "column '{$name}' already exist");
$this->order[] = $this->columns[$name] = $column;
$column->setTable($this);
return $this;
}
示例8: finish
function finish()
{
Assert::isFalse($this->isFinished, 'already finished');
$this->isFinished = true;
// http://php-fpm.anight.org/extra_features.html
// TODO: cut out this functionality to the outer class descendant (e.g., PhpFpmResponse)
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
}
}
示例9: add
/**
* @return ProjectionChain
**/
public function add(ObjectProjection $projection, $name = null)
{
if ($name) {
Assert::isFalse(isset($this->list[$name]));
$this->list[$name] = $projection;
} else {
$this->list[] = $projection;
}
return $this;
}
示例10: toHtml
function toHtml(array $htmlAttributes = array())
{
Assert::isFalse(isset($htmlAttributes['name']));
Assert::isFalse(isset($htmlAttributes['type']));
Assert::isFalse(isset($htmlAttributes['value']));
$htmlAttributes['name'] = $this->getName();
$htmlAttributes['type'] = $this->getType();
$htmlAttributes['value'] = $this->getValue();
return HtmlUtil::getNode('input', $htmlAttributes);
}
示例11: run
/**
* @throws BaseException
* @return ModelAndView
**/
public function run(Prototyped $subject, Form $form, HttpRequest $request)
{
Assert::isFalse($this->running, 'command already running');
Assert::isTrue($subject instanceof DAOConnected);
$this->transaction = InnerTransaction::begin($subject->dao());
try {
$mav = $this->command->run($subject, $form, $request);
$this->running = true;
return $mav;
} catch (BaseException $e) {
$this->transaction->rollback();
throw $e;
}
Assert::isUnreachable();
}
示例12: getControls
/**
* Gets the inner controls
* @return IFormControl[]
*/
function getControls()
{
$yield = array();
if ($this->isImported()) {
foreach ($this->getImportedValue() as $value) {
$control = $this->spawnControl();
$control->importValue($value);
Assert::isFalse($control->hasError(), 'cannot import value `%s` into %s: caused error `%s` %s', $value, get_class($control), (string) $control->getError(), $control->getErrorMessage());
$yield[] = $control;
}
} else {
foreach ($this->getDefaultValue() as $value) {
$control = $this->spawnControl();
$control->setDefaultValue($value);
$yield[] = $control;
}
}
return $yield;
}
示例13: setEncoding
function setEncoding($encoding)
{
parent::setEncoding($encoding);
if ($this->isConnected()) {
$result = pg_set_client_encoding($this->link, $encoding);
Assert::isFalse($result == -1, 'invalid encoding `%s` is specified', $encoding);
}
return $this;
}
示例14: prependRoute
/**
* Prepends the Route to the chain
*
* @param string $name name of the Route to append
* @param Route $route route object to append
*
* @return ChainedRouter itself
*/
function prependRoute($name, Route $route)
{
Assert::isScalar($name);
Assert::isFalse(isset($this->routes[$name]), 'route `%s` already defined', $name);
$this->routes[$name] = $route;
array_unshift($this->chain, $route);
return $this;
}
示例15: dropAll
function dropAll()
{
Assert::isFalse($this->isReadonly(), 'cannot drop readonly collections');
$query = EntityQuery::create($this->mtm->getProxy())->where(Expression::eq($this->mtm->getContainerProxyProperty(), $this->getParentObject()));
$count = $query->delete();
$this->clean();
return $count;
}