View Javadoc

    1   /***
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.cpd;
    5
    6   import java.io.File;
    7   import java.io.FilenameFilter;
    8
    9   public class PHPLanguage implements Language {
    10
    11      public static class PHPFileOrDirectoryFilter implements FilenameFilter {
    12          public boolean accept(File dir, String filename) {
    13              return filename.endsWith("php") || filename.endsWith("class") || (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory());
    14          }
    15      }
    16
    17      public Tokenizer getTokenizer() {
    18          return new PHPTokenizer();
    19      }
    20
    21      public FilenameFilter getFileFilter() {
    22          return new PHPFileOrDirectoryFilter();
    23      }
    24  }