Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP] Import aliasing for PHP #3964

Closed
inkz opened this issue Sep 30, 2021 · 1 comment · Fixed by #5343
Closed

[PHP] Import aliasing for PHP #3964

inkz opened this issue Sep 30, 2021 · 1 comment · Fixed by #5343
Labels
alpha Relates to an experimental feature analysis:naming bug Something isn't working lang:php priority:medium user:internal requested only by someone within Semgrep Inc.

Comments

@inkz
Copy link
Member

inkz commented Sep 30, 2021

semgrep easily tackles import aliasing when import has a name:

<?php
use My\Full\Classname as Another;

$obj = new Another();

pattern:

new My\Full\Classname()

https://semgrep.dev/s/GOpB

works perfectly, but in a situation with imports without a name it does not work:

<?php
use My\Foo\Bar;

$obj2 = new Bar();

pattern:

new My\Foo\Bar()

https://semgrep.dev/s/5De6/

@inkz inkz added the lang:php label Sep 30, 2021
@r2c-demo
Copy link
Collaborator

This issue is synced in Linear at https://linear.app/r2c/issue/PA-422/[php]-import-aliasing-for-php.

@IagoAbal IagoAbal added analysis:naming bug Something isn't working user:internal requested only by someone within Semgrep Inc. labels Sep 30, 2021
@nbrahms nbrahms added the alpha Relates to an experimental feature label Nov 8, 2021
@aryx aryx closed this as completed in #5343 Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha Relates to an experimental feature analysis:naming bug Something isn't working lang:php priority:medium user:internal requested only by someone within Semgrep Inc.
Development

Successfully merging a pull request may close this issue.

5 participants