Code Duplication    Length = 9-9 lines in 2 locations

src/GraphQL/QueryProvider/GqlQueryMapQueryProvider.php 1 location

@@ 68-76 (lines=9) @@
65
  protected function discoverQueryMaps() {
66
    $maps = [];
67
    foreach ($this->lookupPaths as $path) {
68
      if (is_dir($path)) {
69
        $iterator = new RegexDirectoryIterator($path, '/\.gql/i');
70
71
        /** @var \SplFileInfo $file */
72
        foreach ($iterator as $file) {
73
          $filename = $file->getBasename('.gql');
74
          $maps[$filename] = $file->getPathname();
75
        }
76
      }
77
78
      if (is_file($path)) {
79
        $file = new \SplFileInfo($path);

src/GraphQL/QueryProvider/JsonQueryMapQueryProvider.php 1 location

@@ 73-81 (lines=9) @@
70
  protected function discoverQueryMaps() {
71
    $maps = [];
72
    foreach ($this->lookupPaths as $path) {
73
      if (is_dir($path)) {
74
        $iterator = new RegexDirectoryIterator($path, '/\.json/i');
75
76
        /** @var \SplFileInfo $file */
77
        foreach ($iterator as $file) {
78
          $hash = sha1(file_get_contents($file->getPathname()));
79
          $maps[$hash] = $file->getPathname();
80
        }
81
      }
82
83
      if (is_file($path)) {
84
        $file = new \SplFileInfo($path);