Greg Korba πŸ› οΈ Codito Profile picture
πŸ‡΅πŸ‡± https://t.co/BLWMo9OTuf πŸ‡¬πŸ‡§ https://t.co/JA8CNV1PIH | Self-educated specialist: PHP, CI/CD, QA automation, Docker, Gitlab and more 😎. Member of @PHPCSFixer team πŸͺΆ.
Dec 16, 2022 β€’ 22 tweets β€’ 9 min read
In recent days I saw several examples of "actions" in #Laravel, but one especially got my attention and I wanted to clarify it - so we had little discussion with @wendell_adriel and I would like to share my opinion about this particular approach πŸ™‚

πŸ§΅πŸ‘‡

Before we start, one important preface: I'm big fan of explicitness and testability, so I'm using dependency injection everywhere (where's applicable). Examples in this thread will use it too by default, along with #PHP 8.0+ syntaxes.
Dec 14, 2022 β€’ 7 tweets β€’ 4 min read
πŸ“ŠπŸ§΅ #CoditoStats πŸ™‚

While I don't care much about numbers, I check #TwitterAnalytics from time to time mostly because of monthly summaries. Let me tell you that last 28 days were pretty intense comparing to previous period 😁

Let's look what happened! πŸ‘‡ Image First of all @davorminchorov mentioned me in his thread about enums. We initially had discussion about them under his PR (github.com/learnhubdev/la…), but this thread extended it even more πŸ™‚



(187 engagements at this point)
Dec 5, 2022 β€’ 18 tweets β€’ 6 min read
πŸ€” Dictionaries: should they be in the database? πŸ€”

Dictionary is set of values that are supported in your application. But how they should be defined? Well, as always, it depends πŸ˜‰ #PHP #architecture

Let me tell you what I think about it πŸ‘‡πŸ§΅ In general, I believe there are two types of dictionaries:

1) Internal, related to your app's logic
2) UI-managable, related to app instance's data

Let's look about difference between them πŸ™‚
Dec 4, 2022 β€’ 8 tweets β€’ 3 min read
πŸ’‘Value Object: what's that?

Basically, it's a simple object representation of some kind of reusable data structure. Unlike entity, it does not have identity, so value objects are considered as equal if underlying data is equal.

Want to know more? Read below πŸ‘‡πŸ§΅ #architecture Value Object representing name Value Objects encapsulate data and ensure its validity - constructor can, and should, check if provided primitive values are correct. Thanks to that, when you pass VO to other methods, you can be sure it carries proper information πŸ™‚
Aug 24, 2022 β€’ 18 tweets β€’ 8 min read
There were many discussions if #Laravel's facades implement GoF's Facade Pattern, but I think it does not matter at this point - the team won't change naming convention anyway. Naming is not a problem, I see other issues with facades - a #PHP thread 🧡 1) They're basically magic πŸͺ„ Some may see it as advantage, but I consider it as drawback. You don't execute exact code you're calling, but your call is proxied to some underlying service. It strictly couples your code with the framework, which handles it.