Use map() instead of transform(), use fn() instead of function(), consistent coding for form.select
This commit is contained in:
@@ -367,7 +367,7 @@ class Product extends Model implements IDs
|
||||
return round($price,2);
|
||||
}
|
||||
|
||||
public function accounting(string $provider): Collection
|
||||
public function accounting(): Collection
|
||||
{
|
||||
$so = ProviderOauth::where('name',self::provider)
|
||||
->sole();
|
||||
@@ -379,7 +379,7 @@ class Product extends Model implements IDs
|
||||
->API()
|
||||
->getItems()
|
||||
->pluck('pid','Id')
|
||||
->transform(fn($item,$value)=>['id'=>$value,'value'=>$item])
|
||||
->map(fn($item,$value)=>['id'=>$value,'value'=>$item])
|
||||
->values();
|
||||
}
|
||||
|
||||
|
@@ -21,7 +21,7 @@ abstract class Type extends Model
|
||||
*/
|
||||
final public function products()
|
||||
{
|
||||
return $this->morphMany(Product::class, null,'model','model_id');
|
||||
return $this->morphMany(Product::class,null,'model','model_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -140,7 +140,7 @@ class Broadband extends Type
|
||||
}
|
||||
|
||||
if ($config->has('metric') AND $config->get('metric'))
|
||||
$result->transform(function($item) use ($config,$ceil) {
|
||||
$result->map(function($item) use ($config,$ceil) {
|
||||
return $ceil
|
||||
? (int)ceil($item/$config->get('metric'))
|
||||
: $item/$config->get('metric');
|
||||
|
Reference in New Issue
Block a user