Skip to content

Commit 297da59

Browse files
chore(internal): codegen related update
1 parent 958db57 commit 297da59

5 files changed

Lines changed: 39 additions & 0 deletions

File tree

src/Core/Conversion.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,37 @@ private static function tryConvert(Converter|ConverterSource|string $target, mix
170170

171171
return $value;
172172

173+
case 'DateTimeInterface':
174+
case 'DateTimeImmutable':
175+
if (is_string($value)) {
176+
try {
177+
++$state->maybe;
178+
179+
return new \DateTimeImmutable($value);
180+
} catch (\Exception) {
181+
--$state->maybe;
182+
}
183+
}
184+
185+
++$state->no;
186+
187+
return $value;
188+
189+
case 'DateTime':
190+
if (is_string($value)) {
191+
try {
192+
++$state->maybe;
193+
194+
return new \DateTime($value);
195+
} catch (\Exception) {
196+
--$state->maybe;
197+
}
198+
}
199+
200+
++$state->no;
201+
202+
return $value;
203+
173204
default:
174205
++$state->no;
175206

src/Services/BeeperDesktopClientRawService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use BeeperDesktop\ServiceContracts\BeeperDesktopClientRawContract;
1616

1717
/**
18+
* Control the Beeper Desktop application.
19+
*
1820
* @phpstan-import-type RequestOpts from \BeeperDesktop\RequestOptions
1921
*/
2022
final class BeeperDesktopClientRawService implements BeeperDesktopClientRawContract

src/Services/BeeperDesktopClientService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use BeeperDesktop\ServiceContracts\BeeperDesktopClientContract;
1414

1515
/**
16+
* Control the Beeper Desktop application.
17+
*
1618
* @phpstan-import-type RequestOpts from \BeeperDesktop\RequestOptions
1719
*/
1820
final class BeeperDesktopClientService implements BeeperDesktopClientContract

src/Services/InfoRawService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use BeeperDesktop\ServiceContracts\InfoRawContract;
1313

1414
/**
15+
* Control the Beeper Desktop application.
16+
*
1517
* @phpstan-import-type RequestOpts from \BeeperDesktop\RequestOptions
1618
*/
1719
final class InfoRawService implements InfoRawContract

src/Services/InfoService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use BeeperDesktop\ServiceContracts\InfoContract;
1212

1313
/**
14+
* Control the Beeper Desktop application.
15+
*
1416
* @phpstan-import-type RequestOpts from \BeeperDesktop\RequestOptions
1517
*/
1618
final class InfoService implements InfoContract

0 commit comments

Comments
 (0)