Code Duplication    Length = 4-4 lines in 2 locations

projects/packages/changelogger/tests/php/tests/src/VersionCommandTest.php 1 location

@@ 45-48 (lines=4) @@
42
	 * @param string   $expectOutput Expected output.
43
	 */
44
	public function testExecute( array $args, array $options, $expectExitCode, $expectOutput ) {
45
		if ( isset( $options['composer.json'] ) ) {
46
			file_put_contents( 'composer.json', json_encode( array( 'extra' => array( 'changelogger' => $options['composer.json'] ) ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) );
47
			unset( $options['composer.json'] );
48
		}
49
		if ( isset( $options['CHANGELOG.md'] ) ) {
50
			file_put_contents( 'CHANGELOG.md', $options['CHANGELOG.md'] );
51
			unset( $options['CHANGELOG.md'] );

projects/packages/changelogger/tests/php/tests/src/WriteCommandTest.php 1 location

@@ 63-66 (lines=4) @@
60
			),
61
		);
62
63
		if ( isset( $options['composer.json'] ) ) {
64
			file_put_contents( 'composer.json', json_encode( array( 'extra' => array( 'changelogger' => $options['composer.json'] ) ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) );
65
			unset( $options['composer.json'] );
66
		}
67
		$changelog = isset( $options['changelog'] ) ? $options['changelog'] : null;
68
		$changes   = isset( $options['changes'] ) ? $options['changes'] : array();
69
		unset( $options['changelog'], $options['changes'] );