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

Bump to phpstan-drupal 0.12 #119

Merged
merged 19 commits into from
Jan 28, 2020
Merged

Bump to phpstan-drupal 0.12 #119

merged 19 commits into from
Jan 28, 2020

Conversation

mglaman
Copy link
Owner

@mglaman mglaman commented Dec 9, 2019

No description provided.

@mglaman
Copy link
Owner Author

mglaman commented Dec 11, 2019

🤔 this is new and not happening in phpstan-drupal

Class Drupal\Tests\BrowserTestBase not found and could not be autoloaded.

@mglaman mglaman changed the title Bump to phpstan-drupal 0.11.13 Bump to phpstan-drupal 0.11.14 Dec 11, 2019
@mglaman mglaman changed the title Bump to phpstan-drupal 0.11.14 Bump to phpstan-drupal 0.12 Jan 13, 2020
@mglaman
Copy link
Owner Author

mglaman commented Jan 13, 2020

Fatal error: Uncaught TypeError: Argument 1 passed to PHPStan\Command\CommandHelper::begin() must be an instance of _HumbugBox1cba3dc7cb83\Symfony\Component\Console\Input\InputInterface, instance of Symfony\Component\Console\Input\ArgvInput

The new packaging breaks how drupal-check was running PHPStan. But maybe this is OK and we don't need a custom runner any longer.

@mglaman
Copy link
Owner Author

mglaman commented Jan 15, 2020

So we lost the custom error handler that prevented phpstan from dying, \DrupalCheck\DrupalCheckErrorHandler. That prevented crashes like

Cannot declare class Drupal\Tests\ctools\Unit\TestBlockDisplayVariant, because the name is already in use in /tmp/drupal/web/modules/contrib/ctools/tests/src/Unit/BlockDisplayVariantTest.php on line 90
  • See if we can register \DrupalCheck\DrupalCheckErrorHandler through an extension for phpstan so it doesn't die on PHP fatal errors, but reports them.
  • This is occuring again Class Drupal\Tests\BrowserTestBase not found and could not be autoloaded.
  • test_global_require_with_drush is failing
  • test_lightning runs out of memory

@mglaman
Copy link
Owner Author

mglaman commented Jan 18, 2020

web/modules/contained_not_initialized/contained_not_initialized.install invoked the Drupal container outside of the scope of a function or class method. It was not loaded. 

This isn't being caught either anymore.

I wonder if we can just include the prefixed namespace since PHPStan is embedded. But that wouldn't work for non phar builds unless this shipped as a phar always like PHPStan and Rector

@mglaman mglaman added phpstan Issue relates to PHPStan upstream Ticket involves dependencies labels Jan 18, 2020
@mglaman mglaman self-assigned this Jan 18, 2020
@mglaman mglaman force-pushed the phpstan-drupal-update branch 2 times, most recently from 141c8cd to 4890fd0 Compare January 28, 2020 01:48
@mglaman mglaman force-pushed the phpstan-drupal-update branch from 88db5d4 to 22b4781 Compare January 28, 2020 13:33
@mglaman
Copy link
Owner Author

mglaman commented Jan 28, 2020

Remaining items

  • test_contrib is running out of memory to process ctools
  • multiple path analysis is broken

@mglaman mglaman merged commit 58a51a8 into master Jan 28, 2020
@mglaman mglaman deleted the phpstan-drupal-update branch January 28, 2020 17:50
mglaman added a commit that referenced this pull request Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
phpstan Issue relates to PHPStan upstream Ticket involves dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant