Skip to content

Commit

Permalink
Merge pull request ANSTO#9 from joshpme/master
Browse files Browse the repository at this point in the history
Fix up logging and imports
  • Loading branch information
joshpme authored Sep 28, 2022
2 parents 18c4f5a + 5ae6763 commit 7bd9739
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config/packages/prod/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ monolog:
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
level: error
console:
type: console
process_psr_3_messages: false
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function removeReference(Reference $reference)
$this->references->removeElement($reference);
}

public function jsonSerialize()
public function jsonSerialize(): array
{
return [
"id"=>$this->getId(),
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Conference.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public function getForm($form = "long") {
}
}

public function jsonSerialize()
public function jsonSerialize(): array
{
$start = $this->getConferenceStart();
$end = $this->getConferenceEnd();
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Favourite.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getUser()
* which is a value of any type other than a resource.
* @since 5.4.0
*/
public function jsonSerialize()
public function jsonSerialize(): int
{
return $this->getReference()->getId();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public function setCache($cache)
$this->cache = $cache;
}

public function jsonSerialize($full = false)
public function jsonSerialize($full = false): array
{
$response = [
"id" => $this->getId()
Expand Down
5 changes: 2 additions & 3 deletions src/Service/ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,14 @@ private function calculateAuthors($references) {
->getQuery()
->getResult();

if (count($dbAuthors) == 1) {
if (count($dbAuthors) >= 1) {
$dbAuthor = $dbAuthors[0];
/** @var Reference $reference */
foreach ($newAuthorRefs as $reference) {
if (!$dbAuthor->getReferences()->contains($reference)) {
$dbAuthor->addReference($reference);
}
}
} elseif (count($dbAuthors) > 1) {
throw new Exception("Multiple authors found: " . $name);
} else {
$newAuthor = new Author();
$newAuthor->setName($name);
Expand Down

0 comments on commit 7bd9739

Please sign in to comment.