Code Duplication    Length = 22-22 lines in 2 locations

StatementRepository.php 2 locations

@@ 39-60 (lines=22) @@
36
     *
37
     * @throws NotFoundException if no Statement with the given UUID does exist
38
     */
39
    final public function findStatementById($statementId, Actor $authority = null)
40
    {
41
        $criteria = array('id' => $statementId);
42
43
        if (null !== $authority) {
44
            $criteria['authority'] = $authority;
45
        }
46
47
        $mappedStatement = $this->findMappedStatement($criteria);
48
49
        if (null === $mappedStatement) {
50
            throw new NotFoundException();
51
        }
52
53
        $statement = $mappedStatement->getModel();
54
55
        if ($statement->isVoidStatement()) {
56
            throw new NotFoundException();
57
        }
58
59
        return $statement;
60
    }
61
62
    /**
63
     * Finds a voided {@link Statement} by id.
@@ 75-96 (lines=22) @@
72
     * @throws NotFoundException if no voided Statement with the given UUID
73
     *                           does exist
74
     */
75
    final public function findVoidedStatementById($voidedStatementId, Actor $authority = null)
76
    {
77
        $criteria = array('id' => $voidedStatementId);
78
79
        if (null !== $authority) {
80
            $criteria['authority'] = $authority;
81
        }
82
83
        $mappedStatement = $this->findMappedStatement($criteria);
84
85
        if (null === $mappedStatement) {
86
            throw new NotFoundException();
87
        }
88
89
        $statement = $mappedStatement->getModel();
90
91
        if (!$statement->isVoidStatement()) {
92
            throw new NotFoundException();
93
        }
94
95
        return $statement;
96
    }
97
98
    /**
99
     * Finds a collection of {@link Statement Statements} filtered by the given