Comments (17)
First sorry for the late reply.
Thanks for your bug, I will work on the PHP8.1 release soon.
from php-mime-mail-parser.
Sorry I didn't update the issue.
The release has been done 12 days ago with the compatibility of PHP8.1.
For your information the master branch is the next major version so this PR is needed but later.
from php-mime-mail-parser.
any chance getting this fixed soon?
from php-mime-mail-parser.
hmm, the issue still exists with version 7.1:
composer show | grep mim
php-mime-mail-parser/php-mime-mail-parser 7.1.0 A fully tested email parser for PHP 7.2+ (mailparse extension wrapper).
PHP Deprecated: Return type of PhpMimeMailParser\MimePart::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /data/www/sundesk/api/vendor/php-mime-mail-parser/php-mime-mail-parser/src/MimePart.php on line 95
PHP Deprecated: Return type of PhpMimeMailParser\MimePart::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /data/www/sundesk/api/vendor/php-mime-mail-parser/php-mime-mail-parser/src/MimePart.php on line 111
PHP Deprecated: Return type of PhpMimeMailParser\MimePart::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /data/www/sundesk/api/vendor/php-mime-mail-parser/php-mime-mail-parser/src/MimePart.php on line 83
PHP Deprecated: Return type of PhpMimeMailParser\MimePart::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /data/www/sundesk/api/vendor/php-mime-mail-parser/php-mime-mail-parser/src/MimePart.php on line 103
php -v
PHP 8.1.4 (cli) (built: Apr 4 2022 13:30:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
cheers
from php-mime-mail-parser.
I had to run:
composer remove php-mime-mail-parser/php-mime-mail-parser
composer require php-mime-mail-parser/php-mime-mail-parser
php -v
PHP 8.1.4 (cli) (built: Mar 29 2022 00:29:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
from php-mime-mail-parser.
when checking MimePart.php with the 7.1 tag, there are no type hints:
https://github.com/php-mime-mail-parser/php-mime-mail-parser/blob/7.1.0/src/MimePart.php
from php-mime-mail-parser.
Maybe I did something wrong, I'm not an expert in git and I try to get the last release, update the code for 8.1 and do another release without impacting master branch.
In the PR the tests on PHP8.1 was ok without warnings:
#384
from php-mime-mail-parser.
There were neither changes on the php81-support nor on the php8-support branch.
https://github.com/php-mime-mail-parser/php-mime-mail-parser/blob/php81-support/src/MimePart.php
Last changed 3 years ago
from php-mime-mail-parser.
Yes I didn't change this file because the tests were green, the only issue with PHP8.1 was about PHPUnit with assertFileDoesNotExist
.
from php-mime-mail-parser.
Maybe you have disabled the deprecation warnings?
However the function definitions should look like this (as mentioned by @jasverix )
/**
* ArrayAccess
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->part[] = $value;
return;
}
$this->part[$offset] = $value;
}
/**
* ArrayAccess
*
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->part[$offset]);
}
/**
* ArrayAccess
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->part[$offset]);
}
/**
* ArrayAccess
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->part[$offset]) ? $this->part[$offset] : null;
}
from php-mime-mail-parser.
Could you check the last release 7.1.1? I hope it will be ok because I didn't reproduce the error I don't have PHP8.1 yet.
from php-mime-mail-parser.
nope, there is something completely wrong, you have declared your constructors private!?
Parser.php
private function __construct(ParserConfig $parserConfig = null)
{
$this->parserConfig = $parserConfig ?? new ParserConfig;
}
which leads to:
Error: Call to private PhpMimeMailParser\Parser::__construct() from scope ...
MimePart.php is not present anymore, maybe you have accidentally merged a different codebase?
composer show | grep mime
php-mime-mail-parser/php-mime-mail-parser 7.1.1 A fully tested email parser for PHP 7.3+ (mailparse extension wrapper).
from php-mime-mail-parser.
You're right, I deleted the last release.
I will take a look later, I did:
git checkout tags/7.0.0
git switch -c php81-fix
from php-mime-mail-parser.
git clone https://github.com/php-mime-mail-parser/php-mime-mail-parser
git checkout php81-fix
this shows the "right" MimePart.php to me
switch -c creates a new branch, if I am right.
I am using checkout only, btw
from php-mime-mail-parser.
when using:
"php-mime-mail-parser/php-mime-mail-parser": "dev-php81-fix"
everything is working, MimePart. contains the required typehints
from php-mime-mail-parser.
git checkout tags/7.1.0
git switch -c 7.1.2
I don't really know where I mess up last time but I think it's good now.
Release 7.1.2 fix the deprecated error on PHP 8.1 with the new attribute.
Let me know if there is another issue.
from php-mime-mail-parser.
It is working now
thx,
cheers
from php-mime-mail-parser.
Related Issues (20)
- Does not recognize ext-mailparse HOT 1
- composer install fails HOT 1
- Segmentation faults when using embedded images and attachments HOT 2
- getMessageBody does not strip attachments HOT 3
- Warning: input is not rfc822 compliant: not in < bracket HOT 1
- PHP Fatal error: Uncaught Error: Class 'PhpMimeMailParser\Parser' not found HOT 3
- Attachment class __construct arg need tweak HOT 1
- Composer doesn't seem to be working properly HOT 1
- Specify the attachment filename while saving
- mailparse returns false and gives warning if not able to parse file or string HOT 2
- Usage of `mb_encoding_aliases()` in `PhpMimeMailParser\Charset` raises PHP 8.2 deprecation notices HOT 6
- Using getAttachments HOT 2
- Wrong getHeader() encoding HOT 1
- Call to undefined function PhpMimeMailParser\mailparse_msg_create() on PHP 8.2 HOT 2
- getMessageBody('html') did not return email content HOT 1
- segmentation fault due to the subject line of a message HOT 4
- Return invalid data at the start of the body HOT 1
- Class 'PhpMimeMailParser\Charset' not found HOT 1
- Forward messages return "" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-mime-mail-parser.