for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Resta\Container;
use Resta\Support\JsonHandler;
use Resta\Support\SuperClosure;
use Resta\Exception\FileNotFoundException;
class ContainerClosureResolver
{
/**
* container resolver service json file
*
* @param $key
* @return mixed|null
* @throws FileNotFoundException
*/
public static function get($key)
if(file_exists(serviceJson())){
JsonHandler::$file = serviceJson();
$serviceJson = JsonHandler::get();
if(isset($serviceJson['container'][$key])){
return SuperClosure::get($serviceJson['container'][$key]);
Resta\Support\SuperClosu...son['container'][$key])
Resta\Support\SuperClosure::get()
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 null;
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.