@Test public void shouldCheckCustomValidPhpExtensions() { MapSettings settings = new MapSettings(); settings.setProperty(PhpPlugin.FILE_SUFFIXES_KEY, " php6 , php7, , "); Php php = new Php(settings.asConfig()); assertTrue(php.hasValidSuffixes("goodExtension.php6")); assertTrue(php.hasValidSuffixes("goodExtension.php7")); }
public boolean hasValidSuffixes(String fileName) { String pathLowerCase = StringUtils.lowerCase(fileName); for (String suffix : getFileSuffixes()) { if (pathLowerCase.endsWith("." + StringUtils.lowerCase(suffix))) { return true; } } return false; }
Php extends AbstractLanguage { public boolean hasValidSuffixes(String fileName) { String pathLowerCase = StringUtils.lowerCase(fileName); for (String suffix : getFileSuffixes()) { if (pathLowerCase.endsWith("." + StringUtils.lowerCase(suffix))) { return true; } } return false; } }
Php extends AbstractLanguage { public boolean hasValidSuffixes(String fileName) { String pathLowerCase = StringUtils.lowerCase(fileName); for (String suffix : getFileSuffixes()) { if (pathLowerCase.endsWith("." + StringUtils.lowerCase(suffix))) { return true; } } return false; } Php(Configuration settings); }
Php extends AbstractLanguage { public boolean hasValidSuffixes(String fileName) { String pathLowerCase = StringUtils.lowerCase(fileName); for (String suffix : getFileSuffixes()) { if (pathLowerCase.endsWith("." + StringUtils.lowerCase(suffix))) { return true; } } return false; } Php(Configuration settings); @Override String[] getFileSuffixes(); boolean hasValidSuffixes(String fileName); }
Php extends AbstractLanguage { public boolean hasValidSuffixes(String fileName) { String pathLowerCase = StringUtils.lowerCase(fileName); for (String suffix : getFileSuffixes()) { if (pathLowerCase.endsWith("." + StringUtils.lowerCase(suffix))) { return true; } } return false; } Php(Configuration settings); @Override String[] getFileSuffixes(); boolean hasValidSuffixes(String fileName); static final String NAME; static final String KEY; static final String DEFAULT_FILE_SUFFIXES; }