Skip to content

Commit

Permalink
Merge branch 'master' of github.com:laravel/framework
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 12, 2017
2 parents 37d323a + e37d487 commit 8598534
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Broadcasting/BroadcastManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Illuminate\Broadcasting;

use Pusher;
use Closure;
use Pusher\Pusher;
use Psr\Log\LoggerInterface;
use InvalidArgumentException;
use Illuminate\Broadcasting\Broadcasters\LogBroadcaster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Illuminate\Broadcasting\Broadcasters;

use Pusher;
use Pusher\Pusher;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Broadcasting\BroadcastException;
Expand All @@ -13,14 +13,14 @@ class PusherBroadcaster extends Broadcaster
/**
* The Pusher SDK instance.
*
* @var \Pusher
* @var Pusher
*/
protected $pusher;

/**
* Create a new broadcaster instance.
*
* @param \Pusher $pusher
* @param Pusher $pusher
* @return void
*/
public function __construct(Pusher $pusher)
Expand Down Expand Up @@ -112,7 +112,7 @@ public function broadcast(array $channels, $event, array $payload = [])
/**
* Get the Pusher SDK instance.
*
* @return \Pusher
* @return Pusher
*/
public function getPusher()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Broadcasting/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
},
"suggest": {
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0)."
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~3.0)."
},
"config": {
"sort-packages": true
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Http/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public function content()
*/
public function getOriginalContent()
{
return $this->original;
$original = $this->original;

return $original instanceof self ? $original->{__FUNCTION__}() : $original;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/Http/HttpResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ public function testGetOriginalContent()
$this->assertSame($arr, $response->getOriginalContent());
}

public function testGetOriginalContentRetrievesTheFirstOriginalContent()
{
$previousResponse = new \Illuminate\Http\Response(['foo' => 'bar']);
$response = new \Illuminate\Http\Response($previousResponse);

$this->assertSame(['foo' => 'bar'], $response->getOriginalContent());
}

public function testSetAndRetrieveStatusCode()
{
$response = new \Illuminate\Http\Response('foo');
Expand Down

0 comments on commit 8598534

Please sign in to comment.