承接 solis/phpbreaker 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

solis/phpbreaker

Composer 安装命令:

composer require solis/phpbreaker

包简介

This package contains a set of exceptions shared across Solis components

README 文档

README

Codacy Badge Codacy Badge Latest Stable Version License Build Status

This package contains a set of exceptions shared across Solis components.

Install

The best way to use this component is through Composer

composer require solis/phpbreaker

Usage

The simplest usage is to thrown a implementation of Solis\Breaker\ExceptionInterface.

    use Solis\Breaker\ExceptionInterface;
    use Solis\Exceptions\RuntimeException;

    try {
        thrown new RuntimeException('something bad here', 500);          
    } catch (ExceptionInterface $e){
        echo $e->getMessage();
        
        // you can get a representation of the exception as array, containing an error and a debug entry
        // $e->toArray();
        
        // same representation as before but in json format
        // $e->toJson();
        
        // get only the error entry as json representation
        // $e->getErrorAsJson();
        
        // get only the debug entry as json representation
        // $e->getDebugAsJson();
                       
        // its possible to set custom data to the error entry of the exception                                
        // $e->getError()->setEntry($entry, $data);
        
        // the same for the debug entry
        // $e->getDebug()->setEntry($entry, $data);                                      
    }    

All exceptions implemented in this package extends one of the SPL Exceptions. So its possible to catch normally with catch \Exception.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

All feedback / bug reports / pull requests are welcome.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 3.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 8
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固