Completed
Push — master ( f7ad33...cd335b )
by Rudie
02:05
created

test.class.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

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
array('seen' => false, '... 'newestFirst' => true) is of type array<string,integer|boo...ewestFirst":"boolean"}>, but the function expects a boolean.

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:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
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