Skip to content

Commit 796a489

Browse files
committed
pint & strict types 🔧
1 parent c601df5 commit 796a489

16 files changed

+38
-12
lines changed

‎config/formatters.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
return [
46

57
/*

‎pint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"preset": "laravel",
33
"rules": {
44
"phpdoc_separation": false,
5+
"declare_strict_types": true,
56
"concat_space": {
67
"spacing": "one"
78
},

‎src/Collection/DateFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class DateFormatter implements Formatter
1717
*/
1818
public function __construct(
1919
public string|null|CarbonInterface $date = null,
20-
public string|null $timezone = null,
21-
public string|null $date_format = 'Y-m-d',
20+
public ?string $timezone = null,
21+
public ?string $date_format = 'Y-m-d',
2222
) {
2323
if (empty($this->date)) {
2424
$this->date = null;

‎src/Collection/DateTimeFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class DateTimeFormatter implements Formatter
1717
*/
1818
public function __construct(
1919
public string|null|CarbonInterface $datetime = null,
20-
public string|null $timezone = null,
21-
public string|null $datetime_format = 'Y-m-d H:i',
20+
public ?string $timezone = null,
21+
public ?string $datetime_format = 'Y-m-d H:i',
2222
) {
2323
if (empty($this->datetime)) {
2424
$this->datetime = null;

‎tests/DateFormatterTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace MichaelRubel\Formatters\Tests;
46

57
use Carbon\Carbon;

‎tests/DateTimeFormatterTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace MichaelRubel\Formatters\Tests;
46

57
use Carbon\Carbon;

‎tests/FormatterBindingsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace MichaelRubel\Formatters\Tests;
46

57
use Illuminate\Support\Facades\File;

‎tests/FormatterConfigTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace MichaelRubel\Formatters\Tests;
46

57
use Illuminate\Filesystem\Filesystem;
@@ -13,8 +15,8 @@ public function testConfigSettingsAndProviderFiles()
1315
{
1416
$mock = $this->partialMock(Filesystem::class, function (MockInterface $mock) {
1517
$mock->shouldReceive('isDirectory')
16-
->once()
17-
->andReturnFalse();
18+
->once()
19+
->andReturnFalse();
1820
});
1921

2022
app()->instance('files', $mock);

‎tests/FullNameFormatterTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace MichaelRubel\Formatters\Tests;
46

57
use MichaelRubel\Formatters\Collection\FullNameFormatter;

‎tests/LocaleNumberFormatterTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace MichaelRubel\Formatters\Tests;
46

57
use MichaelRubel\Formatters\Collection\LocaleNumberFormatter;
6-
use MichaelRubel\Formatters\Collection\TaxNumberFormatter;
78

89
class LocaleNumberFormatterTest extends TestCase
910
{

0 commit comments

Comments
 (0)