Skip to content

Commit

Permalink
bug #4085 Fix constant return type (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

Fix constant return type

Closes #4084

Commits
-------

f6ce88d Fix constant return type
  • Loading branch information
fabpot committed May 11, 2024
2 parents bfc3b7b + f6ce88d commit 4313162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 3.10.1 (2024-XX-XX)

* n/a
* Fix constant return type

# 3.10.0 (2024-05-11)

Expand Down
5 changes: 4 additions & 1 deletion src/Extension/CoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1365,9 +1365,12 @@ public static function source(Environment $env, $name, $ignoreMissing = false):
* @param string $constant The name of the constant
* @param object|null $object The object to get the constant from
*
* @return mixed Class constants can return many types like scalars, arrays, and
* objects depending on the PHP version (\BackedEnum, \UnitEnum, etc.)
*
* @internal
*/
public static function constant($constant, $object = null): string
public static function constant($constant, $object = null)
{
if (null !== $object) {
if ('class' === $constant) {
Expand Down

0 comments on commit 4313162

Please sign in to comment.