invalidExposeFieldsString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of the Drest package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author Lee Davis
9
 * @copyright Copyright (c) Lee Davis <@leedavis81>
10
 * @link https://github.com/leedavis81/drest/blob/master/LICENSE
11
 * @license http://opensource.org/licenses/MIT The MIT X License (MIT)
12
 */
13
namespace Drest\Query;
14
15
class InvalidExposeFieldsException extends \Exception
16
{
17 1
    public static function invalidExposeFieldsString()
18
    {
19 1
        return new self('Characters used in the expose fields string are invalid. Only character allowed are [a-z], [A-Z], [0-9], "[", "]", "|" and "_"');
20
    }
21
22
23
    /**
24
     * @param $string
25
     * @return InvalidExposeFieldsException
26
     */
27 1
    public static function unableToParseExposeString($string)
28
    {
29 1
        return new self('Unable to parse the given expose string. Ensure syntax is correct, and square brackets are correctly opened / closed. ' . $string);
30
    }
31
}
32