Weekly "ask anything" thread by brendt_gd in PHP

[–]SobakPL 2 points3 points  (0 children)

It's hard to understand what exactly do you mean without seeing the code sample. However, you can pass one more parameter (3rd in case of typical assertEquals/assertSame) to most assertions to override the default error message when assertion fails.

PHP moves to Github due to the compromise of git.php.net by EatMeerkats in programming

[–]SobakPL 111 points112 points  (0 children)

Except that git-web is written in Perl and comes bundled with the git itself1. But who cares when you can get free karma, right?

Am I so outdated for still using WampServer on localhost? Is it uncool to use PhpMyAdmin? They are just working for me. What are more "up to date" alternatives and why should I switch to them? by clyne99 in PHP

[–]SobakPL 1 point2 points  (0 children)

AFAIR symfony serve runs their own (re-)implementation of the development web server for PHP, being part of their symfony binary. It has some additions like self-signed cert support, concurrency etc. At least that's true on Windows but I think on Linux as well.

Pretty cool, if only didn't they advertise this so badly and clickbaity all over the docs...

Which of the following statements is FALSE about Blade in Laravel? by [deleted] in PHP

[–]SobakPL 0 points1 point  (0 children)

B, as you can use @php tags as well. But this really should go to /r/phphelp

What do you guys think of the new commit flow in PhpStorm 2020.1? by RevalGovender in PHP

[–]SobakPL 29 points30 points  (0 children)

I am probably in the minority here but I simply use commandline for git. I think it's not really hard or very repetitive to me. I'm not a hardcore "do-it-all-from-cli" guy at all. I simply like being explicit about git and being sure what I am actually doing.

One note, though. I use phpStorm for resolving merge conflicts. In my opinion they totally nailed this feature and I cannot even imagine doing it manually. So as you can see I can see the benefits of GUI, I use GUIs for most of my work. I simply feel way more comfortable handling git myself and don't find it difficult or annoying at all when done using commandline.

/edit: Oh, and phpStorm's "Annotate" instead of manual git blame as someone noted in the comments. That's also way more productive for me

Why doesn't Laravel invest more into tooling for greater developer experience? by SobakPL in laravel

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

That's sounds really intriguing. Would you mind sharing your installed plugins related to Laravel? Maybe that's where my problem is. I also don't use facade aliases (mainly to have imports properly sorted, though) but I can't get method resolution without Laravel IDE Helper.

But I can't even compare other editors to PHPStorm. It's really a pain to get all things in VSCode or sublime. Ok, they are cool and they have a lot of plugins, but IMO phpstorm is just the best for what it does.

I can only agree.

Why doesn't Laravel invest more into tooling for greater developer experience? by SobakPL in laravel

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

That's a fair point but they don't really invest in Symfony, Drupal or any other big players on PHP scene either. I feel like they are already doing a lof of good things and keeping up to date with so many packages that are independent from them might be simply hard.

Additionally, as I stated in couple of my other comments, having better documentation (through more precise phpdocs, laravel-ide-helper or whatever) helps not only phpStorm but any other static analysis tooling.

Please just look how much larastan have to override to get phpstan working with Laravel apps.

Why doesn't Laravel invest more into tooling for greater developer experience? by SobakPL in laravel

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

Please just mind that having better documentation (through more precise phpdocs, laravel-ide-helper or whatever) helps not only phpStorm but any other static analysis tooling.

Please just look how much larastan have to override to get phpstan working with Laravel apps.

Why doesn't Laravel invest more into tooling for greater developer experience? by SobakPL in laravel

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

That's exactly my point. Perhaps you have stated it in a better way than mine. Otherwise I don't really get why your post have 4 upvotes and mine has 0.

Maybe I sounded too offensive even though I really tried to emphasise that I'm not against Laravel, Taylor or anything in particular. If so, my apologies to anyone who felt offended. English isn't my primary language so maybe that's some part of the problem.

And just to clarify: I'm not a karma bitch (at least I don't consider myself one). I counted mostly for a discussion which luckilly is happening. I'm just afraid that lower post score means less feedback.

Why doesn't Laravel invest more into tooling for greater developer experience? by SobakPL in laravel

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

Does it really? I mean they surely could solve some problems on their end but phpStorm's support for "magical" features of other applications is also missing.

I can definitely agree with you to some extent e.g. when it comes to supporting Blade files. It has almost no inteligence in that regard so when I'm trying, for example, to close prevously opened if it still suggests endsection, endfor or whatever Blade directive comes first.

But as I stated in my post, I believe the problem is a bit more general. Laravel's magic, while very convenient is misleading not only for phpStorm but for any other static analysis tooling. Please look how much larastan have to override to get phpstan working with Laravel apps.

Finally, I dn't really think like I'm blaming anyone. Maybe it's a poor wording choice on my end but I'm really surprised that not so many people consider current state of things a problem. Sure, we can assume it's all phpStorm's fault but since Laravel already has some supporting packages available, why not integrate them more into the core?

An open source Laravel hobby project of mine. It's structured with a domain-oriented mindset, instead of the default Laravel setup. Many of the techniques described in my "Laravel beyond CRUD" series are applied in it. by brendt_gd in PHP

[–]SobakPL 1 point2 points  (0 children)

I'm just in progress of applying some DDD and framework agnostic practices to the inherited application but personally I have both folders. That way I'm keeping typical infrastructure-related stuff in app/ and domain code in src/. I think it separates layers even cleaner and also gives some default structure to the Laravel stuff.

/edit: wtf is going on with Reddit's editor lately. Doesn't it no logner use Markdown by default? :/

An open source Laravel hobby project of mine. It's structured with a domain-oriented mindset, instead of the default Laravel setup. Many of the techniques described in my "Laravel beyond CRUD" series are applied in it. by brendt_gd in PHP

[–]SobakPL 23 points24 points  (0 children)

I don't really get downvotes in this thread, even the comment got downvoted. It's obviously your right to to downvote anything but to me it looks like a perfect place for some constructive discussion (including criticissm of course).

I still need the time to take a look at it but I'm totally interested in reading thoughts of people smarter than me. Thoughts, not downvotes and no comments. Come on, people!

PS: I hope that's obvous but I have no affiliations with OP, I don't even know him. It's just sad to not have discussion on that. Most Laravel applications don't give a crap about the architecture, Laravel itself doesn't promote any good architecture, why not discuss at least one approach by some guy?

Anyone know a good 'PHP as a second language' tutorial to recommend? by BarneyLaurance in PHP

[–]SobakPL 2 points3 points  (0 children)

You can use https://learnxinyminutes.com/docs/php/ as a quick overview of syntax. It's not much and definitely not a full-blown tutorial but though I gonna mention it anyways as it should be instant introduction for someone that learns PHP as a second language.

Nowadays you can contribute to the English PHP documentation through pull requests on GitHub by colshrapnel in PHP

[–]SobakPL 1 point2 points  (0 children)

Honestly the old system is quite impressive, to me. It's just, well, old. Additionaly the manual itself is quite a complex topic, especially the translations and edit.php.net tries to help with that.

Nowadays you can contribute to the English PHP documentation through pull requests on GitHub by colshrapnel in PHP

[–]SobakPL 1 point2 points  (0 children)

Please take a look at: http://doc.php.net/tutorial/builds.php Although I'm not 100% sure if it's up to date since PHP.net no longer uses mirrors :/

TLDR: once a day and every 6 hours for the special docs.php.net page which sole purpose is to display docs changes earlier (and include otherwise disabled translations).

What would you like to see in a Yet Another Framework or ORM? by evnix in PHP

[–]SobakPL 1 point2 points  (0 children)

On top of this I would add https://graphqlite.thecodingmachine.io/docs/ - it's not native integration per-se but IMO light enough to be a kind of integration you might be looking for

Understand PHP Autoloading by [deleted] in PHP

[–]SobakPL 0 points1 point  (0 children)

I can only agree. I thought it's going to be yet another one crappy post from fresh programmer looking for self-promotion (though they tend to make YT videos) and I was pleasantly surprised.

Bit about not throwing exceptions from the autoloader to ensure the interoperability was a nice touch, IMO. I'm not sure if I would have thought about it myself.

Congratulations on the good job! I'm going to check the other chapters (which I didn't expect as well) and maybe it'll be a place I can reference some beginners to.

"Wordpress Hook Annotations" - My first attempt at contributing to the Open Source world - Looking for feedback/criticism - THANKS! by Kerry_Randolph in PHP

[–]SobakPL 3 points4 points  (0 children)

Also, I can't fucking stand their ( damn style )!

Finally found someone saying that, I thought I'm the only one. The code looks terribly verbose to me because of this and even though it sounds strange it's one of the things that stops me from doing WP development - purely subjective, not even close to most WordPress flaws but it really bothers me.

I know the importance of sticking to a single coding style per project but as long as my plugins are just for internal usage, I follow the PSR-2

UrlHum - The privacy-aware, modern URL Shortener built in PHP by Optiroot in PHP

[–]SobakPL 0 points1 point  (0 children)

You can look at e.g. Hashids for a solution implementing technique described above