[Real World] PHP To Markdown
Fun refactoring I had to do in the real world. This presents several challenges: - How to create a table that fits the informations exactly - How to keep track of two informations per line while doing the refactoring - Generate the link from the actual text Have fun!
Start file
public const SCHEMA_MAPPED_CONSTRAINTS = [
Url::class => 'http://schema.org/url',
Email::class => 'http://schema.org/email',
Uuid::class => 'http://schema.org/identifier',
CardScheme::class => 'http://schema.org/identifier',
Bic::class => 'http://schema.org/identifier',
Iban::class => 'http://schema.org/identifier',
Date::class => 'http://schema.org/Date',
DateTime::class => 'http://schema.org/DateTime',
Time::class => 'http://schema.org/Time',
Image::class => 'http://schema.org/image',
File::class => 'http://schema.org/MediaObject',
Currency::class => 'http://schema.org/priceCurrency',
Isbn::class => 'http://schema.org/isbn',
Issn::class => 'http://schema.org/issn',
];
End file
Constraints | Vocabulary |
--------------------------------------------------------------------------------------|-----------------------------------|
[`Url`](https://symfony.com/doc/current/reference/constraints/Url.html) | `http://schema.org/url` |
[`Email`](https://symfony.com/doc/current/reference/constraints/Email.html) | `http://schema.org/email` |
[`Uuid`](https://symfony.com/doc/current/reference/constraints/Uuid.html) | `http://schema.org/identifier` |
[`CardScheme`](https://symfony.com/doc/current/reference/constraints/CardScheme.html) | `http://schema.org/identifier` |
[`Bic`](https://symfony.com/doc/current/reference/constraints/Bic.html) | `http://schema.org/identifier` |
[`Iban`](https://symfony.com/doc/current/reference/constraints/Iban.html) | `http://schema.org/identifier` |
[`Date`](https://symfony.com/doc/current/reference/constraints/Date.html) | `http://schema.org/Date` |
[`DateTime`](https://symfony.com/doc/current/reference/constraints/DateTime.html) | `http://schema.org/DateTime` |
[`Time`](https://symfony.com/doc/current/reference/constraints/Time.html) | `http://schema.org/Time` |
[`Image`](https://symfony.com/doc/current/reference/constraints/Image.html) | `http://schema.org/image` |
[`File`](https://symfony.com/doc/current/reference/constraints/File.html) | `http://schema.org/MediaObject` |
[`Currency`](https://symfony.com/doc/current/reference/constraints/Currency.html) | `http://schema.org/priceCurrency` |
[`Isbn`](https://symfony.com/doc/current/reference/constraints/Isbn.html) | `http://schema.org/isbn` |
[`Issn`](https://symfony.com/doc/current/reference/constraints/Issn.html) | `http://schema.org/issn` |
View Diff
1,16c1,17
< public const SCHEMA_MAPPED_CONSTRAINTS = [
< Url::class => 'http://schema.org/url',
< Email::class => 'http://schema.org/email',
< Uuid::class => 'http://schema.org/identifier',
< CardScheme::class => 'http://schema.org/identifier',
< Bic::class => 'http://schema.org/identifier',
< Iban::class => 'http://schema.org/identifier',
< Date::class => 'http://schema.org/Date',
< DateTime::class => 'http://schema.org/DateTime',
< Time::class => 'http://schema.org/Time',
< Image::class => 'http://schema.org/image',
< File::class => 'http://schema.org/MediaObject',
< Currency::class => 'http://schema.org/priceCurrency',
< Isbn::class => 'http://schema.org/isbn',
< Issn::class => 'http://schema.org/issn',
< ];
---
> Constraints | Vocabulary |
> --------------------------------------------------------------------------------------|-----------------------------------|
> [`Url`](https://symfony.com/doc/current/reference/constraints/Url.html) | `http://schema.org/url` |
> [`Email`](https://symfony.com/doc/current/reference/constraints/Email.html) | `http://schema.org/email` |
> [`Uuid`](https://symfony.com/doc/current/reference/constraints/Uuid.html) | `http://schema.org/identifier` |
> [`CardScheme`](https://symfony.com/doc/current/reference/constraints/CardScheme.html) | `http://schema.org/identifier` |
> [`Bic`](https://symfony.com/doc/current/reference/constraints/Bic.html) | `http://schema.org/identifier` |
> [`Iban`](https://symfony.com/doc/current/reference/constraints/Iban.html) | `http://schema.org/identifier` |
> [`Date`](https://symfony.com/doc/current/reference/constraints/Date.html) | `http://schema.org/Date` |
> [`DateTime`](https://symfony.com/doc/current/reference/constraints/DateTime.html) | `http://schema.org/DateTime` |
> [`Time`](https://symfony.com/doc/current/reference/constraints/Time.html) | `http://schema.org/Time` |
> [`Image`](https://symfony.com/doc/current/reference/constraints/Image.html) | `http://schema.org/image` |
> [`File`](https://symfony.com/doc/current/reference/constraints/File.html) | `http://schema.org/MediaObject` |
> [`Currency`](https://symfony.com/doc/current/reference/constraints/Currency.html) | `http://schema.org/priceCurrency` |
> [`Isbn`](https://symfony.com/doc/current/reference/constraints/Isbn.html) | `http://schema.org/isbn` |
> [`Issn`](https://symfony.com/doc/current/reference/constraints/Issn.html) | `http://schema.org/issn` |
>
Solutions by @nickandbro:
Unlock 6 remaining solutions by signing in and submitting your own entry