1: <?php
2: namespace Contrib\Bundle\CoverallsV1Bundle\Entity\Git;
3:
4: use Contrib\Bundle\CoverallsV1Bundle\Entity\Coveralls;
5:
6: /**
7: * Remote info.
8: *
9: * @author Kitamura Satoshi <with.no.parachute@gmail.com>
10: */
11: class Remote extends Coveralls
12: {
13: /**
14: * Remote name.
15: *
16: * @var string
17: */
18: protected $name;
19:
20: /**
21: * Remote URL.
22: *
23: * @var string
24: */
25: protected $url;
26:
27: // API
28:
29: /**
30: * {@inheritdoc}
31: *
32: * @see \Contrib\Bundle\CoverallsBundle\Entity\ArrayConvertable::toArray()
33: */
34: public function toArray()
35: {
36: return array(
37: 'name' => $this->name,
38: 'url' => $this->url,
39: );
40: }
41:
42: // accessor
43:
44: /**
45: * Set remote name.
46: *
47: * @param string $name Remote name.
48: * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote
49: */
50: public function setName($name)
51: {
52: $this->name = $name;
53:
54: return $this;
55: }
56:
57: /**
58: * Return remote name.
59: *
60: * @return string
61: */
62: public function getName()
63: {
64: if (isset($this->name)) {
65: return $this->name;
66: }
67:
68: return null;
69: }
70:
71: /**
72: * Set remote URL.
73: *
74: * @param string $url Remote URL.
75: * @return \Contrib\Bundle\CoverallsV1Bundle\Entity\Git\Remote
76: */
77: public function setUrl($url)
78: {
79: $this->url = $url;
80:
81: return $this;
82: }
83:
84: /**
85: * Return remote URL.
86: *
87: * @return string
88: */
89: public function getUrl()
90: {
91: if (isset($this->url)) {
92: return $this->url;
93: }
94:
95: return null;
96: }
97: }
98: