Skip to content

Conversation

aavtukhovich
Copy link
Contributor

This PR fixes the error related to the undefined constant self::DEFAULT_LOCALE by replacing it with CarbonInterface::DEFAULT_LOCALE from the Carbon library. This change aligns with the Carbon package’s constants usage and resolves the runtime exception.

After applying this fix, the application runs correctly without errors related to locale constants.

Before changes:

  Undefined constant self::DEFAULT_LOCALE

  at vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:688
    684▕     public static function createFromIsoFormat(
    685▕         string $format,
    686▕         string $time,
    687$timezone = null,
  ➜ 688▕         ?string $locale = self::DEFAULT_LOCALE,
    689▕         ?TranslatorInterface $translator = null
    690▕     ): ?self {
    691$format = preg_replace_callback('/(?<!\\\\)(\\\\{2})*(LTS|LT|[Ll]{1,4})/', function ($match) use ($locale, $translator) {
    692▕             [$code] = $match;

      +13 vendor frames 

`

Copy link
Contributor

@kylekatarnls kylekatarnls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@kylekatarnls kylekatarnls added this to the 3.10.0 milestone Jun 8, 2025
@kylekatarnls kylekatarnls merged commit 0e7a98d into CarbonPHP:master Jun 8, 2025
26 of 29 checks passed
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