Begin to add Entity to stubs
All checks were successful
repod / nextcloud (push) Successful in 1m2s
repod / nodejs (push) Successful in 1m29s

This commit is contained in:
Michel Roux 2023-08-24 00:42:01 +02:00
parent 72ef60f23c
commit 3aae3c012f
8 changed files with 177 additions and 2 deletions

View File

@ -35,5 +35,10 @@
<directory name="stubs" /> <directory name="stubs" />
</errorLevel> </errorLevel>
</InvalidReturnType> </InvalidReturnType>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="stubs" />
</errorLevel>
</PropertyNotSetInConstructor>
</issueHandlers> </issueHandlers>
</psalm> </psalm>

View File

@ -101,13 +101,12 @@ export default {
display: flex; display: flex;
gap: 2rem; gap: 2rem;
height: 10rem; height: 10rem;
overflow: hidden; overflow: auto;
position: relative; position: relative;
} }
.header { .header {
height: 14rem; height: 14rem;
overflow: hidden;
padding: 2rem; padding: 2rem;
position: relative; position: relative;
} }

View File

@ -0,0 +1,11 @@
<template>
<div>
{{ 'oui' }}
</div>
</template>
<script>
export default {
name: 'List',
}
</script>

View File

@ -4,8 +4,18 @@ declare(strict_types=1);
namespace OCA\GPodderSync\Core\EpisodeAction; namespace OCA\GPodderSync\Core\EpisodeAction;
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionRepository;
use OCA\GPodderSync\Db\EpisodeAction\EpisodeActionWriter;
class EpisodeActionSaver class EpisodeActionSaver
{ {
public function __construct(
private EpisodeActionRepository $episodeActionRepository,
private EpisodeActionWriter $episodeActionWriter,
private EpisodeActionReader $episodeActionReader
) {
}
/** /**
* @return array * @return array
*/ */

View File

@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace OCA\GPodderSync\Db\EpisodeAction;
use OCA\GPodderSync\Core\EpisodeAction\EpisodeAction;
use OCP\AppFramework\Db\Entity;
/**
* @psalm-import-type EpisodeActionType from EpisodeAction
*
* @method string getPodcast()
* @method void setPodcast(string $podcast)
* @method string getEpisode()
* @method void setEpisode(string $episode)
* @method string getAction()
* @method void setAction(string $action)
* @method int getTimestampEpoch()
* @method void setTimestampEpoch(mixed $timestampEpoch)
* @method int getStarted()
* @method void setStarted(integer $started)
* @method int getPosition()
* @method void setPosition(integer $position)
* @method int getTotal()
* @method void setTotal(integer $total)
* @method string getGuid()
* @method void setGuid(string $guid)
* @method string getUserId()
* @method void setUserId(string $userId)
*/
class EpisodeActionEntity extends Entity implements \JsonSerializable
{
/**
* @return EpisodeActionType[]
*/
public function jsonSerialize(): mixed
{
}
}

View File

@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace OCA\GPodderSync\Db\EpisodeAction;
use OCP\AppFramework\Db\QBMapper;
use OCP\DB\Exception;
use OCP\IDBConnection;
/**
* @template-extends QBMapper<EpisodeActionEntity>
*/
class EpisodeActionMapper extends QBMapper
{
public function __construct(IDBConnection $db)
{
}
/**
* @return EpisodeActionEntity[]
* @throws Exception
*/
public function findAll(int $sinceTimestamp, string $userId)
{
}
/**
* @return ?EpisodeActionEntity
*/
public function findByEpisodeUrl(string $episodeIdentifier, string $userId)
{
}
/**
* @return ?EpisodeActionEntity
*/
public function findByGuid(string $guid, string $userId)
{
}
}

View File

@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace OCA\GPodderSync\Db\EpisodeAction;
use OCA\GPodderSync\Core\EpisodeAction\EpisodeAction;
class EpisodeActionRepository
{
public function __construct(private EpisodeActionMapper $episodeActionMapper)
{
}
/**
* @return EpisodeAction[]
*/
public function findAll(int $sinceEpoch, string $userId)
{
}
/**
* @return ?EpisodeAction
*/
public function findByEpisodeUrl(string $episodeUrl, string $userId)
{
}
/**
* @return ?EpisodeAction
*/
public function findByGuid(string $guid, string $userId)
{
}
public function deleteEpisodeActionByEpisodeUrl(string $episodeUrl, string $userId): void
{
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace OCA\GPodderSync\Db\EpisodeAction;
use OCP\DB\Exception;
class EpisodeActionWriter
{
public function __construct(private EpisodeActionMapper $episodeActionMapper)
{
}
/**
* @return EpisodeActionEntity
* @throws Exception
*/
public function save(EpisodeActionEntity $episodeActionEntity)
{
}
/**
* @return EpisodeActionEntity
* @throws Exception
*/
public function update(EpisodeActionEntity $episodeActionEntity)
{
}
}