Code Duplication    Length = 4-4 lines in 2 locations

code/tasks/MigrateDeploymentStatusTask.php 1 location

@@ 6-9 (lines=4) @@
3
class MigrateDeploymentStatusTask extends BuildTask {
4
5
	public function run($request) {
6
		$log = function($message) {
7
			$message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
8
			echo $message . PHP_EOL;
9
		};
10
11
		if (!Director::is_cli()) {
12
			$log('This command can only run via CLI');

code/tasks/CleanupOrphanedRecordsTask.php 1 location

@@ 9-12 (lines=4) @@
6
		$args = $request->getVar('args');
7
		$dryRun = $args && in_array('--dry-run', $args);
8
9
		$log = function($message) {
10
			$message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
11
			echo $message . PHP_EOL;
12
		};
13
14
		if (!Director::is_cli()) {
15
			$log('This task must be run under the command line');