<commit_before><?php

namespace spec\PHPSpec2\Matcher;

use PHPSpec2\ObjectBehavior;
use PHPSpec2\Exception\Example\FailureException;

class TypeMatcher extends ObjectBehavior
{
    /**
     * @param PHPSpec2\Formatter\Presenter\StringPresenter $presenter
     */
    function let($presenter)
    {
        $presenter->presentString(ANY_ARGUMENT)->willReturnArgument();
        $presenter->presentValue(ANY_ARGUMENT)->willReturn('object');

        $this->beConstructedWith($presenter);
    }

    function it_should_support_all_aliases()
    {
        $this->supports('beAnInstanceOf', '', array(''))->shouldReturn(true);
        $this->supports('returnAnInstanceOf', '', array(''))->shouldReturn(true);
        $this->supports('haveType', '', array(''))->shouldReturn(true);
    }

    /**
     * @param ArrayObject $object
     */
    function it_matches_subclass_instance($object)
    {
        $this->shouldNotThrow()
            ->duringPositiveMatch('haveType', $object, array('ArrayObject'));
    }

    /**
     * @param ArrayObject $object
     */
    function it_matches_interface_instance($object)
    {
        $this->shouldNotThrow()
            ->duringPositiveMatch('haveType', $object, array('ArrayAccess'));
    }

    /**
     * @param ArrayObject $object<commit_msg>Add example for new TypeMatcher alias<commit_after><?php

namespace spec\PHPSpec2\Matcher;

use PHPSpec2\ObjectBehavior;
use PHPSpec2\Exception\Example\FailureException;

class TypeMatcher extends ObjectBehavior
{
    /**
     * @param PHPSpec2\Formatter\Presenter\StringPresenter $presenter
     */
    function let($presenter)
    {
        $presenter->presentString(ANY_ARGUMENT)->willReturnArgument();
        $presenter->presentValue(ANY_ARGUMENT)->willReturn('object');

        $this->beConstructedWith($presenter);
    }

    function it_should_support_all_aliases()
    {
        $this->supports('beAnInstanceOf', '', array(''))->shouldReturn(true);
        $this->supports('returnAnInstanceOf', '', array(''))->shouldReturn(true);
        $this->supports('haveType', '', array(''))->shouldReturn(true);
        $this->supports('implement', '', array(''))->shouldReturn(true);
    }

    /**
     * @param ArrayObject $object
     */
    function it_matches_subclass_instance($object)
    {
        $this->shouldNotThrow()
            ->duringPositiveMatch('haveType', $object, array('ArrayObject'));
    }

    /**
     * @param ArrayObject $object
     */
    function it_matches_interface_instance($object)
    {
        $this->shouldNotThrow()
            ->duringPositiveMatch('haveType', $object, array('ArrayAccess'));
    }

    /**
     * @param ArrayObject $object
{'fraction_non_alphanumeric': 0.15286624203821655, 'fraction_numerical': 0.0029973772948669914, 'mean_word_length': 3.369885433715221, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '509364', 'n_tokens_mistral': 775, 'n_tokens_neox': 767, 'n_words': 102}