Use map() instead of transform(), use fn() instead of function(), consistent coding for form.select
Some checks failed
Create Docker Image / Build Docker Image (x86_64) (push) Failing after 28s
Create Docker Image / Final Docker Image Manifest (push) Has been skipped

This commit is contained in:
2024-08-18 14:02:03 +10:00
parent 5139b26a05
commit 2c3665650c
15 changed files with 23 additions and 22 deletions

View File

@@ -399,11 +399,11 @@ class ServiceController extends Controller
// We dynamically create our validation
$validator = Validator::make(
$request->post(),
$x=collect($o->type->validation())
collect($o->type->validation())
->keys()
->transform(fn($item)=>sprintf('%s.%s',$o->product->category,$item))
->map(fn($item)=>sprintf('%s.%s',$o->product->category,$item))
->combine(array_values($o->type->validation()))
->transform(fn($item)=>is_string($item)
->map(fn($item)=>is_string($item)
? preg_replace('/^exclude_without:/',sprintf('exclude_without:%s.',$o->product->category),$item)
: $item)
->merge(

View File

@@ -62,7 +62,7 @@ class ImportCosts implements ShouldQueue
'PRICETOTAL'=>'Total (inc-GST)'
];
$this->columns = collect($headers)->transform(function($item) { return strtolower($item); });
$this->columns = collect($headers)->map(fn($item)=>strtolower($item));
}
/**

View File

@@ -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();
}

View File

@@ -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');
}
/**

View File

@@ -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');