GithubHelp home page GithubHelp logo

Comments (3)

BrianHenryIE avatar BrianHenryIE commented on August 22, 2024

The CSF_Metabox class is not present in your library.

Strauss scans the files in the library, decides what the updated name should be (prefix+original), then makes those replacements. In this case, CSF_Metabox was never seen, so its class is not being prefixed, so references to it don't get updated.

If you have CSF_Metabox in a second library and both are included in your project, the reference should be updated correctly.

from strauss.

qriouslad avatar qriouslad commented on August 22, 2024

@BrianHenryIE ah, got it. Thanks for explaining. It's great to get strauss working finally. Looking forward to use it more in future projects.

from strauss.

estevao90 avatar estevao90 commented on August 22, 2024

@BrianHenryIE, I'm running into a similar issue when I try to use Strauss with the stripe-php library (https://github.com/stripe/stripe-php)

Basically, Strauss is not changing the classes in the instanceof checks.

My special config:

"override_autoload": {
	"stripe/stripe-php": {
		"psr-4": {
			"Stripe\\": "lib/"
		},
		"files": [
			"data"
		]
	}
}

An example of the problem:

Original file:
https://github.com/stripe/stripe-php/blob/master/lib/ApiOperations/All.php#L20

Strauss changes:

public static function all($params = null, $opts = null)
  {
      self::_validateParams($params);
      $url = static::classUrl();

      list($response, $opts) = static::_staticRequest('get', $url, $params, $opts);
      $obj = \NewPrefix\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
      if (!($obj instanceof \Stripe\Collection)) {
          throw new \NewPrefix\Stripe\Exception\UnexpectedValueException(
              'Expected type ' . \NewPrefix\Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.'
          );
      }
      $obj->setLastResponse($response);
      $obj->setFilters($params);

      return $obj;
  }

So, Strauss changed the class in the message but did not change the conditional above.

Any ideas?

Thank you!

from strauss.

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.