--level used: DefaultUsing this in continuous integration returns an error code 1, even if there are no errors.
$ php artisan code:analyse
0/78 [ββββββββββββββββββββββββββββ] 0%
7/78 [ββββββββββββββββββββββββββββ] 8%
14/78 [ββββββββββββββββββββββββββββ] 17%
21/78 [ββββββββββββββββββββββββββββ] 26%
28/78 [ββββββββββββββββββββββββββββ] 35%
35/78 [ββββββββββββββββββββββββββββ] 44%
42/78 [ββββββββββββββββββββββββββββ] 53%
49/78 [ββββββββββββββββββββββββββββ] 62%
56/78 [ββββββββββββββββββββββββββββ] 71%
63/78 [ββββββββββββββββββββββββββββ] 80%
70/78 [ββββββββββββββββββββββββββββ] 89%
77/78 [ββββββββββββββββββββββββββββ] 98%
78/78 [ββββββββββββββββββββββββββββ] 100%
[OK] No errors
ERROR: Job failed: exit code 1
Weird, can you try to debug why?
Used --debug but it only listed the files it went through. PHP files truncated below for privacy.
/...php
/...php
/...php
[OK] No errors
ERROR: Job failed: exit code 1
Debug whatβs going on in the source code.
On Thu, 9 May 2019 at 14:36, Zennon Gosalvez notifications@github.com
wrote:
Used --debug but it only listed the files it went through. PHP files
truncated below for privacy./...php
/...php
/...php
[OK] No errors
ERROR: Job failed: exit code 1
β
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/nunomaduro/larastan/issues/266#issuecomment-490884895,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAZTODPTATYIJVHHNQHNY3PUQLDRANCNFSM4HLZXDGQ
.>
OndΕej Mirtes
This must be a single case. I use larastan/phpstan in all my clients' CI.
Try running larastan on the terminal
php artisan ....
echo $?
For some reason, it resolved itself. But now, it's happening again. I'm not entirely sure if it's the server environment. Thanks for the tip @szepeviktor ... here's an updated output:
$ php artisan code:analyse --no-interaction || code=$?
0/53 [ββββββββββββββββββββββββββββ] 0%
3/53 [ββββββββββββββββββββββββββββ] 5%
7/53 [ββββββββββββββββββββββββββββ] 13%
19/53 [ββββββββββββββββββββββββββββ] 35%
25/53 [ββββββββββββββββββββββββββββ] 47%
26/53 [ββββββββββββββββββββββββββββ] 49%
29/53 [ββββββββββββββββββββββββββββ] 54%
36/53 [ββββββββββββββββββββββββββββ] 67%
41/53 [ββββββββββββββββββββββββββββ] 77%
46/53 [ββββββββββββββββββββββββββββ] 86%
51/53 [ββββββββββββββββββββββββββββ] 96%
53/53 [ββββββββββββββββββββββββββββ] 100%
[OK] No errors
$ exit `echo $code`
ERROR: Job failed: exit code 255
The same happens on phpinsights...
$ php artisan insights --no-interaction --min-quality 100 --min-complexity 80 --min-architecture 80 --min-style 100 || code=$?
0/56 [ββββββββββββββββββββββββββββ] 0%
6/56 [ββββββββββββββββββββββββββββ] 10%
12/56 [ββββββββββββββββββββββββββββ] 21%
17/56 [ββββββββββββββββββββββββββββ] 30%
23/56 [ββββββββββββββββββββββββββββ] 41%
28/56 [ββββββββββββββββββββββββββββ] 50%
34/56 [ββββββββββββββββββββββββββββ] 60%
40/56 [ββββββββββββββββββββββββββββ] 71%
45/56 [ββββββββββββββββββββββββββββ] 80%
51/56 [ββββββββββββββββββββββββββββ] 91%
56/56 [ββββββββββββββββββββββββββββ] 100%
100 % 82.8% 95.2% 100 %
Code Complexity Architecture Style
< truncated for brevity >
$ exit `echo $code`
ERROR: Job failed: exit code 255
What if you run PHPStan directly, does it happen? That way we can pinpoint if it' a problem in PHPStan or on Larastan's artisan layer.
Thank you for the suggestions. I finally found the cause of my problem.
$ ./vendor/bin/phpstan analyse app --level 5 || code=$?
Note: Using configuration file /builds/namespace/project/phpstan.neon.
53/53 [ββββββββββββββββββββββββββββ] 100%
[OK] No errors
$ exit `echo $code`
Job succeeded
Which means there's something wrong with the Laravel packages. I noticed that the docker I'm using for this test did not include Laravel's required PHP extensions. After installing those extensions, I got it to work successfully. This explains why there's no problem on Homestead, and there's no problem when running PHPStan directly.