Code Duplication    Length = 4-4 lines in 2 locations

src/Plugin/Spy.php 1 location

@@ 61-64 (lines=4) @@
58
        $key = [$space->getName()];
59
60
        $format = $space->getFormat();
61
        foreach ($space->getPrimaryIndex()['parts'] as $part) {
62
            $field = array_key_exists(0, $part) ? $part[0] : $part['field'];
63
            $key[] = $instance->{$format[$field]['name']};
64
        }
65
66
        return implode(':', $key);
67
    }

src/Procedure/FindOrCreate.php 1 location

@@ 64-67 (lines=4) @@
61
62
        $key = [];
63
        $format = $space->getFormat();
64
        foreach ($space->getPrimaryIndex()['parts'] as $part) {
65
            $field = array_key_exists(0, $part) ? $part[0] : $part['field'];
66
            $key[$format[$field]['name']] = $result['tuple'][$field];
67
        }
68
        return [
69
            'key' => $key,
70
            'created' => !!$result['created'],