Skip to content

Commit

Permalink
Whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius van Witzenburg committed Oct 11, 2016
1 parent 04e79cd commit a0c6325
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
json_path: coveralls-upload.json
json_path: coveralls-upload.json
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ after_script:
- if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then php vendor/bin/coveralls --coverage_clover=clover.xml -v ; fi

notifications:
slack: slimphp:0RNzx2JuhkAqIf0MXcUZ0asT
slack: slimphp:0RNzx2JuhkAqIf0MXcUZ0asT
4 changes: 2 additions & 2 deletions Slim/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ public function respond(ResponseInterface $response)
while ($amountToRead > 0 && !$body->eof()) {
$data = $body->read(min($chunkSize, $amountToRead));
echo $data;

$amountToRead -= strlen($data);

if (connection_status() != CONNECTION_NORMAL) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Slim/DefaultServicesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function register($container)
$routerCacheFile = $container->get('settings')['routerCacheFile'];
}


$router = (new Router)->setCacheFile($routerCacheFile);
if (method_exists($router, 'setContainer')) {
$router->setContainer($container);
Expand Down
2 changes: 1 addition & 1 deletion Slim/Handlers/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
case 'text/html':
$output = $this->renderHtmlErrorMessage($exception);
break;

default:
throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType);
}
Expand Down
2 changes: 1 addition & 1 deletion Slim/Handlers/NotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
case 'text/html':
$output = $this->renderHtmlNotFoundOutput($request);
break;

default:
throw new UnexpectedValueException('Cannot render unknown content type ' . $contentType);
}
Expand Down
2 changes: 1 addition & 1 deletion Slim/Http/Cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected function toHeader($name, array $properties)
if (isset($properties['secure']) && $properties['secure']) {
$result .= '; secure';
}

if (isset($properties['hostonly']) && $properties['hostonly']) {
$result .= '; HostOnly';
}
Expand Down
4 changes: 2 additions & 2 deletions Slim/Routable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
abstract class Routable
{
use CallableResolverAwareTrait;

/**
* Route callable
*
Expand Down Expand Up @@ -93,7 +93,7 @@ public function add($callable)
$this->middleware[] = new DeferredCallable($callable, $this->container);
return $this;
}

/**
* Set the route pattern
*
Expand Down
6 changes: 3 additions & 3 deletions tests/Handlers/AbstractHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AbstractHandlerTest extends \PHPUnit_Framework_TestCase
public function testHalfValidContentType()
{
$req = $this->getMockBuilder('Slim\Http\Request')->disableOriginalConstructor()->getMock();

$req->expects($this->any())->method('getHeaderLine')->will($this->returnValue('unknown/+json'));

$abstractHandler = $this->getMockForAbstractClass(AbstractHandler::class);
Expand Down Expand Up @@ -49,7 +49,7 @@ public function testAcceptableMediaTypeIsNotFirstInList()
$request = $this->getMockBuilder('Slim\Http\Request')
->disableOriginalConstructor()
->getMock();

$request->expects($this->any())
->method('getHeaderLine')
->willReturn('text/plain,text/html');
Expand All @@ -61,7 +61,7 @@ public function testAcceptableMediaTypeIsNotFirstInList()

// use a mock object here as AbstractHandler cannot be directly instantiated
$abstractHandler = $this->getMockForAbstractClass(AbstractHandler::class);

// call determineContentType()
$return = $method->invoke($abstractHandler, $request);

Expand Down
2 changes: 1 addition & 1 deletion tests/Http/UploadedFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function testMoveTo(UploadedFile $uploadedFile)

return $uploadedFile;
}

/**
* @depends testMoveTo
* @param UploadedFile $uploadedFile
Expand Down
8 changes: 4 additions & 4 deletions tests/Mocks/SmallChunksStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ class SmallChunksStream implements StreamInterface
{
const CHUNK_SIZE = 10;
const SIZE = 40;

/**
* @var int
*/
private $amountToRead;

public function __construct()
{
$this->amountToRead = self::SIZE;
}

public function __toString()
{
throw new \Exception('not implemented');
Expand Down Expand Up @@ -82,7 +82,7 @@ public function read($length)
{
$size = min($this->amountToRead, self::CHUNK_SIZE, $length);
$this->amountToRead -= $size;

return str_repeat('.', min($length, $size));
}

Expand Down
8 changes: 4 additions & 4 deletions tests/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public function testGetMethodsReturnsArrayWhenContructedWithString()
$route = new Route('GET', '/hello', function ($req, $res, $args) {
// Do something
});

$this->assertEquals(['GET'], $route->getMethods());
}

public function testGetMethods()
{
$this->assertEquals(['GET', 'POST'], $this->routeFactory()->getMethods());
}

public function testGetPattern()
{
$this->assertEquals('/hello/{name}', $this->routeFactory()->getPattern());
Expand Down Expand Up @@ -417,7 +417,7 @@ public function testInvokeDeferredCallable()
$this->assertInstanceOf('Slim\Http\Response', $result);
$this->assertEquals([$container['CallableTest'], 'toCall'], InvocationStrategyTest::$LastCalledFor);
}

/**
* Ensure that the pattern can be dynamically changed
*/
Expand Down

0 comments on commit a0c6325

Please sign in to comment.