Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
namespace Hamcrest\Text;
3
 
4
/*
5
 Copyright (c) 2010 hamcrest.org
6
 */
7
 
8
/**
9
 * Tests if the argument is a string that contains a substring ignoring case.
10
 */
11
class StringContainsIgnoringCase extends SubstringMatcher
12
{
13
 
14
    public function __construct($substring)
15
    {
16
        parent::__construct($substring);
17
    }
18
 
19
    /**
20
     * Matches if value is a string that contains $substring regardless of the case.
21
     *
22
     * @factory
23
     */
24
    public static function containsStringIgnoringCase($substring)
25
    {
26
        return new self($substring);
27
    }
28
 
29
    // -- Protected Methods
30
 
31
    protected function evalSubstringOf($item)
32
    {
33
        return (false !== stripos((string) $item, $this->_substring));
34
    }
35
 
36
    protected function relationship()
37
    {
38
        return 'containing in any case';
39
    }
40
}