src/Invoice/Source.php
public function getCreditNotes()
    {
        $result = null;
        if ($this->getType() === static::Order) {
            $result = array();
            $shopCreditNotes = $this->getShopCreditNotesOrIds();
            foreach ($shopCreditNotes as $shopCreditNote) {
                $result[] = new static(static::CreditNote, $shopCreditNote);
            }
        }
        return $result;
    }
public function getCreditNotes()
    {
        $result = null;
        if ($this->getType() === static::Order) {
            $result = array();
            $shopCreditNotes = $this->getShopCreditNotesOrIds();
            foreach ($shopCreditNotes as $shopCreditNote) {
                $result[] = new static(static::CreditNote, $shopCreditNote);
            }
        }
        return $result;
    }
public function getCreditNotes ( ) { $ result = null ; if ( $ this -> getType ( ) === static :: Order ) { $ result = array ( ) ; $ shopCreditNotes = $ this -> getShopCreditNotesOrIds ( ) ; foreach ( $ shopCreditNotes as $ shopCreditNote ) { $ result [ ] = new static ( static :: CreditNote , $ shopCreditNote ) ; } } return $ result ; }
Returns the set of credit note sources for an order source.

Do not override this method but override getShopCreditNotes() instead.

@return Source[]|null
If the invoice source is an order, an array of refunds is returned,
null otherwise.
Returns the set of credit note sources for an order source .