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)
110
110
/**
111
111
* Sets table style.
112
112
*
113
- * @param string $name The style name
113
+ * @param TableStyle| string $name The style name or a TableStyle instance
114
114
*
115
115
* @return Table
116
116
*/
117
117
public function setStyle ($ name )
118
118
{
119
- if (isset (self ::$ styles [$ name ])) {
119
+ if ($ name instanceof TableStyle) {
120
+ $ this ->style = $ name ;
121
+ } elseif (isset (self ::$ styles [$ name ])) {
120
122
$ this ->style = self ::$ styles [$ name ];
121
-
122
- return $ this ;
123
+ } else {
124
+ throw new \ InvalidArgumentException ( sprintf ( ' Style "%s" is not defined. ' , $ name )) ;
123
125
}
124
-
125
- throw new \InvalidArgumentException (sprintf ('Style "%s" is not defined. ' , $ name ));
126
126
}
127
127
128
128
/**
You can’t perform that action at this time.
0 commit comments