<commit_before><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\ClientModel;
use App\Repositories\ClientRepository;

class ClientController extends Controller
{
    /**
    *
    * Temp storage data
    *
    * @var array
    *
    */
    private $storage;
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    public function add(Request $request)
    {

        $clientModel      = new ClientModel($request->all());
        $clientRepository = new ClientRepository();
        $clientModel      = $clientRepository->add($clientModel);


        return response()->json(['status' => 0, 'uid' => $clientModel->getUid()], 201);

    }

    //
}
<commit_msg>Adds ability get client information by uid<commit_after><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\ClientModel;
use App\Repositories\ClientRepository;

class ClientController extends Controller
{
    /**
    *
    * Temp storage data
    *
    * @var array
    *
    */
    private $storage;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //void
    }

    /**
    *
    * Contorller add new client
    *
    * @param $request Illuminate\Http\Request
    *
    * @return array
    *
    * @todo Need added validation input data
    *
    */
    public function add(Request $request)
    {

        $clientModel      = new ClientModel($request->all());
        $clientRepository = new ClientRepository();
        
        try {
            $clientModel      = $clientRepository->add($clientModel);
        } catch (PDOException $e) {
            //@todo logger
        } catch (Exception $e) {
            //@todo logger
        }

        unset($clientRepository);

        return response()->json(['status' => 0, 'uid' => $clientModel->getUid()], 201);
    }

    /**
    *
    * Get client info by uid
    *
    * @param $request Illuminate\Http\Request
    * @param $uid int
    *
    * @return array
    *
    */
    public function info(Request $request, $uid)
    {
        $clientModel = new ClientModel();
        $clientModel->setUid($uid);
        $clientRepository = new ClientRepository();
        try {
            $clientModel = $clientRepository->get($clientModel); 
        } catch (PDOException $e) {
            //@todo logger
        } catch (Exception $e) {
            //@todo logger
        }
        
        $response = [
            'status' => 0,
            'data' => [
                'client' => [
                    'name'        => $clientModel->getName(),
                    'country'     => $clientModel->getCountry(),
                    'city'        => $clientModel->getCity(),
                    'currency'    => $clientModel->getCurrency(),
                    'amount'      => $clientModel->getAmount(),
                    'last_active' => $clientModel->getLastActive()
               ]
            ]
        ];
        return response()->json($response, 200);
    }
}

{'fraction_non_alphanumeric': 0.13040692085869912, 'fraction_numerical': 0.003844921499519385, 'mean_word_length': 1.7147826086956521, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '5924333', 'n_tokens_mistral': 886, 'n_tokens_neox': 867, 'n_words': 188}