Skip to content

fix incorrect interface in docs v2.6 #1063

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

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/2.6/customization/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ redirect_from: /customization/extensions/

Extensions provide a way to group related parsers, renderers, etc. together with pre-defined priorities, configuration settings, etc. They are perfect for distributing your customizations as reusable, open-source packages that others can plug into their own projects!

To create an extension, simply create a new class implementing `ExtensionInterface`. This has a single method where you're given a `ConfigurableEnvironmentInterface` to register whatever things you need to. For example:
To create an extension, simply create a new class implementing `ExtensionInterface`. This has a single method where you're given a `EnvironmentBuilderInterface` to register whatever things you need to. For example:

```php
use League\CommonMark\Extension\ExtensionInterface;
use League\CommonMark\Environment\ConfigurableEnvironmentInterface;
use League\CommonMark\Environment\EnvironmentBuilderInterface;

final class EmojiExtension implements ExtensionInterface
{
public function register(ConfigurableEnvironmentInterface $environment): void
public function register(EnvironmentBuilderInterface $environment): void
{
$environment
// TODO: Create the EmojiParser, Emoji, and EmojiRenderer classes
Expand Down
Loading