Tester\CodeCoverage\Collector::save PHP 메소드

save() 공개 정적인 메소드

Saves information about code coverage. Can be called repeatedly to free memory.
public static save ( ) : void
리턴 void
    public static function save()
    {
        if (!self::isStarted()) {
            throw new \LogicException('Code coverage collector has not been started.');
        }
        list($positive, $negative) = call_user_func([__CLASS__, self::$collector]);
        flock(self::$file, LOCK_EX);
        fseek(self::$file, 0);
        $rawContent = stream_get_contents(self::$file);
        $original = $rawContent ? unserialize($rawContent) : [];
        $coverage = array_replace_recursive($negative, $original, $positive);
        fseek(self::$file, 0);
        ftruncate(self::$file, 0);
        fwrite(self::$file, serialize($coverage));
        flock(self::$file, LOCK_UN);
    }