PHPDoc fixes (#12693)

This commit is contained in:
Jellyfrog
2021-04-01 00:35:19 +02:00
committed by GitHub
parent 24c8513029
commit a0a3a1c8d8
20 changed files with 45 additions and 26 deletions

View File

@@ -162,7 +162,7 @@ class TwoFactor
* Generate HOTP (RFC 4226)
* @param string $key Secret Key
* @param int|bool $counter Optional Counter, Defaults to Timestamp
* @return int
* @return string
*/
private static function oathHOTP($key, $counter = false)
{

View File

@@ -247,7 +247,7 @@ class PermissionsCache
}
/**
* @param Demixed $device
* @param mixed $device
* @return int
*/
private function getDeviceId($device)

View File

@@ -103,7 +103,7 @@ class Eloquent
* Access the Database Manager for Fluent style queries. Like the Laravel DB facade.
*
* @param string $name
* @return \Illuminate\Database\Connection
* @return \Illuminate\Database\Connection|null
*/
public static function DB($name = null)
{

View File

@@ -35,7 +35,7 @@ class Datastore
* Initialize and create the Datastore(s)
*
* @param array $options
* @return DatastoreContract
* @return Datastore
*/
public static function init($options = [])
{

View File

@@ -485,7 +485,7 @@ class Rrd extends BaseDatastore
*
* @param string $graph_file
* @param string $options
* @return int
* @return string|int
*/
public function graph($graph_file, $options)
{

View File

@@ -35,7 +35,7 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio
* Try to convert the given Exception to a FilePermissionsException
*
* @param \Exception $exception
* @return static
* @return static|null
*/
public static function upgrade($exception)
{

View File

@@ -34,7 +34,7 @@ class MaximumExecutionTimeExceeded extends \Exception implements UpgradeableExce
* Try to convert the given Exception to a FilePermissionsException
*
* @param \Exception $exception
* @return static
* @return static|null
*/
public static function upgrade($exception)
{

View File

@@ -43,7 +43,7 @@ class UnserializableRouteCache extends \Exception implements UpgradeableExceptio
* Try to convert the given Exception to this exception
*
* @param \Exception $exception
* @return static
* @return static|null
*/
public static function upgrade($exception)
{

View File

@@ -54,7 +54,7 @@ interface Authorizer
* can_modify_passwd
*
* @param int $user_id
* @return array
* @return array|bool
*/
public function getUser($user_id);

View File

@@ -504,7 +504,7 @@ class ModuleTestHelper
*
* @param Snmpsim $snmpsim
* @param bool $no_save
* @return array
* @return array|null
* @throws FileNotFoundException
*/
public function generateTestData(Snmpsim $snmpsim, $no_save = false)

View File

@@ -34,6 +34,9 @@ use Illuminate\Database\Eloquent\Relations\MorphToMany;
use Illuminate\Support\Str;
use LibreNMS\Enum\AlertScheduleStatus;
/**
* @method static \Database\Factories\AlertScheduleFactory factory(...$parameters)
*/
class AlertSchedule extends Model
{
use HasFactory;

View File

@@ -26,6 +26,7 @@ use Permissions;
* @property-read int|null $ports_count
* @property-read int|null $sensors_count
* @property-read int|null $wirelessSensors_count
* @method static \Database\Factories\DeviceFactory factory(...$parameters)
*/
class Device extends BaseModel
{

View File

@@ -31,6 +31,9 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use LibreNMS\Util\Dns;
/**
* @method static \Database\Factories\LocationFactory factory(...$parameters)
*/
class Location extends Model
{
use HasFactory;

View File

@@ -14,6 +14,9 @@ use Illuminate\Support\Facades\Hash;
use LibreNMS\Authentication\LegacyAuth;
use Permissions;
/**
* @method static \Database\Factories\UserFactory factory(...$parameters)
*/
class User extends Authenticatable
{
use Notifiable, HasFactory;

View File

@@ -125,6 +125,7 @@ class AuthSSOTest extends DBTestCase
public function testValidAuthCreateOnly()
{
$this->basicConfig();
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
Config::set('sso.create_users', true);
@@ -158,6 +159,7 @@ class AuthSSOTest extends DBTestCase
public function testValidAuthUpdate()
{
$this->basicConfig();
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
// Create a random username and store it with the defaults
@@ -182,6 +184,7 @@ class AuthSSOTest extends DBTestCase
public function testBadAuth()
{
$this->basicConfig();
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
$this->basicEnvironmentEnv();
@@ -201,6 +204,7 @@ class AuthSSOTest extends DBTestCase
public function testNoAttribute()
{
$this->basicConfig();
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
$this->basicEnvironmentEnv();
@@ -233,6 +237,7 @@ class AuthSSOTest extends DBTestCase
public function testGetExternalUserName()
{
$this->basicConfig();
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
$this->basicEnvironmentEnv();
@@ -266,6 +271,7 @@ class AuthSSOTest extends DBTestCase
public function testGetAttr()
{
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
$_SERVER['HTTP_VALID_ATTR'] = 'string';
@@ -288,6 +294,7 @@ class AuthSSOTest extends DBTestCase
public function testTrustedProxies()
{
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
Config::set('sso.trusted_proxies', ['127.0.0.1', '::1', '2001:630:50::/48', '8.8.8.0/25']);
@@ -340,6 +347,7 @@ class AuthSSOTest extends DBTestCase
public function testLevelCaulculationFromAttr()
{
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
Config::set('sso.mode', 'env');
@@ -383,6 +391,7 @@ class AuthSSOTest extends DBTestCase
public function testGroupParsing()
{
$this->basicConfig();
/** @var \LibreNMS\Authentication\SSOAuthorizer */
$a = LegacyAuth::reset();
$this->basicEnvironmentEnv();

View File

@@ -41,7 +41,7 @@ class MibTest extends TestCase
*
* @group mibs
* @dataProvider mibDirs
* @param $dir
* @param string $dir
*/
public function testMibDirectory($dir)
{
@@ -56,9 +56,9 @@ class MibTest extends TestCase
*
* @group mibs
* @dataProvider mibFiles
* @param $path
* @param $file
* @param $mib_name
* @param string $path
* @param string $file
* @param string $mib_name
*/
public function testDuplicateMibs($path, $file, $mib_name)
{
@@ -86,9 +86,9 @@ class MibTest extends TestCase
*
* @group mibs
* @dataProvider mibFiles
* @param $path
* @param $file
* @param $mib_name
* @param string $path
* @param string $file
* @param string $mib_name
*/
public function testMibNameMatches($path, $file, $mib_name)
{
@@ -104,9 +104,9 @@ class MibTest extends TestCase
*
* @group mibs
* @dataProvider mibFiles
* @param $path
* @param $file
* @param $mib_name
* @param string $path
* @param string $file
* @param string $mib_name
*/
public function testMibContents($path, $file, $mib_name)
{
@@ -165,7 +165,7 @@ class MibTest extends TestCase
/**
* Extract the mib name from a file
*
* @param $file
* @param string $file
* @return mixed
* @throws Exception
*/

View File

@@ -57,7 +57,7 @@ class OSDiscoveryTest extends TestCase
*
* @group os
* @dataProvider osProvider
* @param $os_name
* @param string $os_name
*/
public function testOS($os_name)
{

View File

@@ -90,7 +90,7 @@ class GraphiteStoreTest extends TestCase
}
/**
* @param $mockSocket
* @param mixed $mockSocket
* @return Graphite
*/
private function mockGraphite($mockSocket)

View File

@@ -107,7 +107,7 @@ class OpenTSDBStoreTest extends TestCase
}
/**
* @param $mockSocket
* @param mixed $mockSocket
* @return OpenTSDB
*/
private function mockOpenTSDB($mockSocket)

View File

@@ -110,8 +110,8 @@ class YamlSchemaTest extends TestCase
}
/**
* @param $filePath
* @param $schema_file
* @param string $filePath
* @param string $schema_file
*/
private function validateFileAgainstSchema($filePath, $schema_file)
{