Skip to content

Commit

Permalink
Merge pull request #517 from barbushin/develop
Browse files Browse the repository at this point in the history
Bugfixes and improvements
  • Loading branch information
Sebbo94BY authored Jun 14, 2020
2 parents 26175b1 + fec86ca commit 7ca3d19
Show file tree
Hide file tree
Showing 24 changed files with 1,415 additions and 330 deletions.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ return PhpCsFixer\Config::create()
'import_constants' => true,
'import_functions' => false,
],
'native_constant_invocation' => true,
'native_function_invocation' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ php:
- 7.3

env:
- phpunitflags="--stop-on-failure --exclude-group=live"
- phpunitflags="--stop-on-failure --testdox --exclude-group=live"

matrix:
fast_finish: true
Expand All @@ -30,11 +30,11 @@ matrix:
env:
- lint=no
- coverage=yes
- phpunitflags="--stop-on-failure --coverage-clover=clover.xml"
- phpunitflags="--stop-on-failure --testdox --coverage-clover=clover.xml"

cache:
directories:
- ./vendor
- $HOME/.composer/cache
- ./psalm/cache

before_script:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ $mailbox = new PhpImap\Mailbox(
'UTF-8' // Server encoding (optional)
);

// set some connection arguments (if appropriate)
$mailbox->setConnectionArgs(
CL_EXPUNGE // expunge deleted mails upon mailbox close
| OP_SECURE // don't do non-secure authentication
);

try {
// Get all emails (messages)
// PHP.net imap_search criteria: http://php.net/manual/en/function.imap-search.php
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,24 @@
"psalm/plugin-phpunit": "^0.10.0",
"roave/security-advisories": "dev-master",
"sebastian/phpcpd": "^4.1",
"vimeo/psalm": "^3.11"
"vimeo/psalm": "^3.11.5"
},
"scripts": {
"tests": [
"static-analysis": [
"parallel-lint .php_cs.dist src tests examples",
"phpcpd src tests",
"phpunit --testdox",
"composer-require-checker check ./composer.json",
"phpmnd ./ --exclude=./.github/ --exclude=./examples/ --exclude=./vendor/ --non-zero-exit-on-violation --hint",
"php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run --diff-format=udiff -v",
"psalm --show-info=false"
],
"tests": [
"@static-analysis",
"phpunit --testdox"
]
},
"suggest": {
"ext-fileinfo": "To facilitate IncomingMailAttachment::getMimeType() auto-detection"
"ext-fileinfo": "To facilitate IncomingMailAttachment::getFileInfo() auto-detection"
},
"autoload-dev": {
"psr-4": {
Expand Down
14 changes: 3 additions & 11 deletions psalm.baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.11.2@d470903722cfcbc1cd04744c5491d3e6d13ec3d9">
<files psalm-version="3.11.5@3c60609c218d4d4b3b257728b8089094e5c6c6c2">
<file src="examples/get_and_parse_all_emails_without_saving_attachments.php">
<UnusedVariable occurrences="1">
<code>$mailbox</code>
Expand All @@ -13,9 +13,8 @@
</DocblockTypeContradiction>
</file>
<file src="src/PhpImap/IncomingMail.php">
<PossiblyUnusedMethod occurrences="2">
<PossiblyUnusedMethod occurrences="1">
<code>replaceInternalLinks</code>
<code>embedImageAttachments</code>
</PossiblyUnusedMethod>
<PropertyTypeCoercion occurrences="1">
<code>$this-&gt;dataInfo</code>
Expand All @@ -26,21 +25,14 @@
<code>\in_array($imapSearchOption, $supported_options, true)</code>
<code>\in_array($key, $supported_params, true)</code>
</DocblockTypeContradiction>
<InvalidArgument occurrences="6">
<InvalidArgument occurrences="3">
<code>$element-&gt;charset</code>
<code>$element-&gt;charset</code>
<code>$element-&gt;text</code>
<code>$element-&gt;charset</code>
<code>$element-&gt;charset</code>
<code>$element-&gt;text</code>
</InvalidArgument>
<MixedInferredReturnType occurrences="1">
<code>array</code>
</MixedInferredReturnType>
<PossiblyUndefinedVariable occurrences="2">
<code>$lowercase_encodings</code>
<code>$lowercase_encodings</code>
</PossiblyUndefinedVariable>
<PossiblyUnusedMethod occurrences="24">
<code>setConnectionRetry</code>
<code>setConnectionRetryDelay</code>
Expand Down
5 changes: 5 additions & 0 deletions src/PhpImap/DataPartInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

namespace PhpImap;

use const ENC8BIT;
use const ENCBASE64;
use const ENCBINARY;
use const ENCQUOTEDPRINTABLE;

/**
* @see https://github.com/barbushin/php-imap
*
Expand Down
Loading

0 comments on commit 7ca3d19

Please sign in to comment.