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

Closure detected instead of method #72

Closed
ThePixelDeveloper opened this issue Jan 12, 2015 · 6 comments
Closed

Closure detected instead of method #72

ThePixelDeveloper opened this issue Jan 12, 2015 · 6 comments
Labels

Comments

@ThePixelDeveloper
Copy link

➜  web git:(master) phpmetrics . --report-html ../html
PHPMetrics by Jean-François Lépine <https://twitter.com/Halleck45>

  139/1295 [===>------------------------]  10%
  149/1295 [===>------------------------]  11%
  151/1295 [===>------------------------]  11%
  200/1295 [====>-----------------------]  15%


  [Exception]                         
  Closure detected instead of method  

Got this exception when trying to test it on a project. The current PHP version I'm running is ...

➜  web git:(master) php --version
PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Although the project targets a lower PHP version than 5.4

Help appreciated.

@fonsecas72
Copy link
Contributor

Maybe this is related #33 ?

@Halleck45
Copy link
Collaborator

Maybe this is related #33 ?

Maybe. I've added verbosity in this error with this commit

@ThePixelDeveloper, can you retry with the latest phar or updating sources please ?

@ThePixelDeveloper
Copy link
Author

Tried again and got the following

[Exception]
  a 'Exception' exception occured analyzing file ./mailchimp/MCAPI.class.php
  Message: Closure detected instead of method
  Details:
  ------------
  Stack:
  #0 phar:///usr/local/bin/phpmetrics/src/Hal/Component/OOP/Extractor/Extractor.php(127): Hal\Component\OOP\Extractor\MethodExtractor->extract(4805, Object(Hal\Compon
  ent\Token\TokenCollection))
  #1 phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/Job/Analyze/FileAnalyzer.php(138): Hal\Component\OOP\Extractor\Extractor->extract('./html/sites/al..
  .')
  #2 phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/Job/DoAnalyze.php(121): Hal\Application\Command\Job\Analyze\FileAnalyzer->execute('./html/sites/al..
  .')
  #3 phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/Job/Queue.php(51): Hal\Application\Command\Job\DoAnalyze->execute(Object(Hal\Component\Result\Result
  Collection), Object(Hal\Component\Result\ResultCollection))
  #4 phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/RunMetricsCommand.php(119): Hal\Application\Command\Job\Queue->execute(Object(Hal\Component\Result\R
  esultCollection), Object(Hal\Component\Result\ResultCollection))
  #5 phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(253): Hal\Application\Command\RunMetricsCommand->execute(Ob
  ject(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #6 phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Sym
  fony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #7 phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Objec
  t(Hal\Application\Command\RunMetricsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #8 phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfo
  ny\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
  #9 /usr/local/bin/phpmetrics(17): Symfony\Component\Console\Application->run()
  #10 {main}
  ------------
  Do not hesitate to report a bug: https://github.com/Halleck45/PhpMetrics/issues

@fonsecas72
Copy link
Contributor

Although the project targets a lower PHP version than 5.4

Can you tell what's the exact PHP version?

@Halleck45
Copy link
Collaborator

MCAPI.class.php is a very old file. PhpMetrics probably cannot support this file. I'll try to fix that.

I found the file here, but what's the version of your file ? Can you create a gist with the content of your MCAPI.class.php file ?

@Halleck45
Copy link
Collaborator

No update since 6 month, I close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants