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


PHP Assert::nullOrStringNotEmpty方法代码示例

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


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

示例1: __construct

 /**
  * Creates a new return value.
  *
  * @param string $value       The value as source code.
  * @param string $type        The type shown in the doc block.
  * @param string $description The doc block description.
  */
 public function __construct($value, $type = 'mixed', $description = null)
 {
     Assert::stringNotEmpty($value, 'The return value must be a non-empty string. Got: %s');
     Assert::stringNotEmpty($type, 'The return value type must be a non-empty string. Got: %s');
     Assert::nullOrStringNotEmpty($description, 'The return value description must be a non-empty string or null. Got: %s');
     $this->value = $value;
     $this->type = $type;
     $this->description = $description;
 }
开发者ID:niklongstone,项目名称:manager,代码行数:16,代码来源:ReturnValue.php

示例2: __construct

 /**
  * Creates the violation.
  *
  * @param int         $code          The violation code. One of the constants
  *                                   defined in this class.
  * @param mixed       $invalidValue  The value that caused this violation.
  * @param string      $installerName The name of the validated installer.
  * @param string|null $parameterName The name of the validated installer
  *                                   parameter or `null` if this is a generic
  *                                   error.
  */
 public function __construct($code, $invalidValue, $installerName, $parameterName = null)
 {
     Assert::oneOf($code, self::$codes, 'The violation code %s is not valid.');
     Assert::stringNotEmpty($installerName, 'The installer name must be a non-empty string. Got: %s');
     Assert::nullOrStringNotEmpty($parameterName, 'The parameter name must be a non-empty string or null. Got: %s');
     $this->code = $code;
     $this->installerName = $installerName;
     $this->parameterName = $parameterName;
     $this->invalidValue = $invalidValue;
 }
开发者ID:puli,项目名称:asset-plugin,代码行数:21,代码来源:ConstraintViolation.php

示例3: hasBindings

 /**
  * {@inheritdoc}
  */
 public function hasBindings($typeName = null, Expression $expr = null)
 {
     Assert::nullOrStringNotEmpty($typeName, 'The type class must be a non-empty string. Got: %s');
     if (null !== $typeName) {
         if (null !== $expr) {
             return $this->hasBindingsWithTypeNameThatMatch($typeName, $expr);
         }
         return $this->hasBindingsWithTypeName($typeName);
     }
     if (null !== $expr) {
         return $this->hasBindingsThatMatch($expr);
     }
     return $this->hasAnyBinding();
 }
开发者ID:ikwattro,项目名称:discovery,代码行数:17,代码来源:AbstractEditableDiscovery.php

示例4: __construct

 public function __construct($version = null, Description $description = null)
 {
     Assert::nullOrStringNotEmpty($version);
     $this->version = $version;
     $this->description = $description;
 }
开发者ID:Ocramius,项目名称:ReflectionDocBlock,代码行数:6,代码来源:Version.php


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