<commit_before><?php

namespace App\Http\Controllers\PlatformAPI;

use Illuminate\Http\Request;
use App\LoginModule\AccountsManager;
use Illuminate\Support\Facades\Validator;

class AccountsManagerController extends PlatformAPIController
{

    protected $accounts_manager;

    public function __construct(AccountsManager $accounts_manager) {
        $this->accounts_manager = $accounts_manager;
    }


    private function validatorCreate(array $data) {
        return Validator::make($data, [
            'prefix' => 'required|min:1|max:100',
            'amount' => 'required|integer|min:1|max:50',
            'postfix_length' => 'required|integer|min:3|max:50',
            'password_length' => '<PASSWORD>|integer|min:6|max:50',
        ]);
    }


    public function create(Request $request) {
        $validator = $this->validatorCreate($request->all());
        if($validator->fails()) {
            $res = [
                'success' => false,
                'error' => 'Wrong params'
            ];
            return $this->makeResponse($res, $request->get('client')->secret);
        }
<commit_msg>platfrom api params validation changed<commit_after><?php

namespace App\Http\Controllers\PlatformAPI;

use Illuminate\Http\Request;
use App\LoginModule\AccountsManager;
use Illuminate\Support\Facades\Validator;

class AccountsManagerController extends PlatformAPIController
{

    protected $accounts_manager;

    public function __construct(AccountsManager $accounts_manager) {
        $this->accounts_manager = $accounts_manager;
    }


    private function validatorCreate(array $data) {
        return Validator::make($data, [
            'prefix' => 'required|min:1|max:100',
            'amount' => 'required|integer|min:1',
            'postfix_length' => 'required|integer|min:3|max:50',
            'password_length' => 'required|integer|min:6|max:50',
        ]);
    }


    public function create(Request $request) {
        $validator = $this->validatorCreate($request->all());
        if($validator->fails()) {
            $res = [
                'success' => false,
                'error' => 'Wrong params'
            ];
            return $this->makeResponse($res, $request->get('client')->secret);
        }

{'fraction_non_alphanumeric': 0.13624220837043632, 'fraction_numerical': 0.01068566340160285, 'mean_word_length': 2.8942807625649913, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2013464', 'n_tokens_mistral': 646, 'n_tokens_neox': 644, 'n_words': 106}