本文整理汇总了PHP中Parameter::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Parameter::setName方法的具体用法?PHP Parameter::setName怎么用?PHP Parameter::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameter
的用法示例。
在下文中一共展示了Parameter::setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
/**
* Generates the actual interfaces
*/
public function generate()
{
$interfacesData = json_decode($this->json, true);
foreach ($interfacesData as $interface) {
$filename = $interface['name'] . '.java';
$interfaceObject = new JAVAInterfaceObject();
$interfaceObject->setName($interface['name']);
foreach ($interface['methods'] as $method) {
$methodObject = new JAVAMethod();
$methodObject->setName($method['name']);
$methodObject->setReturnValue($method['returnType']);
$methodObject->setScope($method['scope']);
$methodObject->setComment($method['comment']);
foreach ($method['parameters'] as $parameter) {
$parameterObject = new Parameter();
$parameterObject->setName($parameter['name']);
$parameterObject->setType($parameter['type']);
$methodObject->addParameter($parameterObject);
}
foreach ($method['annotations'] as $annotation) {
$annotationObject = new Annotation();
$annotationObject->setName($annotation['name']);
$annotationObject->setValue($annotation['value']);
$annotationObject->setInterpreter('@');
$methodObject->addAnnotation($annotationObject);
}
$interfaceObject->addMethod($methodObject);
}
file_put_contents($this->folder . DIRECTORY_SEPARATOR . $filename, $interfaceObject->toString());
}
}
示例2: filterInitializationAlsoRespectsCaseInsensitivity
/**
*
* @test
*/
public function filterInitializationAlsoRespectsCaseInsensitivity()
{
$parameters = array();
$param = new Parameter();
$param->setName('typo3version');
$param->setValue('1.2.3');
array_push($parameters, $param);
$this->filter->setParameters($parameters);
$output = $this->filter->read();
$this->assertContains('HTTP.userAgent=TYPO3/1.2.3', $output);
}
示例3: loadForSource
public function loadForSource($url)
{
$datasrc = dirname(dirname(__FILE__)) . '/Resources/data/databases/DataSources.xml';
if (extension_loaded('apc') && ini_get('apc.enabled')) {
$xml = $this->loadFileFromCache($url);
$simulator = new \SimpleXMLElement($xml, LIBXML_NOWARNING, false);
$xml = $this->loadFileFromCache($datasrc);
$datasources = new \SimpleXMLElement($xml, LIBXML_NOWARNING, false);
} else {
$simulator = new \SimpleXMLElement($url, LIBXML_NOWARNING, true);
$datasources = new \SimpleXMLElement($datasrc, LIBXML_NOWARNING, true);
}
foreach ($datasources->DataSource as $datasource) {
$datasourceObj = new DataSource($this, (int) $datasource['id'], (string) $datasource['name'], (string) $datasource['type']);
$datasourceObj->setUri((string) $datasource['uri']);
$datasourceObj->setMethod((string) $datasource['method']);
$datasourceObj->setDatabase((int) $datasource['database']);
$datasourceObj->setDescription((string) $datasource->Description);
$this->datasources[] = $datasourceObj;
}
if ($datasources->Databases) {
foreach ($datasources->Databases->Database as $database) {
$databaseObj = new Database($this, (int) $database['id'], (string) $database['type'], (string) $database['name']);
$databaseObj->setLabel((string) $database['label']);
$databaseObj->setHost((string) $database['host']);
$databaseObj->setPort((int) $database['port']);
$databaseObj->setUser((string) $database['user']);
if ((string) $database['password'] != '') {
$databaseObj->setPassword((string) $database['password']);
} elseif ((string) $database['user'] != '') {
try {
$user = $this->controller->get('kernel')->getContainer()->getParameter('database_user');
if ((string) $database['user'] == $user) {
$databaseObj->setPassword($this->controller->get('kernel')->getContainer()->getParameter('database_password'));
}
} catch (\Exception $e) {
}
}
$this->databases[] = $databaseObj;
}
}
if ($simulator->DataSet) {
foreach ($simulator->DataSet->children() as $child) {
if ($child->getName() == "DataGroup") {
foreach ($child->Data as $data) {
$dataObj = new Data($this, (int) $data['id'], (string) $data['name']);
$dataObj->setLabel((string) $data['label']);
$dataObj->setType((string) $data['type']);
$this->datas[] = $dataObj;
}
} elseif ($child->getName() == "Data") {
$dataObj = new Data($this, (int) $child['id'], (string) $child['name']);
$dataObj->setLabel((string) $child['label']);
$dataObj->setType((string) $child['type']);
$this->datas[] = $dataObj;
}
}
}
if ($simulator->Sources) {
foreach ($simulator->Sources->Source as $source) {
$sourceObj = new Source($this, (int) $source['id'], (string) $source['datasource'], (string) $source['returnType']);
$sourceObj->setRequest((string) $source['request']);
$sourceObj->setSeparator((string) $source['separator']);
$sourceObj->setDelimiter((string) $source['delimiter']);
$sourceObj->setReturnPath((string) $source['returnPath']);
foreach ($source->Parameter as $parameter) {
$parameterObj = new Parameter($sourceObj, (string) $parameter['type']);
$parameterObj->setName((string) $parameter['name']);
$parameterObj->setFormat((string) $parameter['format']);
$parameterObj->setData((int) $parameter['data']);
$sourceObj->addParameter($parameterObj);
}
$this->sources[] = $sourceObj;
}
}
}