These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <pre><?php |
||
2 | |||
3 | require 'env.php'; |
||
4 | require 'IMAP.php'; |
||
5 | |||
6 | $mbox = new IMAPMailbox(IMAP_TEST_HOST, IMAP_TEST_USER, IMAP_TEST_PASS, 'INBOX', ['novalidate-cert']); |
||
7 | print_r($mbox); |
||
8 | |||
9 | $messages = $mbox->messages(array('seen' => false, 'offset' => 0, 'limit' => 3, 'newestFirst' => true)); |
||
0 ignored issues
–
show
|
|||
10 | #print_r($messages); |
||
11 | |||
12 | foreach ( $messages AS $message ) { |
||
13 | |||
14 | echo "------------------------------------------------------------------------\n"; |
||
15 | |||
16 | echo "Subject: ".$message->subject()."\n"; |
||
17 | |||
18 | $parts = $message->parts(); |
||
19 | // print_r($parts); |
||
20 | |||
21 | print_r($message); |
||
22 | |||
23 | foreach ( $message->attachments AS $attachment ) { |
||
24 | var_dump($attachment->save(__DIR__.'/attachments/')); |
||
25 | } |
||
26 | |||
27 | exit; |
||
28 | |||
29 | } |
||
30 | |||
31 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: