Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'cs/zendframework/zendframework#6872-php-cs-fixer-automa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Nov 14, 2014
183 parents 27fa848 + 1bf9aba + 3ec9aa4 + 38be842 + 4ebc653 + 52f7747 + 57b39fa + b06e239 + 156b2cc + 991d497 + 5abe4b0 + d089acd + 6fcf214 + bcbd2dd + 91375d9 + da20dbf + 8cb31b9 + 34aaa76 + a941379 + 5ec4274 + 1a8b800 + 045212a + c918e2c + 1d51877 + 073ffb1 + 6cc70c4 + cca448e + 5f78560 + 1c0be41 + 02f7335 + 88a04db + b1c3dd1 + f3d5365 + 88de986 + fb38487 + 7bfe758 + 2e55342 + 6a04f31 + 57ecc1a + b78abaa + 30a9569 + f96aa9d + 23f86e7 + d43d656 + 4de219f + 3c20bba + a0d3747 + 456d331 + e503406 + 95c2a28 + 1fc5b65 + bc3880f + 2989a80 + e8f73d2 + fcc59de + ad50dbb + a46cbd4 + 6192f93 + bb42677 + 02419fd + cf6df36 + 92345be + 737b39e + fde18af + 43ca092 + e3acc17 + b5bc61a + 30d69f9 + 7dbd12c + 9f45cc7 + 473bfa3 + 916cd80 + 5aac7b0 + 6f66646 + 12c90a3 + 435c161 + 9bb6b33 + 6c32cce + f3c637f + c54876c + e1d13eb + daa8e6c + 5570955 + 388a6c0 + ac33840 + 00e233b + 532572e + 1e1f8d2 + b636e56 + 18878ed + 79ce391 + 9db7d70 + 0c2ce53 + 8dbc4b8 + b8b5d22 + 3dac49c + c87ef97 + 1ffe869 + fbe0570 + 802848d + 9fd0967 + 537b471 + 8cc3c9d + 7f51755 + 71ea52c + f2338ea + 226aada + 6f2818d + fafc8ae + 06d397d + 42a5665 + 9b6e2d1 + 96a0498 + 8cc5c74 + e3d1211 + ec85470 + a6f2c9c + fd7b83c + 6d8b4af + b29c8c0 + 64f42ce + 1a82cad + becf6c6 + 2ef3150 + 298e4df + 829ed04 + 4f30658 + ca02442 + 93fe9e8 + 28004c9 + ee4145b + 5e1f577 + 783b983 + 7b0d8d0 + 93db32e + 2b88f8e + fddfc5a + 7bc42fb + 0fe8dfb + 5ee657c + 5f406b6 + c948fa3 + 960d3da + c281e33 + 62224a4 + 6f2357e + 20aefa2 + 31e6b5a + 8a77c3a + 4982e89 + 1386ed7 + 67368ff + 95214da + 6434c7e + 659bce0 + e6b0ec4 + 5fcb527 + 19f72a6 + 8993ba7 + b8734d1 + e0c31db + 3a7c753 + f31a6f9 + 1a8bac6 + 2c9c99a + c36df00 + 996a250 + 13b7c35 + 6901b30 + f0c8580 + 92424ea + 2340663 + 463b567 + 4e6645a + 6b6cbe1 + 43892df + 9ee3034 + fb74ed3 + 474dcc0 + e16a42e + 73e728b + c71991f + dcd4bb3 commit 8f46a80
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 63 deletions.
3 changes: 0 additions & 3 deletions src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ public function addFunction($function)
'Argument to Zend\Soap\AutoDiscover::addFunction should be a valid function name.'
);
}

} else {
throw new Exception\InvalidArgumentException(
'Argument to Zend\Soap\AutoDiscover::addFunction should be string or array of strings.'
Expand Down Expand Up @@ -483,7 +482,6 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)

// Add the wrapper element part, which must be named 'parameters'
$args['parameters'] = array('element' => $wsdl->addElement($element));

} else {
// RPC style: add each parameter as a typed part
foreach ($prototype->getParameters() as $param) {
Expand Down Expand Up @@ -516,7 +514,6 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)

// Add the wrapper element part, which must be named 'parameters'
$args['parameters'] = array('element' => $wsdl->addElement($element));

} elseif ($prototype->getReturnType() != "void") {
// RPC style: add the return value as a typed part
$args['return'] = array(
Expand Down
4 changes: 2 additions & 2 deletions src/Client/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class Common extends SoapClient
{
/**
/**
* doRequest() pre-processing method
*
* @var callable
Expand Down Expand Up @@ -58,4 +58,4 @@ public function __doRequest($request, $location, $action, $version, $oneWay = nu
}
}

} // end if (extension_loaded('soap')
}
3 changes: 2 additions & 1 deletion src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
* Exception thrown when unrecognized method is called via overloading
*/
class BadMethodCallException extends SPLBadMethodCallException implements ExceptionInterface
{}
{
}
3 changes: 2 additions & 1 deletion src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
* Common Exception interface
*/
interface ExceptionInterface
{}
{
}
3 changes: 2 additions & 1 deletion src/Exception/ExtensionNotLoadedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
* Exception thrown when SOAP PHP extension is not loaded
*/
class ExtensionNotLoadedException extends RuntimeException
{}
{
}
3 changes: 2 additions & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
* Exception thrown when one or more method arguments are invalid
*/
class InvalidArgumentException extends SPLInvalidArgumentException implements ExceptionInterface
{}
{
}
3 changes: 2 additions & 1 deletion src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
* Exception thrown when there is an error during program execution
*/
class RuntimeException extends SPLRuntimeException implements ExceptionInterface
{}
{
}
3 changes: 2 additions & 1 deletion src/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
* Exception thrown when provided arguments are invalid
*/
class UnexpectedValueException extends SPLUnexpectedValueException implements ExceptionInterface
{}
{
}
7 changes: 0 additions & 7 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,10 @@ public function addFunction($function, $namespace = '')
throw new Exception\InvalidArgumentException('One or more invalid functions specified in array');
}
}

} elseif (is_string($function) && function_exists($function)) {
$this->functions[] = $function;

} elseif ($function == SOAP_FUNCTIONS_ALL) {
$this->functions = SOAP_FUNCTIONS_ALL;

} else {
throw new Exception\InvalidArgumentException('Invalid function specified');
}
Expand Down Expand Up @@ -730,13 +727,10 @@ protected function _setRequest($request)

if ($request instanceof DOMDocument) {
$xml = $request->saveXML();

} elseif ($request instanceof DOMNode) {
$xml = $request->ownerDocument->saveXML();

} elseif ($request instanceof SimpleXMLElement) {
$xml = $request->asXML();

} elseif (is_object($request) || is_string($request)) {
if (is_object($request)) {
$xml = $request->__toString();
Expand Down Expand Up @@ -982,7 +976,6 @@ public function registerFaultException($class)
foreach ($class as $row) {
$this->registerFaultException($row);
}

} elseif (is_string($class) && class_exists($class) && (is_subclass_of($class, 'Exception') || 'Exception' === $class)) {
$ref = new ReflectionClass($class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function getContext()
*/
public function scanRegisteredTypes($phpType)
{

if (array_key_exists($phpType, $this->getContext()->getTypes())) {
$soapTypes = $this->getContext()->getTypes();
return $soapTypes[$phpType];
Expand Down
1 change: 0 additions & 1 deletion src/Wsdl/ComplexTypeStrategy/DefaultComplexType.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function addComplexType($type)

foreach ($class->getProperties() as $property) {
if ($property->isPublic() && preg_match_all('/@var\s+([^\s]+)/m', $property->getDocComment(), $matches)) {

/**
* @todo check if 'xsd:element' must be used here (it may not be
* compatible with using 'complexType' node for describing other
Expand Down
15 changes: 3 additions & 12 deletions test/AutoDiscoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class AutoDiscoverTest extends \PHPUnit_Framework_TestCase
{

/**
* @var AutoDiscover
*/
Expand Down Expand Up @@ -219,7 +218,6 @@ public function testAutoDiscoverConstructorWsdlClassException()
*/
public function testSetServiceName($newName, $shouldBeValid)
{

if ($shouldBeValid == false) {
$this->setExpectedException('InvalidArgumentException');
}
Expand Down Expand Up @@ -289,7 +287,6 @@ public function testGetUriException()

public function testClassMap()
{

$classMap = array(
'TestClass' => 'test_class'
);
Expand Down Expand Up @@ -1197,7 +1194,6 @@ public function testChangeWsdlUriInConstructor($uri, $expectedUri)

public function testSetNonStringNonZendUriUriThrowsException()
{

$server = new AutoDiscover();

$this->setExpectedException(
Expand Down Expand Up @@ -1258,8 +1254,7 @@ public function dataProviderValidUris()
*
*/
public function testUsingClassWithMethodsWithMultipleDefaultParameterValues(
)
{
) {
$this->server->setClass(
'\ZendTest\Soap\TestAsset\TestFixingMultiplePrototypes'
);
Expand Down Expand Up @@ -1324,8 +1319,7 @@ public function testComplexTypesThatAreUsedMultipleTimesAreRecoginzedOnce()
* @group ZF-5604
*/
public function testReturnSameArrayOfObjectsResponseOnDifferentMethodsWhenArrayComplex(
)
{
) {
$this->server->setComplexTypeStrategy(
new \Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplex
);
Expand All @@ -1349,8 +1343,7 @@ public function testReturnSameArrayOfObjectsResponseOnDifferentMethodsWhenArrayC
* @group ZF-5430
*/
public function testReturnSameArrayOfObjectsResponseOnDifferentMethodsWhenArraySequence(
)
{
) {
$this->server->setComplexTypeStrategy(
new \Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeSequence
);
Expand Down Expand Up @@ -1473,7 +1466,6 @@ public function testHandle()
*/
public function assertSpecificNodeNumberInXPath($n, $xpath, $msg = null)
{

$nodes = $this->xpath->query($xpath);
if (!($nodes instanceof \DOMNodeList)) {
$this->fail('Nodes not found. Invalid XPath expression ?');
Expand All @@ -1485,7 +1477,6 @@ public function assertSpecificNodeNumberInXPath($n, $xpath, $msg = null)

public function assertAttributesOfNodes($attributes, $nodeList)
{

$c = count($attributes);

$keys = array_keys($attributes);
Expand Down
2 changes: 1 addition & 1 deletion test/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
if (!extension_loaded('soap')) {
$this->markTestSkipped('SOAP Extension is not loaded');
$this->markTestSkipped('SOAP Extension is not loaded');
}
}

Expand Down
3 changes: 1 addition & 2 deletions test/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
if (!extension_loaded('soap')) {
$this->markTestSkipped('SOAP Extension is not loaded');
$this->markTestSkipped('SOAP Extension is not loaded');
}
}

Expand Down Expand Up @@ -690,7 +690,6 @@ public function testDeregisterFaultException($exception)
*/
public function testIsRegisteredAsFaultException($exception)
{

$server = new Server();
$server->registerFaultException($exception);

Expand Down
1 change: 0 additions & 1 deletion test/Wsdl/ArrayOfTypeComplexStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/
class ArrayOfTypeComplexStrategyTest extends WsdlTestHelper
{

public function setUp()
{
$this->strategy = new ArrayOfTypeComplex();
Expand Down
18 changes: 8 additions & 10 deletions test/Wsdl/ArrayOfTypeSequenceStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public function testNestedTypesDefinitions($stringDefinition, $definedTypeName,
$this->assertEquals('tns:'.$definedTypeName, $return);

foreach ($nestedTypeNames as $nestedTypeName => $typeName) {

$nodes = $this->xpath->query('//wsdl:types/xsd:schema/xsd:complexType[@name="'.$nestedTypeName.'"]');
$this->assertEquals(1, $nodes->length, 'Invalid first level of nested element definition');

Expand Down Expand Up @@ -221,25 +220,24 @@ public function testAddComplexTypeArrayOfObject()
'ArrayOfComplexTypeB' => 'ComplexTypeB',
'ArrayOfComplexTypeA' => 'ComplexTypeA'
) as $arrayTypeName => $typeName) {

$nodes = $this->xpath->query(
$nodes = $this->xpath->query(
'//wsdl:types/xsd:schema/xsd:complexType[@name="'.$arrayTypeName.'"]'
);
$this->assertEquals(1, $nodes->length, 'Missing complex type definition.');
$this->assertEquals(1, $nodes->length, 'Missing complex type definition.');

$nodes = $this->xpath->query('xsd:sequence/xsd:element', $nodes->item(0));
$this->assertEquals(1, $nodes->length, 'Missing complex type element declaration');
$nodes = $this->xpath->query('xsd:sequence/xsd:element', $nodes->item(0));
$this->assertEquals(1, $nodes->length, 'Missing complex type element declaration');

$this->assertEquals('item', $nodes->item(0)->getAttribute('name'),
$this->assertEquals('item', $nodes->item(0)->getAttribute('name'),
'Wrong complex type element name attribute'
);
$this->assertEquals('tns:'.$typeName, $nodes->item(0)->getAttribute('type'),
$this->assertEquals('tns:'.$typeName, $nodes->item(0)->getAttribute('type'),
'Wrong complex type type attribute value'
);
$this->assertEquals('0', $nodes->item(0)->getAttribute('minOccurs'),
$this->assertEquals('0', $nodes->item(0)->getAttribute('minOccurs'),
'Wrong complex type minOccurs attribute value'
);
$this->assertEquals('unbounded', $nodes->item(0)->getAttribute('maxOccurs'),
$this->assertEquals('unbounded', $nodes->item(0)->getAttribute('maxOccurs'),
'Wrong complex type maxOccurs attribute value'
);
}
Expand Down
1 change: 0 additions & 1 deletion test/Wsdl/CompositeStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
class CompositeStrategyTest extends WsdlTestHelper
{

public function setUp()
{
// override parent setup because it is needed only in one method
Expand Down
14 changes: 0 additions & 14 deletions test/WsdlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
**/
class WsdlTest extends WsdlTestHelper
{

public function testConstructor()
{
$this->assertEquals(Wsdl::WSDL_NS_URI, $this->dom->lookupNamespaceUri(null));
Expand Down Expand Up @@ -71,7 +70,6 @@ public function testSetUriWithZendUriChangesDomDocumentWsdlStructureTnsAndTarget

$this->assertEquals($expectedUri, $this->dom->lookupNamespaceUri('tns'));
$this->assertEquals($expectedUri, $this->dom->documentElement->getAttribute('targetNamespace'));

}

/**
Expand All @@ -88,7 +86,6 @@ public function testObjectConstructionWithDifferentURI($uri, $expectedUri)

$this->assertEquals($expectedUri, $dom->lookupNamespaceUri('tns'));
$this->assertEquals($expectedUri, $dom->documentElement->getAttribute('targetNamespace'));

}

/**
Expand Down Expand Up @@ -141,7 +138,6 @@ public function testAddMessage($parameters)
$part = $this->xpath->query('wsdl:part[@name="'.$parameterName.'"]', $messageNodes->item(0));
$this->assertEquals($parameterType, $part->item(0)->getAttribute('type'));
}

}

/**
Expand Down Expand Up @@ -173,7 +169,6 @@ public function testAddComplexMessage($parameters)
$this->assertEquals($parameterDefinition['type'], $part->item(0)->getAttribute('type'));
$this->assertEquals($parameterDefinition['name'], $part->item(0)->getAttribute('name'));
}

}

/**
Expand Down Expand Up @@ -274,7 +269,6 @@ public function testAddBinding()

$this->assertEquals('MyServiceBinding', $bindingNodes->item(0)->getAttribute('name'));
$this->assertEquals('myPortType', $bindingNodes->item(0)->getAttribute('type'));

}

/**
Expand Down Expand Up @@ -339,7 +333,6 @@ public function testAddBindingOperation($operationName,
'//wsdl:output/soap:body' => $outputArray,
'//wsdl:fault' => $faultArray
) as $query => $ar) {

if (!empty($ar)) {
$nodes = $this->xpath->query($query);

Expand All @@ -355,7 +348,6 @@ public function testAddBindingOperation($operationName,

public function dataProviderForAddBindingOperation()
{

$enc = 'http://schemas.xmlsoap.org/soap/encoding/';

return array(
Expand Down Expand Up @@ -455,7 +447,6 @@ public function dataProviderForAddService()
*/
public function testAddBindingOperationWithAmpersandInUrl($actualUrl, $expectedUrl)
{

$this->wsdl->addPortType('myPortType');
$binding = $this->wsdl->addBinding('MyServiceBinding', 'myPortType');

Expand Down Expand Up @@ -535,7 +526,6 @@ public function testAddDocumentation()
$nodes = $this->wsdl->toDomDocument()->childNodes;
$this->assertEquals(1, $nodes->length);
$this->assertEquals($doc, $nodes->item(0)->nodeValue);

}

public function testAddDocumentationToSomeElmenet()
Expand Down Expand Up @@ -566,7 +556,6 @@ public function testAddDocumentationToSetInsertsBefore()

$nodes = $this->xpath->query('//wsdl:message[@name="myMessage"]/*[1]');
$this->assertEquals('documentation', $nodes->item(0)->nodeName);

}

public function testDumpToFile()
Expand Down Expand Up @@ -796,7 +785,6 @@ public function testMultipleSequenceDefinitionsOfSameTypeWillBeRecognizedOnceByS

$nodes = $this->xpath->query('//wsdl:types/xsd:schema/xsd:complexType[@name="ArrayOfInt"]');
$this->assertEquals(1, $nodes->length, "ArrayOfInt should appear only once.");

}

public function testClassMap()
Expand Down Expand Up @@ -845,6 +833,4 @@ public function testAddElement()

$this->assertEquals(count($element['sequence']), $n);
}


}
Loading

0 comments on commit 8f46a80

Please sign in to comment.