Skip to content

Commit

Permalink
Fixed #8 (PHP Fatal error: Cannot redeclare from()): decorated from f…
Browse files Browse the repository at this point in the history
…unction with function_exists call.
  • Loading branch information
Athari committed May 22, 2015
1 parent e83468a commit 1c5c5c8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions YaLinqo/Linq.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
});
// @codeCoverageIgnoreEnd

/**
* @param array|\Iterator|\IteratorAggregate|\YaLinqo\Enumerable $source
* @throws \InvalidArgumentException If source is not array or Traversible or Enumerable.
* @return \YaLinqo\Enumerable
*/
function from ($source)
{
return \YaLinqo\Enumerable::from($source);
}
if (!function_exists('from')) {
/**
* @param array|\Iterator|\IteratorAggregate|\YaLinqo\Enumerable $source
* @throws \InvalidArgumentException If source is not array or Traversible or Enumerable.
* @return \YaLinqo\Enumerable
*/
function from ($source)
{
return \YaLinqo\Enumerable::from($source);
}
}

2 comments on commit 1c5c5c8

@cursedcoder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@umpirsky
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.