Skip to content

Commit

Permalink
fix php convention array indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Jun 14, 2024
1 parent 59a8be7 commit 9ac7b65
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 59 deletions.
10 changes: 5 additions & 5 deletions examples/templates/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include_once \dirname(__DIR__).'/../vendor/autoload.php';

if (!\class_exists('Symfony\Component\Dotenv\Dotenv')) {
throw new \RuntimeException('You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
throw new RuntimeException('You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}

$env = \dirname(__DIR__).'/.env';
Expand All @@ -12,15 +12,15 @@
$dotenv = new Symfony\Component\Dotenv\Dotenv($env);
$dotenv->load($env);
} else {
throw new \RuntimeException('You need to define a .env file.');
throw new RuntimeException('You need to define a .env file.');
}

function getEnvVariables()
{
return [
'PRICEHUBBLE_USERNAME' => $_ENV['PRICEHUBBLE_USERNAME'],
'PRICEHUBBLE_PASS' => $_ENV['PRICEHUBBLE_PASS'],
];
'PRICEHUBBLE_USERNAME' => $_ENV['PRICEHUBBLE_USERNAME'],
'PRICEHUBBLE_PASS' => $_ENV['PRICEHUBBLE_PASS'],
];
}

/* Ad hoc functions to make the examples marginally prettier. */
Expand Down
8 changes: 4 additions & 4 deletions src/Pricehubble.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ protected function prepareStateForRequest(string $http_verb, string $url, int $t
];

$this->lastRequest = $parts + [
'method' => $http_verb,
'body' => '',
'timeout' => $timeout,
];
'method' => $http_verb,
'body' => '',
'timeout' => $timeout,
];

return $this->lastResponse;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Resource/AbstractResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ abstract class AbstractResource implements ResourceInterface
/**
* The Pricehubble base API instance.
*
* @var \Antistatique\Pricehubble\Pricehubble
* @var Pricehubble
*/
private Pricehubble $pricehubble;

/**
* Construct a new AbstractApi object.
*
* @param \Antistatique\Pricehubble\Pricehubble $pricehubble
* The Pricehubble base API class
* @param Pricehubble $pricehubble
* The Pricehubble base API class
*/
public function __construct(Pricehubble $pricehubble)
{
Expand All @@ -30,7 +30,7 @@ public function __construct(Pricehubble $pricehubble)
/**
* Set the API provider.
*
* @param \Antistatique\Pricehubble\Pricehubble $pricehubble the Pricehubble base API instance
* @param Pricehubble $pricehubble the Pricehubble base API instance
*
* @return $this
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Resource/ResourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ interface ResourceInterface
/**
* Get the API provider.
*
* @return \Antistatique\Pricehubble\Pricehubble
* The Pricehubble base API instance
* @return Pricehubble
* The Pricehubble base API instance
*/
public function getPricehubble(): Pricehubble;
}
2 changes: 1 addition & 1 deletion tests/Unit/PricehubbleAttachRequestPayloadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class PricehubbleAttachRequestPayloadTest extends TestCase
/**
* The Pricehubble base API instance.
*
* @var \Antistatique\Pricehubble\Pricehubble
* @var Pricehubble
*/
private Pricehubble $pricehubble;

Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/PricehubbleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class PricehubbleTest extends TestCase
/**
* The Pricehubble base API instance.
*
* @var \Antistatique\Pricehubble\Pricehubble
* @var Pricehubble
*/
private Pricehubble $pricehubble;

Expand Down Expand Up @@ -450,8 +450,8 @@ public function testDetermineSuccess401MissingToken()
$this->expectExceptionMessage('401 invalid_request: The access token is missing');
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
$response, [
'error_description' => 'The access token is missing',
'error' => 'invalid_request',
'error_description' => 'The access token is missing',
'error' => 'invalid_request',
], 0,
]);
}
Expand All @@ -469,8 +469,8 @@ public function testDetermineSuccess403MissingProperty()
$this->expectExceptionMessage("403 'dossierId', 'simulationId' or 'buildingId' is a required property");
$this->callPrivateMethod($pricehubble_mock, 'determineSuccess', [
$response, [
'message' => "'dossierId', 'simulationId' or 'buildingId' is a required property",
], 0,
'message' => "'dossierId', 'simulationId' or 'buildingId' is a required property",
], 0,
]);
}

Expand Down
22 changes: 11 additions & 11 deletions tests/Unit/Resource/PointsOfInterestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@ public function testGatherReturnsExpected(): void
'category' => 'education',
'distance' => 256,
'location' => [
'address' => [
'city' => 'Lausanne',
'houseNumber' => '26-28',
'postCode' => '1004',
'street' => 'Avenue de Provence',
],
'address' => [
'city' => 'Lausanne',
'houseNumber' => '26-28',
'postCode' => '1004',
'street' => 'Avenue de Provence',
],
'coordinates' => [
'latitude' => 46.5234680175781,
'longitude' => 6.6108078956604,
],
'latitude' => 46.5234680175781,
'longitude' => 6.6108078956604,
],
'name' => 'Gymnase Provence',
'subcategory' => 'university',
],
'name' => 'Gymnase Provence',
'subcategory' => 'university',
],
8 => [
'category' => 'education',
'distance' => 261,
Expand Down
54 changes: 27 additions & 27 deletions tests/Unit/Resource/ValuationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,35 @@ public function testFullReturnsExpected(): void
$response = json_decode(file_get_contents(__DIR__.'/../../responses/valuation-full.json'), true, 512, JSON_THROW_ON_ERROR);

$fullParams = [
'dealType' => 'sale',
'valuationInputs' => [
[
'property' => [
'location' => [
'address' => [
'postCode' => 8037,
'city' => 'Zürich',
'street' => 'Nordstrasse',
'houseNumber' => '391',
],
],
'buildingYear' => 1850,
'livingArea' => 130,
'propertyType' => [
'code' => 'apartment',
'subcode' => 'apartment_normal',
'dealType' => 'sale',
'valuationInputs' => [
[
'property' => [
'location' => [
'address' => [
'postCode' => 8037,
'city' => 'Zürich',
'street' => 'Nordstrasse',
'houseNumber' => '391',
],
],
'buildingYear' => 1850,
'livingArea' => 130,
'propertyType' => [
'code' => 'apartment',
'subcode' => 'apartment_normal',
],
'numberOfRooms' => 5,
'gardenArea' => 25,
'balconyArea' => 5,
'numberOfIndoorParkingSpaces' => 1,
'numberOfOutdoorParkingSpaces' => 2,
'numberOfBathrooms' => 2,
'renovationYear' => 2019,
],
],
'numberOfRooms' => 5,
'gardenArea' => 25,
'balconyArea' => 5,
'numberOfIndoorParkingSpaces' => 1,
'numberOfOutdoorParkingSpaces' => 2,
'numberOfBathrooms' => 2,
'renovationYear' => 2019,
],
],
],
'countryCode' => 'CH',
'countryCode' => 'CH',
];
$pricehubble_mock = $this->getMockBuilder(Pricehubble::class)
->onlyMethods(['makeRequest'])
Expand Down

0 comments on commit 9ac7b65

Please sign in to comment.