<commit_before><?php

declare(strict_types=1);

namespace DI\Definition\Exception;

use DI\Definition\Definition;

/**
 * Invalid DI definitions.
 *
 * @author <NAME> <<EMAIL>>
 */
class InvalidDefinition extends \Exception
{
    public static function create(Definition $definition, string $message) : self
    {
        return new self(sprintf(
            '%s' . PHP_EOL . 'Full definition:' . PHP_EOL . '%s',
            $message,
            (string) $definition
        ));
    }
}<commit_msg>Allow to pass a `$previous` exception in the InvalidDefinition exception<commit_after><?php

declare(strict_types=1);

namespace DI\Definition\Exception;

use DI\Definition\Definition;

/**
 * Invalid DI definitions.
 *
 * @author <NAME> <<EMAIL>>
 */
class InvalidDefinition extends \Exception
{
    public static function create(Definition $definition, string $message, \Exception $previous = null) : self
    {
        return new self(sprintf(
            '%s' . PHP_EOL . 'Full definition:' . PHP_EOL . '%s',
            $message,
            (string) $definition
        ), 0, $previous);
    }
}
{'fraction_non_alphanumeric': 0.1290909090909091, 'fraction_numerical': 0.0027272727272727275, 'mean_word_length': 2.863157894736842, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '3623121', 'n_tokens_mistral': 313, 'n_tokens_neox': 314, 'n_words': 86}