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

fix bootstrap path #852

Merged
merged 4 commits into from
Jul 1, 2021
Merged

fix bootstrap path #852

merged 4 commits into from
Jul 1, 2021

Conversation

rajyan
Copy link
Contributor

@rajyan rajyan commented Jun 30, 2021

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes
I want to re-open this PR #851.
This PR would enable running larastan without caring about the working directory.
As I mentioned in #851, Laravel's bootstrap and vendor path are hardcoded, and should always be a relative path __DIR__.'/../../../bootstrap/app.php' from vendor/nunomaduro/larastan.

I modified the test a little, and added a test to confirm the changes.

Breaking changes

I think there are no breaking changes.

@rajyan rajyan changed the title Fix/bootstrap path fix bootstrap path Jun 30, 2021
bootstrap.php Outdated Show resolved Hide resolved
Co-authored-by: Viktor Szépe <[email protected]>
@canvural canvural merged commit d8d1a90 into larastan:master Jul 1, 2021
@canvural
Copy link
Collaborator

canvural commented Jul 1, 2021

Thank you!

@bastien-phi
Copy link
Contributor

It looks like it breaks phpstan when using vendor-bin in an application as the bootstrap/app.php is not found in this case

I'm having

PHP Fatal error:  Trait "Orchestra\Testbench\Concerns\CreatesApplication" not found in /code/my-project/vendor-bin/phpstan/vendor/nunomaduro/larastan/src/ApplicationResolver.php on line 16

@szepeviktor
Copy link
Collaborator

@bastien-phi Thank you for your report.
Could you be more specific on your setup? Maybe opening a brand new issue?

@canvural
Copy link
Collaborator

canvural commented Jul 1, 2021

@bastien-phi Is this a Laravel app or a package?

@bastien-phi
Copy link
Contributor

@szepeviktor @canvural see #856

rajyan added a commit to rajyan/larastan that referenced this pull request Jul 2, 2021
@rajyan rajyan mentioned this pull request Jul 2, 2021
3 tasks
canvural pushed a commit that referenced this pull request Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants