Code Duplication    Length = 11-14 lines in 2 locations

src/Query.php 2 locations

@@ 68-81 (lines=14) @@
65
     * @param mixed $return External variable to store query results
66
     * @return mixed If no arguments passed returns query results collection, otherwise query success status
67
     */
68
    public function exec(&$return = null)
69
    {
70
        // Call handlers stack
71
        $this->callHandlers();
72
73
        /** @var RecordInterface[] $return Perform DB request */
74
        $return = $this->database->find($this->class_name, $this);
75
76
        // Clear this query
77
        $this->flush();
78
79
        // Return bool or collection
80
        return func_num_args() ? sizeof($return) : $return;
81
    }
82
83
    /**
84
     * Perform database request and get first record from results collection.
@@ 112-122 (lines=11) @@
109
     * @return mixed If no arguments passed returns query results first database record object,
110
     * otherwise query success status
111
     */
112
    public function fields($fieldName, &$return = null)
113
    {
114
        // Call handlers stack
115
        $this->callHandlers();
116
117
        // Perform DB request
118
        $return = $this->database->fetchColumn($this->class_name, $this, $fieldName);
119
120
        // Return bool or collection
121
        return func_num_args() > 1 ? sizeof($return) : $return;
122
    }
123
124
    /**
125
     * Set query entity to work with.