GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch master (9269d3)
by Telyn
03:20
created
agents/PRAY/DSEXBlock.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     /**
13 13
      * If $prayfile is not null, all the data for this block
14 14
      * will be read from the PRAYFile.
15
-     * @param $prayfile The PRAYFile that this DFAM block belongs to.
15
+     * @param PRAYFile $prayfile The PRAYFile that this DFAM block belongs to.
16 16
      * @param $name The block's name.
17 17
      * @param $content The binary data of this block. May be null.
18 18
      * @param $flags The block's flags
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
      * @param $content The binary data of this block. May be null.
18 18
      * @param $flags The block's flags
19 19
      */
20
-    public function DSEXBlock($prayfile,$name,$content,$flags) {
21
-        parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_DSEX);
20
+    public function DSEXBlock($prayfile, $name, $content, $flags) {
21
+        parent::TagBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_DSEX);
22 22
     }
23 23
 }
24 24
 ?>
Please login to merge, or discard this patch.
agents/PRAY/EGGSBlock.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      * Makes a new EGGSBlock. \n
13 13
      * If $prayfile is not null, all the data about this AGNTBlock
14 14
      * will be read from the PRAYFile.
15
-     * @param $prayfile The PRAYFile associated with this AGNT block.
15
+     * @param PRAYFile $prayfile The PRAYFile associated with this AGNT block.
16 16
      * It is allowed to be null.
17 17
      * @param $name The name of this block.
18 18
      * @param $content This block's content.
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@
 block discarded – undo
19 19
      * @param $flags Any flags this block may have. I think this is a
20 20
      * single byte. Check http://www.creatureswiki.net/wiki/PRAY
21 21
      */
22
-     public function EGGSBlock($prayfile,$name,$content,$flags) {
22
+        public function EGGSBlock($prayfile,$name,$content,$flags) {
23 23
         parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_EGGS);
24 24
 
25 25
     }
26 26
 
27
-     /// @brief Gets the agent's type.
28
-     /**
29
-      * This method is identical to that in EXPCBlock.
30
-      * The type seems to always be 0 for EGGSBlocks.
31
-      */
27
+        /// @brief Gets the agent's type.
28
+        /**
29
+         * This method is identical to that in EXPCBlock.
30
+         * The type seems to always be 0 for EGGSBlocks.
31
+         */
32 32
     public function GetAgentType() {
33 33
         return $this->GetTag('Agent Type');
34 34
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
      * @param $flags Any flags this block may have. I think this is a
20 20
      * single byte. Check http://www.creatureswiki.net/wiki/PRAY
21 21
      */
22
-     public function EGGSBlock($prayfile,$name,$content,$flags) {
23
-        parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_EGGS);
22
+     public function EGGSBlock($prayfile, $name, $content, $flags) {
23
+        parent::TagBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_EGGS);
24 24
 
25 25
     }
26 26
 
Please login to merge, or discard this patch.
agents/PRAY/EXPCBlock.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     /**
32 32
      * If $prayfile is not null, all the data for this block
33 33
      * will be read from the PRAYFile.
34
-     * @param $prayfile The PRAYFile that this DFAM block belongs to.
34
+     * @param PRAYFile $prayfile The PRAYFile that this DFAM block belongs to.
35 35
      * @param $name The block's name.
36 36
      * @param $content The binary data of this block. May be null.
37 37
      * @param $flags The block's flags
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@
 block discarded – undo
36 36
      * @param $content The binary data of this block. May be null.
37 37
      * @param $flags The block's flags
38 38
      */
39
-    public function EXPCBlock($prayfile,$name,$content,$flags) {
40
-        parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_EXPC);
39
+    public function EXPCBlock($prayfile, $name, $content, $flags) {
40
+        parent::TagBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_EXPC);
41 41
     }
42 42
 
43 43
     /// @brief Gets the age of the creature
Please login to merge, or discard this patch.
agents/PRAY/FILEBlock.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      * FILEBlocks are currently read-only. \n
18 18
      * If $prayfile is not null, all the data about this block
19 19
      * will be read from the PRAYFile.
20
-     * @param $prayfile The PRAYFile this FILEBlock belongs to. Can
20
+     * @param PRAYFile $prayfile The PRAYFile this FILEBlock belongs to. Can
21 21
      * be null.
22 22
      * @param $name The name of this file block (also the file's
23 23
      * name)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
      * @param $content The binary data of this file block.
25 25
      * @param $flags The block's flags. See PrayBlock.
26 26
      */
27
-    public function FILEBlock($prayfile,$name,$content,$flags) {
28
-        parent::PrayBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_FILE);
27
+    public function FILEBlock($prayfile, $name, $content, $flags) {
28
+        parent::PrayBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_FILE);
29 29
     }
30 30
 
31 31
     /// @cond INTERNAL_DOCS
Please login to merge, or discard this patch.
agents/PRAY/GENEBlock.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     /**
15 15
      * If $prayfile is not null, all the data for this block
16 16
      * will be read from the PRAYFile.
17
-     * @param $prayfile The PRAYFile object this block belongs to. Can be null.
17
+     * @param PRAYFile $prayfile The PRAYFile object this block belongs to. Can be null.
18 18
      * @param $name The block's name. This is a creature's moniker with .genetics appended.
19 19
      * @param $content The block's binary data. Used when constructing from a PrayFile
20 20
      * @param $flags The block's flags, which apply to the binary data as-is.
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 
5 5
 /// @brief The class for a GENE block 
6 6
 /**
7
-  * The contents are identical to that of a .gen file\n
8
-  * This class doesn't have any useful functions yet - I don't
9
-  * actually know how to decode genetics at the moment.
7
+ * The contents are identical to that of a .gen file\n
8
+ * This class doesn't have any useful functions yet - I don't
9
+ * actually know how to decode genetics at the moment.
10 10
  */
11 11
 class GENEBlock extends PrayBlock {
12 12
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
      * @param $content The block's binary data. Used when constructing from a PrayFile
20 20
      * @param $flags The block's flags, which apply to the binary data as-is.
21 21
      */
22
-    public function GENEBlock($prayfile,$name,$content,$flags) {
23
-        parent::PrayBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_GENE);
22
+    public function GENEBlock($prayfile, $name, $content, $flags) {
23
+        parent::PrayBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_GENE);
24 24
 
25 25
     }
26 26
 
Please login to merge, or discard this patch.
agents/PRAY/GLSTBlock.php 2 patches
Doc Comments   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * If $prayfile is not null, all the data for this block
33 33
      * will be read from the PRAYFile.
34
-     * @param $object The PRAYFile this FILEBlock belongs to, or the
34
+     * @param PRAYFile $object The PRAYFile this FILEBlock belongs to, or the
35 35
      * CreatureHistory object to store. <b>Cannot</b> be null.
36 36
      * @param $name The name of this block. I think it's usually the
37 37
      * creature's moniker with .GLST appended.
@@ -172,6 +172,10 @@  discard block
 block discarded – undo
172 172
 
173 173
 
174 174
     /// @brief Decodes an event. Used by DecompileBlockData.
175
+
176
+    /**
177
+     * @param StringReader $reader
178
+     */
175 179
     private function DecodeEvent($reader) {
176 180
         $eventNumber = $reader->ReadInt(4);
177 181
         //echo 'Event '.$eventNumber."\n";
@@ -206,7 +210,7 @@  discard block
 block discarded – undo
206 210
     /// @brief Compiles the block into binary for PrayBlock
207 211
     /**
208 212
      * @param $format One of the GLST_FORMAT_* constants
209
-     * @return The compiled block data for Compile()
213
+     * @return false|string compiled block data for Compile()
210 214
      */
211 215
     protected function CompileBlockData($format=GLST_FORMAT_UNKNOWN) {
212 216
         //if you don't know
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
 ///@{
11 11
 
12 12
 /** Value: 0 */
13
-define('GLST_FORMAT_UNKNOWN',0);
13
+define('GLST_FORMAT_UNKNOWN', 0);
14 14
 /** Value: 1 */
15
-define('GLST_FORMAT_C3',1);
15
+define('GLST_FORMAT_C3', 1);
16 16
 /** Value: 2 */
17
-define('GLST_FORMAT_DS',2);
17
+define('GLST_FORMAT_DS', 2);
18 18
 //@}
19 19
 
20 20
 /// @brief PRAY Block for Creature History Data.
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
      * @param $content The binary data of this file block.
39 39
      * @param $flags The block's flags. See PrayBlock.
40 40
      */
41
-    public function GLSTBlock($object,$name,$content,$flags) {
42
-        parent::CreaturesArchiveBlock($object,$name,$content,$flags,PRAY_BLOCK_GLST);
43
-        if($object instanceof PRAYFile) {
41
+    public function GLSTBlock($object, $name, $content, $flags) {
42
+        parent::CreaturesArchiveBlock($object, $name, $content, $flags, PRAY_BLOCK_GLST);
43
+        if ($object instanceof PRAYFile) {
44 44
             //Do nothing! Decoding is automated later now :)
45
-        } else if($object instanceof CreatureHistory) {
45
+        } else if ($object instanceof CreatureHistory) {
46 46
             $this->history = $object;
47 47
         } else {
48 48
             throw new Exception('Couldn\'t create a GLST block. :(');
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
     /// @brief Tries to work out which game this GLSTBlock is from
53 53
     private function GuessFormat() {
54 54
         //if I don't know
55
-        if($this->format == GLST_FORMAT_UNKNOWN) {
55
+        if ($this->format == GLST_FORMAT_UNKNOWN) {
56 56
             //ask $prayfile if it exists. (look for DSEX, otherwise C3)
57
-            if($this->prayfile != null) {
57
+            if ($this->prayfile != null) {
58 58
                 //prayfile should know
59
-                if(sizeof($this->prayfile->GetBlocks(PRAY_BLOCK_DSEX)) > 0) {
59
+                if (sizeof($this->prayfile->GetBlocks(PRAY_BLOCK_DSEX)) > 0) {
60 60
                     $format = GLST_FORMAT_DS;
61 61
                 } else {
62 62
                     $format = GLST_FORMAT_C3;
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public function GetPHOTBlockName(CreatureHistoryEvent $event) {
93 93
         $photoname = $event->GetPhotoGraph();
94
-        if(empty($photoname)) {
94
+        if (empty($photoname)) {
95 95
             return null;
96 96
         }
97
-        if($this->format == GLST_FORMAT_DS) {
97
+        if ($this->format == GLST_FORMAT_DS) {
98 98
             return $photoname.'.DSEX.photo';
99 99
         } else {
100 100
             return $photoname.'.photo';
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      * and handle errors.
110 110
      */
111 111
     public function GetPhotoBlock(CreatureHistoryEvent $event) {
112
-        if($this->GetPrayFile() instanceof PRAYFile) {
112
+        if ($this->GetPrayFile() instanceof PRAYFile) {
113 113
             return $block = $this->GetPrayFile()->GetBlockByName($this->GetPHOTBlockName());
114 114
         } else {
115 115
             throw new Exception("This GLSTBlock is not connected to a PRAYFile.");
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
     protected function DecompileBlockData() {   
124 124
         $reader = new StringReader($this->GetData());
125 125
         $firstchar = $reader->Read(1);
126
-        if($firstchar == chr(0x27)) { //apostrophe thing
126
+        if ($firstchar == chr(0x27)) { //apostrophe thing
127 127
             //ds
128 128
             $this->format = GLST_FORMAT_DS;
129
-        } else if($firstchar == chr(0x0C)) { //control character
129
+        } else if ($firstchar == chr(0x0C)) { //control character
130 130
             //c3
131 131
             $this->format = GLST_FORMAT_C3;
132 132
         } else {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         //the first four bytes including $firstchar are probably one integer used to identify the game used.
136 136
         //We read the first one above and now we're skipping the next three.
137 137
         $reader->Skip(3); // 3 nulls.
138
-        if($reader->ReadInt(4)!=1) { //Always 1, don't know why.
138
+        if ($reader->ReadInt(4) != 1) { //Always 1, don't know why.
139 139
             throw new Exception('Either the GLST Block is corrupt or I don\'t understand what the 2nd set of 4 bytes mean.');
140 140
             return false;
141 141
         }
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
         $species        = $reader->ReadInt(4);
148 148
         $eventslength   = $reader->ReadInt(4);
149 149
 
150
-        $this->history = new CreatureHistory($moniker,$name,$gender,$genus,$species);
151
-        if(!isset($eventslength)) {
150
+        $this->history = new CreatureHistory($moniker, $name, $gender, $genus, $species);
151
+        if (!isset($eventslength)) {
152 152
             return false;
153 153
         }
154
-        for($i=0;$i<$eventslength;$i++) {
154
+        for ($i = 0; $i < $eventslength; $i++) {
155 155
             $this->DecodeEvent($reader);
156 156
         }
157 157
 
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
         $mutations = $reader->ReadInt(4);
160 160
         $crossovers = $reader->ReadInt(4);
161 161
 
162
-        $this->history->SetMutationsAndCrossovers($mutations,$crossovers);
162
+        $this->history->SetMutationsAndCrossovers($mutations, $crossovers);
163 163
 
164
-        if($this->format == GLST_FORMAT_DS) {
164
+        if ($this->format == GLST_FORMAT_DS) {
165 165
             $unknown1 = $reader->ReadInt(4);
166
-            $warpveteran = (($reader->ReadInt(4)==1)?1:0);
166
+            $warpveteran = (($reader->ReadInt(4) == 1) ? 1 : 0);
167 167
             $unknown2 = $reader->Read($reader->ReadInt(4));
168
-            $this->history->SetDSUnknowns($unknown1,$unknown2);
168
+            $this->history->SetDSUnknowns($unknown1, $unknown2);
169 169
             $this->history->SetWarpVeteran($warpveteran);
170 170
         }
171 171
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     private function DecodeEvent($reader) {
176 176
         $eventNumber = $reader->ReadInt(4);
177 177
         //echo 'Event '.$eventNumber."\n";
178
-        if($eventNumber < 18) {
178
+        if ($eventNumber < 18) {
179 179
             $eventnumber    = $eventNumber;
180 180
             $worldtime      = $reader->ReadInt(4);
181 181
             $creatureage    = $reader->ReadInt(4);
@@ -187,14 +187,14 @@  discard block
 block discarded – undo
187 187
             $photograph     = $reader->Read($reader->ReadInt(4));
188 188
             $worldname      = $reader->Read($reader->ReadInt(4));
189 189
             $worldUID       = $reader->Read($reader->ReadInt(4));
190
-            $event = new CreatureHistoryEvent($eventnumber,$worldtime,$creatureage,
191
-                $timestamp,$lifestage,$moniker,$moniker2,$usertext,$photograph,
192
-                $worldname,$worldUID);
193
-            if($this->format == GLST_FORMAT_DS) {
190
+            $event = new CreatureHistoryEvent($eventnumber, $worldtime, $creatureage,
191
+                $timestamp, $lifestage, $moniker, $moniker2, $usertext, $photograph,
192
+                $worldname, $worldUID);
193
+            if ($this->format == GLST_FORMAT_DS) {
194 194
                 $DSUser     = $reader->Read($reader->ReadInt(4));
195 195
                 $unknown1   = $reader->ReadInt(4);
196 196
                 $unknown2   = $reader->ReadInt(4);
197
-                $event->AddDSInfo($DSUser,$unknown1,$unknown2);
197
+                $event->AddDSInfo($DSUser, $unknown1, $unknown2);
198 198
             }
199 199
             $this->history->AddEvent($event);
200 200
             return true;
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
      * @param $format One of the GLST_FORMAT_* constants
209 209
      * @return The compiled block data for Compile()
210 210
      */
211
-    protected function CompileBlockData($format=GLST_FORMAT_UNKNOWN) {
211
+    protected function CompileBlockData($format = GLST_FORMAT_UNKNOWN) {
212 212
         //if you don't know
213
-        if($format == GLST_FORMAT_UNKNOWN) {
213
+        if ($format == GLST_FORMAT_UNKNOWN) {
214 214
             $format = $this->GuessFormat();
215 215
         }   
216 216
         $compiled = Archive($this->history->Compile($format));
Please login to merge, or discard this patch.
agents/PRAY/LIVEBlock.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     /**
15 15
      * If $prayfile is not null, all the data for this block
16 16
      * will be read from the PRAYFile.
17
-     * @param $prayfile The PRAYFile this LIVEBlock belongs to.
17
+     * @param PRAYFile $prayfile The PRAYFile this LIVEBlock belongs to.
18 18
      * @param $name The name of this block
19 19
      * @param $content The binary data of this file block.
20 20
      * @param $flags The block's flags. See PrayBlock.
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
      * @param $flags The block's flags. See PrayBlock.
21 21
      */
22 22
 
23
-	public function LIVEBlock($prayfile,$name,$content,$flags) {
24
-		parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_LIVE);
23
+    public function LIVEBlock($prayfile,$name,$content,$flags) {
24
+        parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_LIVE);
25 25
 
26
-	}
26
+    }
27 27
 }
28 28
 ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@
 block discarded – undo
20 20
      * @param $flags The block's flags. See PrayBlock.
21 21
      */
22 22
 
23
-	public function LIVEBlock($prayfile,$name,$content,$flags) {
24
-		parent::TagBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_LIVE);
23
+	public function LIVEBlock($prayfile, $name, $content, $flags) {
24
+		parent::TagBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_LIVE);
25 25
 
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
agents/PRAY/PHOTBlock.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      * If $prayfile is not null, all the data for this block
18 18
      * will be read from the PRAYFile.
19
-     * @param $prayfile The PRAYFile that this DSAG block belongs to.
19
+     * @param PRAYFile $prayfile The PRAYFile that this DSAG block belongs to.
20 20
      * @param $name The block's name.
21 21
      * @param $content The binary data of this block. May be null.
22 22
      * @param $flags The block's flags
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     /// @brief Returns the photo data as an s16 file. <b>Deprecated.</b>
40 40
     /**
41
-     * @return The photo data as an S16File object.
41
+     * @return S16File photo data as an S16File object.
42 42
      */
43 43
     public function GetS16File() {
44 44
         return new S16File(new StringReader($this->GetData()));
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
      * @param $content The binary data of this block. May be null.
22 22
      * @param $flags The block's flags
23 23
      */
24
-    public function PHOTBlock($prayfile,$name,$content,$flags) {
25
-        parent::PrayBlock($prayfile,$name,$content,$flags,PRAY_BLOCK_PHOT);
24
+    public function PHOTBlock($prayfile, $name, $content, $flags) {
25
+        parent::PrayBlock($prayfile, $name, $content, $flags, PRAY_BLOCK_PHOT);
26 26
     }
27 27
 
28 28
     /// @cond INTERNAL_DOCS
Please login to merge, or discard this patch.
agents/PRAY/PrayBlock.php 2 patches
Doc Comments   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     /// @brief Encodes the block header for attaching to the front of the block binary data.
104 104
     /** 
105
-     * @param $length length of the data that will be written to the block
105
+     * @param integer $length length of the data that will be written to the block
106 106
      * @param $uncompressedlength length of the data when uncompressed, etc.
107 107
      */
108 108
     protected function EncodeBlockHeader($length,$uncompressedlength=false) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     /** 
128 128
      * Called automatically during Compile
129 129
      * @param $data the data to perform the function on
130
-     * @return the data, having been transformed.
130
+     * @return boolean|string data, having been transformed.
131 131
      */
132 132
     protected function PerformFlagOperations($data) {
133 133
         if($this->IsFlagSet(PRAY_FLAG_ZLIB_COMPRESSED)) {
@@ -140,6 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     /// @brief Gets the PRAY block's name
142 142
     /** return the PRAY block's name
143
+     * @return string
143 144
      */
144 145
     public function GetName() {
145 146
         return $this->name;
@@ -181,8 +182,8 @@  discard block
 block discarded – undo
181 182
     }
182 183
     /// @brief Tells you whether $flag is set on this PRAY block
183 184
     /**
184
-     * @param $flag the bitfield to compare $flags to. As such can be multiple flags OR'd together.
185
-     * @return true or false.
185
+     * @param integer $flag the bitfield to compare $flags to. As such can be multiple flags OR'd together.
186
+     * @return boolean or false.
186 187
      */
187 188
     public function IsFlagSet($flag) {
188 189
         return (($this->flags & $flag) === $flag);
@@ -222,7 +223,7 @@  discard block
 block discarded – undo
222 223
     }
223 224
     /// @brief Unsets flags
224 225
     /**
225
-     * @param $flags a bitfield representing the flags to set off.
226
+     * @param integer $flags a bitfield representing the flags to set off.
226 227
      */
227 228
     protected function SetFlagsOff($flags) {
228 229
         $this->flags = $this->flags & ~$flags;
@@ -288,7 +289,7 @@  discard block
 block discarded – undo
288 289
     /** For developer use. Called by 
289 290
      *   @param $blocktype   The type of PRAYBlock, as one of the Block Types defines.
290 291
      *   @param $prayfile    The PRAYFile object that the PRAYBlock is a child of. This is used to allow blocks to access to each other.
291
-     *   @param $name        The name of the PRAYBlock
292
+     *   @param string $name        The name of the PRAYBlock
292 293
      *   @param $content     The binary content of the PRAYBlock, uncompressed if necessary.
293 294
      *   @param $flags       The flags given to this PRAYBlock as an integer.
294 295
      *   return An object that is an instance of a subclass of PrayBlock.
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
  */
25 25
 //@{
26 26
 /** Value: 'AGNT' */
27
-define('PRAY_BLOCK_AGNT','AGNT'); 
27
+define('PRAY_BLOCK_AGNT', 'AGNT'); 
28 28
 /** Value: 'CREA' */
29
-define('PRAY_BLOCK_CREA','CREA');
29
+define('PRAY_BLOCK_CREA', 'CREA');
30 30
 /** Value: 'DFAM' */
31
-define('PRAY_BLOCK_DFAM','DFAM');
31
+define('PRAY_BLOCK_DFAM', 'DFAM');
32 32
 /** Value: 'DSAG' */
33
-define('PRAY_BLOCK_DSAG','DSAG');
33
+define('PRAY_BLOCK_DSAG', 'DSAG');
34 34
 /** Value: 'DSEX' */
35
-define('PRAY_BLOCK_DSEX','DSEX');
35
+define('PRAY_BLOCK_DSEX', 'DSEX');
36 36
 /** Value: 'EGG' */
37
-define('PRAY_BLOCK_EGGS' ,'EGGS' );
37
+define('PRAY_BLOCK_EGGS', 'EGGS');
38 38
 /** Value: 'EXPC' */
39
-define('PRAY_BLOCK_EXPC','EXPC');
39
+define('PRAY_BLOCK_EXPC', 'EXPC');
40 40
 /** Value: 'FILE' */
41
-define('PRAY_BLOCK_FILE','FILE');
41
+define('PRAY_BLOCK_FILE', 'FILE');
42 42
 /** Value: 'GENE' */
43
-define('PRAY_BLOCK_GENE','GENE');
43
+define('PRAY_BLOCK_GENE', 'GENE');
44 44
 /** Value: 'GLST' */
45
-define('PRAY_BLOCK_GLST','GLST');
45
+define('PRAY_BLOCK_GLST', 'GLST');
46 46
 /** Value: 'LIVE' */
47
-define('PRAY_BLOCK_LIVE','LIVE');
47
+define('PRAY_BLOCK_LIVE', 'LIVE');
48 48
 /** Value: 'PHOT' */
49
-define('PRAY_BLOCK_PHOT','PHOT');
49
+define('PRAY_BLOCK_PHOT', 'PHOT');
50 50
 /** Value: 'SFAM' */
51
-define('PRAY_BLOCK_SFAM','SFAM');
51
+define('PRAY_BLOCK_SFAM', 'SFAM');
52 52
 //@}
53 53
 
54 54
 /** @name Flags
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 ///@{
58 58
 /** Value: 1*/
59 59
 ///Whether or not the block is zLib compressed.
60
-define('PRAY_FLAG_ZLIB_COMPRESSED',1);
60
+define('PRAY_FLAG_ZLIB_COMPRESSED', 1);
61 61
 ///@}
62 62
 
63 63
 /// @brief Abstract class to represent PRAY blocks
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
      *    @param $flags     A 1-byte integer containing the flags this PrayBlock has set
84 84
      *    @param $type     The type of the PrayBlock as a PRAY_BLOCK_* constant. Must be a four-character string.  
85 85
      */
86
-    public function PrayBlock($prayfile,$name,$content,$flags,$type) {
87
-        if(strlen($type) != 4) {
86
+    public function PrayBlock($prayfile, $name, $content, $flags, $type) {
87
+        if (strlen($type) != 4) {
88 88
             throw new Exception('Invalid PRAY block type: '.$type);
89 89
         }
90
-        if($prayfile instanceof PRAYFile) {
90
+        if ($prayfile instanceof PRAYFile) {
91 91
             $this->prayfile = $prayfile;
92 92
             $this->decompiled = false;
93 93
         } else {
@@ -105,18 +105,18 @@  discard block
 block discarded – undo
105 105
      * @param $length length of the data that will be written to the block
106 106
      * @param $uncompressedlength length of the data when uncompressed, etc.
107 107
      */
108
-    protected function EncodeBlockHeader($length,$uncompressedlength=false) {
108
+    protected function EncodeBlockHeader($length, $uncompressedlength = false) {
109 109
         $compiled = $this->GetType();
110
-        $compiled .= substr($this->GetName(),0,128);
111
-        $len = 128 - strlen($this->GetName());
110
+        $compiled .= substr($this->GetName(), 0, 128);
111
+        $len = 128-strlen($this->GetName());
112 112
         
113
-        for($i=0;$i<$len;$i++) {
113
+        for ($i = 0; $i < $len; $i++) {
114 114
             $compiled .= pack('x');
115 115
         }
116
-        if($uncompressedlength === false) {
116
+        if ($uncompressedlength === false) {
117 117
             $uncompressedlength = $length;
118 118
         }
119
-        $compiled .= pack('VVV',$length,$uncompressedlength,$this->flags);
119
+        $compiled .= pack('VVV', $length, $uncompressedlength, $this->flags);
120 120
         return $compiled;
121 121
     }
122 122
     /// @endcond
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      * @return the data, having been transformed.
131 131
      */
132 132
     protected function PerformFlagOperations($data) {
133
-        if($this->IsFlagSet(PRAY_FLAG_ZLIB_COMPRESSED)) {
133
+        if ($this->IsFlagSet(PRAY_FLAG_ZLIB_COMPRESSED)) {
134 134
             $data = gzcompress($data);
135 135
         }
136 136
         return $data;
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
      * return the PRAY block's binary data.
152 152
      */
153 153
     public function GetData() {
154
-        if($this->decompiled) {
154
+        if ($this->decompiled) {
155 155
             throw new Exception('Can\'t get data on a decompiled PRAYBlock. It must be compiled first');
156 156
             return;
157 157
         }
158
-        if($this->IsFlagSet(PRAY_FLAG_ZLIB_COMPRESSED)) {
158
+        if ($this->IsFlagSet(PRAY_FLAG_ZLIB_COMPRESSED)) {
159 159
             $this->content = gzuncompress($this->content);
160 160
             $this->SetFlagsOff(PRAY_FLAG_ZLIB_COMPRESSED);
161 161
         }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      * Call this function at the beginning of every function that returns data in superclasses so that data decoding is automatic.
234 234
      */
235 235
     protected function EnsureDecompiled() {
236
-        if($this->decompiled) {
236
+        if ($this->decompiled) {
237 237
             return;
238 238
         } else {
239 239
             $this->DecompileBlockData();
@@ -251,18 +251,18 @@  discard block
 block discarded – undo
251 251
      * This function is mainly intended for use by PRAYFiles. 
252 252
      */
253 253
     public function Compile() {
254
-        if($this->decompiled) { 
254
+        if ($this->decompiled) { 
255 255
             $data = $this->CompileBlockData();
256 256
             $uclength = strlen($data);
257 257
             $data = $this->PerformFlagOperations($data);
258
-            $compiled = $this->EncodeBlockHeader(strlen($data),$uclength);
258
+            $compiled = $this->EncodeBlockHeader(strlen($data), $uclength);
259 259
             $compiled .= $data;
260 260
             $this->content = $data;
261 261
             $this->decompiled = false;
262 262
             return $compiled; 
263 263
         } else {
264 264
             $data = $this->PerformFlagOperations($this->content);
265
-            $compiled  = $this->EncodeBlockHeader(strlen($this->content),strlen($data));
265
+            $compiled  = $this->EncodeBlockHeader(strlen($this->content), strlen($data));
266 266
             $compiled .= $this->content;
267 267
             return $compiled;
268 268
         }
@@ -293,50 +293,50 @@  discard block
 block discarded – undo
293 293
      *   @param $flags       The flags given to this PRAYBlock as an integer.
294 294
      *   return An object that is an instance of a subclass of PrayBlock.
295 295
      */
296
-    public static function MakePrayBlock($blocktype,PRAYFile $prayfile,$name,$content,$flags) {
297
-        switch($blocktype) {
296
+    public static function MakePrayBlock($blocktype, PRAYFile $prayfile, $name, $content, $flags) {
297
+        switch ($blocktype) {
298 298
             //agents
299 299
         case PRAY_BLOCK_AGNT:
300
-            return new AGNTBlock($prayfile,$name,$content,$flags);
300
+            return new AGNTBlock($prayfile, $name, $content, $flags);
301 301
         case PRAY_BLOCK_DSAG:
302
-            return new DSAGBlock($prayfile,$name,$content,$flags);
302
+            return new DSAGBlock($prayfile, $name, $content, $flags);
303 303
         case PRAY_BLOCK_LIVE:
304
-            return new LIVEBlock($prayfile,$name,$content,$flags); //sea monkeys agent files.
304
+            return new LIVEBlock($prayfile, $name, $content, $flags); //sea monkeys agent files.
305 305
 
306 306
             //egg
307 307
         case PRAY_BLOCK_EGGS:
308
-            return new EGGSBlock($prayfile,$name,$content,$flags);
308
+            return new EGGSBlock($prayfile, $name, $content, $flags);
309 309
 
310 310
             //starter families
311 311
         case PRAY_BLOCK_DFAM:
312
-            return new DFAMBlock($prayfile,$name,$content,$flags);
312
+            return new DFAMBlock($prayfile, $name, $content, $flags);
313 313
         case PRAY_BLOCK_SFAM:
314
-            return new SFAMBlock($prayfile,$name,$content,$flags);
314
+            return new SFAMBlock($prayfile, $name, $content, $flags);
315 315
 
316 316
             //exported creatures
317 317
         case PRAY_BLOCK_EXPC:
318
-            return new EXPCBlock($prayfile,$name,$content,$flags);
318
+            return new EXPCBlock($prayfile, $name, $content, $flags);
319 319
         case PRAY_BLOCK_DSEX:
320
-            return new DSEXBlock($prayfile,$name,$content,$flags);
320
+            return new DSEXBlock($prayfile, $name, $content, $flags);
321 321
 
322 322
         case PRAY_BLOCK_CREA:
323
-            return new CREABlock($prayfile,$name,$content,$flags);
323
+            return new CREABlock($prayfile, $name, $content, $flags);
324 324
 
325 325
             //creature photos
326 326
         case PRAY_BLOCK_PHOT:
327
-            return new PHOTBlock($prayfile,$name,$content,$flags);
327
+            return new PHOTBlock($prayfile, $name, $content, $flags);
328 328
 
329 329
             //creature history
330 330
         case PRAY_BLOCK_GLST:
331
-            return new GLSTBlock($prayfile,$name,$content,$flags);
331
+            return new GLSTBlock($prayfile, $name, $content, $flags);
332 332
 
333 333
             //creature genetics
334 334
         case PRAY_BLOCK_GENE:
335
-            return new GENEBlock($prayfile,$name,$content,$flags);
335
+            return new GENEBlock($prayfile, $name, $content, $flags);
336 336
 
337 337
             //files
338 338
         case PRAY_BLOCK_FILE:
339
-            return new FILEBlock($prayfile,$name,$content,$flags);
339
+            return new FILEBlock($prayfile, $name, $content, $flags);
340 340
 
341 341
         default:
342 342
             return null;
Please login to merge, or discard this patch.