Completed
Push — master ( d66c3c...7db86c )
by Alex
05:11
created

metadataWriterExpectingEntityOrComplexResourceType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace POData\Common\Messages;
3
4
trait metadataWriter
5
{
6
    /**
7
     * Message to show error when expecting entity or
8
     * complex type, but a different type found.
9
     *
10
     * @return string The error message
11
     */
12
    public static function metadataWriterExpectingEntityOrComplexResourceType()
13
    {
14
        return 'Unexpected resource type found, expecting either ResourceTypeKind::ENTITY or ResourceTypeKind::COMPLEX';
15
    }
16
17
    /**
18
     * Format a message to show error when no association set
19
     * found for a navigation property.
20
     *
21
     * @param string $navigationPropertyName The name of the navigation property
22
     * @param string $resourceTypeName       The resource type on which the
23
     *                                       navigation property is defined
24
     *
25
     * @return string The formatted message
26
     */
27
    public static function metadataWriterNoResourceAssociationSetForNavigationProperty($navigationPropertyName, $resourceTypeName)
28
    {
29
        return "No visible ResourceAssociationSet found for navigation property '$navigationPropertyName' on type '$resourceTypeName'. There must be at least one ResourceAssociationSet for each navigation property.";
30
    }
31
}
32