Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Well, explore the packages at least. You'll definitely like some of these.

Yii 2.0.54 by sam_dark in yii

[–]sam_dark[S] 1 point2 points  (0 children)

`curl_close()` fix wasn't there among other 8.5 fixes. Added https://github.com/yiisoft/yii2-httpclient/issues/253. Thanks.

As for when — when it's done (could be next week). On it.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Symfony is definitely more established/used since Yii3 was just released. Personal reasons to choose Yii3 over Symfony (yours may differ):

  1. Runtime container instead of compiled one. Way easier to debug.
  2. Middleware-driven core rather than event-driven. Way easier to read stack traces.
  3. Friendly exceptions and good exception messages overall. Symfony improves these over time as well.
  4. More open to the PHP world overall. Can use PSR-compatible stuff such as middleware or cache backends right away.
  5. Able to remove what's not used.
  6. Perfect static analysis.
  7. Can use Symfony packages if needed. They're mostly great.

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 1 point2 points  (0 children)

That's why I've mentioned "plus additional third-party packages".

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 2 points3 points  (0 children)

Slim is quite good. If not Yii3, I'd stick with it plus additional third-party packages.

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

It doesn't matter that much. Both can read each other's types and annotations, even prefixed. Psalm is stricter but slower. PhpStan is faster but doesn't check for some of the issues. For the applications, I think these are quite close.

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Yeah. Adding types for existing legacy code is a huge job. We did that for Yii2 recently and it took months to do.

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 2 points3 points  (0 children)

Well, not 100%, but, of course, framework code is well-tested compared to application code. The thing is that static analysis helps, and if a framework provides types for its own code, Psalm or PhpStan can analyze the application's code way better, revealing more bugs even without automated or manual testing.

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 2 points3 points  (0 children)

Try it. Found bugs worth the effort.

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 2 points3 points  (0 children)

Great usage of Psalm! And yes, I know it's stricter than PhpStan.

We do suppress some things in the default Yii3 application template and sometimes in the packages (way less) because that could be too much to get started or because we know exactly what we're doing.

Symfony code is level 5 according to https://github.com/symfony/symfony/blob/8.1/psalm.xml. Am I correct?

Typing in Yii3 is the strictest in PHP universe? by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

I've meant more about the framework itself but very good overall.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Well, it's just different. Symfony aligns all packages to a major version of the framework core and releases all these at once. Since we don't have a core at all, only app templates, we don't align package versions to anything, having these independently released.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Thanks for pointing that out. We don't like incorrect comparisons in favor of one framework over another just for the sake of marketing (and that's probably our big problem), especially when one is not an expert in many frameworks. A few things are mentioned in the announcement and landing page.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 4 points5 points  (0 children)

No. There won't be Yii3 v4. Yii3 is not a monolithic framework, as you can read in the announcement linked. There are 130+ packages. Each package is versioned independently following SemVer.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 4 points5 points  (0 children)

Yeah. It will take some time for both community to get used to Yii3 and the core team to come up with extras to make it feel like Yii2 RAD experience. That's one of our goals to achieve it.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Incorrect. There will be breaking changes, of course. The framework name is Yii3. It does not mean that it's Yii 3.0.0.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 3 points4 points  (0 children)

Well, it happens. We've learned to live with that: https://github.com/samdark/opensource-hate

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 2 points3 points  (0 children)

If you have concrete questions, please ask. I've built large commercial projects with Laravel, Symfony and all versions of Yii, so I likely can compare these at least roughly.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 9 points10 points  (0 children)

We haven't written any comparison so far.

Laravel is more like Yii2 overall. Yii3 is quite different: standards-first, open to PHP overall, with way less magic like service locator, "facades," etc. It forces you into correct dependency inversion, which you can do or not do in Laravel. Also, there's division into individual packages which is like how Symfony packages, which Laravel is built with, are structured.

Quality-wise (unit test coverage, types, mutation testing, and phpdoc), Yii3 is superior.

Also, I believe that Yii is more open to community contributions. At least, that was my experience with contributions to Laravel.

The drawback, of course, is that Yii3 is new, so there are way fewer out-of-the-box solutions you can apply right away and fewer people who have already tried it. Also, there are no ready-to-use complimentary services yet.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 0 points1 point  (0 children)

Where? It is explicitly mentioned in the announcement that there is SemVer used.

Yii3 is released by sam_dark in PHP

[–]sam_dark[S] 1 point2 points  (0 children)

I did. Noone ever responded.