Code Duplication    Length = 6-6 lines in 2 locations

packages/analyzer/src/Declarations.php 1 location

@@ 42-47 (lines=6) @@
39
			throw new Exception( 'Exclude must be an array' );
40
		}
41
42
		$filter = function ( $file, $key, $iterator ) use ( $exclude ) {
43
			if ( $iterator->hasChildren() && ! in_array( $file->getFilename(), $exclude ) ) {
44
				return true;
45
			}
46
			return $file->isFile();
47
		};
48
49
		$inner_iterator = new \RecursiveDirectoryIterator( $root, \RecursiveDirectoryIterator::SKIP_DOTS );
50

packages/analyzer/src/Invocations.php 1 location

@@ 41-46 (lines=6) @@
38
	}
39
40
	public function scan_dir( $root, $exclude = array() ) {
41
		$filter = function ( $file, $key, $iterator ) use ( $exclude ) {
42
			if ( $iterator->hasChildren() && ! in_array( $file->getFilename(), $exclude ) ) {
43
				return true;
44
			}
45
			return $file->isFile();
46
		};
47
48
		$inner_iterator = new \RecursiveDirectoryIterator( $root, \RecursiveDirectoryIterator::SKIP_DOTS );
49