From d257ce2e93dfe52151be3d0386fcc4ea281ca8d5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 7 Dec 2020 12:39:39 -0600 Subject: [PATCH] formatting --- src/Illuminate/Http/Client/Factory.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Illuminate/Http/Client/Factory.php b/src/Illuminate/Http/Client/Factory.php index 64e18f60935c..591d9dec71eb 100644 --- a/src/Illuminate/Http/Client/Factory.php +++ b/src/Illuminate/Http/Client/Factory.php @@ -263,7 +263,7 @@ public function assertSentCount($count) } /** - * Assert that requests were sent in the order specified. + * Assert that the given request were sent in the given order. * * @param array $requestSequence * @return void @@ -273,16 +273,14 @@ public function assertSentInOrder($requestSequence) $this->assertSentCount(count($requestSequence)); foreach ($requestSequence as $orderPosition => $url) { + $callback = is_callable($url) ? $url : function($request) use ($url) { + return $request->url() == $url; + }; - $callback = $url; - if(!is_callable($url)){ - $callback = function($request) use ($url) { - return $request->url() == $url; - }; - } - - PHPUnit::assertTrue( $callback( $this->recorded[ $orderPosition ][0], $this->recorded[ $orderPosition ][1] ) ); - + PHPUnit::assertTrue($callback( + $this->recorded[$orderPosition][0], + $this->recorded[$orderPosition][1] + )); } }