From 8b772d04b1deadb5df13782fb78c4b648f77496e Mon Sep 17 00:00:00 2001 From: Filippo Tessarotto Date: Mon, 10 Jan 2022 11:53:05 +0100 Subject: [PATCH] Run tests with error_reporting=E_ALL (#530) --- composer.json | 13 +++++++++---- phpunit.xml.dist | 3 +++ src/Connection.php | 1 + src/Mailbox.php | 1 + src/Message/AbstractPart.php | 7 +++++++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 5e42df9b..0bcf72af 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "ddeboer/imap", "description": "Object-oriented IMAP for PHP", + "license": "MIT", "keywords": [ "email", "mail", "imap" ], - "license": "MIT", "authors": [ { "name": "David de Boer", @@ -28,13 +28,13 @@ "ext-mbstring": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.3.2", + "friendsofphp/php-cs-fixer": "^v3.4.0", "laminas/laminas-mail": "^2.15.1", "malukenho/mcbumpface": "^1.1.5", - "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan": "^1.3.3", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.1.0", - "phpunit/phpunit": "^9.5.10" + "phpunit/phpunit": "^9.5.11" }, "autoload": { "psr-4": { @@ -45,5 +45,10 @@ "psr-4": { "Ddeboer\\Imap\\Tests\\": "tests/" } + }, + "config": { + "allow-plugins": { + "malukenho/mcbumpface": true + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b035235c..24ee738a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,6 +7,9 @@ colors="true" verbose="true" > + + + ./src diff --git a/src/Connection.php b/src/Connection.php index d9f2bb68..9f5ef90f 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -117,6 +117,7 @@ public function getMailbox(string $name): MailboxInterface return new Mailbox($this->resource, $name, $this->mailboxNames[$name]); } + #[\ReturnTypeWillChange] public function count() { $return = \imap_num_msg($this->resource->getStream()); diff --git a/src/Mailbox.php b/src/Mailbox.php index 2f77799f..38823fee 100644 --- a/src/Mailbox.php +++ b/src/Mailbox.php @@ -64,6 +64,7 @@ public function getDelimiter(): string return $this->info->delimiter; } + #[\ReturnTypeWillChange] public function count() { $return = \imap_num_msg($this->resource->getStream()); diff --git a/src/Message/AbstractPart.php b/src/Message/AbstractPart.php index 0ab0ca58..0647133c 100644 --- a/src/Message/AbstractPart.php +++ b/src/Message/AbstractPart.php @@ -268,6 +268,7 @@ final public function getParts(): array * * @return mixed */ + #[\ReturnTypeWillChange] final public function current() { $this->lazyParseStructure(); @@ -275,11 +276,13 @@ final public function current() return $this->parts[$this->key]; } + #[\ReturnTypeWillChange] final public function getChildren() { return $this->current(); } + #[\ReturnTypeWillChange] final public function hasChildren() { $this->lazyParseStructure(); @@ -290,21 +293,25 @@ final public function hasChildren() /** * @return int */ + #[\ReturnTypeWillChange] final public function key() { return $this->key; } + #[\ReturnTypeWillChange] final public function next() { ++$this->key; } + #[\ReturnTypeWillChange] final public function rewind() { $this->key = 0; } + #[\ReturnTypeWillChange] final public function valid() { $this->lazyParseStructure();