1 | <?php |
||
5 | class COBFileBlock extends COBBlock { |
||
6 | |||
7 | /// @cond INTERNAL_DOCS |
||
8 | // |
||
9 | private $fileType; |
||
10 | private $fileName; |
||
11 | |||
12 | private $reserved; |
||
13 | private $contents; |
||
14 | |||
15 | /// @endcond |
||
16 | |||
17 | /// @brief Constructs a new COBFileBlock |
||
18 | /** |
||
19 | * @param string $type The file type |
||
20 | * @param $name The file name (including extension) |
||
21 | * @param $contents The contents of the file |
||
22 | */ |
||
23 | public function COBFileBlock($type, $name, $contents) { |
||
29 | |||
30 | /// @brief Add the reserved data associated with this file block |
||
31 | /** |
||
32 | * @param $reserved The reserved data |
||
33 | */ |
||
34 | public function AddReserved($reserved) { |
||
37 | |||
38 | /// @brief Supposedly compiles the block into binary. Throws an error to say it's not implemented. |
||
39 | /** @return string |
||
40 | */ |
||
41 | public function Compile() { |
||
45 | |||
46 | /// @brief Get the name of the file |
||
47 | public function GetName() { |
||
50 | |||
51 | /// @brief Get the file's type |
||
52 | /** |
||
53 | * @return 'sprite' or 'sound' - i.e. one of the |
||
54 | * COB_DEPENDENCY_* constants in COBAgentBlock |
||
55 | */ |
||
56 | public function GetFileType() { |
||
59 | |||
60 | /// @brief Get the contents of the file. |
||
61 | public function GetContents() { |
||
64 | |||
65 | /// @brief Get the reserved data |
||
66 | /** |
||
67 | * Reserved data was never officially used. |
||
68 | * @return A 4-byte integer. |
||
69 | */ |
||
70 | public function GetReserved() { |
||
73 | |||
74 | /// @cond INTERNAL_DOCS |
||
75 | |||
76 | /// @brief Creates a new COBFileBlock from an IReader |
||
77 | /** |
||
78 | * @param $reader The reader the data's coming from |
||
79 | */ |
||
80 | public static function CreateFromReader(IReader $reader) { |
||
90 | /// @endcond |
||
91 | } |
||
92 | ?> |
||
93 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.