for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sreedev\Slack\Api;
class Api
{
/**
* Slack
*
* @var mixed
*/
private $Slack;
* endPoints
private $endPoints;
* functionSet
private $functionSet;
* __construct
* @param mixed $Slack
* @param mixed $method
* @param mixed $data
* @return void
public function __construct(\Sreedev\Slack\Slack $Slack, $method, $data, $functionSet)
$this->Slack = $Slack;
$this->setfunctionSet($functionSet);
$json = file_get_contents(__DIR__. '/Slack.json');
$this->endPoints = json_decode($json, true);
return $this->sendRequest($method, $data);
$this->sendRequest($method, $data)
Sreedev\Slack\Api\Api::sendRequest()
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.
}
* sendRequest
private function sendRequest($method, $data)
$request = $this->endPoints[$this->functionSet.$method];
return $this->execute(
$this->execute($request[...request['path'], $data)
Sreedev\Slack\Api\Api::execute()
$request['method'],
$request['path'],
$data
);
* execute
* @param mixed $http_method
public function execute($http_method, $method, $data)
return $this->Slack->makeRequest($http_method, $method, $data);
* setfunctionSet
* @param mixed $functionSet
private function setfunctionSet($functionSet)
$this->functionSet = $functionSet.".";
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.