<commit_before><?php

namespace App\Services;

use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\GuzzleException;

class FcuApiService
{
    /**
     * @param string $nid
     * @return array|null
     */
    public function getStuInfo($nid)
    {
        $nid = strtoupper($nid);
        if (empty(trim($nid))) {
            return null;
        }
        //API資訊
        $apiUrl = config('services.fcu-api.url-get-stu-info');
        $apiClientId = config('services.fcu-api.client-id');
        if (!$apiUrl || !$apiClientId) {
            return null;
        }
        //請求
        $client = new Client();
        $option = [
            'verify' => false,
            'query'  => [
                'client_id' => $apiClientId,
                'id'        => $nid,
            ],
        ];
        try {
            //送出請求並取得結果
            $response = $client->request('GET', $apiUrl, $option);<commit_msg>Mark getStuInfo API as deprecated<commit_after><?php

namespace App\Services;

use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\GuzzleException;

class FcuApiService
{
    /**
     * @param string $nid
     * @return array|null
     * @deprecated
     */
    public function getStuInfo($nid)
    {
        $nid = strtoupper($nid);
        if (empty(trim($nid))) {
            return null;
        }
        //API資訊
        $apiUrl = config('services.fcu-api.url-get-stu-info');
        $apiClientId = config('services.fcu-api.client-id');
        if (!$apiUrl || !$apiClientId) {
            return null;
        }
        //請求
        $client = new Client();
        $option = [
            'verify' => false,
            'query'  => [
                'client_id' => $apiClientId,
                'id'        => $nid,
            ],
        ];
        try {
            //送出請求並取得結果
            $response = $client->request('GET', $apiUrl, $option);
{'fraction_non_alphanumeric': 0.14104515474378487, 'fraction_numerical': 0.0, 'mean_word_length': 1.6720867208672088, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3602644', 'n_tokens_mistral': 636, 'n_tokens_neox': 643, 'n_words': 114}