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

Commit

Permalink
[PSR-2] fixers=braces,elseif,short_tag,php_closing_tag,trailing_space…
Browse files Browse the repository at this point in the history
…s,linefeed

Applied php-cs-fixer --fixers=braces,elseif,short_tag,php_closing_tag,trailing_spaces,linefeed
  • Loading branch information
Maks3w committed Jul 12, 2012
1 parent fafc8ae commit 88de986
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ 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 if ($prototype->getReturnType() != "void") {
} elseif ($prototype->getReturnType() != "void") {
// RPC style: add the return value as a typed part
$args['return'] = array('type' => $wsdl->getType($this->_discoveryStrategy->getFunctionReturnType($function, $prototype)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Wsdl/ComplexTypeStrategy/ArrayOfTypeSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function addComplexType($type)
}

return $complexType;
} else if (($soapType = $this->scanRegisteredTypes($type)) !== null) {
} elseif (($soapType = $this->scanRegisteredTypes($type)) !== null) {
// Existing complex type
return $soapType;
} else {
Expand Down
36 changes: 18 additions & 18 deletions test/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testSoapVersion()
$this->assertEquals(SOAP_1_2, $server->getSoapVersion());
$server->setSoapVersion(SOAP_1_1);
$this->assertEquals(SOAP_1_1, $server->getSoapVersion());

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid soap version specified');
$server->setSoapVersion('bogus');
}
Expand All @@ -134,7 +134,7 @@ public function testValidateUrn()
$server = new Server();
$this->assertTrue($server->validateUrn('http://framework.zend.com/'));
$this->assertTrue($server->validateUrn('urn:soapHandler/GetOpt'));

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid URN');
$server->validateUrn('bogosity');
}
Expand All @@ -146,7 +146,7 @@ public function testSetActor()
$this->assertNull($server->getActor());
$server->setActor('http://framework.zend.com/');
$this->assertEquals('http://framework.zend.com/', $server->getActor());

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid URN');
$server->setActor('bogus');
}
Expand All @@ -167,7 +167,7 @@ public function testSetUri()
$this->assertNull($server->getUri());
$server->setUri('http://framework.zend.com/');
$this->assertEquals('http://framework.zend.com/', $server->getUri());

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid URN');
$server->setUri('bogus');
}
Expand All @@ -192,19 +192,19 @@ public function testSetClassmap()
$server->setClassmap($classmap);
$this->assertTrue($classmap == $server->getClassmap());
}

public function testSetClassmapThrowsExceptionOnBogusStringParameter()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Classmap must be an array');
$server->setClassmap('bogus');
}

public function testSetClassmapThrowsExceptionOnBogusArrayParameter()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid class in class map');
$server->setClassmap(array('soapTypeName', 'bogusClassName'));
}
Expand All @@ -228,7 +228,7 @@ public function testSetWsdl()
$this->assertNull($server->getWSDL());
$server->setWSDL(__DIR__.'/_files/wsdl_example.wsdl');
$this->assertEquals(__DIR__.'/_files/wsdl_example.wsdl', $server->getWSDL());

//$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'foo');
$server->setWSDL(__DIR__.'/_files/bogus.wsdl');
}
Expand Down Expand Up @@ -264,7 +264,7 @@ public function testAddFunction()
public function testAddBogusFunctionAsInteger()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid function specified');
$server->addFunction(126);
}
Expand All @@ -280,7 +280,7 @@ public function testAddBogusFunctionsAsString()
public function testAddBogusFunctionsAsArray()
{
$server = new Server();

$functions = array('\ZendTest\Soap\TestAsset\TestFunc5',
'bogus_function',
'\ZendTest\Soap\TestAsset\TestFunc6');
Expand Down Expand Up @@ -324,7 +324,7 @@ public function testSetClassTwiceThrowsException()
{
$server = new Server();
$server->setClass('\ZendTest\Soap\TestAsset\ServerTestClass');

$this->setExpectedException(
'Zend\Soap\Exception\InvalidArgumentException',
'A class has already been registered with this soap server instance'
Expand Down Expand Up @@ -368,37 +368,37 @@ public function testSetObject()
$r = $server->setObject(new TestAsset\ServerTestClass());
$this->assertSame($server, $r);
}

/**
* @group ZF-4366
*/
public function testSetObjectThrowsExceptionWithBadInput1()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid object argument (integer)');
$server->setObject(465);
}

/**
* @group ZF-4366
*/
public function testSetObjectThrowsExceptionWithBadInput2()
{
$server = new Server();

$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'Invalid object argument (integer)');
$int = 1;
$server->setObject($int);
}

/**
* @group ZF-4366
*/
public function testSetObjectThrowsExceptionWithBadInput3()
{
$server = new Server();

//$this->setExpectedException('Zend\Soap\Exception\InvalidArgumentException', 'foo');
$server->setObject(new TestAsset\ServerTestClass());
}
Expand Down
2 changes: 1 addition & 1 deletion test/TestAsset/MyCalculatorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace ZendTest\Soap\TestAsset;

/**
* MyCalculatorService
* MyCalculatorService
*
* Class used in DocumentLiteralWrapperTest
*/
Expand Down
3 changes: 2 additions & 1 deletion test/TestAsset/WsdlTestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
/**
* Test Class
*/
class WsdlTestClass {
class WsdlTestClass
{
/**
* @var integer
*/
Expand Down
42 changes: 28 additions & 14 deletions test/TestAsset/commontypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ function testFunc($a=100, $b=200, $d=300)
* @package Zend_Soap
* @subpackage UnitTests
*/
class Test {
class Test
{
/**
* Test Function 1
*
Expand Down Expand Up @@ -320,20 +321,23 @@ class MyService
* @param string $foo
* @return \ZendTest\Soap\TestAsset\MyResponse[]
*/
public function foo($foo) {
public function foo($foo)
{
}
/**
* @param string $bar
* @return \ZendTest\Soap\TestAsset\MyResponse[]
*/
public function bar($bar) {
public function bar($bar)
{
}

/**
* @param string $baz
* @return \ZendTest\Soap\TestAsset\MyResponse[]
*/
public function baz($baz) {
public function baz($baz)
{
}
}

Expand All @@ -348,27 +352,31 @@ class MyServiceSequence
* @param string $foo
* @return string[]
*/
public function foo($foo) {
public function foo($foo)
{
}
/**
* @param string $bar
* @return string[]
*/
public function bar($bar) {
public function bar($bar)
{
}

/**
* @param string $baz
* @return string[]
*/
public function baz($baz) {
public function baz($baz)
{
}

/**
* @param string $baz
* @return string[][][]
*/
public function bazNested($baz) {
public function bazNested($baz)
{
}
}

Expand Down Expand Up @@ -430,7 +438,8 @@ public function pushOneWay($message)

/* Client test classes */
/** Test Class */
class TestClass {
class TestClass
{
/**
* Test Function 1
*
Expand Down Expand Up @@ -476,7 +485,8 @@ static function testFunc4()
}

/** Test class 2 */
class TestData1 {
class TestData1
{
/**
* Property1
*
Expand All @@ -493,7 +503,8 @@ class TestData1 {
}

/** Test class 2 */
class TestData2 {
class TestData2
{
/**
* Property1
*
Expand All @@ -509,7 +520,8 @@ class TestData2 {
public $property2;
}

class MockSoapServer {
class MockSoapServer
{
public $handle = null;
public function handle()
{
Expand All @@ -518,9 +530,11 @@ public function handle()
public function __call($name, $args) {}
}

class MockServer extends \Zend\Soap\Server {
class MockServer extends \Zend\Soap\Server
{
public $mockSoapServer = null;
protected function _getSoap() {
protected function _getSoap()
{
$this->mockSoapServer = new MockSoapServer();
return $this->mockSoapServer;
}
Expand Down
24 changes: 16 additions & 8 deletions test/_files/commontypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function testFunc($a=100, $b=200, $d=300)
* @package Zend_Soap
* @subpackage UnitTests
*/
class Zend_Soap_AutoDiscover_Test {
class Zend_Soap_AutoDiscover_Test
{
/**
* Test Function 1
*
Expand Down Expand Up @@ -318,20 +319,23 @@ class Zend_Soap_AutoDiscover_MyService
* @param string $foo
* @return Zend_Soap_AutoDiscover_MyResponse[]
*/
public function foo($foo) {
public function foo($foo)
{
}
/**
* @param string $bar
* @return Zend_Soap_AutoDiscover_MyResponse[]
*/
public function bar($bar) {
public function bar($bar)
{
}

/**
* @param string $baz
* @return Zend_Soap_AutoDiscover_MyResponse[]
*/
public function baz($baz) {
public function baz($baz)
{
}
}

Expand All @@ -346,27 +350,31 @@ class Zend_Soap_AutoDiscover_MyServiceSequence
* @param string $foo
* @return string[]
*/
public function foo($foo) {
public function foo($foo)
{
}
/**
* @param string $bar
* @return string[]
*/
public function bar($bar) {
public function bar($bar)
{
}

/**
* @param string $baz
* @return string[]
*/
public function baz($baz) {
public function baz($baz)
{
}

/**
* @param string $baz
* @return string[][][]
*/
public function bazNested($baz) {
public function bazNested($baz)
{
}
}

Expand Down

0 comments on commit 88de986

Please sign in to comment.