added annotation support

This commit is contained in:
Christian Kerl
2011-04-09 00:40:31 +02:00
parent 05a96310b3
commit 8367556323
10 changed files with 300 additions and 63 deletions

View File

@ -0,0 +1,33 @@
<?php
/*
* This file is part of the WebServiceBundle.
*
* (c) Christian Kerl <christian-kerl@web.de>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Bundle\WebServiceBundle\ServiceDefinition\Annotation;
class Method
{
private $name;
private $service;
public function __construct($values)
{
$this->name = isset($values['value']) ? $values['value'] : null;
$this->service = isset($values['service']) ? $values['service'] : null;
}
public function getName($default = null)
{
return $this->name !== null ? $this->name : $default;
}
public function getService()
{
return $this->service;
}
}

View File

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the WebServiceBundle.
*
* (c) Christian Kerl <christian-kerl@web.de>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Bundle\WebServiceBundle\ServiceDefinition\Annotation;
class Param extends TypedElement
{
private $name;
public function __construct($values)
{
parent::__construct($values);
$this->name = $values['value'];
}
public function getName()
{
return $this->name;
}
}

View File

@ -0,0 +1,19 @@
<?php
/*
* This file is part of the WebServiceBundle.
*
* (c) Christian Kerl <christian-kerl@web.de>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Bundle\WebServiceBundle\ServiceDefinition\Annotation;
class Result extends TypedElement
{
public function __construct($values)
{
parent::__construct($values);
}
}

View File

@ -0,0 +1,40 @@
<?php
/*
* This file is part of the WebServiceBundle.
*
* (c) Christian Kerl <christian-kerl@web.de>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Bundle\WebServiceBundle\ServiceDefinition\Annotation;
abstract class TypedElement
{
private $phpType;
private $xmlType;
public function __construct($values)
{
foreach(array('type', 'phpType') as $key)
{
if(isset($values[$key]))
{
$this->phpType = $values[$key];
}
}
$this->xmlType = isset($values['xmlType']) ? $values['xmlType'] : null;
}
public function getPhpType()
{
return $this->phpType;
}
public function getXmlType()
{
return $this->xmlType;
}
}