Completed
Push — master ( 1f9c9a...dbd6f1 )
by Nate
04:38
created

PropertyMetadata::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 9
cts 9
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 7
crap 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
PropertyMetadata::getAnnotation() 0 1 ?
PropertyMetadata::isVirtual() 0 1 ?
1
<?php
2
/*
3
 * Copyright (c) Nate Brunette.
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
namespace Tebru\Gson;
7
8
use Tebru\Gson\Internal\Data\AnnotationSet;
9
10
/**
11
 * Interface PropertyMetadata
12
 *
13
 * Represents a property and its annotations
14
 *
15
 * @author Nate Brunette <[email protected]>
16
 */
17
interface PropertyMetadata
18
{
19
    /**
20
     * Get the property name
21
     *
22
     * @return string
23
     */
24
    public function getName(): string;
25
26
    /**
27
     * Get the property serialized name
28
     *
29
     * @return string
30
     */
31
    public function getSerializedName(): string;
32
33
    /**
34
     * Get the full php type object
35
     *
36
     * @return PhpType
37
     */
38
    public function getType(): PhpType;
39
40
    /**
41
     * Get the property type as a string
42
     *
43
     * @return string
44
     */
45
    public function getTypeName(): string;
46
47
    /**
48
     * Get the property modifiers as a bitmap of [@see \ReflectionProperty] constants
49
     *
50
     * @return int
51
     */
52
    public function getModifiers(): int;
53
54
    /**
55
     * Get full declaring class metadata
56
     *
57
     * @return ClassMetadata
58
     */
59
    public function getDeclaringClassMetadata(): ClassMetadata;
60
61
    /**
62
     * Get the declaring class name
63
     *
64
     * @return string
65
     */
66
    public function getDeclaringClassName(): string;
67
68
    /**
69
     * Get property annotations
70
     *
71
     * @return AnnotationSet
72
     */
73
    public function getAnnotations(): AnnotationSet;
74
75
    /**
76
     * Get a single annotation, returns null if the annotation doesn't exist
77
     *
78
     * @param string $annotationName
79
     * @return null|object
80
     */
81
    public function getAnnotation(string $annotationName);
82
83
    /**
84
     * Returns true if the property is virtual
85
     *
86
     * @return bool
87
     */
88
    public function isVirtual(): bool;
89
}
90