original_string: protected function buildResourceWatcher($sourceDir, $destinationDir)
      {
          $fs = new Filesystem();
          $relativeDestination = rtrim($fs->makePathRelative($destinationDir, $sourceDir), '/');
  
          $finder = new Finder();
          $finder->files()
              ->name('*.*')
              ->in($sourceDir);
  
          if (false === strpos($relativeDestination, '..')) {
              $finder->exclude($relativeDestination);
          }
  
          $rc = new ResourceCacheMemory();
          $rw = new ResourceWatcher($rc);
          $rw->setFinder($finder);
  
          return $rw;
      }
code: protected function buildResourceWatcher($sourceDir, $destinationDir)
      {
          $fs = new Filesystem();
          $relativeDestination = rtrim($fs->makePathRelative($destinationDir, $sourceDir), '/');
  
          $finder = new Finder();
          $finder->files()
              ->name('*.*')
              ->in($sourceDir);
  
          if (false === strpos($relativeDestination, '..')) {
              $finder->exclude($relativeDestination);
          }
  
          $rc = new ResourceCacheMemory();
          $rw = new ResourceWatcher($rc);
          $rw->setFinder($finder);
  
          return $rw;
      }
code_tokens: protected function buildResourceWatcher ( $ sourceDir , $ destinationDir ) { $ fs = new Filesystem ( ) ; $ relativeDestination = rtrim ( $ fs -> makePathRelative ( $ destinationDir , $ sourceDir ) , '/' ) ; $ finder = new Finder ( ) ; $ finder -> files ( ) -> name ( '*.*' ) -> in ( $ sourceDir ) ; if ( false === strpos ( $ relativeDestination , '..' ) ) { $ finder -> exclude ( $ relativeDestination ) ; } $ rc = new ResourceCacheMemory ( ) ; $ rw = new ResourceWatcher ( $ rc ) ; $ rw -> setFinder ( $ finder ) ; return $ rw ; }
docstring: Builds a ResourceWatcher instance.
  
  @param string $sourceDir      Source path
  @param string $destinationDir Destination path
  
  @return ResourceWatcher The ResourceWatcher instance
docstring_tokens: Builds a ResourceWatcher instance .