Skip to content

Commit

Permalink
Merge pull request #493 from barbushin/develop
Browse files Browse the repository at this point in the history
- Dropped PHP 5.6 support, as it went end-of-life (EOL) on the 31st of December, 2018: https://www.php.net/eol.php
- Dropped PHP 7.0 support, as it went end-of-life (EOL) on the 10th of January, 2019: https://www.php.net/eol.php
- Dropped PHP 7.1 support, as it went end-of-life (EOL) on the 1st of December, 2019: https://www.php.net/eol.php
- #403, #447, #479: Improved MIME decoding
- #485: Fixed ENCBASE64 decoding
- Fixed all Travis CI issues
- Updated psalm baseline
- Satisfied php-cs-fixer
- Added phpcpd to detect duplicated code
- Added phpmnd to detect magic numbers
- PHPUnit: Added and improved / updated test cases
- PR #485: Added some test cases for base64 decoding
- Fully replaced `Mailbox::convertStringEncoding()` with `Mailbox::decodeMimeStr()`
- Improved `composer.json`
- Updated README with PHP version overview
- Updated requirements in README
- Updated badges in README
- Removed not yet working OAuth code
- This and all upcoming releases contain a Travis CI LIVE mailbox test
  • Loading branch information
Sebbo94BY authored Apr 22, 2020
2 parents 1df5b8b + 2fe1496 commit 26175b1
Show file tree
Hide file tree
Showing 24 changed files with 644 additions and 1,519 deletions.
9 changes: 9 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ return PhpCsFixer\Config::create()
'ordered_imports' => true,
'phpdoc_to_comment' => false,
'no_superfluous_phpdoc_tags' => true,
'declare_strict_types' => true,
'void_return' => true,
'ordered_class_elements' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => false,
],
'native_function_invocation' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'this',
],
'php_unit_method_casing' => true,
'php_unit_dedicate_assert' => [
'target' => 'newest',
],
])
->setRiskyAllowed(true)
->setFinder(
Expand Down
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ env:
language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2.0
- 7.2
- 7.3

Expand All @@ -17,10 +15,10 @@ env:
matrix:
fast_finish: true
include:
- php: 5.6
- php: 7.2.0
dist: xenial
env:
- lint="php-cs-fixer"
- lint="yes"
- phpunitflags="do not run"
- php: 7.4
dist: bionic
Expand All @@ -45,15 +43,15 @@ before_script:
- if [[ "$coverage" = "yes" ]]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi
- if [[ "$coverage" = "yes" ]]; then chmod +x ./cc-test-reporter; fi
- if [[ "$coverage" = "yes" ]]; then ./cc-test-reporter before-build; fi
- if [[ "$analysis" = "yes" ]]; then composer require --dev paragonie/hidden-string; fi
- if [[ "$analysis" = "yes" ]]; then composer require --dev --update-with-dependencies "phpunit/phpunit:<9" vimeo/psalm psalm/plugin-phpunit maglnet/composer-require-checker:^2.0; fi

script:
- if [[ "$lint" != "no" ]]; then vendor/bin/parallel-lint .php_cs.dist src tests examples; fi
- if [[ "$phpunitflags" != "do not run" ]]; then vendor/bin/phpunit $phpunitflags; fi
- if [[ "$analysis" = "yes" ]]; then vendor/bin/composer-require-checker check ./composer.json; fi
- if [[ "$analysis" = "yes" ]]; then vendor/bin/phpmnd ./ --exclude=./.github/ --exclude=./examples/ --exclude=./vendor/ --exclude=./psalm/cache/ --non-zero-exit-on-violation --hint; fi
- if [[ "$analysis" = "yes" ]]; then vendor/bin/psalm --show-info=false --shepherd --diff --diff-methods; fi
- if [[ "$lint" = "php-cs-fixer" ]]; then vendor/bin/php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run --diff-format=udiff -v; fi
- if [[ "$lint" = "yes" ]]; then vendor/bin/php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run --diff-format=udiff -v; fi
- if [[ "$lint" = "yes" ]]; then vendor/bin/phpcpd src tests; fi

after_script:
- if [[ "$coverage" = "yes" ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t clover; fi
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Packagist](https://img.shields.io/packagist/dt/php-imap/php-imap.svg?style=flat-square)](https://packagist.org/packages/php-imap/php-imap)
[![Build Status](https://travis-ci.org/barbushin/php-imap.svg?branch=master)](https://travis-ci.org/barbushin/php-imap)
[![Supported PHP Version](https://img.shields.io/packagist/php-v/php-imap/php-imap/3.0.8.svg)](README.md)
[![Supported PHP Version](https://img.shields.io/packagist/php-v/php-imap/php-imap.svg)](README.md)
[![Maintainability](https://api.codeclimate.com/v1/badges/02f72a4fd695cb7e2976/maintainability)](https://codeclimate.com/github/barbushin/php-imap/maintainability)
[![Coverage](https://api.codeclimate.com/v1/badges/02f72a4fd695cb7e2976/test_coverage)](https://codeclimate.com/github/barbushin/php-imap/test_coverage)
[![Test Coverage](https://api.codeclimate.com/v1/badges/02f72a4fd695cb7e2976/test_coverage)](https://codeclimate.com/github/barbushin/php-imap/test_coverage)
[![Type Coverage](https://shepherd.dev/github/barbushin/php-imap/coverage.svg)](https://shepherd.dev/github/barbushin/php-imap)

Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open source library to connect to a mailbox by POP3, IMAP and NNTP using the PHP IMAP extension. This library allows you to fetch emails from your email server. Extend the functionality or create powerful web applications to handle your incoming emails.
Expand All @@ -22,10 +22,19 @@ Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open

### Requirements

* PHP 5.6, 7.0, 7.1, 7.2, 7.3 or 7.4
| PHP Version | php-imap Version |
| ------------- | ------------- |
| 5.6 | 3.x |
| 7.0 | 3.x |
| 7.1 | 3.x |
| 7.2 | 3.x, 4.x |
| 7.3 | 3.x, 4.x |
| 7.4 | >3.0.33, 4.x |

* PHP `fileinfo` extension must be present; so make sure this line is active in your php.ini: `extension=php_fileinfo.dll`
* PHP `iconv` extension must be present; so make sure this line is active in your php.ini: `extension=php_iconv.dll`
* PHP `imap` extension must be present; so make sure this line is active in your php.ini: `extension=php_imap.dll`
* PHP `mbstring` extension must be present; so make sure this line is active in your php.ini: `extension=php_mbstring.dll`
* PHP `iconv` extension must be present, if `mbstring` is not available; so make sure this line is active in your php.ini: `extension=php_iconv.dll`

### Installation by Composer

Expand All @@ -41,9 +50,15 @@ Install the latest available and may unstable source code from `develop`, which

$ composer require php-imap/php-imap:dev-develop

### PHPUnit Tests
### Run Tests

Before you can run the PHPUnit tests you may need to run `composer install` to install all (development) dependencies.
Before you can run the any tests you may need to run `composer install` to install all (development) dependencies.

#### Run all tests

You can run all available tests by running the following command (inside of the installed `php-imap` directory): `composer run tests`

#### Run only PHPUnit tests

You can run all PHPUnit tests by running the following command (inside of the installed `php-imap` directory): `php vendor/bin/phpunit --testdox`

Expand Down
20 changes: 14 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"sort-packages": true
},
"require": {
"php": ">=5.6",
"php": "^7.2",
"ext-fileinfo": "*",
"ext-iconv": "*",
"ext-imap": "*",
Expand All @@ -32,16 +32,24 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"jakub-onderka/php-parallel-lint": "^1.0",
"paragonie/random_compat": "^1",
"phpunit/phpunit": "^5.7"
"maglnet/composer-require-checker": "^2.0",
"paragonie/hidden-string": "^1.0",
"phpunit/phpunit": "^8.5",
"povils/phpmnd": "^2.2",
"psalm/plugin-phpunit": "^0.10.0",
"roave/security-advisories": "dev-master",
"sebastian/phpcpd": "^4.1",
"vimeo/psalm": "^3.11"
},
"scripts": {
"tests": [
"parallel-lint .php_cs.dist src tests examples",
"phpunit",
"phpcpd src tests",
"phpunit --testdox",
"composer-require-checker check ./composer.json",
"psalm --show-info=false",
"php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run --diff-format=udiff -v"
"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"
]
},
"suggest": {
Expand Down
3 changes: 3 additions & 0 deletions examples/get_and_parse_all_emails_with_matching_subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*
* @author Sebastian Krätzig <[email protected]>
*/
declare(strict_types=1);

require_once __DIR__.'/../vendor/autoload.php';

use PhpImap\Exceptions\ConnectionException;
use PhpImap\Mailbox;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*
* @author Sebastian Krätzig <[email protected]>
*/
declare(strict_types=1);

require_once __DIR__.'/../vendor/autoload.php';

use PhpImap\Exceptions\ConnectionException;
use PhpImap\Mailbox;

Expand Down
3 changes: 3 additions & 0 deletions examples/get_and_parse_unseen_emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*
* @author Sebastian Krätzig <[email protected]>
*/
declare(strict_types=1);

require_once __DIR__.'/../vendor/autoload.php';

use PhpImap\Exceptions\ConnectionException;
use PhpImap\Mailbox;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*
* @author Sebastian Krätzig <[email protected]>
*/
declare(strict_types=1);

require_once __DIR__.'/../vendor/autoload.php';

use PhpImap\Exceptions\ConnectionException;
use PhpImap\Mailbox;

Expand Down
Loading

0 comments on commit 26175b1

Please sign in to comment.