Skip to content

Commit 939009c

Browse files
lrljoegithub-actions[bot]
authored andcommitted
Fix styling
1 parent b471f02 commit 939009c

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

src/Views/Columns/DateColumn.php

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Rappasoft\LaravelLivewireTables\Views\Columns;
44

55
use Carbon\Carbon;
6-
use DateTime;
76
use Carbon\Exceptions\InvalidFormatException;
7+
use DateTime;
88
use Illuminate\Database\Eloquent\Model;
99
use Illuminate\Support\HtmlString;
1010
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
@@ -37,36 +37,26 @@ public function getContents(Model $row): null|string|\BackedEnum|HtmlString|Data
3737
return $dateTime->format($this->getOutputFormat());
3838
} else {
3939
// Check if format matches what is expected and return Carbon instance if so, otherwise emptyValue
40-
if (Carbon::canBeCreatedFromFormat($dateTime, $this->getInputFormat()))
41-
{
40+
if (Carbon::canBeCreatedFromFormat($dateTime, $this->getInputFormat())) {
4241
return Carbon::createFromFormat($this->getInputFormat(), $dateTime)->format($this->getOutputFormat());
43-
}
44-
else
45-
{
42+
} else {
4643
try {
47-
if ($date = Carbon::parse($dateTime))
48-
{
44+
if ($date = Carbon::parse($dateTime)) {
4945
return $date->format($this->getOutputFormat());
50-
}
51-
}
52-
catch (InvalidFormatException $e)
53-
{
46+
}
47+
} catch (InvalidFormatException $e) {
5448
return $this->getEmptyValue();
55-
}
56-
catch (\Exception $e)
57-
{
49+
} catch (\Exception $e) {
5850
return $this->getEmptyValue();
5951
}
6052
}
53+
6154
return $this->getEmptyValue();
6255
}
6356
}
64-
}
65-
catch (InvalidFormatException $e)
66-
{
57+
} catch (InvalidFormatException $e) {
6758
return $this->getEmptyValue();
68-
}
69-
catch (\Exception $exception) {
59+
} catch (\Exception $exception) {
7060
return $this->getEmptyValue();
7161
}
7262

src/Views/Columns/DateTimeColumn.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ class DateTimeColumn extends DateColumn
2020
public string $emptyValue = '';
2121

2222
protected string $view = 'livewire-tables::includes.columns.date';
23-
2423
}

0 commit comments

Comments
 (0)