This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name facade:resolve | |
* @desc Show underlying classes and the corresponding IoC bindings | |
* @sign {query:optional:"The query string":"*"} | |
*/ | |
class SomeCommand { | |
public function go($input, $output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// command-name {name:required} {age:optional:"Jack"} | |
// command-name {--name} {--age:required} {--country:optional:USA} | |
// facade:resolve "Show underlying classes and the corresponding IoC bindings" {query:optional:"Query string":"*"} | |
listen("say-hello")->act(function($input, $output) { | |
$output("Hello, world!"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in app/tasks.php | |
// the second argument contains the array of "dependencies" | |
task("default", ["minify_css", "minify_js", "concatenate"]); | |
// smart enough to analyze the arguments | |
// and "inject" required components | |
task("minify_css", function($minifyCss) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Acme; | |
use Illuminate\Filesystem\Filesystem; | |
class Updater { | |
/** | |
* The Filesystem instance | |
* | |
* @var Illuminate\Filesystem\Filesystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$foo = 10; $bar = 9; | |
var_dump($foo = $bar); // whoops, accidental assignment! but no message will be displayed | |
var_dump(($foo) = $bar); // again, but this is a syntax error b/c an expression can't have a value assigned to it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias art="php artisan" | |
alias art_set_env="sed -i 's/your-machine-name/`hostname`/g' bootstrap/start.php" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_declared_class($file) | |
{ | |
require_once $file; | |
$classes = get_declared_classes(); | |
return end($classes); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Bar extends \Exception {} | |
namespace Foo { | |
try | |
{ | |
// do something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! \function_exists('artisan_call')) | |
{ | |
function artisan_call($command, array $parameters = array()) | |
{ | |
$buffer = new \Symfony\Component\Console\Output\BufferedOutput(); | |
\Artisan::call($command, $parameters, $buffer); |