Skip to content

Commit d19fe5d

Browse files
authoredMar 27, 2019
Merge pull request #36 from Niko9911/patch-1
Check if the function is declared before declaring it.
2 parents 621dbaf + 2833a54 commit d19fe5d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"autoload": {
1414
"psr-4": { "React\\Promise\\Timer\\": "src/" },
15-
"files": [ "src/functions.php" ]
15+
"files": [ "src/functions_include.php" ]
1616
},
1717
"autoload-dev": {
1818
"psr-4": { "React\\Tests\\Promise\\Timer\\": "tests/" }

‎src/functions_include.php

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace React\Promise\Timer;
4+
5+
if (!function_exists('React\\Promise\\Timer\\timeout')) {
6+
require __DIR__ . '/functions.php';
7+
}

0 commit comments

Comments
 (0)
Please sign in to comment.