fix static analysis

This commit is contained in:
Dennis Eichhorn 2023-04-11 00:20:13 +02:00
parent 859a04c791
commit 3d68874c2c
8 changed files with 38 additions and 7 deletions

View File

@ -26,6 +26,8 @@ use phpOMS\DataStorage\Database\Query\Where;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T
*/
class DataMapperFactory
{
@ -117,7 +119,7 @@ class DataMapperFactory
/**
* Model to use by the mapper.
*
* @var class-string
* @var class-string<T>
* @since 1.0.0
*/
public const MODEL = '';
@ -195,13 +197,16 @@ class DataMapperFactory
*
* @param ConnectionAbstract $db Database connection
*
* @return ReadMapper
* @return ReadMapper<T>
*
* @since 1.0.0
*/
public static function get(ConnectionAbstract $db = null) : ReadMapper
{
return (new ReadMapper(new static(), $db ?? self::$db))->get();
/** @var ReadMapper<T> $reader */
$reader = new ReadMapper(new static(), $db ?? self::$db);
return $reader->get();
}
/**
@ -215,7 +220,10 @@ class DataMapperFactory
*/
public static function getRaw(ConnectionAbstract $db = null) : ReadMapper
{
return (new ReadMapper(new static(), $db ?? self::$db))->getRaw();
/** @var ReadMapper<T> $reader */
$reader = new ReadMapper(new static(), $db ?? self::$db);
return $reader->getRaw();
}
/**
@ -271,7 +279,10 @@ class DataMapperFactory
*/
public static function getAll(ConnectionAbstract $db = null) : ReadMapper
{
return (new ReadMapper(new static(), $db ?? self::$db))->getAll();
/** @var ReadMapper<T> $reader */
$reader = new ReadMapper(new static(), $db ?? self::$db);
return $reader->getAll();
}
/**

View File

@ -25,6 +25,8 @@ use phpOMS\Utils\ArrayUtils;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template R
*/
final class ReadMapper extends DataMapperAbstract
{
@ -132,7 +134,7 @@ final class ReadMapper extends DataMapperAbstract
*
* @param mixed ...$options Options to pass to read mapper
*
* @return mixed
* @return R
*
* @since 1.0.0
*/
@ -164,7 +166,7 @@ final class ReadMapper extends DataMapperAbstract
* Careful, this doesn't merge with the internal query.
* If you want to merge it use ->query() instead
*
* @return object|array
* @return R
*
* @since 1.0.0
*/

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of City
* @extends DataMapperFactory<T>
*/
class CityMapper extends DataMapperFactory
{

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Country
* @extends DataMapperFactory<T>
*/
class CountryMapper extends DataMapperFactory
{

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Currency
* @extends DataMapperFactory<T>
*/
final class CurrencyMapper extends DataMapperFactory
{

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Iban
* @extends DataMapperFactory<T>
*/
class IbanMapper extends DataMapperFactory
{

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Language
* @extends DataMapperFactory<T>
*/
class LanguageMapper extends DataMapperFactory
{

View File

@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @template T of Conditional
* @extends DataMapperFactory<T>
*/
final class ConditionalMapper extends DataMapperFactory
{