@@ 251-256 (lines=6) @@ | ||
248 | ||
249 | // Invariant is not needed in private or static functions. |
|
250 | // Also make sure that there is none in front of the constructor check |
|
251 | if ($functionDefinition->getVisibility() !== 'private' && |
|
252 | !$functionDefinition->isStatic() && $functionDefinition->getName() !== '__construct' |
|
253 | ) { |
|
254 | $code .= Placeholders::INVARIANT_CALL_START . ' |
|
255 | '; |
|
256 | } |
|
257 | ||
258 | $code .= Placeholders::PRECONDITION . $functionDefinition->getName() . Placeholders::PLACEHOLDER_CLOSE . ' |
|
259 | ' . Placeholders::OLD_SETUP . $functionDefinition->getName() . Placeholders::PLACEHOLDER_CLOSE. ' |
|
@@ 292-296 (lines=5) @@ | ||
289 | $code .= ' ' . Placeholders::POSTCONDITION . $functionDefinition->getName() . Placeholders::PLACEHOLDER_CLOSE; |
|
290 | ||
291 | // Invariant is not needed in private or static functions |
|
292 | if ($functionDefinition->getVisibility() !== 'private' && !$functionDefinition->isStatic()) { |
|
293 | $code .= ' |
|
294 | ' . Placeholders::INVARIANT_CALL_END . ' |
|
295 | '; |
|
296 | } |
|
297 | ||
298 | // close of the contract context |
|
299 | $code .= 'if (' . ReservedKeywords::CONTRACT_CONTEXT . ') { |