Cleaned unused method, property, variable or parameter

This commit is contained in:
Francis Besset 2013-12-02 16:02:29 +01:00
parent b45224587a
commit 8788d7595d
14 changed files with 14 additions and 47 deletions

View File

@ -48,8 +48,6 @@ class TypeRepository
public function fixTypeInformation(ServiceDefinition $definition) public function fixTypeInformation(ServiceDefinition $definition)
{ {
$typeMap = $this->defaultTypeMap;
foreach($definition->getAllTypes() as $type) { foreach($definition->getAllTypes() as $type) {
$phpType = $type->getPhpType(); $phpType = $type->getPhpType();
$xmlType = $type->getXmlType(); $xmlType = $type->getXmlType();

View File

@ -84,7 +84,7 @@ class BeSimpleSoapExtension extends Extension
foreach ($config as $client => $options) { foreach ($config as $client => $options) {
$definition = new DefinitionDecorator('besimple.soap.client.builder'); $definition = new DefinitionDecorator('besimple.soap.client.builder');
$context = $container->setDefinition(sprintf('besimple.soap.client.builder.%s', $client), $definition); $container->setDefinition(sprintf('besimple.soap.client.builder.%s', $client), $definition);
$definition->replaceArgument(0, $options['wsdl']); $definition->replaceArgument(0, $options['wsdl']);
@ -118,7 +118,7 @@ class BeSimpleSoapExtension extends Extension
private function createClientClassmap($client, array $classmap, ContainerBuilder $container) private function createClientClassmap($client, array $classmap, ContainerBuilder $container)
{ {
$definition = new DefinitionDecorator('besimple.soap.classmap'); $definition = new DefinitionDecorator('besimple.soap.classmap');
$context = $container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition); $container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition);
$definition->setMethodCalls(array( $definition->setMethodCalls(array(
array('set', array($classmap)), array('set', array($classmap)),
@ -130,7 +130,7 @@ class BeSimpleSoapExtension extends Extension
private function createClient($client, ContainerBuilder $container) private function createClient($client, ContainerBuilder $container)
{ {
$definition = new DefinitionDecorator('besimple.soap.client'); $definition = new DefinitionDecorator('besimple.soap.client');
$context = $container->setDefinition(sprintf('besimple.soap.client.%s', $client), $definition); $container->setDefinition(sprintf('besimple.soap.client.%s', $client), $definition);
$definition->setFactoryService(sprintf('besimple.soap.client.builder.%s', $client)); $definition->setFactoryService(sprintf('besimple.soap.client.builder.%s', $client));
} }
@ -142,7 +142,7 @@ class BeSimpleSoapExtension extends Extension
$contextId = 'besimple.soap.context.'.$config['name']; $contextId = 'besimple.soap.context.'.$config['name'];
$definition = new DefinitionDecorator('besimple.soap.context.'.$bindingSuffix); $definition = new DefinitionDecorator('besimple.soap.context.'.$bindingSuffix);
$context = $container->setDefinition($contextId, $definition); $container->setDefinition($contextId, $definition);
if (isset($config['cache_type'])) { if (isset($config['cache_type'])) {
$config['cache_type'] = $this->getCacheType($config['cache_type']); $config['cache_type'] = $this->getCacheType($config['cache_type']);

View File

@ -54,7 +54,6 @@ class RpcLiteralRequestMessageBinder implements MessageBinderInterface
if ($type instanceof ArrayOfType) { if ($type instanceof ArrayOfType) {
$isArray = true; $isArray = true;
$array = array(); $array = array();
$arrayType = $type;
$type = $this->typeRepository->getType($type->get('item')->getType()); $type = $this->typeRepository->getType($type->get('item')->getType());
} }

View File

@ -42,7 +42,6 @@ class RpcLiteralResponseMessageBinder implements MessageBinderInterface
$type = $this->typeRepository->getType($phpType); $type = $this->typeRepository->getType($phpType);
if ($type instanceof ArrayOfType) { if ($type instanceof ArrayOfType) {
$isArray = true; $isArray = true;
$arrayType = $type;
$type = $this->typeRepository->getType($type->get('item')->getType()); $type = $this->typeRepository->getType($type->get('item')->getType());
} }

View File

@ -21,8 +21,6 @@ use BeSimple\SoapCommon\Definition\Type\TypeRepository;
*/ */
class Definition extends BaseDefinition class Definition extends BaseDefinition
{ {
private $complexTypes;
public function __construct(TypeRepository $typeRepository) public function __construct(TypeRepository $typeRepository)
{ {
$this->typeRepository = $typeRepository; $this->typeRepository = $typeRepository;

View File

@ -141,30 +141,6 @@ class AnnotationClassLoader extends Loader
} }
} }
/**
* @param \ReflectionMethod $method
* @param \BeSimple\SoapBundle\ServiceDefinition\Annotation\Param $annotation
*
* @return \BeSimple\SoapBundle\ServiceDefinition\Type
*/
private function getArgumentType(\ReflectionMethod $method, Annotation\Param $annotation)
{
$phpType = $annotation->getPhpType();
$xmlType = $annotation->getXmlType();
if (null === $phpType) {
foreach ($method->getParameters() as $param) {
if ($param->name === $annotation->getName()) {
$phpType = $param->getClass()->name;
break;
}
}
}
return new Definition\Type($phpType, $xmlType);
}
private function loadType($phpType) private function loadType($phpType)
{ {
if (false !== $arrayOf = $this->typeRepository->getArrayOf($phpType)) { if (false !== $arrayOf = $this->typeRepository->getArrayOf($phpType)) {

View File

@ -61,7 +61,7 @@ class AnnotationFileLoader extends FileLoader
$path = $this->locator->locate($file); $path = $this->locator->locate($file);
if ($class = $this->findClass($path)) { if ($class = $this->findClass($path)) {
return $definition = $this->loader->load($class, $type); return $this->loader->load($class, $type);
} }
return null; return null;

View File

@ -26,8 +26,6 @@ use Symfony\Component\Config\Loader\LoaderInterface;
*/ */
class WebServiceContext class WebServiceContext
{ {
private $converterRepository;
private $options; private $options;
private $serviceDefinition; private $serviceDefinition;

View File

@ -90,7 +90,7 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
// TODO // TODO
$headers = $multipart->getHeadersForHttp(); $headers = $multipart->getHeadersForHttp();
list($name, $contentType) = explode(': ', $headers[0]); list(, $contentType) = explode(': ', $headers[0]);
$request->setContentType($contentType); $request->setContentType($contentType);
} }
@ -135,4 +135,4 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
$response->setAttachments($attachmentsRecieved); $response->setAttachments($attachmentsRecieved);
} }
} }
} }

View File

@ -210,7 +210,7 @@ class WsSecurityFilter extends WsSecurityFilterClientServer implements SoapReque
$referenceList = XmlSecurityEnc::createReferenceList($encryptedKey); $referenceList = XmlSecurityEnc::createReferenceList($encryptedKey);
// token reference to encrypted key // token reference to encrypted key
$keyInfo = $this->createKeyInfo($filterHelper, self::TOKEN_REFERENCE_SECURITY_TOKEN, $guid); $keyInfo = $this->createKeyInfo($filterHelper, self::TOKEN_REFERENCE_SECURITY_TOKEN, $guid);
$nodes = $this->createNodeListForEncryption($dom, $security); $nodes = $this->createNodeListForEncryption($dom);
foreach ($nodes as $node) { foreach ($nodes as $node) {
$type = XmlSecurityEnc::ELEMENT; $type = XmlSecurityEnc::ELEMENT;
if ($node->localName == 'Body') { if ($node->localName == 'Body') {

View File

@ -242,11 +242,10 @@ abstract class WsSecurityFilterClientServer
* Create a list of \DOMNodes that should be encrypted. * Create a list of \DOMNodes that should be encrypted.
* *
* @param \DOMDocument $dom DOMDocument to query * @param \DOMDocument $dom DOMDocument to query
* @param \DOMElement $security Security element
* *
* @return \DOMNodeList * @return \DOMNodeList
*/ */
protected function createNodeListForEncryption(\DOMDocument $dom, \DOMElement $security) protected function createNodeListForEncryption(\DOMDocument $dom)
{ {
$xpath = new \DOMXPath($dom); $xpath = new \DOMXPath($dom);
$xpath->registerNamespace('SOAP-ENV', $dom->documentElement->namespaceURI); $xpath->registerNamespace('SOAP-ENV', $dom->documentElement->namespaceURI);

View File

@ -174,7 +174,7 @@ class WsdlHandler
return true; return true;
// type/* match // type/* match
} else { } else {
list($ctype, $csubtype) = explode('/', $currentMimeType); list($ctype) = explode('/', $currentMimeType);
foreach ($mimeTypes as $mimeType) { foreach ($mimeTypes as $mimeType) {
list($type, $subtype) = explode('/', $mimeType); list($type, $subtype) = explode('/', $mimeType);
if ($subtype == '*' && $type == $ctype) { if ($subtype == '*' && $type == $ctype) {
@ -202,4 +202,4 @@ class WsdlHandler
$this->domXpath->registerNamespace('soap', $this->wsdlSoapNamespace); $this->domXpath->registerNamespace('soap', $this->wsdlSoapNamespace);
} }
} }
} }

View File

@ -130,9 +130,9 @@ class MimeFilter implements SoapRequestFilter, SoapResponseFilter
// TODO // TODO
$headers = $multipart->getHeadersForHttp(); $headers = $multipart->getHeadersForHttp();
list($name, $contentType) = explode(': ', $headers[0]); list(, $contentType) = explode(': ', $headers[0]);
$response->setContentType($contentType); $response->setContentType($contentType);
} }
} }
} }

View File

@ -226,7 +226,7 @@ class WsSecurityFilter extends WsSecurityFilterClientServer implements SoapReque
$referenceList = XmlSecurityEnc::createReferenceList($encryptedKey); $referenceList = XmlSecurityEnc::createReferenceList($encryptedKey);
// token reference to encrypted key // token reference to encrypted key
$keyInfo = $this->createKeyInfo($filterHelper, self::TOKEN_REFERENCE_SECURITY_TOKEN, $guid); $keyInfo = $this->createKeyInfo($filterHelper, self::TOKEN_REFERENCE_SECURITY_TOKEN, $guid);
$nodes = $this->createNodeListForEncryption($dom, $security); $nodes = $this->createNodeListForEncryption($dom);
foreach ($nodes as $node) { foreach ($nodes as $node) {
$type = XmlSecurityEnc::ELEMENT; $type = XmlSecurityEnc::ELEMENT;
if ($node->localName == 'Body') { if ($node->localName == 'Body') {