mirror of
https://github.com/Karaka-Management/oms-Calendar.git
synced 2026-01-30 16:28:43 +00:00
phpcs+phpstan fixes
This commit is contained in:
parent
ce7587ea28
commit
bc15be0084
|
|
@ -36,7 +36,7 @@ class Navigation
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function install(string $path = null, DatabasePool $dbPool = null) : void
|
||||
public static function install(string $path, DatabasePool $dbPool) : void
|
||||
{
|
||||
\Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Navigation.install.json']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ namespace Modules\Calendar\Controller;
|
|||
use Modules\Calendar\Models\CalendarMapper;
|
||||
|
||||
use phpOMS\Asset\AssetType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Stdlib\Base\SmartDateTime;
|
||||
|
|
@ -37,16 +38,16 @@ final class BackendController extends Controller
|
|||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return \Serializable
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewCalendarDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
public function viewCalendarDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
|
||||
/** @var Head $head */
|
||||
/** @var \phpOMS\Model\Html\Head $head */
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head->addAsset(AssetType::CSS, '/Modules/Calendar/Theme/Backend/css/styles.css');
|
||||
|
||||
|
|
@ -68,14 +69,14 @@ final class BackendController extends Controller
|
|||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return \Serializable
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||
public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
/** @var Head $head */
|
||||
/** @var \phpOMS\Model\Html\Head $head */
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head->addAsset(AssetType::CSS, '/Modules/Calendar/Theme/Backend/css/styles.css');
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Calendar\Controller;
|
||||
|
||||
|
||||
use phpOMS\Module\ModuleAbstract;
|
||||
use phpOMS\Module\WebInterface;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Calendar
|
|||
/**
|
||||
* Created at.
|
||||
*
|
||||
* @var \Datetime
|
||||
* @var \DateTime
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $createdAt = null;
|
||||
|
|
@ -62,7 +62,7 @@ class Calendar
|
|||
/**
|
||||
* Current date of the calendar.
|
||||
*
|
||||
* @var \Datetime
|
||||
* @var \DateTime
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $date = null;
|
||||
|
|
|
|||
|
|
@ -53,11 +53,6 @@ final class CalendarMapper extends DataMapperAbstract
|
|||
*
|
||||
* @var array<string, array<string, null|string>>
|
||||
* @since 1.0.0
|
||||
*/ /**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array<string, string>>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $hasMany = [
|
||||
'events' => [
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class Event
|
|||
/**
|
||||
* Created.
|
||||
*
|
||||
* @var \Datetime
|
||||
* @var \DateTime
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $createdAt = null;
|
||||
|
|
@ -178,19 +178,13 @@ class Event
|
|||
/**
|
||||
* @param Account $person Person to add
|
||||
*
|
||||
* @return int Account id/position
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function addPerson(Account $person)
|
||||
public function addPerson(Account $person) : void
|
||||
{
|
||||
$this->people[] = $person;
|
||||
|
||||
\end($this->people);
|
||||
$key = \key($this->people);
|
||||
\reset($this->people);
|
||||
|
||||
return $key;
|
||||
$this->people[$person->getId()] = $person;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user