Lysice/laravel-xlswriter

在xlswriter扩展1.4+的版本存在问题

Opened this issue · 0 comments

在xlswriter扩展1.4+的版本存在问题
扩展在1.4开始对 setPrintedPortrait与setPrintedLandscape 进行了非兼容式改名,所以使用高版本的扩展会报错

虽然我通过调整源码可以临时使用,但是composer的库没有更新,每次都得做侵入式修改,确实比较繁琐

以下为兼容方式,请修复一下这个缺陷吧。.
/**
* setPortrait
* @return $this
* @throws Exception
*/
private function setPortrait()
{
if(method_exists($this,'setPrintedPortrait')){
$this->excel->setPrintedPortrait();
}else{
$this->excel->setPortrait();
}
return $this;
}

/**
 * setLandscape
 * @return $this
 * @throws Exception
 */
private function setLandscape()
{
    if(method_exists($this,'setPrintedLandscape')){
        $this->excel->setPrintedLandscape();
    }else{
        $this->excel->setLandscape();
    }
    return $this;
}