-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use the decorator feature for Asset methods #4
Comments
The issue is that the Usually you could do something like this for such dynamic classes: namespace Kirby\Filesystem
{
/**
* @mixin \Kirby\Filesystem\File
*/
class Asset
{
// ...
}
} This nothing this plugin can currently provide. |
Oh interesting. I knew Would it make more sense to ask the core team to add the @mixin annotation directly to |
It would make sense to have this in the core. Not sure where their stance is on using |
Okay! I'll close this topic here and then approach the Kirby team about the possibility of adding Do you know where the best place to approach them about this is? I think the options are GitHub, Discord, the forum, and https://feedback.getkirby.com/, but it isn't exactly clear to me what is the preferred place to reach the Dev team about something like this. |
Github is probably a good place to start. You could also try to directly create a PR for that if you can. Feel free to reference this issue and you can leave it open. I'm considering adding the |
Hello,
I'm not sure if this is the correct place to post something like this, so feel free to redirect me if needed.
I am trying to generate a stub so that PhpStorm doesn't complain that
read()
is not a method ofKirby\Filesystem\Asset
when doing this:asset('logo.svg')->read()
.My interpretation of the docs is that the decorator feature was designed to handle this, so I edited my /site/config/config.php:
However, it doesn't work as I would expect. If I do a diff with the generated types file before and after I added the above to my config, I see that there is no change:
![image](https://private-user-images.githubusercontent.com/108958455/352855608-be96e667-fa62-4c48-825a-03617dba0acc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NzA5NjAsIm5iZiI6MTczOTU3MDY2MCwicGF0aCI6Ii8xMDg5NTg0NTUvMzUyODU1NjA4LWJlOTZlNjY3LWZhNjItNGM0OC04MjVhLTAzNjE3ZGJhMGFjYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQyMjA0MjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MWY4ZGZhZmRlYzlkZDFkMzVjYjFhOTJjMTY5NGFiMmUzZTA3MjExNzAyOGYwYjgwYjU4NWE0MWRjNGU5NTgzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.SC9DH-Vu5FCskIzAVRWGNU1rqKowPWRWCIE2jrzP-3A)
For fun, I also tried editing the /plugins/kirby-types/config.php file to add:
But that didn't seem to have an effect either. So, is there something I am doing wrong or is this a bug?
The text was updated successfully, but these errors were encountered: