Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet from RuntimeProvider.php
<?php
/**
* Class RuntimeProvider
*
* Use Pimple as dependency injection container
*
*/
class RuntimeProvider implements ServiceProviderInterface
{
/**
* @param Container $pimple
*/
public function register(Container $pimple)
{
$slug = 'hello-testable';
$lyricsFile = dirname(__DIR__) . '/assets/hello-dolly.txt';
$pimple['lyrics'] = function ($pimple) use($lyricsFile) {
return new \helloTestable\Lyrics($lyricsFile);
};
$pimple['helloTestable'] = function ($pimple) {
return new \helloTestable\helloTestable($pimple['lyrics']);
};
}
}
@merianos

This comment has been minimized.

merianos commented Dec 27, 2017

Hello @eriktorsner.

Thanks for sharing this awesome tutorial in WordPress Essentials.

The reason I drop a line here is that the line 15 seems like has no purpose in this code snippet.

Again, thank you !! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment