本文整理汇总了PHP中Webmozart\Expression\Expr::keyExists方法的典型用法代码示例。如果您正苦于以下问题:PHP Expr::keyExists方法的具体用法?PHP Expr::keyExists怎么用?PHP Expr::keyExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Expression\Expr
的用法示例。
在下文中一共展示了Expr::keyExists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: orKeyExists
public function orKeyExists($keyName)
{
return $this->orX(Expr::keyExists($keyName));
}
示例2: testMatch
public function testMatch()
{
$target = new InstallTarget('local', 'symlink', 'web', '/%s', array('param1' => 'value1', 'param2' => 'value2'));
$this->assertFalse($target->match(Expr::same('foobar', InstallTarget::NAME)));
$this->assertTrue($target->match(Expr::same('local', InstallTarget::NAME)));
$this->assertFalse($target->match(Expr::same('foobar', InstallTarget::INSTALLER_NAME)));
$this->assertTrue($target->match(Expr::same('symlink', InstallTarget::INSTALLER_NAME)));
$this->assertFalse($target->match(Expr::same('foobar', InstallTarget::LOCATION)));
$this->assertTrue($target->match(Expr::same('web', InstallTarget::LOCATION)));
$this->assertFalse($target->match(Expr::same('foobar', InstallTarget::URL_FORMAT)));
$this->assertTrue($target->match(Expr::same('/%s', InstallTarget::URL_FORMAT)));
$this->assertFalse($target->match(Expr::key(InstallTarget::PARAMETER_VALUES, Expr::keyExists('foobar'))));
$this->assertTrue($target->match(Expr::key(InstallTarget::PARAMETER_VALUES, Expr::keyExists('param1'))));
}
示例3: testMatch
public function testMatch()
{
$server = new Server('localhost', 'symlink', 'web', '/%s', array('param1' => 'value1', 'param2' => 'value2'));
$this->assertFalse($server->match(Expr::same('foobar', Server::NAME)));
$this->assertTrue($server->match(Expr::same('localhost', Server::NAME)));
$this->assertFalse($server->match(Expr::same('foobar', Server::INSTALLER_NAME)));
$this->assertTrue($server->match(Expr::same('symlink', Server::INSTALLER_NAME)));
$this->assertFalse($server->match(Expr::same('foobar', Server::DOCUMENT_ROOT)));
$this->assertTrue($server->match(Expr::same('web', Server::DOCUMENT_ROOT)));
$this->assertFalse($server->match(Expr::same('foobar', Server::URL_FORMAT)));
$this->assertTrue($server->match(Expr::same('/%s', Server::URL_FORMAT)));
$this->assertFalse($server->match(Expr::key(Server::PARAMETER_VALUES, Expr::keyExists('foobar'))));
$this->assertTrue($server->match(Expr::key(Server::PARAMETER_VALUES, Expr::keyExists('param1'))));
}
示例4: andKeyExists
public function andKeyExists($keyName)
{
return $this->andX(Expr::keyExists($keyName));
}