Skip to content

Commit 1c5c5c8

Browse files
committed
Fixed #8 (PHP Fatal error: Cannot redeclare from()): decorated from function with function_exists call.
1 parent e83468a commit 1c5c5c8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

YaLinqo/Linq.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
});
99
// @codeCoverageIgnoreEnd
1010

11-
/**
12-
* @param array|\Iterator|\IteratorAggregate|\YaLinqo\Enumerable $source
13-
* @throws \InvalidArgumentException If source is not array or Traversible or Enumerable.
14-
* @return \YaLinqo\Enumerable
15-
*/
16-
function from ($source)
17-
{
18-
return \YaLinqo\Enumerable::from($source);
19-
}
11+
if (!function_exists('from')) {
12+
/**
13+
* @param array|\Iterator|\IteratorAggregate|\YaLinqo\Enumerable $source
14+
* @throws \InvalidArgumentException If source is not array or Traversible or Enumerable.
15+
* @return \YaLinqo\Enumerable
16+
*/
17+
function from ($source)
18+
{
19+
return \YaLinqo\Enumerable::from($source);
20+
}
21+
}

0 commit comments

Comments
 (0)