Giter VIP home page Giter VIP logo

Comments (6)

mbabker avatar mbabker commented on July 20, 2024

We only have the trigger_error() calls on the 2.0 branches across the Framework repos, and that's where the message you're seeing comes from.

Also, what exactly is your proposal for "clarified to include framework or similar"? Unless we're going to start putting product identifiers in all @since and @deprecated tags as well as the inline deprecation messages (for all products, not just the Framework packages, since everything is on a different version trajectory at this point) I'm not quite sure how you'd best clarify this without creating more confusion (just look at https://api.joomla.org/cms-3/namespaces/Joomla.html where there is a mix of CMS and Framework classes with CMS, Platform, and Framework versioning in place).

from di.

brianteeman avatar brianteeman commented on July 20, 2024

Deprecated in version X of Package Y ??

from di.

brianteeman avatar brianteeman commented on July 20, 2024

Or the CMS logger needs to log where the message is coming from

from di.

mbabker avatar mbabker commented on July 20, 2024

We shouldn't need the package identifiers. Even though all of the packages are on their own release schedules, this only applies to minor/patch releases. Majors are still going out together (and at least for now tied to the CMS schedule).

With the upgraded debug bar in the CMS, in theory that should be able to have an error handler similar to this one that can get extended context like backtraces. Or, we change that handler to try to include some data about calling context, so the log statement is something like <deprecation message> called by <foo> (I don't think we need to arbitrarily include the full stack trace in those log messages personally).

from di.

brianteeman avatar brianteeman commented on July 20, 2024

Called by too works for me

from di.

mbabker avatar mbabker commented on July 20, 2024

Since this was opened, Symfony has a new deprecation contracts package that offers a function that gives runtime errors closer to the format you're looking for.

So with that package this block changes to:

trigger_deprecation(
    'joomla/di',
    '1.5.0',
    '%1$s() is deprecated and will be removed in 3.0, use %2$s::has() instead.',
    __METHOD__,
    ContainerInterface::class
);

And the resulting runtime message (which is what lands in the CMS logger) is something like this:

Since joomla/di 1.5.0: Joomla\DI\Container::exists() is deprecated and will be removed in 3.0, use Psr\Container\ContainerInterface::has() instead.

Using that package and its helper function is a worthwhile change IMO (and I've done it on other open source packages already) since it does give a little more context as to where the deprecation originates from when you have your PHP runtime collecting E_USER_DEPRECATED messages.

Doesn't really help with doc blocks though unless you end up rewriting them all to something similar to Symfony's standard but with package identifiers in them, so something like this:

/**
 * @deprecated in joomla/di 1.5 to be removed in 3.0, use `Container::has()` instead
 */

But, the con with doing that is it's going to break quite a bit about how the phpDocumentor build transforms those tags into output (inside the various class pages or the deprecation report).

from di.

Related Issues (12)

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.