public function testCamel() { $this->assertEquals('CamelCase', Inflector::getDefault()->camel('camel_case')); $this->assertEquals('CamelCaseWords', Inflector::getDefault()->camel('camel_case_words')); $this->assertEquals('Test', Inflector::getDefault()->camel('test')); $this->assertEquals('Expect100Continue', ucfirst(Inflector::getDefault()->camel('expect100_continue'))); // Get from cache $this->assertEquals('Test', Inflector::getDefault()->camel('test', false)); }
/** * @param array|string $namespaces Namespaces of waiter objects * @param InflectorInterface $inflector Inflector used to resolve class names */ public function __construct($namespaces = array(), InflectorInterface $inflector = null) { $this->namespaces = (array) $namespaces; $this->inflector = $inflector ?: Inflector::getDefault(); }
/** * Magic call to wrapped amazon aws methods. If not command found, then call parent component * @param string $method * @param array $args * @return mixed * @throws CException */ public function __call($method, $args) { // the "current" is nessesary here: if ($args == false) { $args = array(); } else { $args = current($args); } try { $command = $this->getClient()->getCommand(Inflector::getDefault()->camel($method), $args); if ($command) { return $this->getClient()->execute($command, $args); } } catch (Exception $e) { // do nothing throw new CException(Yii::t('zii', $e->getMessage())); //custom added } return parent::__call($method, $args); }
/** * @param ClientInterface $client Client that owns the commands * @param InflectorInterface $inflector Inflector used to resolve class names */ public function __construct(ClientInterface $client, InflectorInterface $inflector = null) { $this->client = $client; $this->inflector = $inflector ?: Inflector::getDefault(); }
/** * @param array $config Array of configuration directives * @param InflectorInterface $inflector Inflector used to resolve class names */ public function __construct(array $config, InflectorInterface $inflector = null) { $this->config = $config; $this->inflector = $inflector ?: Inflector::getDefault(); }
/** * {@inheritdoc} */ public function getInflector() { if (!$this->inflector) { $this->inflector = Inflector::getDefault(); } return $this->inflector; }
/** * @param string $baseNamespace Base namespace of all locking strategies * @param InflectorInterface $inflector Inflector used to resolve class names */ public function __construct($baseNamespace = null, InflectorInterface $inflector = null) { $this->baseNamespace = $baseNamespace ?: __NAMESPACE__; $this->inflector = $inflector ?: Inflector::getDefault(); }