Skip to content

Commit

Permalink
Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentBean committed Nov 12, 2024
1 parent 6e4ef96 commit 5516afd
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/Events/DynamicsResponseEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ class DynamicsResponseEvent
public function __construct(
public Response $response,
public string $connection,
) {
}
) {}
}
3 changes: 1 addition & 2 deletions src/Events/DynamicsTimeoutEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ class DynamicsTimeoutEvent

public function __construct(
public string $connection,
) {
}
) {}
}
4 changes: 1 addition & 3 deletions src/Listeners/ResponseAvailabilityListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

class ResponseAvailabilityListener
{
public function __construct(protected RegistersUnavailability $unavailability)
{
}
public function __construct(protected RegistersUnavailability $unavailability) {}

public function handle(DynamicsResponseEvent $event): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Listeners/TimeoutAvailabilityListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

class TimeoutAvailabilityListener
{
public function __construct(protected RegistersUnavailability $unavailability)
{
}
public function __construct(protected RegistersUnavailability $unavailability) {}

public function handle(DynamicsTimeoutEvent $event): void
{
Expand Down
1 change: 0 additions & 1 deletion src/OData/BaseResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use JustBetter\DynamicsClient\Contracts\Availability\ChecksAvailability;
use JustBetter\DynamicsClient\Contracts\ClientFactoryContract;
use JustBetter\DynamicsClient\Exceptions\DynamicsException;
use JustBetter\DynamicsClient\Exceptions\UnreachableException;
use JustBetter\DynamicsClient\Query\QueryBuilder;
use SaintSystems\OData\Entity;
use SaintSystems\OData\ODataClient;
Expand Down
4 changes: 2 additions & 2 deletions tests/Client/ClientHttpProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class ClientHttpProviderTest extends TestCase
#[Test]
public function it_throws_when_unavailable(): void
{
$this->mock(ChecksAvailability::class, function(MockInterface $mock): void {
$mock->shouldReceive('check')->with('default')->andReturnFalse();
$this->mock(ChecksAvailability::class, function (MockInterface $mock): void {
$mock->shouldReceive('check')->with('default')->andReturnFalse();
});

config()->set('dynamics.connections.default.availability.throw', true);
Expand Down
5 changes: 2 additions & 3 deletions tests/Listeners/ResponseAvailabilityListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@ public function it_does_not_trigger_on_ok_status(): void
{
Item::fake();

$this->mock(RegistersUnavailability::class, function(MockInterface $mock): void {
$this->mock(RegistersUnavailability::class, function (MockInterface $mock): void {
$mock->shouldNotReceive('register');
});

Http::fake([
'*' => Http::response(null, 200),
])->preventStrayRequests();


Item::query('default')->get();
}

#[Test]
public function it_calls_action(): void
{
Item::fake();
$this->mock(RegistersUnavailability::class, function(MockInterface $mock): void {
$this->mock(RegistersUnavailability::class, function (MockInterface $mock): void {
$mock->shouldReceive('register')->with('default')->once();
});

Expand Down
2 changes: 1 addition & 1 deletion tests/Listeners/TimeoutAvailabilityListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TimeoutAvailabilityListenerTest extends TestCase
#[Test]
public function it_calls_action(): void
{
$this->mock(RegistersUnavailability::class, function(MockInterface $mock): void {
$this->mock(RegistersUnavailability::class, function (MockInterface $mock): void {
$mock->shouldReceive('register')->with('::connection::')->once();
});

Expand Down

0 comments on commit 5516afd

Please sign in to comment.