Skip to content

Commit 3e14792

Browse files
committed
✨ added support for functional mode
1 parent e84977e commit 3e14792

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
"autoload": {
2525
"psr-4": {
2626
"Leaf\\": "src"
27-
}
27+
},
28+
"files": [
29+
"src/functions.php"
30+
]
2831
},
2932
"minimum-stability": "stable",
3033
"require": {

src/functions.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use function Leaf\fetch as LeafFetch;
4+
5+
if (!function_exists('fetch')) {
6+
/**
7+
* Shortcut method for making network requests.
8+
*
9+
* @param array|string $options The url or request to hit.
10+
*/
11+
function fetch($options, $params = [])
12+
{
13+
return LeafFetch($options, $params);
14+
}
15+
}

0 commit comments

Comments
 (0)