Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Fixes #588: Level Import: Random ISO Code #612

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mptap
Copy link

@mptap mptap commented Jan 8, 2018

No description provided.

@@ -151,7 +151,7 @@ private static function levelFromRow(Map<string, string> $row): Level {
foreach ($elements as $level) {
$title = must_have_string($level, 'title');
$type = must_have_string($level, 'type');
$entity_iso_code = must_have_string($level, 'entity_iso_code');
$entity_iso_code = must_have_string($level, 'entity_iso_code') or await Country::genRandomAvailableCountry()->getIsoCode();
Copy link

@azjezz azjezz Apr 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert.

  1. always use || instead of or
  2. this is a syntax error, we can't have await in there.
  3. must_have_string will always return, there's no case where it returns a "falsy" value, so the or await Country::genRandomAvailableCountry()->getIsoCode(); will never be executed.

Copy link

@azjezz azjezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made to src/models/Level.php introduced a syntax error, causing the build to fail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants