Sfpot - Loïck Piera - Septembre 2015
Sfpot - Loïck Piera - Septembre 2015
Process long ?
Mac OS | Linux | Windows |
---|---|---|
Growl | notify-send | Notifu (Windows 7) |
terminal-notifier | Toaster (Windows 8+) | |
AppleScript (Mac OS X 10.8+) |
Evidemment chacun a ses propres syntaxes et options
/** @var \Joli\JoliNotif\Notifier|null $notifier */
$notifier = Joli\JoliNotif\NotifierFactory::create();
if ($notifier) {
$notification =
(new Joli\JoliNotif\Notification())
->setBody('The notification body')
->setTitle('The notification title')
->setIcon(__DIR__.'/Resources/icons/success.png');
;
$notifier->send($notification);
}
echo 'Hi', 'World';
hello\world('foo', 'bar' . 'baz');
array(
0: Stmt_Echo(
exprs: array(
0: Scalar_String(
value: Hi
)
1: Scalar_String(
value: World
)
)
)
1: Expr_FuncCall(
name: Name(
parts: array(
0: hello
1: world
)
)
args: array(
0: Arg(
value: Scalar_String(
value: foo
)
byRef: false
)
1: Arg(
value: Expr_Concat(
left: Scalar_String(
value: bar
)
right: Scalar_String(
value: baz
)
)
byRef: false
)
)
)
)
namespace PhpParser\NodeVisitor;
interface NodeVisitor {
public function beforeTraverse(array $nodes) {}
public function enterNode(Node $node) {}
public function leaveNode(Node $node) {}
public function afterTraverse(array $nodes) {}
}
$foo =& new Bar();
class NewAssignmentByReferenceChecker extends AbstractChecker
{
public function leaveNode(Node $node)
{
if ($node instanceof Node\Expr\AssignRef) {
if ($node->expr instanceof Node\Expr\New_) {
$this->errorCollection->add(new Error(
$this->parserContext->getFilename(),
$node->getLine(),
'New objects cannot be assigned by reference.'
));
}
}
}
}