Code Duplication    Length = 7-11 lines in 3 locations

src/Comodojo/Extender/Base/Daemon.php 1 location

@@ 188-197 (lines=10) @@
185
186
    }
187
188
    public static function getLoopTime($looptime) {
189
190
        return filter_var($looptime, FILTER_VALIDATE_INT, array(
191
            'options' => array(
192
                'default' => 1,
193
                'min_range' => 1
194
            )
195
        ));
196
197
    }
198
199
}
200

src/Comodojo/Extender/Components/Niceness.php 1 location

@@ 77-87 (lines=11) @@
74
75
    }
76
77
    private static function getNiceness($niceness=null) {
78
79
        return filter_var($niceness, FILTER_VALIDATE_INT, array(
80
            'options' => array(
81
                'default' => 0,
82
                'min_range' => -10,
83
                'max_range' => 10
84
            )
85
        ));
86
87
    }
88
89
}
90

src/Extender.php 1 location

@@ 324-330 (lines=7) @@
321
     *
322
     * @return  Extender          $this
323
     */
324
    final public function setMaxChildsRuntime($time) {
325
326
        $this->max_childs_runtime = filter_var($time, FILTER_VALIDATE_INT, array("min_range" => 1, "default" => 300));
327
328
        return $this;
329
330
    }
331
332
    /**
333
     * Get maximum time (in seconds) the parent will wait for child tasks to be completed (in miltithread mode)