本文整理汇总了PHP中zibo\library\String::isString方法的典型用法代码示例。如果您正苦于以下问题:PHP String::isString方法的具体用法?PHP String::isString怎么用?PHP String::isString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zibo\library\String
的用法示例。
在下文中一共展示了String::isString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setType
/**
* Set the type of this message
* @param string $type
* @return null
*/
public function setType($type = null)
{
if ($type !== null && !String::isString($type, String::NOT_EMPTY)) {
throw new ZiboException('The provided type is invalid or empty');
}
$this->type = $type;
}
示例2: setId
/**
* Sets the id of this cache object
* @param string $id
* @return null
* @throws zibo\ZiboException when the provided id is empty or invalid
*/
private function setId($id)
{
if (!String::isString($id, String::NOT_EMPTY)) {
throw new ZiboException('Provided id is empty');
}
$this->id = $id;
}
示例3: setMethodName
/**
* Sets the method name of this callback
* @param string $methodName A method name
* @return null
*/
public function setMethodName($methodName)
{
if (!String::isString($methodName, String::NOT_EMPTY)) {
throw new ZiboException('Provided class name is empty or invalid');
}
$this->methodName = $methodName;
}
示例4: setSql
/**
* Sets the SQL for this condition
* @param string $sql The SQL
* @return null
* @throws zibo\library\database\exception\DatabaseException when the provided SQL is empty or not a string
*/
private function setSql($sql)
{
if (!String::isString($sql, String::NOT_EMPTY)) {
throw new DatabaseException('Provided sql is empty or not a valid string');
}
$this->sql = $sql;
}
示例5: setName
/**
* Set the name of this field
* @param string $name
* @return null
* @throws zibo\library\database\exception\DatabaseException when the name is empty or not a string
*/
private function setName($name)
{
if (!String::isString($name, String::NOT_EMPTY)) {
throw new DatabaseException('Provided name is empty');
}
$this->name = $name;
}
示例6: setId
/**
* Sets the id of this dependency
* @param string $id A identifier
* @return null
*/
public function setId($id = null)
{
if ($id !== null && !String::isString($id, String::NOT_EMPTY)) {
throw new ZiboException('Provided id is empty or invalid');
}
$this->id = $id;
}
示例7: quoteIdentifier
/**
* Quotes a database identifier
* @param string $identifier Identifier to quote
* @return string Quoted identifier
* @throws zibo\library\database\exception\DatabaseException when the provided identifier is empty or not a scalar value
*/
public function quoteIdentifier($identifier)
{
if (!String::isString($identifier, String::NOT_EMPTY)) {
throw new DatabaseException('Provided identifier is empty');
}
return $identifier;
}
示例8: parseVariables
private function parseVariables($string)
{
if (!String::isString($string, String::NOT_EMPTY) || !isset($this->variables)) {
return $string;
}
foreach ($this->variables as $variable => $value) {
$string = str_replace('%' . $variable . '%', $value, $string);
}
return $string;
}
示例9: setType
/**
* Set the join type
* @param string $type possible values are INNER, LEFT and RIGHT
* @return null
* @throws zibo\library\database\exception\DatabaseException when the type is empty or not valid type
*/
private function setType($type)
{
if (!String::isString($type, String::NOT_EMPTY)) {
throw new DatabaseException('Provided type is empty');
}
if ($type != self::TYPE_LEFT && $type != self::TYPE_INNER && $type != self::TYPE_RIGHT) {
throw new DatabaseException($type . ' is not a valid type, try ' . self::TYPE_LEFT . ', ' . self::TYPE_INNER . ' or ' . self::TYPE_RIGHT);
}
$this->type = $type;
}
示例10: setAlias
/**
* Set the alias of this expression
* @param string $alias
* @return null
* @throws zibo\library\database\exception\DatabaseException
*/
public function setAlias($alias = null)
{
if ($alias === null) {
$this->alias = null;
return;
}
if (!String::isString($alias, String::NOT_EMPTY)) {
throw new DatabaseException('Provided alias is empty');
}
$this->alias = $alias;
}
示例11: setDefaultAction
/**
* Sets the default action of this router
* @param string $defaultController full class name of the default controller
* @param string $defaultAction method name of the default action in the controller
* @return null
* @throws zibo\ZiboException when the default controller is an invalid or empty value
* @throws zibo\ZiboException when the default action is an invalid or empty value
*/
public function setDefaultAction($defaultController, $defaultAction = null)
{
if (!String::isString($defaultController, String::NOT_EMPTY)) {
throw new ZiboException('Provided default controller is empty or not a string');
}
if ($defaultAction !== null && !String::isString($defaultAction, String::NOT_EMPTY)) {
throw new ZiboException('Provided default action is empty or not a string');
}
$this->defaultController = $defaultController;
$this->defaultAction = $defaultAction;
}
示例12: __construct
/**
* Constructs a new DSN
* @param string $dsn String of the database source name
* @return null
* @throws zibo\ZiboException when the provided DSN is not a string
* @throws zibo\library\database\exception\DatabaseException when the provided DSN is empty or invalid
*/
public function __construct($dsn)
{
if (!String::isString($dsn, String::NOT_EMPTY)) {
throw new DatabaseException('Provided dsn string is empty');
}
$validator = new DsnValidator();
if (!$validator->isValid($dsn)) {
throw new DatabaseException('Invalid dsn string provided: ' . $dsn);
}
$this->parseDsn($dsn);
}
示例13: setOperator
/**
* Set the mathematical operator of the expression
* @param string $operator
* @return null
* @throws zibo\library\database\exception\DatabaseException when the operator is empty or invalid
*/
private function setOperator($operator = null)
{
if ($operator === null) {
$this->operator = MathematicalExpression::OPERATOR_ADDITION;
return;
}
if (!String::isString($operator, String::NOT_EMPTY)) {
throw new DatabaseException('Provided operator is empty');
}
$this->operator = $operator;
}
示例14: setDirection
/**
* Set the direction of this order clause
* @param string direction
* @return null
* @throws zibo\ZiboException when $direction is not a valid string
* @throws zibo\library\database\exception\DatabaseException when the direction is empty or invalid
*/
private function setDirection($direction = null)
{
if ($direction === null) {
$direction = self::DIRECTION_ASC;
}
if (!String::isString($direction, String::NOT_EMPTY)) {
throw new DatabaseException('Provided direction is empty');
}
if ($direction != self::DIRECTION_ASC && $direction != self::DIRECTION_DESC) {
throw new DatabaseException('Provided direction is invalid, try ' . self::DIRECTION_ASC . ' or ' . self::DIRECTION_DESC);
}
$this->direction = $direction;
}
示例15: set
/**
* Sets a value to the session or clear a previously set key by passing a
* null value
* @param string $key Key of the value
* @param mixed $value The value, null to clear
* @return null
* @throws zibo\ZiboException when an invalid key is provided
*/
public function set($key, $value = null)
{
if (!String::isString($key, String::NOT_EMPTY)) {
throw new ZiboException('Provided id is empty or invalid');
}
if ($value === null) {
if (isset($_SESSION[$key])) {
unset($_SESSION[$key]);
}
} else {
$_SESSION[$key] = $value;
}
}