<commit_before><?php

namespace Interop\Async;

/**
 * Promise object representing the future value of an asynchronous operation.
 */
interface Promise
{
    /**
     * Registers a callback to be invoked when the promise is resolved.
     *
     * @param callable(\Throwable|\Exception|null $exception, mixed $result) $onResolved
     *
     * @return void
     */
    public function when(callable $onResolved);
}<commit_msg>Clarify Promise::when docblock<commit_after><?php

namespace Interop\Async;

/**
 * Promise object representing the future value of an asynchronous operation.
 */
interface Promise
{
    /**
     * Registers a callback to be invoked when the promise is resolved.
     *
     * The callback receives `null` as first parameter and `$value` as second parameter on success. It receives the
     * failure reason as first parameter and `null` as second parameter on failure.
     *
     * If the promise is already resolved, the callback MUST be executed immediately.
     *
     * Warning: If you use type declarations for `$value`, be sure to make them accept `null` in case of failures.
     *
     * @param callable(\Throwable|\Exception|null $exception, mixed $value) $onResolved Callback to be executed.
     *
     * @return void
     */
    public function when(callable $onResolved);
}
{'fraction_non_alphanumeric': 0.08745247148288973, 'fraction_numerical': 0.0, 'mean_word_length': 3.1910828025477707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7508812', 'n_tokens_mistral': 348, 'n_tokens_neox': 341, 'n_words': 142}