Skip to content

Commit 7ca3d19

Browse files
authored
Merge pull request #517 from barbushin/develop
Bugfixes and improvements
2 parents 26175b1 + fec86ca commit 7ca3d19

24 files changed

+1415
-330
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ return PhpCsFixer\Config::create()
1818
'import_constants' => true,
1919
'import_functions' => false,
2020
],
21+
'native_constant_invocation' => true,
2122
'native_function_invocation' => true,
2223
'php_unit_test_case_static_method_calls' => [
2324
'call_type' => 'this',

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ php:
1010
- 7.3
1111

1212
env:
13-
- phpunitflags="--stop-on-failure --exclude-group=live"
13+
- phpunitflags="--stop-on-failure --testdox --exclude-group=live"
1414

1515
matrix:
1616
fast_finish: true
@@ -30,11 +30,11 @@ matrix:
3030
env:
3131
- lint=no
3232
- coverage=yes
33-
- phpunitflags="--stop-on-failure --coverage-clover=clover.xml"
33+
- phpunitflags="--stop-on-failure --testdox --coverage-clover=clover.xml"
3434

3535
cache:
3636
directories:
37-
- ./vendor
37+
- $HOME/.composer/cache
3838
- ./psalm/cache
3939

4040
before_script:

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ $mailbox = new PhpImap\Mailbox(
8080
'UTF-8' // Server encoding (optional)
8181
);
8282

83+
// set some connection arguments (if appropriate)
84+
$mailbox->setConnectionArgs(
85+
CL_EXPUNGE // expunge deleted mails upon mailbox close
86+
| OP_SECURE // don't do non-secure authentication
87+
);
88+
8389
try {
8490
// Get all emails (messages)
8591
// PHP.net imap_search criteria: http://php.net/manual/en/function.imap-search.php

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,24 @@
3939
"psalm/plugin-phpunit": "^0.10.0",
4040
"roave/security-advisories": "dev-master",
4141
"sebastian/phpcpd": "^4.1",
42-
"vimeo/psalm": "^3.11"
42+
"vimeo/psalm": "^3.11.5"
4343
},
4444
"scripts": {
45-
"tests": [
45+
"static-analysis": [
4646
"parallel-lint .php_cs.dist src tests examples",
4747
"phpcpd src tests",
48-
"phpunit --testdox",
4948
"composer-require-checker check ./composer.json",
5049
"phpmnd ./ --exclude=./.github/ --exclude=./examples/ --exclude=./vendor/ --non-zero-exit-on-violation --hint",
5150
"php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run --diff-format=udiff -v",
5251
"psalm --show-info=false"
52+
],
53+
"tests": [
54+
"@static-analysis",
55+
"phpunit --testdox"
5356
]
5457
},
5558
"suggest": {
56-
"ext-fileinfo": "To facilitate IncomingMailAttachment::getMimeType() auto-detection"
59+
"ext-fileinfo": "To facilitate IncomingMailAttachment::getFileInfo() auto-detection"
5760
},
5861
"autoload-dev": {
5962
"psr-4": {

psalm.baseline.xml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="3.11.2@d470903722cfcbc1cd04744c5491d3e6d13ec3d9">
2+
<files psalm-version="3.11.5@3c60609c218d4d4b3b257728b8089094e5c6c6c2">
33
<file src="examples/get_and_parse_all_emails_without_saving_attachments.php">
44
<UnusedVariable occurrences="1">
55
<code>$mailbox</code>
@@ -13,9 +13,8 @@
1313
</DocblockTypeContradiction>
1414
</file>
1515
<file src="src/PhpImap/IncomingMail.php">
16-
<PossiblyUnusedMethod occurrences="2">
16+
<PossiblyUnusedMethod occurrences="1">
1717
<code>replaceInternalLinks</code>
18-
<code>embedImageAttachments</code>
1918
</PossiblyUnusedMethod>
2019
<PropertyTypeCoercion occurrences="1">
2120
<code>$this-&gt;dataInfo</code>
@@ -26,21 +25,14 @@
2625
<code>\in_array($imapSearchOption, $supported_options, true)</code>
2726
<code>\in_array($key, $supported_params, true)</code>
2827
</DocblockTypeContradiction>
29-
<InvalidArgument occurrences="6">
28+
<InvalidArgument occurrences="3">
3029
<code>$element-&gt;charset</code>
3130
<code>$element-&gt;charset</code>
3231
<code>$element-&gt;text</code>
3332
<code>$element-&gt;charset</code>
3433
<code>$element-&gt;charset</code>
3534
<code>$element-&gt;text</code>
3635
</InvalidArgument>
37-
<MixedInferredReturnType occurrences="1">
38-
<code>array</code>
39-
</MixedInferredReturnType>
40-
<PossiblyUndefinedVariable occurrences="2">
41-
<code>$lowercase_encodings</code>
42-
<code>$lowercase_encodings</code>
43-
</PossiblyUndefinedVariable>
4436
<PossiblyUnusedMethod occurrences="24">
4537
<code>setConnectionRetry</code>
4638
<code>setConnectionRetryDelay</code>

src/PhpImap/DataPartInfo.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
namespace PhpImap;
66

7+
use const ENC8BIT;
8+
use const ENCBASE64;
9+
use const ENCBINARY;
10+
use const ENCQUOTEDPRINTABLE;
11+
712
/**
813
* @see https://github.com/barbushin/php-imap
914
*

0 commit comments

Comments
 (0)