Skip to content

Commit

Permalink
Merge pull request #11 from pzaj2/master
Browse files Browse the repository at this point in the history
Fix construction of exception messages in static methods.
  • Loading branch information
nicolasThal authored Oct 2, 2017
2 parents f49973d + b33ee0a commit 19e38fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AutopilotException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand All @@ -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'));
}

/**
Expand All @@ -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));
}

}

0 comments on commit 19e38fc

Please sign in to comment.