Giter VIP home page Giter VIP logo

Comments (10)

chrillep avatar chrillep commented on May 24, 2024 1

if i get the time ill try and whip up a reproducible repo. This is really bugging me :)

from rector.

TomasVotruba avatar TomasVotruba commented on May 24, 2024 1

@chrillep Thanks for provided files. This is really autoload issue with Wordpress, it loads this file first https://core.trac.wordpress.org/browser/tags/6.4.2/src/wp-admin/includes/noop.php#L18 and then suggests Rector that this method has no arguments.

Not how Rector or PHPStan can be helpful at Wordpress if the autoload is providing false information. Could be dead end by Wordpress design.

Instead I'd suggest to skip rules like RemoveExtraParametersRector using skip() method in rector.php:
https://getrector.com/documentation/ignoring-rules-or-paths

from rector.

samsonasik avatar samsonasik commented on May 24, 2024

Duplicate with #7894

function seems not autoloaded, or too late loaded, you can read the doc for how to solve it https://getrector.com/documentation/static-reflection-and-autoload

from rector.

chrillep avatar chrillep commented on May 24, 2024

I dont' understand?
I'ts only happening in CI ?
locally its fine.
the exact same composer commands are ran.
this started happening with
"rector/rector": "^0.18.12",

ill try and get to the bottom of the differences.

in the meantime we are using bedrock and sage which is basicly WP for composer.
So it already autoloads from vendor

https://roots.io/bedrock/
https://roots.io/sage/
https://roots.io/acorn/

from rector.

chrillep avatar chrillep commented on May 24, 2024

are you saying i should load all the files needed before the autoloading is done ?
for example l10n.php ?

from rector.

samsonasik avatar samsonasik commented on May 24, 2024

Yes, functions need to be registered as files in composer,

https://stackoverflow.com/questions/24171078/composer-psr-how-to-autoload-functions

On rector use case, you can place under autoload-dev

or you can define custom bootstrap for it.

from rector.

chrillep avatar chrillep commented on May 24, 2024

ill try but it still does not explain why it works locally :)

from rector.

chrillep avatar chrillep commented on May 24, 2024

yeah, thank u. I used the RemoveExtraParametersRector class.
But for me and my colleagues, its still a conundrum as to why this works locally
without RemoveExtraParametersRector and not in the ci.
Seeing as you are the creator of this repo, ill just use the RemoveExtraParametersRector :).

from rector.

TomasVotruba avatar TomasVotruba commented on May 24, 2024

@chrillep That could be caused by autoload order. E.g. I know that Windows, Unix and OSx order same files differently. This is being used by Composer internals and could result in prioritizing one file over another.

from rector.

chrillep avatar chrillep commented on May 24, 2024

Aaah ok . Yeah we use OS X locally. And GitHub Ci is Ubuntu/ linux by default .

Thank you for the Peace of mind 🙏

from rector.

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.