Giter Club home page Giter Club logo

Comments (8)

patinthehat avatar patinthehat commented on June 18, 2024 1

Thank you for the bug report, I will look into this.

from php-code-search.

patinthehat avatar patinthehat commented on June 18, 2024 1

Great! Thanks again for the reports and prompt/helpful responses 👍

from php-code-search.

patinthehat avatar patinthehat commented on June 18, 2024

@Hypnopompia I've published v1.10.6, which should fix the deprecation warnings you're seeings. Are you able to confirm that the issue is resolved?

from php-code-search.

Hypnopompia avatar Hypnopompia commented on June 18, 2024

@patinthehat I can confirm that v.1.10.6 removes the warnings. Thanks!

However, when using the spatie/x-ray package in my laravel project, I am seeing this error:

Call to undefined method Permafrost\PhpCodeSearch\Support\Collections\Collection::merge()

It appears the collect() helper in https://github.com/permafrost-dev/php-code-search/blob/main/src/Support/helpers.php#L95-L100 is taking priority over the laravel collect() helper and returning a different Collection class, so when laravel tries to run the merge() method, it fails.

To resolve this, I just removed the x-ray package from my laravel project and installed the x-ray package globally using composer. Now it runs fine with no errors or warnings. I think x-ray was meant to be included in any project that also includes the ray package, so I'm not sure if there's a better way to handle the conflicting helper functions, but I'll leave that for you to decide. I have a workaround that is working for me.

Thanks so much!

from php-code-search.

patinthehat avatar patinthehat commented on June 18, 2024

@Hypnopompia I also wrote the spatie\x-ray package - I'll look into this issue now and patch it ASAP. Thanks for the updated report!

A few follow up questions:

  • Are you using spatie\laravel-ray?
  • Can you provide more information from the error you're getting so I can locate the issue?

from php-code-search.

Hypnopompia avatar Hypnopompia commented on June 18, 2024

Yes, my composer.json includes:
"spatie/laravel-ray": "^1.28"

The error is thrown when running the ./artisan command:

./artisan

In app.php line 237:
Call to undefined method Permafrost\PhpCodeSearch\Support\Collections\Collection::merge()

in my config/app.php file, line 237 is

'aliases' => Facade::defaultAliases()->merge([

CleanShot 2023-11-10 at 14 31 51

In Facade::defaultAliases(), it looks like this:

CleanShot 2023-11-10 at 14 35 01

Hopefully that helps. Let me know if there is any other information I can provide.

from php-code-search.

patinthehat avatar patinthehat commented on June 18, 2024

@Hypnopompia I've published v1.11.0, could you see if this resolves the issue you reported when x-ray is installed locally (project-level) instead of globally?

from php-code-search.

Hypnopompia avatar Hypnopompia commented on June 18, 2024

@patinthehat yep, I can confirm that the error I was seeing is no longer there. Looks good! Thanks so much.

from php-code-search.

Related Issues (1)

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.