Comments (10)
#259 で対応されたのでクローズします。
from bear.package.
1.7.2でリリースしました
from bear.package.
ありがとうございます!後で見ますね
from bear.package.
json_decodeのエラーをキャッチしてJsonDecodeException
例外とかにしましょうか?
from bear.package.
そうなると私的にはとてもありがたいです。
from bear.package.
ユーザー目線でInvalidJsonException
の方がいいですね
from bear.package.
なるほど。確かにそちらの方が catch する側で自然に感じます。
from bear.package.
#259
@kalibora レビューしてもらっていいでしょうか?
from bear.package.
こんな感じの実装も見るんですがjson_last_error()
でいいような
public static function decode($json)
{
set_error_handler(function () use ($json) {
throw new JsonDecodeException($json);
});
$value = json_decode($json, true);
if (false === $value) {
throw new JsonDecodeException($json);
}
restore_error_handler();
return $value;
}
from bear.package.
@kalibora レビューしてもらっていいでしょうか?
見させていただきます!
from bear.package.
Related Issues (20)
- tagging for HEAD HOT 1
- Need More Test for Compiler HOT 1
- Don't do `require` for autoloaded classes. HOT 8
- Need Description for Compiler::scanClass HOT 2
- Fails to compile resource objects that depend on intercepted objects
- Undefined offset: 0 in src/Provide/Error/Status.php
- AppInterface cannot be bound
- "Can't preload unlinked class" warning at first run with preload
- Add Injector::getOverrideInstance() method
- apcu stub doesn't work well
- Create an injector factory from AbstractAppMeta to specify the tmp directory, etc
- Convention-based router HOT 5
- Unable to get bound dependencies with getOverrideInstance()
- Tutorial error without APCu HOT 4
- Compileエラー HOT 1
- cliコンテキストのランタイムチェック
- Failed to verify the injector cache
- Better error message for saving non-cacheable Injector
- Phar support
- ローカルキャッシュがvar/tmpに作成されない
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bear.package.