Skip to content

Commit

Permalink
changed PHPRenameProcessor#canEnableUpdateReferences() not to check w…
Browse files Browse the repository at this point in the history
…hether the enclosing type is PSR-0 compliant or not (Issue #89)
  • Loading branch information
iteman committed Apr 8, 2014
1 parent b7ed2aa commit 9d2ce58
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2009, 2013 IBM Corporation and others.
* Copyright (c) 2000, 2009, 2013-2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -155,23 +155,12 @@ public boolean canEnableUpdateReferences() {
IType enclosingType = (IType) modelElement.getAncestor(IModelElement.TYPE);
if (enclosingType == null) return false;

PHPType phpType = new PHPType(enclosingType);
if (phpType.inNamespace()) {
try {
return phpType.isPSR0Compliant();
} catch (CoreException e) {
PEXUIPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, PEXUIPlugin.PLUGIN_ID, e.getMessage(), e));

return false;
}
} else {
try {
return phpType.inResourceWithSameName();
} catch (CoreException e) {
PEXUIPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, PEXUIPlugin.PLUGIN_ID, e.getMessage(), e));
try {
return new PHPType(enclosingType).inResourceWithSameName();
} catch (CoreException e) {
PEXUIPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, PEXUIPlugin.PLUGIN_ID, e.getMessage(), e));

return false;
}
return false;
}
}

Expand Down

0 comments on commit 9d2ce58

Please sign in to comment.