Code Duplication    Length = 5-6 lines in 2 locations

src/StreamFilters/SkeletonFilter.php 2 locations

@@ 272-277 (lines=6) @@
269
270
        // Invariant is not needed in private or static functions.
271
        // Also make sure that there is none in front of the constructor check
272
        if ($functionDefinition->getVisibility() !== 'private' &&
273
            !$functionDefinition->isStatic() && $functionDefinition->getName() !== '__construct'
274
        ) {
275
            $code .= Placeholders::INVARIANT_CALL_START . '
276
            ';
277
        }
278
279
        $code .= Placeholders::PRECONDITION . $functionDefinition->getName() . Placeholders::PLACEHOLDER_CLOSE . '
280
            ' . Placeholders::OLD_SETUP . $functionDefinition->getName() . Placeholders::PLACEHOLDER_CLOSE. '
@@ 313-317 (lines=5) @@
310
        $code .= '    ' . Placeholders::POSTCONDITION . $functionDefinition->getName() . Placeholders::PLACEHOLDER_CLOSE;
311
312
        // Invariant is not needed in private or static functions
313
        if ($functionDefinition->getVisibility() !== 'private' && !$functionDefinition->isStatic()) {
314
            $code .= '
315
            ' . Placeholders::INVARIANT_CALL_END . '
316
            ';
317
        }
318
319
        // close of the contract context
320
        $code .= 'if (' . ReservedKeywords::CONTRACT_CONTEXT . ') {