File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -110,19 +110,19 @@ public static function getStyleDefinition($name)
110110 /**
111111 * Sets table style.
112112 *
113- * @param string $name The style name
113+ * @param TableStyle| string $name The style name or a TableStyle instance
114114 *
115115 * @return Table
116116 */
117117 public function setStyle ($ name )
118118 {
119- if (isset (self ::$ styles [$ name ])) {
119+ if ($ name instanceof TableStyle) {
120+ $ this ->style = $ name ;
121+ } elseif (isset (self ::$ styles [$ name ])) {
120122 $ this ->style = self ::$ styles [$ name ];
121-
122- return $ this ;
123+ } else {
124+ throw new \ InvalidArgumentException ( sprintf ( ' Style "%s" is not defined. ' , $ name )) ;
123125 }
124-
125- throw new \InvalidArgumentException (sprintf ('Style "%s" is not defined. ' , $ name ));
126126 }
127127
128128 /**
You can’t perform that action at this time.
0 commit comments