@Override protected String performOp(String val) { return StringUtils.stripStart(val, " "); }
@Override protected String performOp(String val) { return StringUtils.stripStart(val, " "); }
return str; str = stripStart(str, stripChars); return stripEnd(str, stripChars);
/** * Foobar/Bar => Foobar\Bar * \\Foobar\Foobar => Foobar\Bar */ @NotNull private static String normalizeRouteController(@NotNull String string) { string = string.replace("/", "\\"); string = StringUtils.stripStart(string,"\\"); return string; }
/** * Support "use Symfony\Component\Routing\Annotation\Route as BaseRoute;" */ public static boolean isRouteClassAnnotation(@NotNull String clazz) { String myClazz = StringUtils.stripStart(clazz, "\\"); return ROUTE_CLASSES.stream().anyMatch(s -> s.equalsIgnoreCase(myClazz)); } }
public static boolean isEqualClassName(@Nullable PhpClass phpClass, @Nullable String compareClassName) { if(phpClass == null || compareClassName == null) { return false; } return StringUtils.stripStart(phpClass.getPresentableFQN(), "\\") .equals(StringUtils.stripStart(compareClassName, "\\")); }
@NotNull @Override public String getLookupString() { return StringUtils.stripStart(phpClass.getPresentableFQN(), "\\"); }
@Nullable @Override public String getUrlForRequest(@NotNull ProfilerRequestInterface request) { String profilerUrl = request.getProfilerUrl(); // already absolute url given if(profilerUrl.startsWith("http://") || profilerUrl.startsWith("https://")) { return profilerUrl; } return this.url + "/" + StringUtils.stripStart(profilerUrl, "/"); } }
private boolean isString(@NotNull PhpType type) { for (String s : type.getTypes()) { if(StringUtils.stripStart(s, "\\").equalsIgnoreCase("string")) { return true; } } return false; }
@NotNull @Override public String getLookupString() { if(this.useClassNameAsLookupString) { return StringUtils.stripStart(this.className.getPresentableFQN(), "\\"); } return entityName; }
@NotNull public static String getServiceNameForClass(@NotNull Project project, @NotNull String className) { className = StringUtils.stripStart(className, "\\"); ServiceNameStrategyParameter parameter = new ServiceNameStrategyParameter(project, className); for (ServiceNameStrategyInterface nameStrategy : NAME_STRATEGIES) { String serviceName = nameStrategy.getServiceName(parameter); if(serviceName != null && StringUtils.isNotBlank(serviceName)) { return serviceName; } } return className.toLowerCase().replace("\\", "_"); }
/** * Foo::class to its class fqn include namespace */ public static String getClassConstantPhpFqn(@NotNull ClassConstantReference classConstant) { PhpExpression classReference = classConstant.getClassReference(); if(!(classReference instanceof PhpReference)) { return null; } String typeName = ((PhpReference) classReference).getFQN(); return typeName != null && StringUtils.isNotBlank(typeName) ? StringUtils.stripStart(typeName, "\\") : null; }
private void initClassName() { if(this.classInit != null) { classCompletionPanelWrapper.setClassName(StringUtils.stripStart(this.classInit, "\\")); return; } try { String data = (String) Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor); if(data != null && data.length() <= 255 && data.matches("[_A-Za-z0-9\\\\]+")) { classCompletionPanelWrapper.setClassName(data); } } catch (UnsupportedFlavorException | IOException ignored) { } }
/** * Foo\Bar::methodAction */ @Nullable private static String convertMethodToRouteControllerName(@NotNull Method method) { PhpClass phpClass = method.getContainingClass(); if(phpClass == null) { return null; } return StringUtils.stripStart(phpClass.getFQN(), "\\") + "::" + method.getName(); }
@Nullable @Override public String getUrlForRequest(@NotNull ProfilerRequestInterface request) { if(this.baseUrl != null) { return this.baseUrl + "/" + StringUtils.stripStart(request.getProfilerUrl(), "/"); } return ProfilerUtil.getBaseProfilerUrlFromRequest(request.getProfilerUrl()); }
@NotNull public static Collection<VirtualFile> findMetadataForRepositoryClass(@NotNull PhpClass phpClass) { return findMetadataForRepositoryClass( phpClass.getProject(), StringUtils.stripStart(phpClass.getPresentableFQN(), "\\") ); }
private String createServiceAsText(@NotNull ServiceBuilder.OutputType outputType, @NotNull PsiFile psiFile) { return new ServiceBuilder(this.modelList.getItems(), psiFile, this.checkBoxSymfonyIdClass.isSelected()).build( outputType, StringUtils.stripStart(classCompletionPanelWrapper.getClassName(), "\\"), textFieldServiceName.getText() ); }
private String createServiceAsText(@NotNull ServiceBuilder.OutputType outputType) { return new ServiceBuilder(this.modelList.getItems(), this.project, this.checkBoxSymfonyIdClass.isSelected()).build( outputType, StringUtils.stripStart(classCompletionPanelWrapper.getClassName(), "\\"), textFieldServiceName.getText() ); }
private String findClassInstance(@NotNull PhpDocComment phpDocComment, @NotNull PhpDocTag phpDocTag) { PsiElement phpDocAttributeList = PsiElementUtils.getChildrenOfType(phpDocTag, PlatformPatterns.psiElement(PhpDocElementTypes.phpDocAttributeList)); if(phpDocAttributeList instanceof PhpPsiElement) { PsiElement childrenOfType = PsiElementUtils.getChildrenOfType(phpDocAttributeList, PlatformPatterns.psiElement(PhpDocElementTypes.phpDocString)); if(childrenOfType instanceof StringLiteralExpression) { String contents = StringUtils.stripStart(((StringLiteralExpression) childrenOfType).getContents(), "\\"); if(StringUtils.isNotBlank(contents) && contents.length() < 350) { return contents; } } } return EventDispatcherUtil.extractEventClassInstance(phpDocComment.getText()); } }
public void renderElement(LookupElementPresentation presentation) { presentation.setItemText(getLookupString()); presentation.setTypeText(StringUtils.stripStart(controllerAction.getMethod().getFQN(), "\\")); presentation.setTypeGrayed(true); presentation.setIcon(PhpIcons.METHOD_ICON); }