<commit_before><?php
/**
 * This file is part of the BEAR.Resource package.
 *
 * @license http://opensource.org/licenses/MIT MIT
 */
namespace BEAR\Resource\Interceptor;

use BEAR\Resource\Annotation\JsonSchema;
use BEAR\Resource\Code;
use BEAR\Resource\Exception\JsonSchemaErrorException;
use BEAR\Resource\Exception\JsonSchemaException;
use BEAR\Resource\Exception\JsonSchemaNotFoundException;
use BEAR\Resource\ResourceObject;
use JsonSchema\Constraints\Constraint;
use JsonSchema\Validator;
use Ray\Aop\MethodInterceptor;
use Ray\Aop\MethodInvocation;
use Ray\Aop\WeavedInterface;
use Ray\Di\Di\Named;

final class JsonSchemaInterceptor implements MethodInterceptor
{
    /**
     * @var string
     */
    private $schemaDir;

    /**
     * @var string
     */
    private $validateDir;

    /**
     * @param string $schemaDir
     * @param string $validateDir
     *
     * @Named("schemaDir=json_schema_dir,validateDir=json_validate_dir")
     */
    public function __construct($schemaDir, $validateDir)
    {
        $this->schemaDir = $schemaDir;
        $this->validateDir = $validateDir;
    }

    /**
     * {@inheritdoc}
     */
    public function invoke(MethodInvocation $invocation)
    {
        /* @var $jsonSchema JsonSchema */
        $jsonSchema = $invocation->getMethod()->getAnnotation(JsonSchema::class);

        if ($jsonSchema->params) {
            $arguments = $this->getNamedArguments($invocation);<commit_msg>remove an unneeded empty line<commit_after><?php
/**
 * This file is part of the BEAR.Resource package.
 *
 * @license http://opensource.org/licenses/MIT MIT
 */
namespace BEAR\Resource\Interceptor;

use BEAR\Resource\Annotation\JsonSchema;
use BEAR\Resource\Code;
use BEAR\Resource\Exception\JsonSchemaErrorException;
use BEAR\Resource\Exception\JsonSchemaException;
use BEAR\Resource\Exception\JsonSchemaNotFoundException;
use BEAR\Resource\ResourceObject;
use JsonSchema\Constraints\Constraint;
use JsonSchema\Validator;
use Ray\Aop\MethodInterceptor;
use Ray\Aop\MethodInvocation;
use Ray\Aop\WeavedInterface;
use Ray\Di\Di\Named;

final class JsonSchemaInterceptor implements MethodInterceptor
{
    /**
     * @var string
     */
    private $schemaDir;

    /**
     * @var string
     */
    private $validateDir;

    /**
     * @param string $schemaDir
     * @param string $validateDir
     *
     * @Named("schemaDir=json_schema_dir,validateDir=json_validate_dir")
     */
    public function __construct($schemaDir, $validateDir)
    {
        $this->schemaDir = $schemaDir;
        $this->validateDir = $validateDir;
    }

    /**
     * {@inheritdoc}
     */
    public function invoke(MethodInvocation $invocation)
    {
        /* @var $jsonSchema JsonSchema */
        $jsonSchema = $invocation->getMethod()->getAnnotation(JsonSchema::class);
        if ($jsonSchema->params) {
            $arguments = $this->getNamedArguments($invocation);
{'fraction_non_alphanumeric': 0.11841652323580035, 'fraction_numerical': 0.0, 'mean_word_length': 3.4298780487804876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3004981', 'n_tokens_mistral': 852, 'n_tokens_neox': 845, 'n_words': 163}