How to call abstract method from interface I would like to use a method of fileExists. It belongs to VolumeInterface.
https://docs.craftcms.com/api/v3/craft-base-volumeinterface.html

I suppose the code would be like \craft\base\Volume::fileExists($path).

However, Craft returns an error;

Non-static method craft\base\VolumeInterface::fileExists() cannot be called statically


Could I ask how I should modify the code?
The normal way would be to instantiate and call non-statically like this:

(new \craft\base\Volume)-&gt;fileExists($path);

...However, that won't work here because it's an abstract class, which, by definition, cannot be instantiated. Assuming you're dealing with an Asset element(?), try calling getVolume() and then you should be able to call fileExists() from there. E.g:

$asset-&gt;getVolume()-&gt;fileExists();