public function getBrokenLinks($showSummaryInfo = false){
        $brokenLinks = $this->filter(function(Link $link){
            return $link->isVisited() !== Link::STATUS_NOT_VISITED &&  //exclude links that are not visited
                    $link->checkCrawlableStatusCode()===false;
        });
        
        return $showSummaryInfo===false? //retrieve summary or details of links
                $brokenLinks:
                $brokenLinks->map(function(Link $link){
            return [
                'source_page' => $link->getParentUrl(),
                'link' => $link->getAbsoluteUrl(),
                'status_code' => $link->getStatusCode(),
            ];
        });
        
    }
public function getBrokenLinks($showSummaryInfo = false){
        $brokenLinks = $this->filter(function(Link $link){
            return $link->isVisited() !== Link::STATUS_NOT_VISITED &&  //exclude links that are not visited
                    $link->checkCrawlableStatusCode()===false;
        });
        
        return $showSummaryInfo===false? //retrieve summary or details of links
                $brokenLinks:
                $brokenLinks->map(function(Link $link){
            return [
                'source_page' => $link->getParentUrl(),
                'link' => $link->getAbsoluteUrl(),
                'status_code' => $link->getStatusCode(),
            ];
        });
        
    }
public function getBrokenLinks ( $ showSummaryInfo = false ) { $ brokenLinks = $ this -> filter ( function ( Link $ link ) { return $ link -> isVisited ( ) !== Link :: STATUS_NOT_VISITED && //exclude links that are not visited $ link -> checkCrawlableStatusCode ( ) === false ; } ) ; return $ showSummaryInfo === false ? //retrieve summary or details of links $ brokenLinks : $ brokenLinks -> map ( function ( Link $ link ) { return [ 'source_page' => $ link -> getParentUrl ( ) , 'link' => $ link -> getAbsoluteUrl ( ) , 'status_code' => $ link -> getStatusCode ( ) , ] ; } ) ; }
getting broken links
@param bool $showSummaryInfo if set to true, it will return only status_code and source page
@return LinksCollection
getting broken links