<commit_before><?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require dirname(__DIR__) . '/vendor/autoload.php';

use Gdbots\Pbjc\SchemaStore;
use Gdbots\Pbjc\Compiler;
use Gdbots\Pbjc\Generator\PhpGenerator;
use Gdbots\Pbjc\Generator\JsonGenerator;

SchemaStore::addDir(__DIR__.'/schemas');

$compile = new Compiler();

foreach (['acme:blog', 'acme:core', 'gdbots:pbj'] as $namespace) {

    // generate PHP files
    $generator = $compile->run('php', $namespace, __DIR__.'/src');

    foreach ($generator->getFiles() as $file => $output) {
        echo highlight_string($output, true).'<hr />';
    }

    // generate JSON files
    $generator = $compile->run('json', $namespace, __DIR__.'/json-schema');

    foreach ($generator->getFiles() as $file => $output) {
        $output = sprintf("<?php\n\n\$json = %s;\n", var_export(json_decode($output, true), true));

        echo highlight_string($output, true).'<hr />';
    }
}<commit_msg>Fixed typo - wrong language name - use json-schema<commit_after><?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require dirname(__DIR__) . '/vendor/autoload.php';

use Gdbots\Pbjc\SchemaStore;
use Gdbots\Pbjc\Compiler;
use Gdbots\Pbjc\Generator\PhpGenerator;
use Gdbots\Pbjc\Generator\JsonGenerator;

SchemaStore::addDir(__DIR__.'/schemas');

$compile = new Compiler();

foreach (['acme:blog', 'acme:core', 'gdbots:pbj'] as $namespace) {

    // generate PHP files
    $generator = $compile->run('php', $namespace, __DIR__.'/src');

    foreach ($generator->getFiles() as $file => $output) {
        echo highlight_string($output, true).'<hr />';
    }

    // generate JSON Schema files
    $generator = $compile->run('json-schema', $namespace, __DIR__.'/json-schema');

    foreach ($generator->getFiles() as $file => $output) {
        $output = sprintf("<?php\n\n\$json = %s;\n", var_export(json_decode($output, true), true));

        echo highlight_string($output, true).'<hr />';
    }
}
{'fraction_non_alphanumeric': 0.185203331700147, 'fraction_numerical': 0.0019598236158745713, 'mean_word_length': 4.345549738219895, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '308538', 'n_tokens_mistral': 719, 'n_tokens_neox': 685, 'n_words': 133}