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

Internal error: Invalid value #204

Open
mgbellaire opened this issue Feb 3, 2021 · 2 comments
Open

Internal error: Invalid value #204

mgbellaire opened this issue Feb 3, 2021 · 2 comments

Comments

@mgbellaire
Copy link

How is drupal-check installed?
composer require phpstan/phpstan:0.12.42 --dev
composer require mglaman/drupal-check --dev

Environment:

  • OS: macOS 10.15.7
  • PHP Version: 7.3.26
  • Drupal core: 8.9.13

Describe the bug
I am checking config_update module (version 8.x-1.5) and am getting this error:

 ------ --------------------------------------------------------------
  Line   config_update_ui/config_update_ui.drush.inc
 ------ --------------------------------------------------------------
         Internal error: Invalid value
         Run PHPStan with --debug option and post the stack trace to:
         https://github.com/phpstan/phpstan/issues/new
 ------ --------------------------------------------------------------

Console output

Analyzing path: /Users/mbellaire/Docker/CAP/cappex/docroot/modules/contrib/config_update
Current working directory: /Users/mbellaire/Docker/CAP/cappex
Using Drupal root: /Users/mbellaire/Docker/CAP/cappex/docroot
Using vendor root: /Users/mbellaire/Docker/CAP/cappex/vendor
PHPStan path: /Users/mbellaire/Docker/CAP/cappex/vendor/phpstan/phpstan/phpstan.phar
PHPStan configuration path: /private/var/folders/zm/2tmljds54t94_q5bg8r5_r4r0000gp/T/drupal_check_phpstan_1612362002.neon
PHPStan configuration:
parameters:
	tipsOfTheDay: false
	reportUnmatchedIgnoredErrors: false
	excludes_analyse:
		- */tests/Drupal/Tests/Listeners/Legacy/*
		- */tests/fixtures/*.php
		- */settings*.php
		- */node_modules/*

	ignoreErrors:
		- "#\\Drupal calls should be avoided in classes, use dependency injection instead#"
		- "#Plugin definitions cannot be altered.#"
		- "#Missing cache backend declaration for performance.#"
		- "#Plugin manager has cache backend specified but does not declare cache tags.#"

	drupal:
		drupal_root: /Users/mbellaire/Docker/CAP/cappex/docroot

	customRulesetUsed: true
	bootstrapFiles:
		- /Users/mbellaire/Docker/CAP/cappex/vendor/mglaman/drupal-check/error-bootstrap.php

includes:
	- /Users/mbellaire/Docker/CAP/cappex/vendor/phpstan/phpstan-deprecation-rules/rules.neon
	- /Users/mbellaire/Docker/CAP/cappex/vendor/mglaman/phpstan-drupal/extension.neon


Executing PHPStan
 ------ -------------------------------------------------------------- 
  Line   config_update_ui/config_update_ui.drush.inc                   
 ------ -------------------------------------------------------------- 
         Internal error: Invalid value                                 
         Run PHPStan with --debug option and post the stack trace to:  
         https://github.com/phpstan/phpstan/issues/new                 
 ------ -------------------------------------------------------------- 

 ------ -------------------------------------------------------------- 
  Line   config_update_ui/config_update_ui.drush_testing.inc           
 ------ -------------------------------------------------------------- 
         Internal error: Invalid value                                 
         Run PHPStan with --debug option and post the stack trace to:  
         https://github.com/phpstan/phpstan/issues/new                 
 ------ -------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   config_update_ui/src/Form/ConfigDeleteConfirmForm.php                 
 ------ ---------------------------------------------------------------------- 
  140    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
 ------ ---------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   config_update_ui/src/Form/ConfigImportConfirmForm.php                 
 ------ ---------------------------------------------------------------------- 
  142    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
 ------ ---------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   config_update_ui/src/Form/ConfigRevertConfirmForm.php                 
 ------ ---------------------------------------------------------------------- 
  142    Call to deprecated function drupal_set_message():                     
         in drupal:8.5.0 and is removed from drupal:9.0.0.                     
         Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.  
 ------ ---------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------- 
  Line   config_update_ui/src/Tests/ConfigProfileOverridesTest.php       
 ------ ---------------------------------------------------------------- 
  12     Class Drupal\config_update_ui\Tests\ConfigProfileOverridesTest  
         extends deprecated class Drupal\simpletest\WebTestBase:         
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,      
         use \Drupal\Tests\BrowserTestBase. See                          
         https://www.drupal.org/node/3030340.                            
  43     Call to method setUp() of deprecated class                      
         Drupal\simpletest\WebTestBase:                                  
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,      
         use \Drupal\Tests\BrowserTestBase. See                          
         https://www.drupal.org/node/3030340.                            
 ------ ---------------------------------------------------------------- 

 ------ -------------------------------------------------------------- 
  Line   config_update_ui/src/Tests/ConfigUpdateTest.php               
 ------ -------------------------------------------------------------- 
  12     Class Drupal\config_update_ui\Tests\ConfigUpdateTest extends  
         deprecated class Drupal\simpletest\WebTestBase:               
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,    
         use \Drupal\Tests\BrowserTestBase. See                        
         https://www.drupal.org/node/3030340.                          
  46     Call to method setUp() of deprecated class                    
         Drupal\simpletest\WebTestBase:                                
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,    
         use \Drupal\Tests\BrowserTestBase. See                        
         https://www.drupal.org/node/3030340.                          
 ------ -------------------------------------------------------------- 

 ------ --------------------------------------------------------------------- 
  Line   src/ConfigLister.php                                                 
 ------ --------------------------------------------------------------------- 
  92     Call to deprecated method isSubclassOf() of class                    
         Drupal\Core\Entity\EntityTypeInterface:                              
         in drupal:8.3.0 and is removed from drupal:10.0.0.                   
         Use Drupal\Core\Entity\EntityTypeInterface::entityClassImplements()  
         instead.                                                             
 ------ --------------------------------------------------------------------- 

 [ERROR] Found 10 errors                                                        

Finished executing PHPStan
Unlinking PHPStan configuration
Return PHPStan exit code
mglaman added a commit that referenced this issue Mar 17, 2021
Adds testing pipeline for contrib to check on #204
@mglaman
Copy link
Owner

mglaman commented Mar 17, 2021

I've added a testing pipeline for this and can reproduce

@mglaman
Copy link
Owner

mglaman commented Mar 17, 2021

Thanks for the find, I have the test reproducing the issue:

 ------ ---------------------------------------------------------------------- 
  Line   config_update_ui/src/ConfigUpdateUiCliService.php                     
 ------ ---------------------------------------------------------------------- 
         Internal error: Invalid value                                         
         Run PHPStan with --debug option and post the stack trace to:          
         https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md  
 ------ ---------------------------------------------------------------------- 

I have a feeling its due to missing Drush 8, and this is code for backwards compatibility. PHPStan doesn't handle that well for optional or conditional dependencies.

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

No branches or pull requests

2 participants