@@ -33,7 +33,7 @@ class ActiveExcelSheet extends ExcelSheet
3333 */
3434 public function getQuery ()
3535 {
36- if ($ this ->_query ===null ) {
36+ if ($ this ->_query === null ) {
3737 throw new \Exception ('No query set ' );
3838 }
3939 return $ this ->_query ;
@@ -56,12 +56,13 @@ public function getData()
5656 }
5757
5858 /**
59- * @return string[] list of attributes for the table columns. If no attributes are set,
60- * attributes are set to `ActiveRecord::attributes()` for the main query record.
59+ * @return string[] list of attributes for the table columns. If no
60+ * attributes are set, attributes are set to `ActiveRecord::attributes()`
61+ * for the main query record.
6162 */
6263 public function getAttributes ()
6364 {
64- if ($ this ->_attributes ===null ) {
65+ if ($ this ->_attributes === null ) {
6566 $ class = $ this ->getQuery ()->modelClass ;
6667 $ model = new $ class ;
6768 $ this ->_attributes = $ model ->attributes ();
@@ -86,11 +87,12 @@ public function setData($value)
8687 }
8788
8889 /**
89- * @return string[] the column titles. If not set, the respective attribute label is used
90+ * @return string[] the column titles. If not set, the respective attribute
91+ * label is used
9092 */
9193 public function getTitles ()
9294 {
93- if ($ this ->_titles ===null ) {
95+ if ($ this ->_titles === null ) {
9496 $ class = $ this ->getQuery ()->modelClass ;
9597 $ model = new $ class ;
9698 $ this ->_titles = array_map (function ($ a ) use ($ model ) {
@@ -101,16 +103,17 @@ public function getTitles()
101103 }
102104
103105 /**
104- * @param string[]|false $value the column titles indexed by 0-based column index.
105- * The array is merged with the default titles from `getTitles()` (=attribute labels).
106- * If an empty array or `false`, no titles will be generated.
106+ * @param string[]|false $value the column titles indexed by 0-based column
107+ * index. The array is merged with the default titles from `getTitles()`
108+ * (=attribute labels). If an empty array or `false`, no titles will be
109+ * generated.
107110 */
108111 public function setTitles ($ value )
109112 {
110113 if (!$ value ) {
111114 $ this ->_titles = $ value ;
112115 } else {
113- if ($ this ->_titles ===null ) {
116+ if ($ this ->_titles === null ) {
114117 $ this ->getTitles (); // Sets attribute labels as defaults
115118 }
116119 foreach ($ value as $ i => $ v ) {
@@ -120,12 +123,13 @@ public function setTitles($value)
120123 }
121124
122125 /**
123- * @param string[] $value the format strings for the column cells indexed by 0-based column index.
124- * If not set, the formats are auto-generated from the DB column types.
126+ * @param string[] $value the format strings for the column cells indexed
127+ * by 0-based column index. If not set, the formats are auto-generated
128+ * from the DB column types.
125129 */
126130 public function getFormats ()
127131 {
128- if ($ this ->_formats ===null ) {
132+ if ($ this ->_formats === null ) {
129133 $ this ->_formats = [];
130134 $ attrs = $ this ->getAttributes ();
131135 $ types = $ this ->getColumnTypes ();
@@ -149,16 +153,17 @@ public function getFormats()
149153 }
150154
151155 /**
152- * @param string[]|false $value the format strings for the column cells indexed by 0-based column index.
153- * The array is merged with the default formats from `getFormats()` (auto-generated from DB columns).
154- * If an empty array or `false`, no formats are applied.
156+ * @param string[]|false $value the format strings for the column cells
157+ * indexed by 0-based column index. The array is merged with the default
158+ * formats from `getFormats()` (auto-generated from DB columns). If an
159+ * empty array or `false`, no formats are applied.
155160 */
156161 public function setFormats ($ value )
157162 {
158163 if (!$ value ) {
159164 $ this ->_formats = $ value ;
160165 } else {
161- if ($ this ->_formats ===null ) {
166+ if ($ this ->_formats === null ) {
162167 $ this ->getFormats (); // Sets auto-generated formats as defaults
163168 }
164169 foreach ($ value as $ i => $ v ) {
@@ -168,12 +173,13 @@ public function setFormats($value)
168173 }
169174
170175 /**
171- * @return Callable[] the value formatters for the column cells indexed by 0-based column index.
172- * If not set, the formatters are aut-generated from the DB column types.
176+ * @return Callable[] the value formatters for the column cells indexed by
177+ * 0-based column index. If not set, the formatters are aut-generated from
178+ * the DB column types.
173179 */
174180 public function getFormatters ()
175181 {
176- if ($ this ->_formatters ===null ) {
182+ if ($ this ->_formatters === null ) {
177183 $ this ->_formatters = [];
178184 $ attrs = $ this ->getAttributes ();
179185 $ types = $ this ->getColumnTypes ();
@@ -192,16 +198,17 @@ public function getFormatters()
192198 }
193199
194200 /**
195- * @param Callable[]|null $value the value formatters for the column cells indexed by 0-based column index.
196- * The array is merged with the default formats from `getFormatters()` (auto-generated from DB columns).
197- * If an empty array or `false`, no formatters are applied.
201+ * @param Callable[]|null $value the value formatters for the column cells
202+ * indexed by 0-based column index. The array is merged with the default
203+ * formats from `getFormatters()` (auto-generated from DB columns). If an
204+ * empty array or `false`, no formatters are applied.
198205 */
199206 public function setFormatters ($ value )
200207 {
201208 if (!$ value ) {
202209 $ this ->_formatters = $ value ;
203210 } else {
204- if ($ this ->_formatters ===null ) {
211+ if ($ this ->_formatters === null ) {
205212 $ this ->getFormatters (); // Sets auto-generated formatters as defaults
206213 }
207214 foreach ($ value as $ i => $ v ) {
@@ -211,11 +218,12 @@ public function setFormatters($value)
211218 }
212219
213220 /**
214- * @return yii\db\ColumnSchema[] the DB column types `ColumnSchema::$type` indexed by 0-based column index
221+ * @return yii\db\ColumnSchema[] the DB column types `ColumnSchema::$type`
222+ * indexed by 0-based column index
215223 */
216224 protected function getColumnTypes ()
217225 {
218- if ($ this ->_columnTypes ===null ) {
226+ if ($ this ->_columnTypes === null ) {
219227 $ class = $ this ->getQuery ()->modelClass ;
220228 $ model = new $ class ;
221229 $ this ->_columnTypes = array_map (function ($ attr ) use ($ model ) {
@@ -238,19 +246,24 @@ protected function renderRow($data, $row, $formats, $formatters, $callbacks, $ty
238246 }
239247
240248 /**
241- * Returns either the ColumnSchema or a new instance of the related model for the given attribute name.
249+ * Returns either the ColumnSchema or a new instance of the related model
250+ * for the given attribute name.
242251 *
243- * The name can be specified in dot format, like `company.name` in which case the ColumnSchema for
244- * the `name` attribute in the related `company` record would be returned.
252+ * The name can be specified in dot format, like `company.name` in which
253+ * case the ColumnSchema for the `name` attribute in the related `company`
254+ * record would be returned.
245255 *
246- * If the attribute is a relation name (which could also use dot notation) then `$isRelation` must
247- * be set to `true`. In this case an instance of the related ActiveRecord class is returned.
256+ * If the attribute is a relation name (which could also use dot notation)
257+ * then `$isRelation` must be set to `true`. In this case an instance of
258+ * the related ActiveRecord class is returned.
248259 *
249260 * @param yii\db\ActiveRecord $model the model where the attribute exist
250261 * @param string $attribute name of the attribute
251- * @param mixed $isRelation whether the name specifies a relation, in which case an `ActiveRecord`
252- * is returned. Default is `false`, which returns a `ColumnSchema`.
253- * @return yii\db\ColumnSchema|yii\db\ActiveRecord the type instance of the attribute
262+ * @param mixed $isRelation whether the name specifies a relation, in which
263+ * case an `ActiveRecord` is returned. Default is `false`, which returns a
264+ * `ColumnSchema`.
265+ * @return yii\db\ColumnSchema|yii\db\ActiveRecord the type instance of the
266+ * attribute
254267 */
255268 public static function getType ($ model , $ attribute , $ isRelation = false )
256269 {
0 commit comments