Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from zibios/analysis-8Al9Vk
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
zibios committed Feb 25, 2018
2 parents c25bae6 + edd75d8 commit 4f1e831
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Transformer/Response/AbstractResponseTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function getModelClasses()
*/
protected function getModelClassForResource($resourceClass)
{
if (array_key_exists($resourceClass, $this->getModelClasses()) === false) {
if (false === array_key_exists($resourceClass, $this->getModelClasses())) {
throw new \InvalidArgumentException(sprintf('"%s" class not supported', $resourceClass));
}

Expand Down
2 changes: 1 addition & 1 deletion src/TransformerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function createResponseModelTransformer(SerializerInterface $seria
*/
protected static function prepareSerializer(SerializerInterface $serializer = null)
{
if ($serializer === null) {
if (null === $serializer) {
$serializer = SerializerFactory::create();
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Transformer/Response/ResponseTransformerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function test_normalizeParams($response, $resourceClass, $isValid)
$exceptionOccurred = false;
$exceptionClass = '';
$exceptionMessage = '';

try {
$this->object->transform($response, $resourceClass);
} catch (\Throwable $t) {
Expand All @@ -76,10 +77,10 @@ public function test_normalizeParams($response, $resourceClass, $isValid)
$exceptionMessage = $e->getMessage();
}

if ($isValid === false) {
if (false === $isValid) {
self::assertTrue($exceptionOccurred, 'Exception should be thrown');
}
if ($isValid === true) {
if (true === $isValid) {
self::assertFalse($exceptionOccurred, sprintf('Exception should not be thrown, "%s" "%s" occurred', $exceptionClass, $exceptionMessage));
}
}
Expand Down

0 comments on commit 4f1e831

Please sign in to comment.