From 5ec3cfe45a1513c2c6b53d278e1f54960a3d5dd8 Mon Sep 17 00:00:00 2001 From: mjankovskis Date: Tue, 17 Jul 2018 14:53:31 +0300 Subject: [PATCH] Upgrade required php version. Added default value checking for candidate item --- composer.json | 2 +- src/Structures/CandidateItem.php | 52 ++++++++++++++++---------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 057c872..bfcb1b2 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": ">=5.5.0", + "php": ">=7.0", "ext-curl": "*", "ext-json": "*" }, diff --git a/src/Structures/CandidateItem.php b/src/Structures/CandidateItem.php index 94948ec..118585f 100644 --- a/src/Structures/CandidateItem.php +++ b/src/Structures/CandidateItem.php @@ -156,32 +156,32 @@ public static function fromArray(array $rawCandidate) $candidate->rawData = $rawCandidate; $candidate->id = $rawCandidate['_id']; - $candidate->address = $rawCandidate['address']; - $candidate->assigned_to = $rawCandidate['assigned_to']; - $candidate->cover_letter = $rawCandidate['cover_letter']; - $candidate->creation_date = $rawCandidate['creation_date']; - $candidate->education = $rawCandidate['education']; - $candidate->email_address = $rawCandidate['email_address']; - $candidate->followed_by = $rawCandidate['followed_by']; - $candidate->headline = $rawCandidate['headline']; - $candidate->initial = $rawCandidate['initial']; - $candidate->name = $rawCandidate['name']; - $candidate->origin = $rawCandidate['origin']; - $candidate->overall_score = $rawCandidate['overall_score']; - $candidate->phone_number = $rawCandidate['phone_number']; - $candidate->profile_photo_url = $rawCandidate['profile_photo_url']; - $candidate->questionnaire = $rawCandidate['questionnaire']; - $candidate->recruited_by = $rawCandidate['recruited_by']; - $candidate->referred_by = $rawCandidate['referred_by']; - $candidate->sourced_by = $rawCandidate['sourced_by']; - $candidate->resume = $rawCandidate['resume']; - $candidate->social_profiles = $rawCandidate['social_profiles']; - $candidate->source = $rawCandidate['source']; - $candidate->stage = $rawCandidate['stage']; - $candidate->summary = $rawCandidate['summary']; - $candidate->tags = $rawCandidate['tags']; - $candidate->updated_date = $rawCandidate['updated_date']; - $candidate->work_history = $rawCandidate['work_history']; + $candidate->address = $rawCandidate['address'] ?? ''; + $candidate->assigned_to = $rawCandidate['assigned_to'] ?? []; + $candidate->cover_letter = $rawCandidate['cover_letter'] ?? ''; + $candidate->creation_date = $rawCandidate['creation_date'] ?? ''; + $candidate->education = $rawCandidate['education'] ?? []; + $candidate->email_address = $rawCandidate['email_address'] ?? ''; + $candidate->followed_by = $rawCandidate['followed_by'] ?? ''; + $candidate->headline = $rawCandidate['headline'] ?? ''; + $candidate->initial = $rawCandidate['initial'] ?? ''; + $candidate->name = $rawCandidate['name'] ?? ''; + $candidate->origin = $rawCandidate['origin'] ?? ''; + $candidate->overall_score = $rawCandidate['overall_score'] ?? []; + $candidate->phone_number = $rawCandidate['phone_number'] ?? ''; + $candidate->profile_photo_url = $rawCandidate['profile_photo_url'] ?? ''; + $candidate->questionnaire = $rawCandidate['questionnaire'] ?? []; + $candidate->recruited_by = $rawCandidate['recruited_by'] ?? []; + $candidate->referred_by = $rawCandidate['referred_by'] ?? []; + $candidate->sourced_by = $rawCandidate['sourced_by'] ?? []; + $candidate->resume = $rawCandidate['resume'] ?? []; + $candidate->social_profiles = $rawCandidate['social_profiles'] ?? []; + $candidate->source = $rawCandidate['source'] ?? []; + $candidate->stage = $rawCandidate['stage'] ?? []; + $candidate->summary = $rawCandidate['summary'] ?? ''; + $candidate->tags = $rawCandidate['tags'] ?? []; + $candidate->updated_date = $rawCandidate['updated_date'] ?? ''; + $candidate->work_history = $rawCandidate['work_history'] ?? []; return $candidate; }