Skip to content

Commit 93a9689

Browse files
committed
Add polyfill for \JsonSerializable
1 parent 287d0b4 commit 93a9689

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"sort-packages": true
3030
},
3131
"autoload": {
32+
"files": [ "src/polyfill.php" ],
3233
"classmap": [
3334
"./"
3435
]

src/polyfill.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
/**
4+
* Polyfill for PHP < 5.4
5+
*/
6+
if (!interface_exists('JsonSerializable', false)) {
7+
interface JsonSerializable
8+
{
9+
/**
10+
* @param void
11+
* @return mixed
12+
*/
13+
function jsonSerialize();
14+
}
15+
}

0 commit comments

Comments
 (0)