phpstan-drupal

Extension for PHPStan to allow analysis of Drupal code.

MIT License

Downloads
17.5M
Stars
181
Committers
56

Bot releases are hidden (Show)

phpstan-drupal - 1.1.8

Published by mglaman almost 3 years ago

RenderCallbackRule Improvements

The RenderCallbackRule added in 1.1.5 had various flaws. This release should fix them:

  • Improper analysis of #access_callback – not an array, single callable.
  • Improper analysis of #lazy_builder – an array, but of call_user_func_array values ([callable, args])
  • service_name:method style callbacks were not parsed, now they are

What's Changed

New Contributors

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.7...1.1.8

phpstan-drupal - 1.1.7

Published by mglaman almost 3 years ago

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.6...1.1.7

phpstan-drupal - 1.1.6

Published by mglaman almost 3 years ago

Hotfix.

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.5...1.1.6

phpstan-drupal - 1.1.5

Published by mglaman almost 3 years ago

phpstan-drupal - 1.1.4

Published by mglaman almost 3 years ago

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.3...1.1.4

phpstan-drupal - 1.1.3

Published by mglaman almost 3 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.2...1.1.3

phpstan-drupal - 1.1.2

Published by mglaman almost 3 years ago

Highlights

With #264 we have added the ability to look up discovered extensions, which should greatly improve the rules which load files called by module_load_include and ModuleHandlerInterface::loadInclude. Previously these two rules had to re-scan for extensions whenever the function or method was analyzed.

What's Changed

New Contributors

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.1...1.1.2

phpstan-drupal - 1.1.1

Published by mglaman almost 3 years ago

Major fix for sites without drupal/core-dev

This release includes fixes for Class PHPUnit\Framework\TestCase not found. errors!

testcase-not-found

Note you must have this in your phpstan.neon if drupal/core-dev is missing:

	excludePaths:
		-  */tests/src/*/*.php

What's Changed

New Contributors

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.1.0...1.1.1

phpstan-drupal - 1.1.0

Published by mglaman almost 3 years ago

Backwards compatibility warning

1.1.0 has introduced a breaking change in the configuration schema. See below for more information.

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.0.3...1.1.0

Configuration changes

The drupal.entityTypeStorageMapping allowed specifying what storage classes were used for different entity types. With #239, support was added to specify what entity class an entity type uses. With #250 the way entity type information is configured has been changed.

Previously:

parameters:
	drupal:
		entityTypeStorageMapping:
			node: Drupal\node\NodeStorage
			taxonomy_term: Drupal\taxonomy\TermStorage
			user: Drupal\user\UserStorage

Now there is an entityMapping property so that we can handle future enhancements with entity type static analysis.

parameters:
	drupal:
		entityMapping:
			node:
				class: Drupal\node\Entity\Node
				storage: Drupal\node\NodeStorage
			taxonomy_term:
				class: Drupal\taxonomy\Entity\Term
				storage: Drupal\taxonomy\TermStorage
			user:
				class: Drupal\user\Entity\User
				storage: Drupal\user\UserStorage
			block:
				class: Drupal\block\Entity\Block
phpstan-drupal - 1.0.3

Published by mglaman almost 3 years ago

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.0.2...1.0.3

phpstan-drupal - 1.0.2

Published by mglaman almost 3 years ago

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.0.1...1.0.2

phpstan-drupal - 1.0.1

Published by mglaman almost 3 years ago

What's Changed

Full Changelog: https://github.com/mglaman/phpstan-drupal/compare/1.0.0...1.0.1

phpstan-drupal - 1.0.0

Published by mglaman almost 3 years ago

phpstan-drupal - 0.12.15

Published by mglaman about 3 years ago

🥳 Features:

  • Dynamic return type extension for \Drupal::service #190
phpstan-drupal - 0.12.14

Published by mglaman about 3 years ago

🥳 Features:

  • Detect when deprecated services are fetched from the container #205

🛠 Task:

  • Clean up PHPUnit bootstrap inclusion #203
phpstan-drupal - 0.12.13

Published by mglaman about 3 years ago

🐞 Bug fix:

  • Update ConfigEntityConfigExportRule to only run if the ConfigEntity class is annotated (not just with a phpDoc present) #200
phpstan-drupal - 0.12.12

Published by mglaman over 3 years ago

🥳 Features:

  • Verify that BrowserTestBase::$defaultTheme is populated by child class #191

🐞 Bug fix:

  • Anonymous classes trigger errors with version 0.12.11 #194
phpstan-drupal - 0.12.11

Published by mglaman over 3 years ago

This patch release adds new rules to help catch deprecations from Drupal 8 to Drupal 9 in context-aware plugins and config entities. See https://www.drupal.org/project/upgrade_status/issues/3161052

🥳 Features:

  • Detect missing config_export annotation key #188
  • Detect deprecated context annotation value #186
phpstan-drupal - 0.12.10

Published by mglaman over 3 years ago

🐞 Bug fixes:

  • #175: Fixes crashes on GlobalDrupalDependencyInjectionRule and autoloading when PHPUnit does not exist. Note: PHPStan still warns about autoloading and symbol discovery, still, but not crash.
  • #136: Test modules weighted higher to avoid redeclares of existing functions #123.

🥳 Features:

  • #174: Add dynamic file load support for module_load_include #166
phpstan-drupal - 0.12.9

Published by mglaman over 3 years ago

#161 Fixes a type error in DrupalAutoloader on PHP 8
#157 Adds Drupal 9 testing support, including a workaround for PHPUnit 8 support (setUp(): void)

Thank you to my sponsors that make these releases possible: