Changed NULL coalesce from ?? (#6353)

PHP 5 does not have the double question mark null coalesce support.
This commit is contained in:
Wes Hulette 2018-10-26 18:53:18 -04:00 committed by snipe
parent a4876e9f3e
commit 6b3b673daa
2 changed files with 4 additions and 4 deletions

View file

@ -316,8 +316,8 @@ abstract class Importer
$user->last_name = $user_array['last_name'];
$user->username = $user_array['username'];
$user->email = $user_array['email'];
$user->manager_id = $user_array['manager_id'] ?? null;
$user->department_id = $user_array['department_id'] ?? null;
$user->manager_id = ($user_array['manager_id'] ? $user_array['manager_id'] : null);
$user->department_id = ($user_array['department_id'] ? $user_array['department_id']: null);
$user->activated = $user_array['activated'];
$user->password = $this->tempPassword;

View file

@ -53,8 +53,8 @@ class UserImporter extends ItemImporter
\Log::debug('UserImporter.php Activated fetchHumanBoolean: '. $this->fetchHumanBoolean($this->findCsvMatch($row, 'activated')));
$this->item['employee_num'] = $this->findCsvMatch($row, 'employee_num');
$this->item['department_id'] = $this->createOrFetchDepartment($this->findCsvMatch($row, 'department')) ?? null;
$this->item['manager_id'] = $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')) ?? null;
$this->item['department_id'] = $this->createOrFetchDepartment($this->findCsvMatch($row, 'department')) ? $this->createOrFetchDepartment($this->findCsvMatch($row, 'department')) : null;
$this->item['manager_id'] = $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')) ? $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')) : null;
$user = User::where('username', $this->item['username'])->first();