6
6
/**
7
7
* Build a new array using a callback (Original method was deprecetad since version 5.2).
8
8
*
9
- * @param array $array
10
- * @param callable $callback
9
+ * @param array $array
10
+ * @param callable $callback
11
11
* @return array
12
12
*/
13
13
function array_build ($ array , callable $ callback )
@@ -101,7 +101,7 @@ function table_indexes(Model $model, $withTranslated = true)
101
101
/**
102
102
* Check if we are on desired connection or get the current connection name.
103
103
*
104
- * @param string $name
104
+ * @param string $name
105
105
* @return mixed string|boolean
106
106
*/
107
107
function connection ($ name = null )
@@ -138,7 +138,7 @@ function enum_values($table, $column)
138
138
/**
139
139
* @param $values
140
140
* @param $column
141
- * @param mixed $namespace
141
+ * @param mixed $namespace
142
142
* @return array
143
143
*/
144
144
function translated_values ($ values , $ namespace , $ column )
@@ -169,9 +169,9 @@ function translated_values($values, $namespace, $column)
169
169
/**
170
170
* Fetch key => value pairs from an Eloquent model.
171
171
*
172
- * @param mixed $model
173
- * @param string $labelAttribute
174
- * @param string $keyAttribute
172
+ * @param mixed $model
173
+ * @param string $labelAttribute
174
+ * @param string $keyAttribute
175
175
* @return array
176
176
*/
177
177
function html_list ($ model , $ labelAttribute = 'name ' , $ keyAttribute = 'id ' )
@@ -189,7 +189,7 @@ function html_list($model, $labelAttribute = 'name', $keyAttribute = 'id')
189
189
* Generate route with query string.
190
190
*
191
191
* @param $route
192
- * @param array $params
192
+ * @param array $params
193
193
* @return string
194
194
*/
195
195
function qsRoute ($ route = null , array $ params = [])
@@ -293,7 +293,7 @@ function auto_p($value, $lineBreaks = true)
293
293
* Ensures that the contents of a <<pre>>...<</pre>> HTML block are not
294
294
* converted into paragraphs or line-breaks.
295
295
*
296
- * @param array|string $matches The array or string
296
+ * @param array|string $matches The array or string
297
297
* @return string the pre block without paragraph/line-break conversion
298
298
*/
299
299
function clean_pre ($ matches )
@@ -314,7 +314,7 @@ function clean_pre($matches)
314
314
/**
315
315
* Newline preservation help function for wpautop.
316
316
*
317
- * @param array $matches preg_replace_callback matches array
317
+ * @param array $matches preg_replace_callback matches array
318
318
* @returns string
319
319
* @return mixed
320
320
* @since 3.1.0
@@ -350,9 +350,9 @@ function boolean($value)
350
350
}
351
351
352
352
/**
353
- * @param string $name
353
+ * @param string $name
354
354
* @param $value
355
- * @param string $key
355
+ * @param string $key
356
356
* @return string
357
357
*/
358
358
function rank (string $ name , $ value , string $ key )
@@ -361,23 +361,23 @@ function rank(string $name, $value, string $key)
361
361
}
362
362
363
363
/**
364
- * @param string $image
365
- * @param array $attributes
364
+ * @param string $image
365
+ * @param array $attributes
366
366
* @return string
367
367
*/
368
368
function image (string $ image , array $ attributes = [])
369
369
{
370
370
$ attributes = \admin \helpers \html_attributes ($ attributes );
371
371
372
- return $ image ? '<img src=" ' .$ image .'" ' .$ attributes .' /> ' : '' ;
372
+ return $ image ? '<img src=" ' .( $ image ?? asset ( ' images/no-image.png ' )) .'" ' .$ attributes .' /> ' : '' ;
373
373
}
374
374
375
375
/**
376
376
* Output image from Paperclip attachment object.
377
377
*
378
- * @param null|Attachment $attachment
379
- * @param null|string $style
380
- * @param array $attributes
378
+ * @param null|Attachment $attachment
379
+ * @param null|string $style
380
+ * @param array $attributes
381
381
* @return null|string
382
382
*/
383
383
function staplerImage (Attachment $ attachment = null , string $ style = null , $ attributes = [])
@@ -432,8 +432,8 @@ function staplerImage(Attachment $attachment = null, string $style = null, $attr
432
432
}
433
433
434
434
/**
435
- * @param array $items
436
- * @param null|Closure $callback
435
+ * @param array $items
436
+ * @param null|Closure $callback
437
437
* @return array|string
438
438
*/
439
439
function _prepare_collection (array $ items , Closure $ callback = null )
@@ -454,8 +454,8 @@ function _prepare_collection(array $items, Closure $callback = null)
454
454
}
455
455
456
456
/**
457
- * @param string $label
458
- * @param string $class
457
+ * @param string $label
458
+ * @param string $class
459
459
* @return string
460
460
*/
461
461
function label (string $ label = '' , string $ class = 'label-success ' )
@@ -464,8 +464,8 @@ function label(string $label = '', string $class = 'label-success')
464
464
}
465
465
466
466
/**
467
- * @param string $label
468
- * @param string $class
467
+ * @param string $label
468
+ * @param string $class
469
469
* @return string
470
470
*/
471
471
function badge (string $ label = '' , string $ class = 'bg-green ' )
0 commit comments