当前位置: 首页>>代码示例>>PHP>>正文


PHP Assert::isArray方法代码示例

本文整理汇总了PHP中Assert::isArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::isArray方法的具体用法?PHP Assert::isArray怎么用?PHP Assert::isArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assert的用法示例。


在下文中一共展示了Assert::isArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isIndexExists

 public static function isIndexExists($array, $key, $message = null)
 {
     Assert::isArray($array);
     if (!array_key_exists($key, $array)) {
         throw new WrongArgumentException($message . ', ' . self::dumpArgument($key));
     }
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:7,代码来源:Assert.class.php

示例2: __construct

 protected function __construct(array $dbs = array())
 {
     Assert::isArray($dbs);
     foreach ($dbs as $connector => $credentials) {
         $this->pool[$connector] = DB::spawn($connector, $credentials['user'], $credentials['pass'], $credentials['host'], $credentials['base']);
     }
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:7,代码来源:DBTestPool.class.php

示例3: setDefault

 /**
  * @return PrimitiveMultiList
  **/
 public function setDefault($default)
 {
     Assert::isArray($default);
     foreach ($default as $index) {
         Assert::isTrue(array_key_exists($index, $this->list));
     }
     return parent::setDefault($default);
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:11,代码来源:PrimitiveMultiList.class.php

示例4: cacheListByQuery

 protected function cacheListByQuery(SelectQuery $query, $array)
 {
     if ($array !== Cache::NOT_FOUND) {
         Assert::isArray($array);
         Assert::isTrue(current($array) instanceof Identifiable);
     }
     Cache::me()->mark($this->className)->add($this->makeQueryKey($query, self::SUFFIX_LIST), $array, Cache::EXPIRES_FOREVER);
     return $array;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:9,代码来源:CacheDaoWorker.class.php

示例5: setValue

 /**
  * @return PrimitiveEnumList
  **/
 public function setValue($value)
 {
     if ($value) {
         Assert::isArray($value);
         Assert::isInstance(current($value), 'Enum');
     }
     $this->value = $value;
     return $this;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:12,代码来源:PrimitiveEnumList.class.php

示例6: __construct

 public function __construct($field, $words, $logic)
 {
     if (is_string($field)) {
         $field = new DBField($field);
     }
     Assert::isArray($words);
     $this->field = $field;
     $this->words = $words;
     $this->logic = $logic;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:10,代码来源:FullText.class.php

示例7: __construct

 protected function __construct(array $dbs = array())
 {
     Assert::isArray($dbs);
     foreach ($dbs as $connector => $credentials) {
         $this->pool[$connector] = DB::spawn($connector, $credentials['user'], $credentials['pass'], $credentials['host'], $credentials['base']);
         if ($this->pool[$connector] instanceof MySQLim) {
             $this->pool[$connector]->setDefaultEngine('INNODB');
         }
     }
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:10,代码来源:DBTestPool.class.php

示例8: cacheListByQuery

 protected function cacheListByQuery(SelectQuery $query, $array)
 {
     if ($array !== Cache::NOT_FOUND) {
         Assert::isArray($array);
         Assert::isTrue(current($array) instanceof Identifiable);
     }
     $cache = Cache::me();
     $key = $this->makeQueryKey($query, self::SUFFIX_LIST);
     if ($this->handler->touch($this->keyToInt($key))) {
         $cache->mark($this->className)->add($key, $array, Cache::EXPIRES_FOREVER);
     }
     return $array;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:13,代码来源:VoodooDaoWorker.class.php

示例9: toStringOneDeepLvl

 /**
  * @deprecated to support old convert method in CurlHttpClient
  * @param array $array
  * @return string 
  */
 public static function toStringOneDeepLvl($array)
 {
     Assert::isArray($array);
     $result = array();
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             foreach ($value as $valueKey => $simpleValue) {
                 $result[] = $key . '[' . $valueKey . ']=' . urlencode($simpleValue);
             }
         } else {
             $result[] = $key . '=' . urlencode($value);
         }
     }
     return implode('&', $result);
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:20,代码来源:UrlParamsUtils.class.php

示例10: 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;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:17,代码来源:Csv.class.php

示例11: import

 /**
  * 
  * @param array $scope 
  * from http request
  * looks like foo[1]=42&bar[1]=test&foo[2]=44&bar[2]=anothertest
  */
 public function import(array $scope)
 {
     $this->imported = true;
     foreach ($scope as $name => $paramList) {
         /**
          *@var array $paramList
          * looks like array(1 => 42, 2 => 44)
          */
         Assert::isArray($paramList);
         foreach ($paramList as $key => $value) {
             if (!isset($this->formList[$key])) {
                 $this->formList[$key] = clone $this->sampleForm;
             }
             $this->formList[$key]->importMore(array($name => $value));
         }
     }
     reset($this->formList);
     return $this;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:25,代码来源:FormCollection.class.php

示例12: importValue

 public function importValue($value)
 {
     if ($value !== null) {
         Assert::isArray($value);
     } else {
         return null;
     }
     $result = true;
     $resultValue = array();
     foreach ($value as $id => $form) {
         Assert::isInstance($form, 'Form');
         $resultValue[$id] = $form;
         if ($form->getErrors()) {
             $result = false;
         }
     }
     $this->value = $resultValue;
     return $result;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:19,代码来源:PrimitiveFormsList.class.php

示例13: cacheListByQuery

 protected function cacheListByQuery(SelectQuery $query, $array)
 {
     if ($array !== Cache::NOT_FOUND) {
         Assert::isArray($array);
         Assert::isTrue(current($array) instanceof Identifiable);
     }
     $cache = Cache::me();
     $listKey = $this->makeQueryKey($query, self::SUFFIX_LIST);
     $semKey = $this->keyToInt($this->indexKey);
     $pool = SemaphorePool::me();
     if ($pool->get($semKey)) {
         $this->syncMap($listKey);
         $cache->mark($this->className)->add($listKey, $array, Cache::EXPIRES_FOREVER);
         if ($array !== Cache::NOT_FOUND) {
             foreach ($array as $object) {
                 $this->cacheById($object);
             }
         }
         $pool->free($semKey);
     }
     return $array;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:22,代码来源:SmartDaoWorker.class.php

示例14: setParametersList

 /**
  * @return HttpContentType
  **/
 public function setParametersList($parameters)
 {
     Assert::isArray($parameters);
     $this->parameters = $parameters;
     return $this;
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:9,代码来源:ContentTypeHeader.class.php

示例15: prepareFullText

 public static function prepareFullText($words, $logic)
 {
     Assert::isArray($words);
     $glue = $logic == DB::FULL_TEXT_AND ? ' & ' : ' | ';
     return strtolower(implode($glue, array_map(array('PostgresDialect', 'quoteValue'), $words)));
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:6,代码来源:PostgresDialect.class.php


注:本文中的Assert::isArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。