Code Duplication    Length = 15-15 lines in 2 locations

vendor/cakephp/cakephp/src/ORM/Association/HasOne.php 1 location

@@ 139-153 (lines=15) @@
136
    /**
137
     * {@inheritDoc}
138
     */
139
    protected function _linkField($options)
140
    {
141
        $links = [];
142
        $name = $this->alias();
143
144
        foreach ((array)$options['foreignKey'] as $key) {
145
            $links[] = sprintf('%s.%s', $name, $key);
146
        }
147
148
        if (count($links) === 1) {
149
            return $links[0];
150
        }
151
152
        return $links;
153
    }
154
155
    /**
156
     * {@inheritDoc}

vendor/cakephp/cakephp/src/ORM/Association/BelongsToMany.php 1 location

@@ 1225-1239 (lines=15) @@
1222
     * @param array $options the options to use for getting the link field.
1223
     * @return string
1224
     */
1225
    protected function _linkField($options)
1226
    {
1227
        $links = [];
1228
        $name = $this->_junctionAssociationName();
1229
1230
        foreach ((array)$options['foreignKey'] as $key) {
1231
            $links[] = sprintf('%s.%s', $name, $key);
1232
        }
1233
1234
        if (count($links) === 1) {
1235
            return $links[0];
1236
        }
1237
1238
        return $links;
1239
    }
1240
1241
    /**
1242
     * Returns the name of the association from the target table to the junction table,