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

Fixed nette/utils indirect dependency #116

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Apr 29, 2024

fixes

➜  phpunit git:(phpstan) ✗ vendor/bin/phpstan
Note: Using configuration file /Users/staabm/workspace/phpunit/phpstan.neon.
 904/904 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

PHP Fatal error:  Uncaught Error: Class "Nette\Utils\Arrays" not found in /Users/staabm/workspace/phpunit/vendor/tomasvotruba/unused-public/src/Rules/UnusedPublicClassMethodRule.php:86
Stack trace:
#0 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseApplication.php(172): TomasVotruba\UnusedPublic\Rules\UnusedPublicClassMethodRule->processNode(Object(PHPStan\Node\CollectedDataNode), Object(PHPStan\Analyser\MutatingScope))
#1 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseApplication.php(136): PHPStan\Command\AnalyseApplication->getCollectedDataErrors(Array, false)
#2 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/src/Command/AnalyseCommand.php(202): PHPStan\Command\AnalyseApplication->analyse(Array, false, Object(PHPStan\Command\Symfony\SymfonyOutput), Object(PHPStan\Command\Symfony\SymfonyOutput), false, false, '/Users/staabm/w...', Array, Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Input\ArgvInput))
#3 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Command/Command.php(259): PHPStan\Command\AnalyseCommand->execute(Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Output\ConsoleOutput))
#4 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(870): _PHPStan_7961f7ae1\Symfony\Component\Console\Command\Command->run(Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Output\ConsoleOutput))
#5 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(261): _PHPStan_7961f7ae1\Symfony\Component\Console\Application->doRunCommand(Object(PHPStan\Command\AnalyseCommand), Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Output\ConsoleOutput))
#6 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/console/Application.php(157): _PHPStan_7961f7ae1\Symfony\Component\Console\Application->doRun(Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Input\ArgvInput), Object(_PHPStan_7961f7ae1\Symfony\Component\Console\Output\ConsoleOutput))
#7 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(124): _PHPStan_7961f7ae1\Symfony\Component\Console\Application->run()
#8 phar:///Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan.phar/bin/phpstan(125): _PHPStan_7961f7ae1\{closure}()
#9 /Users/staabm/workspace/phpunit/vendor/phpstan/phpstan/phpstan(8): require('phar:///Users/s...')
#10 /Users/staabm/workspace/phpunit/vendor/bin/phpstan(119): include('/Users/staabm/w...')
#11 {main}
  thrown in /Users/staabm/workspace/phpunit/vendor/tomasvotruba/unused-public/src/Rules/UnusedPublicClassMethodRule.php on line 86

@@ -4,7 +4,6 @@

namespace TomasVotruba\UnusedPublic\Rules;

use Nette\Utils\Arrays;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before this PR a class was used which is not declared in composer.json dependencies

@staabm
Copy link
Contributor Author

staabm commented Apr 29, 2024

added a new shipmonk-rnd/composer-dependency-analyser CI check to prevent regressing this again.

//cc @janedbal in case you have any suggestions

@TomasVotruba
Copy link
Owner

Awesome, thank you for fix and CI check to avoid these in the future 🥳

@TomasVotruba TomasVotruba merged commit c75a883 into TomasVotruba:main Apr 29, 2024
8 checks passed
@staabm staabm deleted the drop-nette branch April 29, 2024 11:00
neoighodaro added a commit to neoighodaro/unused-public that referenced this pull request Nov 21, 2024
* TomasVotruba-main: (21 commits)
  Delete .github/FUNDING.yml
  Update FUNDING.yml
  Update composer.json
  Keep the code DRY
  Small improvement
  Added support for @internal or @public
  Reduce memory consumption of collectors (TomasVotruba#131)
  Fix blade regex to discover method call with args (TomasVotruba#128)
  Fix template discovery, to include root file too (TomasVotruba#127)
  remove `composer-dependency-analyser.php` from releases (TomasVotruba#126)
  Bump deps (TomasVotruba#125)
  Detect public properties used via Subclass (TomasVotruba#123)
  Fix ClassConstFetchCollector (TomasVotruba#122)
  Fix union-type handling in PublicStaticPropertyFetchCollector (TomasVotruba#121)
  Fix union-type handling in PublicPropertyFetchCollector (TomasVotruba#120)
  add phpstan error identifiers (TomasVotruba#118)
  Fixed nette/utils indirect dependency (TomasVotruba#116)
  Added test for JsonSerialize (TomasVotruba#112)
  Add RelativeUnusedPublicClassMethodRule (TomasVotruba#111)
  Bump to PHP 8.2 (TomasVotruba#110)
  ...
neoighodaro added a commit to neoighodaro/unused-public that referenced this pull request Nov 21, 2024
* origin/main: (22 commits)
  Allow phpstan 2
  Delete .github/FUNDING.yml
  Update FUNDING.yml
  Update composer.json
  Keep the code DRY
  Small improvement
  Added support for @internal or @public
  Reduce memory consumption of collectors (TomasVotruba#131)
  Fix blade regex to discover method call with args (TomasVotruba#128)
  Fix template discovery, to include root file too (TomasVotruba#127)
  remove `composer-dependency-analyser.php` from releases (TomasVotruba#126)
  Bump deps (TomasVotruba#125)
  Detect public properties used via Subclass (TomasVotruba#123)
  Fix ClassConstFetchCollector (TomasVotruba#122)
  Fix union-type handling in PublicStaticPropertyFetchCollector (TomasVotruba#121)
  Fix union-type handling in PublicPropertyFetchCollector (TomasVotruba#120)
  add phpstan error identifiers (TomasVotruba#118)
  Fixed nette/utils indirect dependency (TomasVotruba#116)
  Added test for JsonSerialize (TomasVotruba#112)
  Add RelativeUnusedPublicClassMethodRule (TomasVotruba#111)
  ...
ngmy pushed a commit to ngmy/unused-public that referenced this pull request Dec 16, 2024
* Fixed nette/utils indirect dependency

* CI: setup shipmonk/composer-dependency-analyser to prevent regressions

* Update composer-dependency-analyser.php

* fix nikic/php-parser dependency
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.

2 participants