We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
passing a Style/Cell object to the consctructor of Element/Cell ignores the object. A new Style/Cell object is always created.
In Element/Cell
public function __construct($width = null, $style = null) { $this->width = $width; $this->style = $this->setNewStyle(new CellStyle(), $style, true); }
should be changed to (not stable)
public function __construct($width = null, $style = null) { $this->width = $width; $this->style = $this->setNewStyle(new CellStyle(), $style, !$style); }
or better (stable parameter three)
public function __construct($width = null, $style = null) { $this->width = $width; $this->style = $this->setNewStyle(new CellStyle(), $style, !($style instanceof CellStyle)); }
or best case (without using $this->setNewStyle)
public function __construct($width = null, $style = null) { $this->width = $width; if($style instanceof CellStyle) { $this->style = $style; } elseif(is_array($style)) { $this->style = new CellStyle(); $this->style->setStyleByArray($style); } elseif($style === null) { $this->style = new CellStyle(); } else { throw new \InvalidArgumentException("Invalid style"); } }
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
passing a Style/Cell object to the consctructor of Element/Cell ignores the object. A new Style/Cell object is always created.
In Element/Cell
should be changed to (not stable)
or better (stable parameter three)
or best case (without using $this->setNewStyle)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: