private function makeCall($context, $cmd, $service, $path = null) { $method = $service; if (!empty($path) && !is_numeric($path)) { $method = $path; $path = null; } return (object) array('context' => $context, 'http' => $cmd, 'service' => $service, 'method' => $method, 'function' => $cmd . U::dashedToCamelCase($method), 'path' => $path); }
/** * @param Context $context * @param string $cmd * @param string $service * @param string $path */ protected function push($context, $cmd, $service, $path = null) { $method = $service; if (!empty($path) && !is_numeric($path)) { $method = $path; $path = null; } $this->chain[] = (object) array('context' => $context, 'http' => $cmd, 'service' => $service, 'method' => $method, 'function' => $cmd . U::dashedToCamelCase($method), 'path' => $path); }
public function testDashedToCamelCase() { $this->assertEquals('Class', U::dashedToCamelCase('class')); $this->assertEquals('MyApp', U::dashedToCamelCase('my-app')); $this->assertEquals('VeryVeryVeryVeryLONG', U::dashedToCamelCase('very-very-very-very-LONG')); }