本文整理汇总了PHP中Assert\Assertion::keyIsset方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::keyIsset方法的具体用法?PHP Assertion::keyIsset怎么用?PHP Assertion::keyIsset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assert\Assertion
的用法示例。
在下文中一共展示了Assertion::keyIsset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromString
/**
* @param string $location
*
* @return static
*/
public static function fromString($location)
{
Assertion::string($location);
$result = explode('.', $location);
Assertion::keyIsset($result, 0);
Assertion::keyIsset($result, 1);
return new static((int) $result[0], (int) $result[1]);
}
示例2: getDataMapperForEntity
/**
* @param string $entityClass
*
* @return DataMapperInterface
*/
public function getDataMapperForEntity($entityClass)
{
Assertion::keyIsset($this->entityDataMapperMap, $entityClass, sprintf("Could not find data mapper service name for entity class '%s'", $entityClass));
$entityDMServiceName = $this->entityDataMapperMap[$entityClass];
$dataMapper = $this->get($entityDMServiceName);
if (!is_a($dataMapper->getEntityClass(), $entityClass, true)) {
throw new Exception\RuntimeException(sprintf('"%s" entity class mismatch: expected "%s", got "%s"', $entityDMServiceName, $entityClass, $dataMapper->getEntityClass()));
}
return $dataMapper;
}
示例3: getTemplateService
public function getTemplateService($eng = "")
{
$ret = null;
// spécify engine or use default
$engine = $eng == "" ? TEMPLATE_ENGINE : $eng;
try {
Assertion::keyIsset($this->arr, $engine, "Template engine {$engine} is not defined");
$class = $this->arr[$engine];
Assertion::ClassExists($class);
$ret = new $class();
} catch (Exception $e) {
}
return $ret;
}
示例4: __construct
public function __construct(CommitteeId $id, string $name, string $summary, Email $email = null, string $markDown = '', string $html = '', array $members = [])
{
$this->id = (string) $id;
$this->name = $name;
$this->summary = $summary;
$this->email = (string) $email;
$this->markDown = $markDown;
$this->html = $html;
foreach ($members as $member) {
Assertion::keyIsset($member, 'id');
Assertion::keyIsset($member, 'first_name');
Assertion::keyIsset($member, 'last_name');
}
$this->members = $members;
}
示例5: iShouldSee
/**
* @Then I should see :arg1 for property :arg2
*/
public function iShouldSee($arg1, $arg2)
{
Assertion::keyIsset($this->response['errors'], $arg2);
Assertion::inArray($arg1, $this->response['errors'][$arg2]);
}
示例6: checkNameSuggestions
/**
* @Then /^I should see suggestions for my username$/
*/
public function checkNameSuggestions()
{
Assertion::keyIsset($this->apiContext->getResponse(), 'name_suggestions');
}