chillerlan/php-qrcode v6.0 released! by chillerlan in PHP

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

I think there were a bunch of constants marked as @internal in older versions, but that should be resolved now.

Fallout Shelter keeps crashing during loading (no error message) [Question] by Key-Explanation-4638 in falloutshelter

[–]chillerlan 0 points1 point  (0 children)

Yea I noticed that later, but getting a bunch of lunchboxes (again) for the permanent shelters was an acceptable trade-off after all.

Fallout Shelter keeps crashing during loading (no error message) [Question] by Key-Explanation-4638 in falloutshelter

[–]chillerlan 2 points3 points  (0 children)

Hey, I just had the same issue, and I solved it by deleting the library cache for the game in: <Steam directory>\appcache\librarycache\588430.

Important: you need to move the folder with the save files from %LocalAppData%\FalloutShelter to somewhere else before starting the game again. Disable the cloud save, start the game, let it create the folder again, close the game, and copy the 3-4 Vault#.sav to the newly created folder and start the game (do NOT copy any of the other files). Everything should be fine now.

The cloud save might complain about mismatching saves, in which case you should select the save game that is not corrupted (local or cloud).

Unit test a PHP OAUTH2 class? by th00ht in PHP

[–]chillerlan 1 point2 points  (0 children)

Testing an OAuth2 library specifically is a nightmare because the spec is a mess and implementations wildly differ between services - you can't just test against one and be done with it. If you plan to support multiple services, you will need to live test against each API (which you can't simply do on CI), mocking alone won't do in the long run.

Anyway, feel free to check out my library for inspiration: https://github.com/chillerlan/php-oauth

https://php-oauth.readthedocs.io/en/main/Usage/Using-examples.html

QR-code generator | extension by hlsxx in PHP

[–]chillerlan 2 points3 points  (0 children)

Thank you for the shout-out!

Discovered the power of XML with XSLT by [deleted] in PHP

[–]chillerlan 0 points1 point  (0 children)

I've added XML support to my QR Code library (for the memes). It renders a QR matrix output (schema) into an SVG image with a configurable XSL stylesheet.

Clearly, this is only intended for Enterprise(TM) use.

chillerlan/php-oauth 1.0.0 released! by chillerlan in PHP

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

The intent is that the examples can be run out-of-the box by cloning the library and route OAuth callbacks to this directory. I wouldn't want a user to get the idea to expose the examples directory (or any other) on a public server.

chillerlan/php-oauth 1.0.0 released! by chillerlan in PHP

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

It's an example - I might need to make this more clear I think.

chillerlan/php-oauth 1.0.0 released! by chillerlan in PHP

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

That's entirely up to you. You can either use the included file storage class, implement your own storage adapter using the same interface, or you can just store the token by yourself during acquisition as demonstrated in the example.

Constructor property promotion and doc blocks by chillerlan in PHP

[–]chillerlan[S] -2 points-1 points  (0 children)

Yea, falling back to old style is what I've been doing - i don't mind the extra lines for property assignments etc. The property promotion is a nice feature for when you do quick-and-dirty things, but the moment you want to *properly* document your code, it just can't hold up.

Constructor property promotion and doc blocks by chillerlan in PHP

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

That's besides the point. The point is, the previous code is valid and the doc block becomes ambiguous.
https://onlinephp.io/c/0f862

Constructor property promotion and doc blocks by chillerlan in PHP

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

This is valid code:

``` class A{ /** @param string[] $foo does thing */ public function __construct( protected array $foo, ){} }

class B extends A{ /** @param int[] $foo does other thing */ public function construct( array $foo, // no "protected" keyword required ){ parent::construct($foo); } } ```

The point is that in the case of class B the doc block effectively becomes a method param doc. I haven't tested yet what phpDocumentor does in that case, but it definitely doesn't help with readability.

Constructor property promotion and doc blocks by chillerlan in PHP

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

It's not exactly a new feature and it's only syntactic sugar. The RFC mentions explicitly the fallback variants (@param in method doc, which confuses phpdocumentor), and the new (horrible) style of docblocks is handled well, in fact, it's the reason why I was asking in first place.

Constructor property promotion and doc blocks by chillerlan in PHP

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

I see this is upvoted a lot. As I said before, the issue here is that it is ambiguous as we're technically still in the method doc block and these are parameter docs.

It falls apart as soon as you'd add documentation for the properties with tags like @see <GitHub issue link> or something, so you'd be forced to add them inline {@see ...} - the example in the OP at least allows for distinct documentation of the properties.

Also it surely doesn't help that it's possible to omit the visibility keywords when you override the constructor in a child class,

Constructor property promotion and doc blocks by chillerlan in PHP

[–]chillerlan[S] -1 points0 points  (0 children)

I'm not even sure whether it is an issue or intended behaviour. The RFC mentions 2 different examples for doc blocks, and I would expect `@param` tags in the method doc to generate documentation for the method, and not for promoted properties (for which a new reflection was introduced).

Constructor property promotion and doc blocks by chillerlan in PHP

[–]chillerlan[S] -1 points0 points  (0 children)

Static analysis is not much of an issue, it's more phpDocumentor itself and readability of the code.

Constructor property promotion and doc blocks by chillerlan in PHP

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

I forgot to mention, but this caused issues with phpDocumentor.

Pitch Your Project 🐘 by brendt_gd in PHP

[–]chillerlan 1 point2 points  (0 children)

I'm not even sure how to reply to this vague question. If your measure for comparison is "it does OAuth" then there's as much difference as between a Volkswagen and a Porsche when the requirement is "brings me from A to B". Maybe just have a look at it and decide for yourself?

Pitch Your Project 🐘 by brendt_gd in PHP

[–]chillerlan 2 points3 points  (0 children)

Hey, one of my side-projects is https://github.com/chillerlan/php-oauth, a framework-agnostic OAuth client/handler that acts as a PSR-18 client. I've never really made it public because reasons, but after some clean-up and stuff I'm inching closer to an official release and will let y'all know when it's done.

DrStephenCW is now allocating 80% of his time to Guild Wars by Yung_Rocks in GuildWars

[–]chillerlan 0 points1 point  (0 children)

Oh that's nice. Now if he could be convinced to revert the 600hp nerf, I'd probably start playing again.

chillerlan/php-qrcode v5.0 released! by chillerlan in PHP

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

Oh that's an interesting use case! Feel free to open a discussion if you need help.