Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Kint to 5, stop overriding d() function in favor of new function ddb() #1

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

benvoynick
Copy link
Contributor

The amount of deprecation notices that may be raised by Kint 1.x is getting annoyingly high as of PHP 8.1. Which also means it will straight up stop working some day on new PHP versions.

This PR upgrades to Kint 5. It also makes some other big changes:

  • The override of the d() function is removed. In its place is now a non-colliding function ddb() serving the same purpose as the old d(). The README has been updated to note this change. The README is also updated to show that choosing between Debug Bar and inline output is now most easily done by choosing between ddb() (Debug Bar) and d() (inline). This was primarily to allow the next change:
  • Kint is now a dependency in composer.json, and will be installed and autoloaded via composer so long as the plugin itself. I am still including a committed copy of Kint inside the plugin, too, which the plugin will fall back to if it does not detect the Kint class. So non-composer-based sites are still supported. Composer-based ones can now have the benefits of Composer, such as being able to upgrade to minor and patch releases of Kint without needing the release of a new version of this plugin.

There are also some other less notable changes, such as type declarations where I thought it would make sense, and adding dump functions to Kint's alias list so that they are omitted from Kint's backtrace output.

Since some of these changes are breaking - plus, the change from Kint 1.x to 5.x - I have also marked the plugin as version 2.0.0 in its PHP file, and would suggest marking a release as such.

Stop overriding d() in favor of a new dedicated function ddb() for sending Kint output to the debug bar.
Support including Kint via standard Composer/autoloading methods. But also commit Kint with its own Composer autoloader as a fallback.
@jameelmoses jameelmoses merged commit 9bb24bb into jameelmoses:main Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants