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
fix: make
, makeWith
and resolve
methods not resolving to correct type on Application and Container.
#1451
Conversation
3849c0c
to
416ab65
Compare
if ($expr instanceof String_) { | ||
try { | ||
/** @var object|null $resolved */ | ||
$resolved = $this->resolve($expr->value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not really guaranteed that resolve
will return an object, scalars can be bound into the container using constant string names too and i've seen that in the wild, so it might be worth expanding this code to anticipate more types to be returned in the future
not sure that the |
274fc1f
to
fc206a7
Compare
Hi, i have checked the failing E2E test and actually this is correct that test is failing. https://github.com/koel/koel/blob/master/tests/Traits/CreatesApplication.php#L25 use App\Console\Kernel;
use Illuminate\Contracts\Console\Kernel as Artisan;
private Kernel $artisan;
$this->artisan = $app->make(Artisan::class); Because this PR adds phpstan functionality that makes it understand that I will try send a PR to fix this issue in original repo. |
… type on Application and Container.
fc206a7
to
1440c29
Compare
@canvural is there anything i can do to help get this over the line? thanks |
Pls can you re-run the E2E pipeline? Should be passing now. |
Here you go. This is the rerun. |
I see - though the dependent PR is merged, there is fixed git reference: https://github.com/nunomaduro/larastan/blob/master/.github/workflows/e2e-tests.yml#L40 We would need to change it to |
make
, makeWith
and resolve
methods not resolving to correct type on Application and Container.
Thank you! |
resolves #1441
Changes
Added return type extension for Application and Container
make
,makeWith
andresolves
method.Abstracts repeated behavior into a
AppMakeHelper
and uses that in places i could find it being duplicated.