Skip to content
This repository has been archived by the owner on Apr 28, 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 fa3d132 commit 3df4d2a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/AbstractValue.php
Expand Up @@ -290,8 +290,7 @@ protected static function _phpVarToNativeXmlRpc($value)
}
}

switch (self::getXmlRpcTypeByValue($value))
{
switch (self::getXmlRpcTypeByValue($value)) {
case self::XMLRPC_TYPE_DATETIME:
return new Value\DateTime($value);

Expand Down
12 changes: 6 additions & 6 deletions src/Generator/AbstractGenerator.php
Expand Up @@ -36,7 +36,7 @@ public function __construct($encoding = 'UTF-8')

/**
* Initialize internal objects
*
*
* @return void
*/
abstract protected function _init();
Expand All @@ -45,7 +45,7 @@ abstract protected function _init();
* Start XML element
*
* Method opens a new XML element with an element name and an optional value
*
*
* @param string $name XML tag name
* @param string $value Optional value of the XML tag
* @return AbstractGenerator Fluent interface
Expand Down Expand Up @@ -77,7 +77,7 @@ public function closeElement($name)

/**
* Return encoding
*
*
* @return string
*/
public function getEncoding()
Expand All @@ -87,8 +87,8 @@ public function getEncoding()

/**
* Set XML encoding
*
* @param string $encoding
*
* @param string $encoding
* @return AbstractGenerator
*/
public function setEncoding($encoding)
Expand Down Expand Up @@ -146,7 +146,7 @@ abstract protected function _writeTextData($text);

/**
* End XML element
*
*
* @param string $name
*/
abstract protected function _closeElement($name);
Expand Down
16 changes: 10 additions & 6 deletions test/ClientTest.php
Expand Up @@ -649,13 +649,13 @@ public function testHandlesLeadingOrTrailingWhitespaceInChunkedResponseProperly(
$baseUri = "http://foo:80";
$this->httpAdapter = new Adapter\Test();
$this->httpClient = new Http\Client(null, array('adapter' => $this->httpAdapter));

$respBody = file_get_contents(dirname(__FILE__) . "/_files/ZF1897-response-chunked.txt");
$this->httpAdapter->setResponse($respBody);

$this->xmlrpcClient = new Client($baseUri);
$this->xmlrpcClient->setHttpClient($this->httpClient);

$this->assertEquals('FOO', $this->xmlrpcClient->call('foo'));
}

Expand Down Expand Up @@ -713,8 +713,10 @@ public function mockHttpClient()
}

/** related to ZF-8478 */
class PythonSimpleXMLRPCServerWithUnsupportedIntrospection extends Client\ServerProxy {
public function __call($method, $args) {
class PythonSimpleXMLRPCServerWithUnsupportedIntrospection extends Client\ServerProxy
{
public function __call($method, $args)
{
if ($method == 'methodSignature') {
return 'signatures not supported';
}
Expand All @@ -723,8 +725,10 @@ public function __call($method, $args) {
}

/** related to ZF-8478 */
class TestClient extends Client {
public function getProxy($namespace = '') {
class TestClient extends Client
{
public function getProxy($namespace = '')
{
if (empty($this->_proxyCache[$namespace])) {
$this->_proxyCache[$namespace] = new PythonSimpleXMLRPCServerWithUnsupportedIntrospection($this, $namespace);
}
Expand Down
6 changes: 3 additions & 3 deletions test/FaultTest.php
Expand Up @@ -159,19 +159,19 @@ public function testLoadXmlThrowsExceptionOnInvalidInput2()
$this->setExpectedException('Zend\XmlRpc\Exception\InvalidArgumentException', 'Invalid fault structure');
$this->assertFalse($this->_fault->loadXml('<methodResponse><fault/></methodResponse>'));
}

public function testLoadXmlThrowsExceptionOnInvalidInput3()
{
$this->setExpectedException('Zend\XmlRpc\Exception\InvalidArgumentException', 'Invalid fault structure');
$this->_fault->loadXml('<methodResponse><fault/></methodResponse>');
}

public function testLoadXmlThrowsExceptionOnInvalidInput4()
{
$this->setExpectedException('Zend\XmlRpc\Exception\InvalidArgumentException', 'Fault code and string required');
$this->_fault->loadXml('<methodResponse><fault><value><struct/></value></fault></methodResponse>');
}

/**
* Zend_XmlRpc_Fault::isFault() test
*/
Expand Down
2 changes: 1 addition & 1 deletion test/RequestTest.php
Expand Up @@ -170,7 +170,7 @@ public function testLoadXml()

$xml = $dom->saveXml();


$parsed = $this->_request->loadXml($xml);
$this->assertTrue($parsed, $xml);

Expand Down
10 changes: 5 additions & 5 deletions test/ResponseTest.php
Expand Up @@ -212,27 +212,27 @@ public function testSetGetEncoding()
public function testLoadXmlCreatesFaultWithMissingNodes()
{
$sxl = new \SimpleXMLElement('<?xml version="1.0"?><methodResponse><params><param>foo</param></params></methodResponse>');

$this->assertFalse($this->_response->loadXml($sxl->asXML()));
$this->assertTrue($this->_response->isFault());
$fault = $this->_response->getFault();
$this->assertEquals(653, $fault->getCode());
}

public function testLoadXmlCreatesFaultWithMissingNodes2()
{
$sxl = new \SimpleXMLElement('<?xml version="1.0"?><methodResponse><params>foo</params></methodResponse>');

$this->assertFalse($this->_response->loadXml($sxl->asXML()));
$this->assertTrue($this->_response->isFault());
$fault = $this->_response->getFault();
$this->assertEquals(653, $fault->getCode());
}

public function testLoadXmlThrowsExceptionWithMissingNodes3()
{
$sxl = new \SimpleXMLElement('<?xml version="1.0"?><methodResponse><bar>foo</bar></methodResponse>');

$this->assertFalse($this->_response->loadXml($sxl->asXML()));
$this->assertTrue($this->_response->isFault());
$fault = $this->_response->getFault();
Expand Down
2 changes: 1 addition & 1 deletion test/ValueTest.php
Expand Up @@ -583,7 +583,7 @@ public function testMarshalDateTimeFromNativeStringProducesIsoOutput()

public function testMarshalDateTimeFromInvalidString()
{
$this->setExpectedException('Zend\XmlRpc\Exception\ValueException',
$this->setExpectedException('Zend\XmlRpc\Exception\ValueException',
"The timezone could not be found in the database");
AbstractValue::getXmlRpcValue('foobarbaz', AbstractValue::XMLRPC_TYPE_DATETIME);
}
Expand Down

0 comments on commit 3df4d2a

Please sign in to comment.