Missing class import via use statement (line '66', column '27'). Open
throw new Exception('Please provide a stream function.');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method sendRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->headers[0] = $this->contentTypes["application/json"];
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Missing function doc comment Open
public function __construct(
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Variable "curl_info" is not in valid camel caps format Open
unset($curl_info[CURLOPT_POSTFIELDS]);
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Variable "curl_info" is not in valid camel caps format Open
curl_setopt_array($curl, $curl_info);
- Exclude checks
Variable "post_fields" is not in valid camel caps format Open
$post_fields = json_encode($opts);
- Exclude checks
Variable "post_fields" is not in valid camel caps format Open
$post_fields = $opts;
- Exclude checks
Missing parameter name Open
* @param $model
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Missing parameter name Open
* @param $fileId
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Missing parameter name Open
* @param $fineTuneId
- Exclude checks
Missing parameter name Open
* @param $fileId
- Exclude checks
Variable "curl_info" is not in valid camel caps format Open
$curl_info[CURLOPT_WRITEFUNCTION] = $this->streamMethod;
- Exclude checks
Missing function doc comment Open
public function setTimeout(int $timeout)
- Exclude checks
Missing parameter name Open
* @param $fineTuneId
- Exclude checks
Missing class doc comment Open
class OpenAi
- Exclude checks
Missing parameter name Open
* @param $fileId
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Missing parameter name Open
* @param $fineTuneId
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Missing parameter name Open
* @param $fineTuneId
- Exclude checks
Variable "curl_info" is not in valid camel caps format Open
$curl_info = [
- Exclude checks
Missing parameter name Open
* @param $opts
- Exclude checks
Variable "post_fields" is not in valid camel caps format Open
CURLOPT_POSTFIELDS => $post_fields,
- Exclude checks
The variable $post_fields is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $curl_info is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $curl_info is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $post_fields is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $post_fields is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $curl_info is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $curl_info is not named in camelCase. Open
private function sendRequest(
string $url,
string $method,
array $opts = []
) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}