File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 2828 "ext-curl" : " *"
2929 },
3030 "autoload" : {
31- "psr-0" : { "Bitbucket\\ " : " lib/" }
31+ "psr-0" : { "Bitbucket\\ " : " lib/" },
32+ "files" : [" polyfill-55.php" ]
3233 },
3334 "scripts" : {
3435 "test" : " vendor/bin/phpunit"
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright 2015 - 2016 Alexandru Guzinschi <alex@gentle.ro>
4+ *
5+ * This software may be modified and distributed under the terms
6+ * of the MIT license. See the LICENSE file for details.
7+ */
8+
9+ /**
10+ * Provides functions unavailable in PHP releases prior to v5.5
11+ */
12+ if (PHP_VERSION_ID < 50500 ) {
13+ if (!function_exists ('json_last_error_msg ' )) {
14+ function json_last_error_msg ()
15+ {
16+ switch (json_last_error ()) {
17+ case JSON_ERROR_NONE :
18+ return 'No error ' ;
19+ case JSON_ERROR_DEPTH :
20+ return 'Maximum stack depth exceeded ' ;
21+ case JSON_ERROR_STATE_MISMATCH :
22+ return 'State mismatch (invalid or malformed JSON) ' ;
23+ case JSON_ERROR_CTRL_CHAR :
24+ return 'Control character error, possibly incorrectly encoded ' ;
25+ case JSON_ERROR_SYNTAX :
26+ return 'Syntax error ' ;
27+ case JSON_ERROR_UTF8 :
28+ return 'Malformed UTF-8 characters, possibly incorrectly encoded ' ;
29+ default :
30+ return 'Unknown error ' ;
31+ }
32+ }
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments