PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/vendor/phpunit/phpunit/src/Framework/Constraint/IsFinite.php

https://bitbucket.org/alan_cordova/api-sb-map
PHP | 38 lines | 12 code | 2 blank | 24 comment | 0 complexity | 460ab8d0456f9cc6b6ad2305f64cd89a MD5 | raw file
 1<?php
 2/*
 3 * This file is part of PHPUnit.
 4 *
 5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 6 *
 7 * For the full copyright and license information, please view the LICENSE
 8 * file that was distributed with this source code.
 9 */
10
11/**
12 * Constraint that accepts finite.
13 */
14class PHPUnit_Framework_Constraint_IsFinite extends PHPUnit_Framework_Constraint
15{
16    /**
17     * Evaluates the constraint for parameter $other. Returns true if the
18     * constraint is met, false otherwise.
19     *
20     * @param mixed $other Value or object to evaluate.
21     *
22     * @return bool
23     */
24    protected function matches($other)
25    {
26        return is_finite($other);
27    }
28
29    /**
30     * Returns a string representation of the constraint.
31     *
32     * @return string
33     */
34    public function toString()
35    {
36        return 'is finite';
37    }
38}