From b33ee0a157ac2efa0694e7caf263c76418eeed1e Mon Sep 17 00:00:00 2001 From: Patryk Zajdler Date: Mon, 2 Oct 2017 13:54:10 +0100 Subject: [PATCH] Fix construction of exception messages in static methods. On PHP 7 they result in null messages --- src/AutopilotException.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AutopilotException.php b/src/AutopilotException.php index fc97658..f8e62af 100644 --- a/src/AutopilotException.php +++ b/src/AutopilotException.php @@ -233,7 +233,7 @@ public static function invalidContactType() */ public static function contactsBulkSaveFailed($message = null) { - return new static('contacts bulk upload failed' . is_null($message) ? '' : ': ' . $message); + return new static('contacts bulk upload failed' . (is_null($message) ? '' : ': ' . $message)); } /** @@ -245,7 +245,7 @@ public static function contactsBulkSaveFailed($message = null) */ public static function invalidAutopilotType($type = null) { - return new static(is_null($type) ? 'Invalid data type.' : '"' . $type . '" is not a valid Autopilot data type'); + return new static((is_null($type) ? 'Invalid data type.' : '"' . $type . '" is not a valid Autopilot data type')); } /** @@ -258,7 +258,7 @@ public static function invalidAutopilotType($type = null) */ public static function typeMismatch($expected, $type = null) { - return new static('Type value mismatch! Expected: ' . $expected . is_null($type) ? '' : ', got: '. $type); + return new static('Type value mismatch! Expected: ' . $expected . (is_null($type) ? '' : ', got: '. $type)); } }