Skip to content

Commit f4ed70d

Browse files
committed
fix: lint
1 parent ad01c48 commit f4ed70d

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

lib/EasyPost/Util/InternalUtil.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,15 @@ public static function convertToEasyPostObject(EasyPostClient|null $client, mixe
181181
* @param array<string> $carriers
182182
* @param array<string> $services
183183
* @param string|null $ratesKey
184-
* @return Rate|PickupRate
184+
* @return object
185185
* @throws EasyPostException
186186
*/
187187
public static function getLowestObjectRate(
188188
?EasyPostObject $easypostObject,
189189
?array $carriers = [],
190190
?array $services = [],
191191
?string $ratesKey = 'rates'
192-
): Rate|PickupRate {
192+
): object {
193193
$lowestRate = false;
194194
$carriersInclude = [];
195195
$carriersExclude = [];
@@ -235,8 +235,11 @@ public static function getLowestObjectRate(
235235
continue;
236236
}
237237

238-
if (!$lowestRate || floatval($easypostObject->$ratesKey[$i]->rate) < floatval($lowestRate->rate)) {
239-
$lowestRate = clone ($easypostObject->$ratesKey[$i]);
238+
if (
239+
!$lowestRate ||
240+
floatval($easypostObject->$ratesKey[$i]->rate) < floatval($lowestRate->rate) // @phpstan-ignore-line
241+
) {
242+
$lowestRate = clone($easypostObject->$ratesKey[$i]);
240243
}
241244
}
242245

test/EasyPost/Fixture.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,12 @@ public static function lumaPlannedShipDate(): string
296296
{
297297
return '2025-06-12';
298298
}
299+
300+
/**
301+
* @return array<mixed>
302+
*/
303+
public static function referralUser(): array
304+
{
305+
return self::readFixtureData()['users']['referral'];
306+
}
299307
}

test/EasyPost/ReferralCustomerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function testCreate(): void
4343
TestUtil::setupCassette('referral_customers/create.yml');
4444

4545
$referral = self::$client->referralCustomer->create([
46-
'name' => 'Test Referral',
47-
'email' => 'test@test.com',
48-
'phone' => '8888888888'
46+
'name' => Fixture::referralUser()['name'],
47+
'email' => Fixture::referralUser()['email'],
48+
'phone' => Fixture::referralUser()['phone'],
4949
]);
5050

5151
$this->assertInstanceOf(User::class, $referral);

0 commit comments

Comments
 (0)