phpinsights: Logic Exception unable to find data within Laravel project
| Q | A |
|---|---|
| Bug report? | no |
| Feature request? | no |
| Library version | 2.0 |
HI I’m using php insights for the first time. I’ve installed the package within my Laravel project and published the config file.
On first run I get this error:
LogicException
Unable to find data for /home/vagrant/code/wedleague/app/Http/Controllers/Admin/RoleController.php
at vendor/nunomaduro/phpinsights/src/Domain/Runner.php:184
180â–• {
181â–• $cacheKey = 'insights.' . $this->cacheKey . '.' . md5($file->getContents());
182â–• // Do not use cache if fix is enabled to force processors to handle it
183â–• if (! $this->cache->has($cacheKey)) {
➜ 184▕ throw new \LogicException('Unable to find data for ' . $file->getPathname());
185â–• }
186â–•
187â–• $this->loadDetailsCache($cacheKey);
188â–•
+4 vendor frames
5 [internal]:0
NunoMaduro\PhpInsights\Domain\Insights\InsightCollectionFactory::NunoMaduro\PhpInsights\Domain\Insights\{closure}()
+17 vendor frames
23 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
I’m not sure where to start working out what’s gone wrong. The controller exists - what does this error mean?
Sorry for vague question.
Running on a vagrant machine with homestead php7.4 if that’s any help.
Any pointers appreciated
Thank you
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 27 (5 by maintainers)
I still have this problem with friendsofphp/php-cs-fixer at
v3.10.0and PHPInsights at"v2.4.0Pinning
friendsofphp/php-cs-fixerat3.9.5worked for me as a temporary solution.3.9.6and3.10.0are both giving the errorI also confirm that pinning friendsofphp/php-cs-fixer at 3.9.5 solves the problem.
In my case it’s because some files are in Windows mode (crlf) not linux (lf). I applyed a dos2unix command to fix the error
Still experiencing this issue. None of the above solutions worked for me. Ended up just commenting out lines 183 - 185 in vendor/nunomaduro/phpinsights/src/Domain/Runner.php to allow for the report to be fully generated.
I get the same error no matter which file im checking - on laravel and php 8, also in new Project…
php artisan insights config\app.php
got it… so we’ll be waiting till next commit to be fixed!