| 1 | <?php |
||
| 13 | class ColorTeam implements TeamInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * The color of the team |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $color; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Define a new ColorTeam |
||
| 24 | * @param string $color The color of the team |
||
| 25 | */ |
||
| 26 | 4 | public function __construct($color) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Get a unique identifier for the team |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | 4 | public function getId() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | 1 | public function getName() |
|
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 1 | public function getAvatar() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * {@inheritdoc} |
||
| 59 | */ |
||
| 60 | 4 | public function isValid() |
|
| 64 | |||
| 65 | /** |
||
| 66 | * {@inheritdoc} |
||
| 67 | */ |
||
| 68 | 2 | public function isLastMatch($match) |
|
| 72 | |||
| 73 | /** |
||
| 74 | * {@inheritdoc} |
||
| 75 | */ |
||
| 76 | public function supportsMatchCount() |
||
| 80 | 1 | ||
| 81 | /** |
||
| 82 | * Return whether a team color is valid |
||
| 83 | * |
||
| 84 | * @param string $color The color to check |
||
| 85 | */ |
||
| 86 | public static function isValidTeamColor($color) |
||
| 90 | |||
| 91 | 1 | /** |
|
| 92 | * {@inheritdoc} |
||
| 93 | 1 | */ |
|
| 94 | public function isSameAs($team) |
||
| 100 | } |
||
| 101 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: