Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stateful
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grifart libs
stateful
Commits
144bcdd3
Commit
144bcdd3
authored
3 years ago
by
Daniel Kurowski
Browse files
Options
Downloads
Patches
Plain Diff
fix phpstan - array shape for states
parent
a620ef11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!26
Upgrade deps and ci image
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Integration/BrickDateTimeIntegration.php
+7
-0
7 additions, 0 deletions
src/Integration/BrickDateTimeIntegration.php
with
7 additions
and
0 deletions
src/Integration/BrickDateTimeIntegration.php
+
7
−
0
View file @
144bcdd3
...
...
@@ -49,6 +49,7 @@ final class BrickDateTimeIntegration
},
static
function
(
State
$state
):
Instant
{
$state
->
ensureVersion
(
1
);
/** @var array{timestamp: string} $state */
$local
=
LocalDateTime
::
parse
(
$state
[
'timestamp'
],
IsoParsers
::
offsetDateTime
());
return
$local
->
atTimeZone
(
TimeZone
::
utc
())
->
getInstant
();
},
...
...
@@ -62,6 +63,7 @@ final class BrickDateTimeIntegration
},
static
function
(
State
$state
):
LocalDate
{
$state
->
ensureVersion
(
1
);
/** @var array{date: string} $state */
return
LocalDate
::
parse
(
$state
[
'date'
]);
},
...
...
@@ -74,6 +76,7 @@ final class BrickDateTimeIntegration
},
static
function
(
State
$state
):
LocalTime
{
$state
->
ensureVersion
(
1
);
/** @var array{time: string} $state */
return
LocalTime
::
parse
(
$state
[
'time'
]);
},
...
...
@@ -86,6 +89,7 @@ final class BrickDateTimeIntegration
},
static
function
(
State
$state
):
LocalDateTime
{
$state
->
ensureVersion
(
1
);
/** @var array{datetime: string} $state */
return
LocalDateTime
::
parse
(
$state
[
'datetime'
]);
},
...
...
@@ -98,6 +102,7 @@ final class BrickDateTimeIntegration
},
static
function
(
State
$state
):
ZonedDateTime
{
$state
->
ensureVersion
(
1
);
/** @var array{dateTimeWithZone: string} $state */
return
ZonedDateTime
::
parse
(
$state
[
'dateTimeWithZone'
]);
},
...
...
@@ -115,6 +120,7 @@ final class BrickDateTimeIntegration
/** @matchSubtypes*/
static
function
(
State
$state
):
TimeZone
{
$state
->
ensureVersion
(
1
);
/** @var array{id: string} $state */
$instance
=
TimeZone
::
parse
(
$state
[
'id'
]);
// make sure that what we have serialized, we are also deserializing
...
...
@@ -134,6 +140,7 @@ final class BrickDateTimeIntegration
},
static
function
(
State
$state
):
Duration
{
$state
->
ensureVersion
(
1
);
/** @var array{duration: string} $state */
return
Duration
::
parse
(
$state
[
'duration'
]);
},
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment