Skip to content

Commit

Permalink
Small build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Oct 5, 2021
1 parent c145919 commit c798015
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[![Code coverage](https://badgen.net/coveralls/c/github/FastyBird/json-api?cache=300&style=flast-square)](https://coveralls.io/r/FastyBird/json-api)

![PHP](https://badgen.net/packagist/php/FastyBird/json-api?cache=300&style=flast-square)
[![Downloads total](https://badgen.net/packagist/dt/FastyBird/json-api?cache=300&style=flast-square)](https://packagist.org/packages/FastyBird/json-api)
[![Latest stable](https://badgen.net/packagist/v/FastyBird/json-api/latest?cache=300&style=flast-square)](https://packagist.org/packages/FastyBird/json-api)
[![Downloads total](https://badgen.net/packagist/dt/FastyBird/json-api?cache=300&style=flast-square)](https://packagist.org/packages/FastyBird/json-api)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)

## What is FastyBird {JSON:API} library?
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"consistence-community/consistence": "^2.1",
"contributte/translation": "^0.8",
"doctrine/orm": "^2.6",
"fastybird/web-server": "^0.2",
"fastybird/web-server": "^0.3",
"ipub/json-api-document": "^0.2",
"neomerx/json-api": "^4.0",
"nette/bootstrap": "^3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/Hydrators/Hydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ protected function mapEntity(string $entityClassName): array
$className = $mapping->targetEntity;

// Check if class is callable
if (class_exists($className)) {
if (is_string($className) && class_exists($className)) {
$fields[] = new Hydrators\Fields\SingleEntityField($className, false, $mappedKey, $isRelationship, $fieldName, $isRequired, $isWritable);
}
} elseif (in_array(ORM\Mapping\OneToMany::class, $propertyAnnotations, true)) {
Expand All @@ -361,7 +361,7 @@ protected function mapEntity(string $entityClassName): array
$className = $mapping->targetEntity;

// Check if class is callable
if (class_exists($className)) {
if (is_string($className) && class_exists($className)) {
$fields[] = new Hydrators\Fields\SingleEntityField($className, false, $mappedKey, $isRelationship, $fieldName, $isRequired, $isWritable);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/common.neon
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contributteTranslation:
dirs: []

contributteConsole:
name: FastyBird:WebServer!
name: FastyBird:JsonApi!
version: '1.0'
catchExceptions: true
autoExit: true
Expand Down

0 comments on commit c798015

Please sign in to comment.