for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Mikhail Dolgov <[email protected]>
* @date 04.03.2016 17:54
*/
* @return \Psr\Log\LoggerInterface
* @throws Exception
function get_pinba_logger()
{
* @var $app \Silex\Application
global $app;
global
Instead of relying on global state, we recommend one of these alternatives:
function myFunction($a, $b) { // Do something }
class MyClass { private $a; private $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function myFunction() { // Do something } }
static $logger = null;
if(is_null($logger)) {
$logger = $app['pinba_logger'];
}
return $logger;
function pinba_script_name_set ($name){
$name
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
get_pinba_logger()->debug(__FUNCTION__, func_get_args());
function pinba_timer_start ($tags){
$tags
return rand(100,999);
function pinba_timer_stop ($tags){
function pinba_timer_add ($tags, $time){
$time
function pinba_get_info (){
get_pinba_logger()->debug(__FUNCTION__);
return array(
'hostname' => 'emulate hostname',
"server_name" => 'emulate server name',
);
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state