-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28ec4b9
commit 93123ec
Showing
5 changed files
with
69 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace ThenLabs\ComposedViews; | ||
|
||
use Wa72\HtmlPageDom\HtmlPageCrawler; | ||
use BadMethodCallException; | ||
|
||
/** | ||
* @author Andy Daniel Navarro Taño <andaniel05@gmail.com> | ||
*/ | ||
trait ProxyToCrawlerTrait | ||
{ | ||
/** | ||
* @var HtmlPageCrawler | ||
*/ | ||
protected $crawler; | ||
|
||
public function __call($method, $arguments) | ||
{ | ||
$callback = [$this->crawler, $method]; | ||
|
||
if (is_callable($callback)) { | ||
return call_user_func_array($callback, $arguments); | ||
} else { | ||
throw new BadMethodCallException("Unknow method '{$method}'."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters