Skip to content
Snippets Groups Projects
Commit 7301d7ed authored by Адлан Шамавов's avatar Адлан Шамавов
Browse files

refactoring

parent dc99cfdb
No related branches found
No related tags found
1 merge request!4Ptps controller 4
<?php
namespace App\Validation;
class ArrayValidation
{
public static function validateFunc1(array $array): bool
{
$prices = array_column($array, 'price');
$counts = array_column($array, 'count');
return ctype_digit(implode('',$prices)) && ctype_digit(implode('', $counts));
}
public static function validateFunc2(array $array): bool
{
$ids = array_column($array, 'id');
$ages = array_column($array, 'age');
return ctype_digit(implode('', $ids)) && ctype_digit(implode('', $ages));
}
public static function validateFunc4(array $array): bool
{
$depths = array_column($array, 'depth');
return ctype_digit(implode('', $depths));
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment