for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Factory.php - Jaxon Request Factory
*
* Create Jaxon client side requests to a given class.
* @package jaxon-core
* @author Thierry Feuzeu <[email protected]>
* @copyright 2016 Thierry Feuzeu <[email protected]>
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link https://github.com/jaxon-php/jaxon-core
*/
namespace Jaxon\Request\Factory\CallableObject;
use Jaxon\Request\Support\CallableObject;
class Request
{
* The callable object this factory is attached to
* @var CallableObject
private $xCallable;
* The class constructor
* @param CallableObject $xCallable
public function __construct(CallableObject $xCallable)
$this->xCallable = $xCallable;
}
* Generate the corresponding javascript code for a call to any method
* @return string
public function __call($sMethod, $aArguments)
// Make the request
$factory = rq()->setCallable($this->xCallable);
return call_user_func_array([$factory, 'call'], array_merge([$sMethod], $aArguments));