for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Seasx\SeasLogger;
use Co;
/**
* Class Context
* @package Seasx\SeasLogger
*/
class Context
{
* @param string $name
* @param $value
public static function set(string $name, $value): void
Co::getContext()[$name] = $value;
Co::getContext()
Swoole\Coroutine::getContext()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
}
* @return mixed
public static function get(string $name)
return isset(Co::getContext()[$name]) ? Co::getContext()[$name] : null;
* @return bool
public static function has(string $name): bool
return isset(Co::getContext()[$name]);
public static function delete(string $name): void
unset(Co::getContext()[$name]);
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.