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

A compilation unit should contain at least one token #1039

Closed
mikaelz opened this issue Sep 28, 2023 · 2 comments
Closed

A compilation unit should contain at least one token #1039

mikaelz opened this issue Sep 28, 2023 · 2 comments
Labels
Milestone

Comments

@mikaelz
Copy link

mikaelz commented Sep 28, 2023

  • PHPMD version: 2.14.0
  • PHP Version: 8.1.23
  • Installation type: composer
  • Operating System / Distribution & Version: Arch Linux

Current Behavior

Just run the new version 2.14 and error is shown. With the previous version we had no issue in the office.

docker-compose run --rm php-qa phpmd ./app ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml
A compilation unit should contain at least one token

Searched for the error string and it comes from PDepend
/home/docker/.composer/vendor/pdepend/pdepend/src/main/php/PDepend/Source/AST/ASTCompilationUnit.php: throw new InvalidArgumentException('A compilation unit should contain at least one token');

@kylekatarnls
Copy link
Member

Hello, we'll soon release a patch. meanwhile you can use composer require "pdepend/pdepend:dev-master as 2.15.1"

@mikaelz
Copy link
Author

mikaelz commented Sep 28, 2023

Thanks just wanted to post that older version works

~/.composer $ vi composer.json
~/.composer $ composer update 
Loading composer repositories with package information                                                                                                                                   Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Downgrading pdepend/pdepend (2.15.0 => 2.14.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading pdepend/pdepend (2.14.0)
  - Downgrading pdepend/pdepend (2.15.0 => 2.14.0): Extracting archive
Generating autoload files
26 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
phpstan/extension-installer: Extensions installed
No security vulnerability advisories found
~/.composer $ cd /var/www/
/var/www $ phpmd ./app ansi phpmd.xml 

Found 0 violations and 0 errors in 10123ms

No mess detected

@kylekatarnls kylekatarnls added this to the 2.14.1 milestone Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants