Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 103-113 (lines=11) @@
100
     * @throws \InvalidArgumentException if an invalid strategy name is passed
101
     * @return string the strategy to be used for saving
102
     */
103
    public function saveStrategy($strategy = null)
104
    {
105
        if ($strategy === null) {
106
            return $this->_saveStrategy;
107
        }
108
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
109
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
110
            throw new InvalidArgumentException($msg);
111
        }
112
        return $this->_saveStrategy = $strategy;
113
    }
114
115
    /**
116
     * Takes an entity from the source table and looks if there is a field

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

@@ 496-506 (lines=11) @@
493
     * @throws \InvalidArgumentException if an invalid strategy name is passed
494
     * @return string the strategy to be used for saving
495
     */
496
    public function saveStrategy($strategy = null)
497
    {
498
        if ($strategy === null) {
499
            return $this->_saveStrategy;
500
        }
501
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
502
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
503
            throw new InvalidArgumentException($msg);
504
        }
505
        return $this->_saveStrategy = $strategy;
506
    }
507
508
    /**
509
     * Takes an entity from the source table and looks if there is a field