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

Fix yield calls for PHP5.5 #3254

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions laravel/blade.php
Expand Up @@ -370,7 +370,7 @@ protected static function compile_yields($value)
{
$pattern = static::matcher('yield');

return preg_replace($pattern, '$1<?php echo \\Laravel\\Section::yield$2; ?>', $value);
return preg_replace($pattern, '$1<?php echo \\Laravel\\Section::yield_template$2; ?>', $value);
}

/**
Expand Down Expand Up @@ -427,7 +427,7 @@ protected static function compile_extensions($value)
}

return $value;
}
}

/**
* Get the regular expression for a generic Blade function.
Expand Down
6 changes: 3 additions & 3 deletions laravel/helpers.php
Expand Up @@ -560,9 +560,9 @@ function render_each($partial, array $data, $iterator, $empty = 'raw|')
* @param string $section
* @return string
*/
function yield($section)
function yield_template($section)
{
return Laravel\Section::yield($section);
return Laravel\Section::yield_template($section);
}

/**
Expand All @@ -584,7 +584,7 @@ function get_cli_option($option, $default = null)

return value($default);
}

/**
* Calculate the human-readable file size (with proper units).
*
Expand Down
2 changes: 1 addition & 1 deletion laravel/section.php
Expand Up @@ -69,7 +69,7 @@ public static function inject($section, $content)
*/
public static function yield_section()
{
return static::yield(static::stop());
return static::yield_template(static::stop());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion laravel/tests/cases/blade.test.php
Expand Up @@ -78,7 +78,7 @@ public function testYieldsAreCompiledCorrectly()
{
$blade = "@yield('something')";

$this->assertEquals("<?php echo \\Laravel\\Section::yield('something'); ?>", Blade::compile_string($blade));
$this->assertEquals("<?php echo \\Laravel\\Section::yield_template('something'); ?>", Blade::compile_string($blade));
}

/**
Expand Down