Issues (4)

examples/set-nameservers.php (1 issue)

Labels
Severity
1
<?php
2
3
use Level23\Dynadot\DynadotApi;
4
use Monolog\Logger;
5
6
require '../vendor/autoload.php';
7
8
$apiKey = file_get_contents('.key');
9
10
// Create the logger
11
$logger = new Logger('my_logger');
12
13
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler());
14
$logger->addInfo('Key: ' . $apiKey);
0 ignored issues
show
The method addInfo() does not exist on Monolog\Logger. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
$logger->/** @scrutinizer ignore-call */ 
15
         addInfo('Key: ' . $apiKey);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
15
16
try {
17
    $api = new DynadotApi($apiKey, $logger);
18
    $api->setNameserversForDomain('exmple.com', ['ns01.example.com', 'ns2.example.net', 'ns03.example.org']);
19
    echo "OK";
20
} catch (Exception $e) {
21
    echo $e->getMessage();
22
    echo "<br>";
23
    echo $e->getTraceAsString();
24
}
25