Hot take: I love #Symfony, it's really the best #PHP framework out there (at least, the most powerful), but this obsession with #YAML is just… something. When I read workflows, even sample ones, my brain issues a warning about possible stack overflow 😂
A sample from a blog post about enums in workflows in 7.4:
```
# config/packages/workflow.yaml
framework:
workflows:
blog_publishing:
type: 'workflow'
marking_store:
type: 'method'
property: 'status'
supports:
- App\Entity\BlogPost
initial_marking: !php/enum App\Enumeration\BlogPostStatus::Draft
places: !php/enum App\Enumeration\BlogPostStatus
transitions:
to_review:
from: !php/enum App\Enumeration\BlogPostStatus::Draft
to: !php/enum App\Enumeration\BlogPostStatus::Reviewed
publish:
from: !php/enum App\Enumeration\BlogPostStatus::Reviewed
to: !php/enum App\Enumeration\BlogPostStatus::Published
reject:
from: !php/enum App\Enumeration\BlogPostStatus::Reviewed
to: !php/enum App\Enumeration\BlogPostStatus::Rejected
```
Maybe it's just me, but to me it's extremely hard to read and debug.
in reply to André Polykanine

I absolutely hate YAML… one misplaced space, and your GitHub actions workflow file can break the build of your Hugo based website when publishing to gitHub Pages YAML and JSON files are my least favorite file types to work with. They make me want to pull out my hair, or go to the top of the Columbia tower in downtown Seattle and toss my laptop off the roof. That would be a 73 story drop by the way.
in reply to André Polykanine

Agreed. I absolutely *hate* frameworks and other projects that put code in config files like this, and it's something that always turns me away whenever I start think "maybe I should finally learn Symfony" again. And if it must be done, YAML is a particularly poor choice for it: noyaml.com/

My fave Nette does it too (and in its own bespoke config file format no less) but at least it's to a far lesser degree than Symfony and friends do it.

in reply to André Polykanine

Теперь понял о чём ты тогда рассказывал. Мда уж, понять можно, но так себе и не сразу. Навеяло воспоминания про всякие конструкции из реактивного Спринга. Вот там такое можно накрутить, с другой стороны, в императивном стиле смотрелось бы ещё хуже.
in reply to Kirill

@Yinshi Я бы хотел флюэнт стайл. Ну типа такого: $config->doSomething()->thenSomethingElse()->andthisAlso(). В Джаве это были бы точки вместо стрелок. Очень удобно, особенно если каждая строка с точки начинается. Ну типа LINQ в Шарпике.
in reply to André Polykanine

Дада, в .NET есть места где можно писать в таком стиле, оно и называется Fluent API. В EF Core так можно конфигурировать например, или библиотека для валидации, забыл как называется. А LINQ крутая вещ, в своё время знатно насобачился и много использовал в проекте, тем более там конвертировалось сразу в SQL. Я бы и сам мог его написать, но лень же, да и пусть компилятор за меня поработает. Главное контролировать что на выходе, а то есть ситуации, когда лучше самому написать SQL.
in reply to André Polykanine

Вообще, пока я тут погружаюсь во всё это дело, радует что помню больше чем предполагал. Конечно не смогу зафигачить многопоточный код, используя примитивы синхронизации вроде семафоров, или настраивать пул потоков, но в целом картина в голове более приличная.
Unknown parent

mastodon - Link to source

Ben Ramsey

@hand I’d love to see an example of what this looks like. André mentioned a security config that used fluent interfaces.

Can you point to a config file that shows an example of what you mean?

Do you mean something like this? github.com/mezzio/mezzio-skele…