<commit_before><?php

header("Access-Control-Allow-Origin: *");

require_once __DIR__.'/vendor/autoload.php';

use Swarrot\Broker\MessagePublisher\PeclPackageMessagePublisher;

// Basic server, call function based on "method" passing "id" & "params" parameters
$request = json_decode(file_get_contents('php://input'), true);
echo json_encode($request['method']($request['id'], isset($request['params']) ? $request['params'] : null));

function createDocument($id, $params)
{
    $name = $params['name'].'.pdf';
    exec('php generator.php '.$name, $output);

    $response = ['id' => $id, 'result' => $output[0]];

    return $response;
}

/*
function publishMessage($message)
{
    $publisher = new PeclPackageMessagePublisher();
    $publisher
}
*/
<commit_msg>Simplify api<commit_after><?php

header("Access-Control-Allow-Origin: *");

require_once __DIR__.'/vendor/autoload.php';

// Basic server, call function based on "method" passing "id" & "params" parameters
$request = json_decode(file_get_contents('php://input'), true);
echo json_encode($request['method']($request['id'], isset($request['params']) ? $request['params'] : null));

function createDocument($id, $params)
{
    exec('php generator.php '.$params['name'].'.pdf', $output);

    $response = ['id' => $id, 'result' => $output[0]];

    return $response;
}

{'fraction_non_alphanumeric': 0.1980421686746988, 'fraction_numerical': 0.0015060240963855422, 'mean_word_length': 5.678391959798995, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1015943', 'n_tokens_mistral': 431, 'n_tokens_neox': 420, 'n_words': 85}