How to check given path has File using isFile() method Magento 2?

Magento 2, You can check the given path is a file or not using isFile() method.

Example, You have an image inside pub/media folder with path,
$imagePath = ‘/catalog/product/placeholder/default/coming-soon.jpg’;

You can see a placeholder image at the above location in the media folder.

Now you have to check coming-soon.jpg file is exist or not using Magento 2, You need to use below code snippet,

coming-soon.jpg is reside under the above location.

You can check the given path is file exists or not using above way by passing image path only.