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

allowExceptParams fails on v2.11.3 when concatenation with object param #166

Closed
simivar opened this issue Jan 23, 2023 · 1 comment · Fixed by #167
Closed

allowExceptParams fails on v2.11.3 when concatenation with object param #166

simivar opened this issue Jan 23, 2023 · 1 comment · Fixed by #167

Comments

@simivar
Copy link

simivar commented Jan 23, 2023

I had this PHPStan rule specified in my configuration:

parameters:
	disallowedFunctionCalls:
		-
			function: 'env()'
			allowIn:
				- 'src/AllowedIn.php'
			allowExceptParams:
				-
					position: 1
					name: 'key'
					value: 'SOME_ENV'

and it worked perfectly fine until upgrading to version v2.11.3. In the version v2.11.3 and v2.11.4 code snippet from below fails even though it shouldn't:

<?php

class WithProperty {
	/** @var string */
	public string $property;
}

class Test {
	public function __construct() {
		$withProperty = new WithProperty();
		env($withProperty->property . '_OTHER');
	}
}
@spaze
Copy link
Owner

spaze commented Jan 23, 2023

Hey @simivar, thanks for the issue and sorry for the trouble. That was indeed a regression introduced in 2.11.3 (in #159). I've fixed it now and released it in 2.11.5. Hope that helps :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants