Giter Club home page Giter Club logo

Comments (15)

JBtje avatar JBtje commented on July 20, 2024 1

My current solution is terrible and ugly as ... but it works for the time being.

Implement the above changes to the Collection.php file. Store the file somewhere IN your project (i use resources/MyParcel/Collection.php)
Collection.txt

After deploy of your code to the server, overwrite the Collection.php file in the vendor folder

cp resources/MyParcel/Collection.txt ./vendor/myparcelnl/sdk/src/Support/Collection.php

from sdk.

RickJeroen avatar RickJeroen commented on July 20, 2024 1

We are still having this issue on laravel/framework (v7.10.3) with myparcelnl/sdk (v4.0.0):

Fatal error: Declaration of MyParcelNL\Sdk\src\Support\Collection::when($value, callable $callback, ?callable $default = NULL) must be compatible with Illuminate\Support\Collection::when($value, ?callable $callback = NULL, ?callable $default = NULL) in /vendor/myparcelnl/sdk/src/Support/Collection.php on line 486

from sdk.

Cannonb4ll avatar Cannonb4ll commented on July 20, 2024

Having this issue as well.

from sdk.

appelflap avatar appelflap commented on July 20, 2024

Saw that part of this is fixed by 648c7db. Except that Illuminati v7.5.2 is moving further and has changed the declaration of the when call:

Fatal error: Declaration of MyParcelNL\Sdk\src\Support\Collection::when($value, callable $callback, ?callable $default = NULL) must be compatible with Illuminate\Support\Collection::when($value, ?callable $callback = NULL, ?callable $default = NULL) in /app/vendor/myparcelnl/sdk/src/Support/Collection.php on line 38

Maybe make two tags when it gets merged into master to let people lock down a combination of myparcel+illuminate in their composer.json?

from sdk.

reindert-vetter avatar reindert-vetter commented on July 20, 2024

This is resolved in version 4.0.0. @appelflap @JBtje @Cannonb4ll Can you test whether it works now?

from sdk.

appelflap avatar appelflap commented on July 20, 2024

Tried to update, but the 4.x isn't on packagist yet @reindert-vetter

from sdk.

RichardPerdaan avatar RichardPerdaan commented on July 20, 2024

Hi @appelflap ,
When I look on packagist I see version 4.0.0 there, would you like to try again?

from sdk.

appelflap avatar appelflap commented on July 20, 2024

Yes, see it now too. Page says: This package is not auto-updated. Last update: 2020-05-08 10:25:13 UTC

Looks good! Stable with:

illuminate/http (v5.6.0 => v7.10.3)
symfony/event-dispatcher (v4.2.12 => v5.0.8)

from sdk.

appelflap avatar appelflap commented on July 20, 2024

@RickJeroen, do you also have illuminate/support v7.10.3? Because MyParcelNL\Sdk\src\Support\Collection (indirectly) implements the EnumerateValuesTrait from that package andhas function definition public function when($value, callable $callback = null, callable $default = null) without the optional '?' sign.

from sdk.

reindert-vetter avatar reindert-vetter commented on July 20, 2024

@appelflap @RickJeroen @JBtje Do you like or dislike the fact that we extend the standard laravel class? It does force us to stay up to date with the latest changes in Laravel collection

from sdk.

appelflap avatar appelflap commented on July 20, 2024

No problems with it being extended, but the dependency is not in the project composer.json. So version compatibility is somewhat unclear.

from sdk.

RickJeroen avatar RickJeroen commented on July 20, 2024

No problems with it being extended, but the dependency is not in the project composer.json. So version compatibility is somewhat unclear.

I agree

from sdk.

JBtje avatar JBtje commented on July 20, 2024

No problems with it being extended, but the dependency is not in the project composer.json. So version compatibility is somewhat unclear.

agree as well

from sdk.

JBtje avatar JBtje commented on July 20, 2024

Just tested #230, it works for laravel 7.4-7.11 (latest). Though, as stated by Appelflap, adding dependency requirement in composer.json would be nice.

from sdk.

Cannonb4ll avatar Cannonb4ll commented on July 20, 2024

Still having the same error, have not tried #230 but would be nice if that got merged.

PHP Fatal error:  Declaration of MyParcelNL\Sdk\src\Support\Collection::when($value, callable $callback, ?callable $default = NULL) must be compatible with Illuminate\Support\Collection::when($value, ?callable $callback = NULL, ?callable $default = NULL) in /Users/dennissmink/Workspace/package-dev/vendor/myparcelnl/sdk/src/Support/Collection.php on line 486

from sdk.

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.