Skip to content

Clevis/utils-functions-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Functions Proxy

Usage

/** @var ICurlProxy $curl */
$curl = new FunctionsProxy('curl_');

$handle = $curl->init();
$curl->setopt($handle, CURLOPT_URL, 'example.com');
$curl->setopt($handle, CURLOPT_RETURNTRANSFER, 1);
$response = $curl->exec($handle);
$curl->close();

Why

Because unlike built-in functions, this proxy could be mocked in tests.

About

Simple proxy to function calls that can be mocked.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages