Change a newly-deprecated array access

PHP allowed array accesses with curly braces but deprecated the feature
[1] with 7.4. With this change the CSV import will work with 7.4 without
any errors or warnings. The change does not affect other versions.

[1] https://wiki.php.net/rfc/deprecate_curly_braces_array_access
This commit is contained in:
Pascal Jungblut
2019-12-30 11:21:25 +01:00
parent 26f5e5e518
commit e5fff53221

View File

@@ -142,7 +142,7 @@ class ImportableConverter
try {
// add exclamation mark for better parsing. http://php.net/manual/en/datetime.createfromformat.php
$dateFormat = $this->config['date-format'] ?? 'Ymd';
if ('!' !== $dateFormat{0}) {
if ('!' !== $dateFormat[0]) {
$dateFormat = '!' . $dateFormat;
}
$object = Carbon::createFromFormat($dateFormat, $date);