Git Product home page Git Product logo

Comments (17)

eXorus avatar eXorus commented on June 7, 2024 3

First sorry for the late reply.

Thanks for your bug, I will work on the PHP8.1 release soon.

from php-mime-mail-parser.

eXorus avatar eXorus commented on June 7, 2024 1

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.

mbretter avatar mbretter commented on June 7, 2024

any chance getting this fixed soon?

from php-mime-mail-parser.

mbretter avatar mbretter commented on June 7, 2024

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.

jimmybrancaccio avatar jimmybrancaccio commented on June 7, 2024

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.

mbretter avatar mbretter commented on June 7, 2024

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.

eXorus avatar eXorus commented on June 7, 2024

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.

mbretter avatar mbretter commented on June 7, 2024

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.

eXorus avatar eXorus commented on June 7, 2024

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.

mbretter avatar mbretter commented on June 7, 2024

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.

eXorus avatar eXorus commented on June 7, 2024

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.

mbretter avatar mbretter commented on June 7, 2024

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.

eXorus avatar eXorus commented on June 7, 2024

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.

mbretter avatar mbretter commented on June 7, 2024
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.

mbretter avatar mbretter commented on June 7, 2024

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.

eXorus avatar eXorus commented on June 7, 2024
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.

mbretter avatar mbretter commented on June 7, 2024

It is working now

thx,
cheers

from php-mime-mail-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.