src/PayPalRestApiClient/Traits/LinkFinder.php
protected function findLink($rel)
    {
        $result = array_filter($this->getLinks(), function($link) use ($rel) {
            if ( ! $link instanceof LinkInterface) {
                throw new \RuntimeException("All element of links array should implement PayPalRestApiClient\Model\LinkInterface");
            }

            if ($rel === $link->getRel()) {
                return true;
            }
        });

        if (count($result) > 0) {
            $link = array_shift($result);

            return $link;
        }

        throw new \RuntimeException("Cannot find a link corresponding to rel '".$rel."'");
    }
protected function findLink($rel)
    {
        $result = array_filter($this->getLinks(), function($link) use ($rel) {
            if ( ! $link instanceof LinkInterface) {
                throw new \RuntimeException("All element of links array should implement PayPalRestApiClient\Model\LinkInterface");
            }

            if ($rel === $link->getRel()) {
                return true;
            }
        });

        if (count($result) > 0) {
            $link = array_shift($result);

            return $link;
        }

        throw new \RuntimeException("Cannot find a link corresponding to rel '".$rel."'");
    }
Searches and returns the first link object with attribute "rel" equal to $rel input variable

@param string $rel

@return PayPalRestApiClient\Model\LinkInterface