首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏mousemin

    PSR-6 缓存接口规范

    16 * 17 * @throws InvalidArgumentException 18 * 如果 $key 不是合法的值,\Psr\Cache\InvalidArgumentException 30 * 31 * @throws InvalidArgumentException 32 * 如果 $keys 里面有哪个`键`不是合法,\Psr\Cache\InvalidArgumentException 48 * 49 * @throws InvalidArgumentException 50 * 如果 $key 不是合法的值,\Psr\Cache\InvalidArgumentException 70 * 71 * @throws InvalidArgumentException 72 * 如果 $key 不是合法的值,\Psr\Cache\InvalidArgumentException 84 * 85 * @throws InvalidArgumentException 86 * 如果 $keys 里面有哪个 `键` 不是合法,\Psr\Cache\InvalidArgumentException

    71430编辑于 2023-06-10
  • 来自专栏学院君的专栏

    PHP 错误和异常处理(下)

    key_exists($key, $book)) { throw new InvalidArgumentException("数组为空或者对应索引不存在!") ; } return $book[$key]; } 通过 throw 关键字即可抛出异常,这里我们通过 new 关键字实例化了一个内置的 InvalidArgumentException 如果调用程序抛出了多个异常: function getItemFromBook($book, $key) { if (empty($book)) { throw new InvalidArgumentException 可以通过添加 finally 语句块定义一个兜底逻辑: $exit = false; try { $val = getItemFromBook($book, 'desc'); } catch (InvalidArgumentException try { $val = getItemFromBook($book, 'desc'); } catch (InvalidArgumentException $exception) {

    1.4K10发布于 2020-07-24
  • 来自专栏全栈程序员必看

    java中如何进行异常处理_java检查时异常

    最常见的运行时异常为NullPointerException,ArrayIndexOutOfBoundsException和InvalidArgumentException。 该InvalidArgumentException是当将无效参数传递给某个方法服务器的引用连接上引发异常。

    1.1K20编辑于 2022-11-11
  • 来自专栏最后一声蝉鸣

    laravel&lumen 连接金仓数据库(KingBase)

    SqlServerConnector, 'kingbase' => new KingBaseConnector, default => throw new InvalidArgumentException > new KingBaseConnection($connection, $database, $prefix, $config), default => throw new InvalidArgumentException

    30810编辑于 2025-07-09
  • 来自专栏Owen's World

    PHP实现JWT lcobucci/jwt生成jwt token

    Common; use Lcobucci\JWT\Builder; use Lcobucci\JWT\Parser; use Lcobucci\JWT\Signer\Hmac\Sha256; use InvalidArgumentException 'user_name' => $parse->getClaim('user_name') ]; } }catch (InvalidArgumentException

    2.2K20编辑于 2021-12-08
  • 来自专栏Owen's World

    PHP实现定时任务hellogerard/jobby实例

    code callable(InputInterface $input, OutputInterface $output) * @return Command * @throws \InvalidArgumentException is_callable($code)) { throw new \InvalidArgumentException('Invalid callable provided to Command ; } /** * 设置别名 * @param string[] $aliases * @return Command * @throws \InvalidArgumentException $aliases instanceof \Traversable) { throw new \InvalidArgumentException('$aliases must be preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { throw new \InvalidArgumentException(sprintf

    98520编辑于 2021-12-08
  • 来自专栏全栈程序员必看

    Spring过滤器和拦截器的区别[通俗易懂]

    StringUtils.isNotEmpty(userIdString)) { throw new InvalidArgumentException(“userId is required”); StringUtils.isNotEmpty(accessToken)) { throw new InvalidArgumentException(“accessToken is required NumberUtils.isNumber(userIdString)) { throw new InvalidArgumentException(“userId[“ + userIdString

    77130编辑于 2022-10-02
  • 来自专栏好派笔记

    分享一个php单元测试框架PHPUnit

    filter_var($email, FILTER_VALIDATE_EMAIL)) { throw new InvalidArgumentException( public function testCannotBeCreatedFromInvalidEmailAddress(): void { $this->expectException(InvalidArgumentException

    72700发布于 2021-10-07
  • 来自专栏IT码农

    Laravel5.2之Filesystem源码解析(上)

    param string $name * @return \Illuminate\Contracts\Filesystem\Filesystem * * @throws \InvalidArgumentException driverMethod)) { return $this->{$driverMethod}($config); } else { throw new InvalidArgumentException param string $name * @return \Illuminate\Contracts\Filesystem\Filesystem * * @throws \InvalidArgumentException driverMethod)) { return $this->{$driverMethod}($config); } else { throw new InvalidArgumentException

    1.2K31发布于 2019-09-02
  • 来自专栏陶士涵的菜地

    [PHP] 静态工厂模式-创建型设计模式

    } elseif ($type == 'string') { return new FormatString(); } throw new InvalidArgumentException

    36810发布于 2020-10-27
  • 来自专栏IT码农

    Laravel5.2之Filesystem源码解析(上)

    param string $name * @return \Illuminate\Contracts\Filesystem\Filesystem * * @throws \InvalidArgumentException driverMethod)) { return $this->{$driverMethod}($config); } else { throw new InvalidArgumentException param string $name * @return \Illuminate\Contracts\Filesystem\Filesystem * * @throws \InvalidArgumentException driverMethod)) { return $this->{$driverMethod}($config); } else { throw new InvalidArgumentException

    1.8K31编辑于 2022-01-10
  • 来自专栏喵了个咪的博客空间

    phalcon-入门篇8(Model层基础使用2)

    return $this->id; } public function setName($name) { if (strlen($name) < 10) { throw new \InvalidArgumentException = 11) { throw new \InvalidArgumentException('用户电话号码不足11位或超过'); } $this->phone = $phone >phone; } public function setPasswd($passwd) { if (strlen($passwd) <= 5) { throw new \InvalidArgumentException

    1.3K40发布于 2018-03-01
  • 来自专栏网管叨bi叨

    Laravel源码解析之用户认证系统(二)

    return \Illuminate\Contracts\Auth\Guard|\Illuminate\Contracts\Auth\StatefulGuard * * @throws \InvalidArgumentException ] $config = $this->getConfig($name); if (is_null($config)) { throw new InvalidArgumentException driverMethod)) { return $this->{$driverMethod}($name, $config); } throw new InvalidArgumentException return $this->createEloquentProvider($config); default: throw new InvalidArgumentException

    2.7K30发布于 2019-10-13
  • 来自专栏E=mc²

    Traceback (most recent call last) 无法定位到元素python+selenium

    TOC #selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined

    1.9K31发布于 2020-08-16
  • 来自专栏IT码农

    Laravel5.3之Query Builder源码解析(上)

    return new SqlServerConnection($connection, $database, $prefix, $config); } throw new InvalidArgumentException isset($config['driver'])) { throw new InvalidArgumentException('A driver must be specified case 'sqlsrv': return new SqlServerConnector; } throw new InvalidArgumentException

    1.1K31编辑于 2022-01-10
  • 来自专栏崔哥的专栏

    The file or directory to be published does not exist: /var/www/yii-demo/vendor/yiisoft/yii2/gii/asse

    报错内容 Invalid Argument – yii\base\InvalidArgumentException The file or directory to be published does

    55810编辑于 2022-09-26
  • 来自专栏IT码农

    Laravel5.3之Query Builder源码解析(上)

    return new SqlServerConnection($connection, $database, $prefix, $config); } throw new InvalidArgumentException isset($config['driver'])) { throw new InvalidArgumentException('A driver must be specified case 'sqlsrv': return new SqlServerConnector; } throw new InvalidArgumentException

    1.4K21发布于 2019-09-03
  • 来自专栏站长的编程笔记

    TP6.0 自定义异常处理类

    HttpException) { return $this->json($e->getMessage(), $e->getStatusCode()); } // 无效参数异常 if ($e instanceof \InvalidArgumentException

    73950编辑于 2023-01-16
  • 来自专栏mousemin

    PSR-7 HTTP 消息接口规范

    130 * @throws \InvalidArgumentException 报头头信息的值非法的时候会被抛出。 203 * @throws \InvalidArgumentException 使用无效端口时抛出异常。 221 * @throws \InvalidArgumentException 使用无效的路径时抛出。 236 * @throws \InvalidArgumentException 使用无效的查询字符串时抛出。 48 * @throws \InvalidArgumentException 参数有问题时抛出异常。

    1.7K70编辑于 2023-06-10
  • 来自专栏火丁笔记

    一个PHP实现的ID生成器

    NODE_BITS); if (is_int($node) === false || $node > $max || $node < 0) { throw new \InvalidArgumentException TIME_BITS); if (is_int($time) === false || $time > $max || $time < 0) { throw new \InvalidArgumentException

    74251编辑于 2021-12-14
领券