Skip to content

Commit 43e7289

Browse files
committed
Removed unecessary types from docblocs
1 parent 8833338 commit 43e7289

File tree

6 files changed

+4
-87
lines changed

6 files changed

+4
-87
lines changed

src/Casts/ImmutableTimezonedDatetime.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22

33
namespace Whitecube\LaravelTimezones\Casts;
44

5+
use Illuminate\Database\Eloquent\Model;
6+
57
class ImmutableTimezonedDatetime extends TimezonedDatetime
68
{
79
/**
810
* Cast the given value.
9-
*
10-
* @param \Illuminate\Database\Eloquent\Model $model
11-
* @param string $key
12-
* @param mixed $value
13-
* @param array $attributes
14-
* @return array
1511
*/
16-
public function get($model, $key, $value, $attributes)
12+
public function get(Model $model, string $key, mixed $value, array $attributes)
1713
{
1814
if($date = parent::get($model, $key, $value, $attributes)) {
1915
return $date->toImmutable();

src/Casts/TimezonedDatetime.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,11 @@ class TimezonedDatetime implements CastsAttributes
1616
{
1717
/**
1818
* A developer-specific format to use for string parsing.
19-
*
20-
* @var null|string
2119
*/
2220
protected ?string $format;
2321

2422
/**
2523
* Create a new casting instance.
26-
*
27-
* @param null|string $format
28-
* @return void
2924
*/
3025
public function __construct(?string $format = null)
3126
{
@@ -35,10 +30,6 @@ public function __construct(?string $format = null)
3530
/**
3631
* Cast the given value.
3732
*
38-
* @param \Illuminate\Database\Eloquent\Model $model
39-
* @param string $key
40-
* @param mixed $value
41-
* @param array $attributes
4233
* @return \Carbon\CarbonInterface
4334
*/
4435
public function get(Model $model, string $key, mixed $value, array $attributes)
@@ -59,10 +50,6 @@ public function get(Model $model, string $key, mixed $value, array $attributes)
5950
/**
6051
* Prepare the given value for storage.
6152
*
62-
* @param \Illuminate\Database\Eloquent\Model $model
63-
* @param string $key
64-
* @param mixed $value
65-
* @param array $attributes
6653
* @return string
6754
*/
6855
public function set(Model $model, string $key, mixed $value, array $attributes)

src/Concerns/HasTimezonedTimestamps.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ trait HasTimezonedTimestamps
99
{
1010
/**
1111
* Determine if the given attribute is a date or date castable.
12-
*
13-
* @param string $key
14-
* @return bool
1512
*/
16-
protected function isDateAttribute($key): bool
13+
protected function isDateAttribute(string $key): bool
1714
{
1815
return (in_array($key, $this->getDates(), true) ||
1916
$this->isDateCastable($key)) &&
@@ -22,9 +19,6 @@ protected function isDateAttribute($key): bool
2219

2320
/**
2421
* Check if key is a timezoned datetime cast.
25-
*
26-
* @param string $key
27-
* @return bool
2822
*/
2923
protected function hasTimezonedDatetimeCast(string $key): bool
3024
{

src/DatetimeParser.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class DatetimeParser
1616

1717
/**
1818
* Parse the value into a carbon instance.
19-
*
20-
* @param mixed $value
21-
* @param null|string $format
22-
* @return CarbonInterface
2319
*/
2420
public function parse(mixed $value, ?string $format): CarbonInterface
2521
{
@@ -30,8 +26,6 @@ public function parse(mixed $value, ?string $format): CarbonInterface
3026

3127
/**
3228
* Get the format for database stored dates.
33-
*
34-
* @return string
3529
*/
3630
public function getDateFormat(): ?string
3731
{

src/ServiceProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ class ServiceProvider extends BaseServiceProvider
99
{
1010
/**
1111
* Register any application services.
12-
*
13-
* @return void
1412
*/
1513
public function register()
1614
{

src/Timezone.php

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,15 @@ class Timezone
1313

1414
/**
1515
* The app's current display & manipulation timezone.
16-
*
17-
* @var \Carbon\CarbonTimeZone
1816
*/
1917
protected CarbonTimeZone $current;
2018
/**
2119
* The app's current storage timezone.
22-
*
23-
* @var \Carbon\CarbonTimeZone
2420
*/
2521
protected CarbonTimeZone $storage;
2622

2723
/**
2824
* Create a new singleton instance.
29-
*
30-
* @param string $default
31-
* @return void
3225
*/
3326
public function __construct(string $default)
3427
{
@@ -40,9 +33,6 @@ public function __construct(string $default)
4033
* @alias setCurrent
4134
*
4235
* Set the current application timezone.
43-
*
44-
* @param mixed $timezone
45-
* @return void
4636
*/
4737
public function set(mixed $timezone = null): void
4838
{
@@ -51,9 +41,6 @@ public function set(mixed $timezone = null): void
5141

5242
/**
5343
* Set the current application timezone.
54-
*
55-
* @param mixed $timezone
56-
* @return void
5744
*/
5845
public function setCurrent(mixed $timezone): void
5946
{
@@ -62,8 +49,6 @@ public function setCurrent(mixed $timezone): void
6249

6350
/**
6451
* Return the current application timezone.
65-
*
66-
* @return \Carbon\CarbonTimeZone
6752
*/
6853
public function current(): CarbonTimeZone
6954
{
@@ -72,9 +57,6 @@ public function current(): CarbonTimeZone
7257

7358
/**
7459
* Set the current database timezone.
75-
*
76-
* @param mixed $timezone
77-
* @return void
7860
*/
7961
public function setStorage(mixed $timezone): void
8062
{
@@ -83,8 +65,6 @@ public function setStorage(mixed $timezone): void
8365

8466
/**
8567
* Return the current application timezone.
86-
*
87-
* @return \Carbon\CarbonTimeZone
8868
*/
8969
public function storage(): CarbonTimeZone
9070
{
@@ -93,8 +73,6 @@ public function storage(): CarbonTimeZone
9373

9474
/**
9575
* Get the current timezoned date.
96-
*
97-
* @return \Carbon\CarbonInterface
9876
*/
9977
public function now(): CarbonInterface
10078
{
@@ -103,10 +81,6 @@ public function now(): CarbonInterface
10381

10482
/**
10583
* Configure given date for the application's current timezone.
106-
*
107-
* @param mixed $value
108-
* @param null|callable $maker
109-
* @return \Carbon\CarbonInterface
11084
*/
11185
public function date(mixed $value, callable $maker = null): CarbonInterface
11286
{
@@ -115,10 +89,6 @@ public function date(mixed $value, callable $maker = null): CarbonInterface
11589

11690
/**
11791
* Configure given date for the database storage timezone.
118-
*
119-
* @param mixed $value
120-
* @param null|callable $maker
121-
* @return \Carbon\CarbonInterface
12292
*/
12393
public function store(mixed $value, callable $maker = null): CarbonInterface
12494
{
@@ -127,9 +97,6 @@ public function store(mixed $value, callable $maker = null): CarbonInterface
12797

12898
/**
12999
* Duplicate the given date and shift its timezone to the application's current timezone.
130-
*
131-
* @param \Carbon\CarbonInterface $date
132-
* @return \Carbon\CarbonInterface
133100
*/
134101
protected function convertToCurrent(CarbonInterface $date): CarbonInterface
135102
{
@@ -138,9 +105,6 @@ protected function convertToCurrent(CarbonInterface $date): CarbonInterface
138105

139106
/**
140107
* Duplicate the given date and shift its timezone to the database's storage timezone.
141-
*
142-
* @param \Carbon\CarbonInterface $date
143-
* @return \Carbon\CarbonInterface
144108
*/
145109
protected function convertToStorage(CarbonInterface $date): CarbonInterface
146110
{
@@ -149,10 +113,6 @@ protected function convertToStorage(CarbonInterface $date): CarbonInterface
149113

150114
/**
151115
* Create or configure date using the application's current timezone.
152-
*
153-
* @param mixed $value
154-
* @param null|callable $maker
155-
* @return \Carbon\CarbonInterface
156116
*/
157117
protected function makeDateWithCurrent(mixed $value, callable $maker = null): CarbonInterface
158118
{
@@ -163,10 +123,6 @@ protected function makeDateWithCurrent(mixed $value, callable $maker = null): Ca
163123

164124
/**
165125
* Create or configure date using the database's storage timezone.
166-
*
167-
* @param mixed $value
168-
* @param null|callable $maker
169-
* @return \Carbon\CarbonInterface
170126
*/
171127
protected function makeDateWithStorage(mixed $value, callable $maker = null): CarbonInterface
172128
{
@@ -177,11 +133,6 @@ protected function makeDateWithStorage(mixed $value, callable $maker = null): Ca
177133

178134
/**
179135
* Create a date using the provided timezone.
180-
*
181-
* @param mixed $value
182-
* @param \Carbon\CarbonTimeZone $timezone
183-
* @param null|callable $maker
184-
* @return \Carbon\CarbonInterface
185136
*/
186137
protected function makeDate(mixed $value, CarbonTimeZone $timezone, callable $maker = null): CarbonInterface
187138
{
@@ -192,9 +143,6 @@ protected function makeDate(mixed $value, CarbonTimeZone $timezone, callable $ma
192143

193144
/**
194145
* Create a Carbon timezone from given value.
195-
*
196-
* @param mixed $value
197-
* @return \Carbon\CarbonTimeZone
198146
*/
199147
protected function makeTimezone(mixed $value): CarbonTimeZone
200148
{

0 commit comments

Comments
 (0)