mirror of
https://github.com/danog/Valinor.git
synced 2024-11-30 04:39:05 +01:00
f232cc0636
A new constructor can be registered to declare which format(s) are supported during the mapping of a date object. By default, any valid timestamp or ATOM-formatted value will be accepted. ```php (new \CuyZ\Valinor\MapperBuilder()) // Both COOKIE and ATOM formats will be accepted ->registerConstructor( new \CuyZ\Valinor\Mapper\Object\DateTimeFormatConstructor(DATE_COOKIE, DATE_ATOM) ) ->mapper() ->map(DateTimeInterface::class, 'Monday, 08-Nov-1971 13:37:42 UTC'); ``` The previously very opinionated behaviour has been removed, but can be temporarily used to help with the migration. ```php (new \CuyZ\Valinor\MapperBuilder()) ->registerConstructor( new \CuyZ\Valinor\Mapper\Object\BackwardCompatibilityDateTimeConstructor() ) ->mapper() ->map(DateTimeInterface::class, 'Monday, 08-Nov-1971 13:37:42 UTC'); ```
91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
|
|
|
|
site_name: Valinor
|
|
site_url: https://valinor.cuyz.io/
|
|
repo_url: https://github.com/CuyZ/Valinor
|
|
repo_name: CuyZ/Valinor
|
|
edit_uri: edit/master/docs/pages/
|
|
docs_dir: pages
|
|
|
|
extra:
|
|
meta:
|
|
title: Valinor • PHP object mapper with strong type support
|
|
description: PHP library that helps to map any input into a strongly-typed value object structure.
|
|
image: img/valinor-banner.png
|
|
social:
|
|
- icon: fontawesome/brands/github
|
|
link: https://github.com/CuyZ
|
|
- icon: fontawesome/solid/globe
|
|
link: https://cuyz.io
|
|
version:
|
|
provider: mike
|
|
extra_css:
|
|
- stylesheets/extra.css
|
|
|
|
plugins:
|
|
- mike:
|
|
canonical_version: latest/
|
|
|
|
theme:
|
|
name: material
|
|
custom_dir: overrides
|
|
favicon: img/valinor-icon.svg
|
|
logo: img/valinor-icon.svg
|
|
features:
|
|
- navigation.sections
|
|
- navigation.top
|
|
- navigation.indexes
|
|
- content.code.annotate
|
|
palette:
|
|
- media: "(prefers-color-scheme: light)"
|
|
scheme: default
|
|
primary: teal
|
|
accent: teal
|
|
toggle:
|
|
icon: material/brightness-7
|
|
name: Switch to dark mode
|
|
- media: "(prefers-color-scheme: dark)"
|
|
scheme: slate
|
|
primary: teal
|
|
accent: teal
|
|
toggle:
|
|
icon: material/brightness-4
|
|
name: Switch to light mode
|
|
|
|
markdown_extensions:
|
|
- meta
|
|
- toc:
|
|
permalink: true
|
|
- pymdownx.highlight:
|
|
anchor_linenums: true
|
|
extend_pygments_lang:
|
|
- name: php
|
|
lang: php
|
|
options:
|
|
startinline: true
|
|
- pymdownx.inlinehilite
|
|
- pymdownx.snippets:
|
|
auto_append:
|
|
- docs/includes/links.md
|
|
- pymdownx.superfences
|
|
- admonition
|
|
|
|
nav:
|
|
- Introduction: index.md
|
|
- Getting Started: getting-started.md
|
|
- Credits: credits.md
|
|
- Changelog: changelog.md
|
|
- Usage:
|
|
- Validation: validation.md
|
|
- Message customization: message-customization.md
|
|
- Source: source.md
|
|
- Mapping:
|
|
- Type strictness: mapping/type-strictness.md
|
|
- Construction strategy: mapping/construction-strategy.md
|
|
- Inferring interfaces: mapping/inferring-interfaces.md
|
|
- Handled types: mapping/handled-types.md
|
|
- Other:
|
|
- Performance & caching: other/performance-and-cache.md
|
|
- Dealing with dates: other/dealing-with-dates.md
|
|
- Static analysis: other/static-analysis.md
|