Completed
Push — master ( 0ca994...bcdd07 )
by Neomerx
05:23
created

Validation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessages() 0 17 1
1
<?php namespace Limoncello\Flute\Resources\Messages\En;
2
3
/**
4
 * Copyright 2015-2017 [email protected]
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 * http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
use Limoncello\Contracts\L10n\MessageStorageInterface;
20
use Limoncello\Flute\Contracts\Validation\ErrorCodes;
21
use Limoncello\Validation\I18n\EnUsLocale;
22
23
/**
24
 * @package Limoncello\Flute
25
 */
26
class Validation implements MessageStorageInterface
27
{
28
    /**
29
     * @inheritdoc
30
     */
31
    public static function getMessages(): array
32
    {
33
        return
34
            EnUsLocale::MESSAGES +
35
36
            [
37
                ErrorCodes::TYPE_MISSING               => 'JSON API type should be specified.',
38
                ErrorCodes::INVALID_ATTRIBUTES         => 'JSON API attributes are invalid.',
39
                ErrorCodes::UNKNOWN_ATTRIBUTE          => 'Unknown JSON API attribute.',
40
                ErrorCodes::INVALID_RELATIONSHIP_TYPE  => 'The value should be a valid JSON API relationship type.',
41
                ErrorCodes::INVALID_RELATIONSHIP       => 'Invalid JSON API relationship.',
42
                ErrorCodes::UNKNOWN_RELATIONSHIP       => 'Unknown JSON API relationship.',
43
                ErrorCodes::EXIST_IN_DATABASE_SINGLE   => 'The value should be a valid identifier.',
44
                ErrorCodes::EXIST_IN_DATABASE_MULTIPLE => 'The value should be valid identifiers.',
45
                ErrorCodes::UNIQUE_IN_DATABASE_SINGLE  => 'The value should be a unique identifier.',
46
            ];
47
    }
48
}
49