當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Assertion::keyIsset方法代碼示例

本文整理匯總了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]);
 }
開發者ID:WeCamp,項目名稱:flyingliquourice,代碼行數:13,代碼來源:Coords.php

示例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;
 }
開發者ID:stefanotorresi,項目名稱:thorr-persistence,代碼行數:15,代碼來源:DataMapperManager.php

示例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;
 }
開發者ID:kletellier,項目名稱:mvc,代碼行數:14,代碼來源:TemplateProvider.php

示例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;
 }
開發者ID:ProfessorFrancken,項目名稱:ProfessorFrancken,代碼行數:15,代碼來源:CommitteesList.php

示例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]);
 }
開發者ID:thomasmodeneis,項目名稱:Sententiaregum,代碼行數:8,代碼來源:RegistrationContext.php

示例6: checkNameSuggestions

 /**
  * @Then /^I should see suggestions for my username$/
  */
 public function checkNameSuggestions()
 {
     Assertion::keyIsset($this->apiContext->getResponse(), 'name_suggestions');
 }
開發者ID:sententiaregum,項目名稱:sententiaregum,代碼行數:7,代碼來源:CreateAccountContext.php


注:本文中的Assert\Assertion::keyIsset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。