1

From this \vendor\magento\module-wishlist\Pricing\ConfiguredPrice\ConfigurableProduct.php

File I find below code:

public function getConfiguredAmount(): \Magento\Framework\Pricing\Amount\AmountInterface
    {
        /** @var \Magento\Wishlist\Model\Item\Option $customOption */
        $customOption = $this->getProduct()->getCustomOption('simple_product');
        $product = $customOption ? $customOption->getProduct() : $this->getProduct();
        return $product->getPriceInfo()->getPrice(ConfiguredPriceInterface::CONFIGURED_PRICE_CODE)->getAmount();
    }

What the below code mean

public function getConfiguredAmount(): \Magento\Framework\Pricing\Amount\AmountInterface

  • Please check my answer, also let me know if there is need to expand it. – Vivek Kumar Aug 30 '18 at 19:06
1

It is a new feature in PHP 7 called Return type declarations.

Return type declarations specify the type of the value that will be returned from a function. The same types are available for return type declarations as are available for argument type declarations.

Relevant for your given code ;

When overriding a parent method, the child's method must match any return type declaration on the parent. If the parent doesn't define a return type, then the child method may do so.

You can read it more in new features notes - here

and detailed official documentation - here

Please don't hesitate to ping me in case of confusion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.