[TOOLS] Fix all issues found by PHPStan level 2

This commit is contained in:
2021-09-06 23:47:28 +01:00
parent 4b1780a2ee
commit 4e30e5aad9
33 changed files with 114 additions and 89 deletions

View File

@@ -2,12 +2,13 @@
namespace Plugin\ActivityStreamsTwo\Util\Model\EntityToType;
use App\Core\Entity;
use Plugin\ActivityStreamsTwo\Util\Type;
abstract class EntityToType
{
/**
* @param $entity
* @param Entity $entity
*
* @throws \Exception
*
@@ -25,4 +26,4 @@ abstract class EntityToType
return Type::create($map);
}
}
}
}

View File

@@ -10,7 +10,7 @@ use Plugin\ActivityStreamsTwo\Util\Type;
class NoteToType
{
/**
* @param $entity
* @param Note $note
*
* @throws \Exception
*
@@ -30,4 +30,4 @@ class NoteToType
];
return Type::create(type: 'Note', attributes: $attr);
}
}
}

View File

@@ -7,8 +7,10 @@ use Plugin\ActivityStreamsTwo\Util\Model\EntityToType\EntityToType;
abstract class AbstractResponse
{
/**
* @param Type $type
* @param int $status The response status code
* param Type $type // What is this `Type`
*
* @param int $status The response status code
* @param mixed $type
*
* @throws \Exception
*
@@ -21,4 +23,4 @@ abstract class AbstractResponse
status: $status
);
}
}
}

View File

@@ -7,8 +7,10 @@ use Symfony\Component\HttpFoundation\JsonResponse;
class TypeResponse extends JsonResponse
{
/**
* @param Type $data
* @param int $status The response status code
* param Type $data // what `Type` is this?
*
* @param int $status The response status code
* @param null|mixed $data
*
* @return JsonResponse
*/

View File

@@ -137,7 +137,6 @@ abstract class AbstractObject
* Checks that property exists
*
* @param string $name
* @param bool $strict
*
* @throws Exception
*

View File

@@ -27,7 +27,7 @@ abstract class AbstractActivity extends ObjectType
/**
* @var string
*/
protected string $id;
public string $id;
/**
* Describes one or more entities that either performed or are

View File

@@ -30,7 +30,7 @@ class Collection extends ObjectType
/**
* @var string
*/
protected string $id;
public string $id;
/**
* A non-negative integer specifying the total number of objects

View File

@@ -29,7 +29,7 @@ class CollectionPage extends Collection
/**
* @var string
*/
protected string $id;
public string $id;
/**
* Identifies the Collection to which CollectionPage objects items

View File

@@ -34,7 +34,7 @@ class ObjectType extends AbstractObject
*
* @var string
*/
protected string $id;
public string $id;
/**
* @var string

View File

@@ -22,7 +22,7 @@ abstract class Validator
/**
* Contains all custom validators
*
* @var array<string,string>
* @var array<string, ValidatorInterface>
*
* [ 'attributeName' => CustomValidatorClassName::class ]
*/