Skip to content

Commit

Permalink
Merge branch 'apigee:3.x' into issue_343
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli authored Jan 10, 2024
2 parents aacb74a + 189c2dc commit 698956c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"symfony/options-resolver": "^6.3",
"symfony/property-access": "^6.3",
"symfony/property-info": "^6.3",
"symfony/serializer": "^6.3"
"symfony/serializer": "^6.3.11"
},
"require-dev": {
"dms/phpunit-arraysubset-asserts": "^0.4.0",
Expand Down
11 changes: 7 additions & 4 deletions src/Api/Management/Entity/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Apigee\Edge\Entity\Property\ScopesPropertyAwareTrait;
use Apigee\Edge\Entity\Property\StatusPropertyAwareTrait;
use Apigee\Edge\Structure\AttributesProperty;
use LogicException;

/**
* Class App.
Expand Down Expand Up @@ -55,7 +56,7 @@ abstract class App extends Entity implements AppInterface
/** @var string Url, used for "three-legged" OAuth grant type flows. */
protected $callbackUrl;

/** @var \Apigee\Edge\Api\Management\Entity\AppCredential[] */
/** @var AppCredential[] */
protected $credentials = [];

/** @var string[] */
Expand Down Expand Up @@ -187,6 +188,8 @@ public function setCallbackUrl(string $callbackUrl): void
*/
public function getCredentials(): array
{
usort($this->credentials, static fn (AppCredentialInterface $a, AppCredentialInterface $b) => $b->getIssuedAt() <=> $a->getIssuedAt());

return $this->credentials;
}

Expand All @@ -195,7 +198,7 @@ public function getCredentials(): array
*
* Credentials, included in app, can not be changed by modifying them on the entity level.
*
* @param \Apigee\Edge\Api\Management\Entity\AppCredentialInterface ...$credentials
* @param AppCredentialInterface ...$credentials
*
* @internal
*/
Expand Down Expand Up @@ -238,14 +241,14 @@ final public function getApiProducts(): array
*
* @param array $initialApiProducts
*
* @throws \LogicException If used to update existing App.
* @throws LogicException If used to update existing App.
*/
final public function setInitialApiProducts(array $initialApiProducts): void
{
if (!$this->appId) {
$this->initialApiProducts = $initialApiProducts;
} else {
throw new \LogicException('This method is only supported for creating a new app.');
throw new LogicException('This method is only supported for creating a new app.');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

class ReportCriteriaDenormalizerTest extends TestCase
{
/** @var \Apigee\Edge\Api\Monetization\Denormalizer\ReportCriteriaDenormalizer */
/** @var Apigee\Edge\Api\Monetization\Denormalizer\ReportCriteriaDenormalizer */
protected static $denormalizer;

/**
Expand All @@ -46,7 +46,7 @@ public static function setUpBeforeClass(): void

public function testDenormalizeWithAbtractClassNoContext(): void
{
$this->expectException('\Error');
$this->expectException('\Symfony\Component\Serializer\Exception\NotNormalizableValueException');

static::$denormalizer->denormalize((object) [], AbstractCriteria::class, 'json');
}
Expand Down

0 comments on commit 698956c

Please sign in to comment.