Skip to content

[DependencyInjection] Document the date_time and date_time_format env var processors #18835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions configuration/env_var_processors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ Symfony provides the following env var processors:
``env(float:FOO)``
Casts ``FOO`` to a float.

``env(date_time:FOO)``
Copy link
Contributor

@94noni 94noni Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event if other example uses FOO, what about here use a real date_time value format ?
I mean is it the Y-m-d H:i:s ?
obviously, for env(int:FOO) we know int refers to what, but date time is more ambiguous and doc must be straightfroward
wdyt?

also, you must add a version added directive to document that such new processor have been added on sf v6.4 👍🏻

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation updated to the latest implementation. I have added the "version added directives" and the usage examples to describe how to use the both processors. I think that the examples are sufficient and the FOO can stay in processor name to make the documentation consistent.

Casts ``FOO`` to a \DateTime.

``env(date_time_immutable:FOO)``
Casts ``FOO`` to a \DateTimeImmutable.

``env(const:FOO)``
Finds the const value named in ``FOO``:

Expand Down