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

[5.8] Add view path to end of compiled blade view #28117

Merged
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+8 −4
Diff settings

Always

Just for now

@@ -122,6 +122,10 @@ public function compile($path = null)
$this->files->get($this->getPath())
);
if (! empty($this->getPath())) {
$contents .= "<?php /**PATH {$this->getPath()} ENDPATH**/ ?>";

This comment has been minimized.

Copy link
@fitztrev

fitztrev Apr 4, 2019

Contributor
Suggested change
$contents .= "<?php /**PATH {$this->getPath()} ENDPATH**/ ?>";
$contents .= "<?php #PATH {$this->getPath()} ENDPATH# ?>";

Maybe just a slightly different comment syntax for aesthetics and shorter regex pattern?

This comment has been minimized.

Copy link
@driesvints

driesvints Apr 4, 2019

Author Member

Could be possible yes. Gonna wait what @bzixilu says.

}
$this->files->put(
$this->getCompiledPath($this->getPath()), $contents
);
@@ -49,15 +49,15 @@ public function testCompileCompilesFileAndReturnsContents()
{
$compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);
$files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World<?php /**PATH foo ENDPATH**/ ?>');
$compiler->compile('foo');
}
public function testCompileCompilesAndGetThePath()
{
$compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);
$files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World<?php /**PATH foo ENDPATH**/ ?>');
$compiler->compile('foo');
$this->assertEquals('foo', $compiler->getPath());
}
@@ -73,7 +73,7 @@ public function testCompileWithPathSetBefore()
{
$compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);
$files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World<?php /**PATH foo ENDPATH**/ ?>');
// set path before compilation
$compiler->setPath('foo');
// trigger compilation with null $path
@@ -97,7 +97,7 @@ public function testIncludePathToTemplate()
{
$compiler = new BladeCompiler($files = $this->getFiles(), __DIR__);
$files->shouldReceive('get')->once()->with('foo')->andReturn('Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World');
$files->shouldReceive('put')->once()->with(__DIR__.'/'.sha1('foo').'.php', 'Hello World<?php /**PATH foo ENDPATH**/ ?>');
$compiler->compile('foo');
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.