for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Linder\Controller;
use Anax\Commons\ContainerInjectableInterface;
use Anax\Commons\ContainerInjectableTrait;
use Linder\Model\IpVerifier;
/**
* A controller that handles a get request
* uses a model and returns a Json.
* @return Array
*/
class IpVerifierAPIController implements ContainerInjectableInterface
{
use ContainerInjectableTrait;
public function indexAction() : array
$ip = $this->di->request->getGet("ip") ?: $this->di->request->getServer("REMOTE_ADDR");
request
Psr\Container\ContainerInterface
instanceof
return [
$this->di->get("ipverifier")->getJson($ip)
];
}