Skip to content

Commit

Permalink
Run new php-cs-fixer against code
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Jan 2, 2024
1 parent 3051fb2 commit e7e3aa6
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 61 deletions.
6 changes: 3 additions & 3 deletions src/MinFraud.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private function validateAndAdd(string $className, string $key, array $values):
* @throws WebServiceException when some other error occurs. This also
* serves as the base class for the above exceptions.
*
* @return \MaxMind\MinFraud\Model\Score minFraud Score model object
* @return Score minFraud Score model object
*/
public function score(): Score
{
Expand All @@ -356,7 +356,7 @@ public function score(): Score
* @throws WebServiceException when some other error occurs. This also
* serves as the base class for the above exceptions.
*
* @return \MaxMind\MinFraud\Model\Insights minFraud Insights model object
* @return Insights minFraud Insights model object
*/
public function insights(): Insights
{
Expand All @@ -378,7 +378,7 @@ public function insights(): Insights
* @throws WebServiceException when some other error occurs. This also
* serves as the base class for the above exceptions.
*
* @return \MaxMind\MinFraud\Model\Factors minFraud Factors model object
* @return Factors minFraud Factors model object
*/
public function factors(): Factors
{
Expand Down
4 changes: 2 additions & 2 deletions src/MinFraud/Model/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class CreditCard implements \JsonSerializable
public readonly ?bool $isVirtual;

/**
* @var \MaxMind\MinFraud\Model\Issuer an object containing
* information about the credit card issuer
* @var Issuer an object containing
* information about the credit card issuer
*/
public readonly Issuer $issuer;

Expand Down
4 changes: 2 additions & 2 deletions src/MinFraud/Model/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
class Email implements \JsonSerializable
{
/**
* @var \MaxMind\MinFraud\Model\EmailDomain an object
* containing information about the email domain
* @var EmailDomain an object
* containing information about the email domain
*/
public readonly EmailDomain $domain;

Expand Down
6 changes: 3 additions & 3 deletions src/MinFraud/Model/Factors.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class Factors extends Insights
{
/**
* @var \MaxMind\MinFraud\Model\Subscores an object
* containing scores for many of the individual risk factors that are used to
* calculate the overall risk score
* @var Subscores an object
* containing scores for many of the individual risk factors that are used to
* calculate the overall risk score
*/
public readonly Subscores $subscores;

Expand Down
34 changes: 17 additions & 17 deletions src/MinFraud/Model/Insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
class Insights implements \JsonSerializable
{
/**
* @var \MaxMind\MinFraud\Model\BillingAddress an object
* containing minFraud data related to the billing address used in the
* transaction
* @var BillingAddress an object
* containing minFraud data related to the billing address used in the
* transaction
*/
public readonly BillingAddress $billingAddress;

/**
* @var \MaxMind\MinFraud\Model\CreditCard an object containing
* minFraud data about the credit card used in the transaction
* @var CreditCard an object containing
* minFraud data about the credit card used in the transaction
*/
public readonly CreditCard $creditCard;

/**
* @var \MaxMind\MinFraud\Model\Device this object contains
* information about the device that MaxMind believes is associated with the
* IP address passed in the request
* @var Device this object contains
* information about the device that MaxMind believes is associated with the
* IP address passed in the request
*/
public readonly Device $device;

/**
* @var \MaxMind\MinFraud\Model\Disposition an object
* containing the disposition set by custom rules
* @var Disposition an object
* containing the disposition set by custom rules
*/
public readonly Disposition $disposition;

/**
* @var \MaxMind\MinFraud\Model\Email this object contains
* information about the email address passed in the request
* @var Email this object contains
* information about the email address passed in the request
*/
public readonly Email $email;

Expand All @@ -55,8 +55,8 @@ class Insights implements \JsonSerializable
public readonly string $id;

/**
* @var \MaxMind\MinFraud\Model\IpAddress an object containing
* GeoIP2 and minFraud Insights information about the geolocated IP address
* @var IpAddress an object containing
* GeoIP2 and minFraud Insights information about the geolocated IP address
*/
public readonly IpAddress $ipAddress;

Expand All @@ -76,9 +76,9 @@ class Insights implements \JsonSerializable
public readonly float $riskScore;

/**
* @var \MaxMind\MinFraud\Model\ShippingAddress an object
* containing minFraud data related to the shipping address used in the
* transaction
* @var ShippingAddress an object
* containing minFraud data related to the shipping address used in the
* transaction
*/
public readonly ShippingAddress $shippingAddress;

Expand Down
51 changes: 29 additions & 22 deletions src/MinFraud/Model/IpAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,68 @@
namespace MaxMind\MinFraud\Model;

use GeoIp2\Model\Insights;
use GeoIp2\Record\City;
use GeoIp2\Record\Continent;
use GeoIp2\Record\Country;
use GeoIp2\Record\Postal;
use GeoIp2\Record\RepresentedCountry;
use GeoIp2\Record\Subdivision;
use GeoIp2\Record\Traits;

/**
* Model containing GeoIP2 data and the risk for the IP address.
*/
class IpAddress implements \JsonSerializable
{
/**
* @var \GeoIp2\Record\City city data for the requested IP address
* @var City city data for the requested IP address
*/
public readonly \GeoIp2\Record\City $city;

/**
* @var \GeoIp2\Record\Continent continent data for the requested IP
* address
* @var Continent continent data for the requested IP
* address
*/
public readonly \GeoIp2\Record\Continent $continent;

/**
* @var \GeoIp2\Record\Country Country data for the requested IP address.
* This object represents the country where MaxMind believes the end
* user is located.
* @var Country Country data for the requested IP address.
* This object represents the country where MaxMind believes the end
* user is located.
*/
public readonly \GeoIp2\Record\Country $country;

/**
* @var \GeoIp2\Record\Country Registered country data for the requested
* IP address. This record represents the country where the ISP has
* registered a given IP block and may differ from the user's country.
* @var Country Registered country data for the requested
* IP address. This record represents the country where the ISP has
* registered a given IP block and may differ from the user's country.
*/
public readonly \GeoIp2\Record\Country $registeredCountry;

/**
* @var \MaxMind\MinFraud\Model\GeoIp2Location location data for the requested IP
* address
* @var GeoIp2Location location data for the requested IP
* address
*/
public readonly \MaxMind\MinFraud\Model\GeoIp2Location $location;

/**
* @var \GeoIp2\Record\Subdivision An object representing the most
* specific subdivision returned. If the response did not contain any
* subdivisions, this method returns an empty \GeoIp2\Record\Subdivision
* object.
* @var Subdivision An object representing the most
* specific subdivision returned. If the response did not contain any
* subdivisions, this method returns an empty \GeoIp2\Record\Subdivision
* object.
*/
public readonly \GeoIp2\Record\Subdivision $mostSpecificSubdivision;

/**
* @var \GeoIp2\Record\Postal postal data for the requested IP address
* @var Postal postal data for the requested IP address
*/
public readonly \GeoIp2\Record\Postal $postal;

/**
* @var \GeoIp2\Record\RepresentedCountry Represented country data for
* the requested IP address. The represented country is used for things
* like military bases. It is only present when the represented country
* differs from the country.
* @var RepresentedCountry Represented country data for
* the requested IP address. The represented country is used for things
* like military bases. It is only present when the represented country
* differs from the country.
*/
public readonly \GeoIp2\Record\RepresentedCountry $representedCountry;

Expand Down Expand Up @@ -89,8 +96,8 @@ class IpAddress implements \JsonSerializable
public readonly array $subdivisions;

/**
* @var \GeoIp2\Record\Traits data for the traits of the requested IP
* address
* @var Traits data for the traits of the requested IP
* address
*/
public readonly \GeoIp2\Record\Traits $traits;

Expand Down
8 changes: 4 additions & 4 deletions src/MinFraud/Model/Score.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
class Score implements \JsonSerializable
{
/**
* @var \MaxMind\MinFraud\Model\Disposition an object
* containing the disposition set by custom rules
* @var Disposition an object
* containing the disposition set by custom rules
*/
public readonly Disposition $disposition;

Expand All @@ -29,8 +29,8 @@ class Score implements \JsonSerializable
public readonly string $id;

/**
* @var \MaxMind\MinFraud\Model\ScoreIpAddress an object
* containing the IP risk for the transaction
* @var ScoreIpAddress an object
* containing the IP risk for the transaction
*/
public readonly ScoreIpAddress $ipAddress;

Expand Down
2 changes: 1 addition & 1 deletion src/MinFraud/ReportTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
/**
* @param array $values the transaction parameters
*
* @throws \MaxMind\Exception\InvalidInputException when the request has missing or invalid
* @throws InvalidInputException when the request has missing or invalid
* data
* @throws \MaxMind\Exception\AuthenticationException when there is an issue authenticating the
* request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
use MaxMind\Exception\InvalidInputException;
use MaxMind\MinFraud\ReportTransaction;
use MaxMind\Test\MinFraud\ReportTransaction\ReportTransactionData as Data;
use MaxMind\Test\MinFraud\ServiceClientTester;

/**
* @coversNothing
*
* @internal
*/
class ReportTransactionTest extends \MaxMind\Test\MinFraud\ServiceClientTester
class ReportTransactionTest extends ServiceClientTester
{
public function testMinimalRequest(): void
{
Expand Down
3 changes: 2 additions & 1 deletion tests/MaxMind/Test/MinFraud/ServiceClientTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Composer\CaBundle\CaBundle;
use MaxMind\MinFraud\ServiceClient;
use MaxMind\WebService\Client;
use MaxMind\WebService\Http\Request;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -27,7 +28,7 @@ protected function createRequest(
$userId = 1;
$licenseKey = 'abcdefghij';

$stub = $this->createMock(\MaxMind\WebService\Http\Request::class);
$stub = $this->createMock(Request::class);

$stub->expects($this->exactly($callsToRequest))
->method('post')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use MaxMind\MinFraud\Validation\Rules\CreditCard;
use PHPUnit\Framework\TestCase;
use Respect\Validation\Exceptions\CountryCodeException;

/**
* @coversNothing
Expand All @@ -23,7 +24,7 @@ public function testInvalidCountry($code): void
{
$validator = new CreditCard();

$this->expectException(\Respect\Validation\Exceptions\CountryCodeException::class);
$this->expectException(CountryCodeException::class);

$validator->check([
'country' => $code,
Expand Down
3 changes: 2 additions & 1 deletion tests/MaxMind/Test/MinFraud/Validation/Rules/DeviceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use MaxMind\MinFraud\Validation\Rules\Device;
use PHPUnit\Framework\TestCase;
use Respect\Validation\Exceptions\IpException;

/**
* @coversNothing
Expand All @@ -18,7 +19,7 @@ public function testInvalidIP(): void
{
$validator = new Device();

$this->expectException(\Respect\Validation\Exceptions\IpException::class);
$this->expectException(IpException::class);

$validator->check([
'ip_address' => '1.2.3',
Expand Down
7 changes: 4 additions & 3 deletions tests/MaxMind/Test/MinFraudTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@

use MaxMind\Exception\InvalidInputException;
use MaxMind\MinFraud;
use MaxMind\Test\MinFraud\ServiceClientTester;
use MaxMind\Test\MinFraudData as Data;

/**
* @coversNothing
*
* @internal
*/
class MinFraudTest extends \MaxMind\Test\MinFraud\ServiceClientTester
class MinFraudTest extends ServiceClientTester
{
/**
* @dataProvider services
Expand Down Expand Up @@ -84,7 +85,7 @@ public function testLocalesOption(): void
public function testEmailHashingDisabled(): void
{
// Reflection isn't ideal, but this is the easiest way to check.
$class = new \ReflectionClass(\MaxMind\MinFraud::class);
$class = new \ReflectionClass(MinFraud::class);
$prop = $class->getProperty('content');
$prop->setAccessible(true);

Expand Down Expand Up @@ -123,7 +124,7 @@ public function testEmailHashingDisabled(): void
public function testEmailHashingEnabled(): void
{
// Reflection isn't ideal, but this is the easiest way to check.
$class = new \ReflectionClass(\MaxMind\MinFraud::class);
$class = new \ReflectionClass(MinFraud::class);
$prop = $class->getProperty('content');
$prop->setAccessible(true);

Expand Down

0 comments on commit e7e3aa6

Please sign in to comment.