Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v4

Expand Down
93 changes: 48 additions & 45 deletions .jeeves.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
Mygento:
Base:
Event:
readonly: true
columns:
id:
type: bigint
pk: true
identity: true
unsigned: true
nullable: false
comment: 'Event ID'
instance:
type: varchar
nullable: false
comment: 'Server'
channel:
type: varchar
nullable: false
comment: 'Channel'
level:
type: int
unsigned: true
nullable: false
comment: 'level'
source: 'Mygento\Base\Model\Source\Loglevel'
message:
type: text
nullable: false
comment: 'log datetime'
logged_at:
type: datetime
nullable: false
comment: 'message'
context:
type: text
comment: 'context'
extra:
type: text
comment: 'extra'
indexes:
IX_EVENT_INST:
columns: ['instance']
IX_EVENT_CHAN:
columns: ['channel']
IX_EVENT_LVL:
columns: ['level']
settings:
php_version: 8.2
entities:
Event:
readonly: true
columns:
id:
type: bigint
pk: true
identity: true
unsigned: true
nullable: false
comment: 'Event ID'
instance:
type: varchar
nullable: false
comment: 'Server'
channel:
type: varchar
nullable: false
comment: 'Channel'
level:
type: int
unsigned: true
nullable: false
comment: 'level'
source: 'Mygento\Base\Model\Source\Loglevel'
message:
type: text
nullable: false
comment: 'log datetime'
logged_at:
type: datetime
nullable: false
comment: 'message'
context:
type: text
comment: 'context'
extra:
type: text
comment: 'extra'
indexes:
IX_EVENT_INST:
columns: ['instance']
IX_EVENT_CHAN:
columns: ['channel']
IX_EVENT_LVL:
columns: ['level']
55 changes: 16 additions & 39 deletions Api/Data/EventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,105 +21,82 @@ interface EventInterface

/**
* Get id
* @return int|null
*/
public function getId();
public function getId(): ?int;

/**
* Set id
* @param int $id
* @return $this
*/
public function setId($id);
public function setId($id): self;

/**
* Get instance
* @return string|null
*/
public function getInstance();
public function getInstance(): string;

/**
* Set instance
* @param string $instance
* @return $this
*/
public function setInstance($instance);
public function setInstance(string $instance): self;

/**
* Get channel
* @return string|null
*/
public function getChannel();
public function getChannel(): string;

/**
* Set channel
* @param string $channel
* @return $this
*/
public function setChannel($channel);
public function setChannel(string $channel): self;

/**
* Get level
* @return int|null
*/
public function getLevel();
public function getLevel(): int;

/**
* Set level
* @param int $level
* @return $this
*/
public function setLevel($level);
public function setLevel(int $level): self;

/**
* Get message
* @return string|null
*/
public function getMessage();
public function getMessage(): string;

/**
* Set message
* @param string $message
* @return $this
*/
public function setMessage($message);
public function setMessage(string $message): self;

/**
* Get logged at
* @return string|null
*/
public function getLoggedAt();
public function getLoggedAt(): string;

/**
* Set logged at
* @param string $loggedAt
* @return $this
*/
public function setLoggedAt($loggedAt);
public function setLoggedAt(string $loggedAt): self;

/**
* Get context
* @return string|null
*/
public function getContext();
public function getContext(): ?string;

/**
* Set context
* @param string $context
* @return $this
*/
public function setContext($context);
public function setContext(?string $context): self;

/**
* Get extra
* @return string|null
*/
public function getExtra();
public function getExtra(): ?string;

/**
* Set extra
* @param string $extra
* @return $this
*/
public function setExtra($extra);
public function setExtra(?string $extra): self;
}
4 changes: 3 additions & 1 deletion Api/Data/EventSearchResultsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

namespace Mygento\Base\Api\Data;

interface EventSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface
use Magento\Framework\Api\SearchResultsInterface;

interface EventSearchResultsInterface extends SearchResultsInterface
{
/**
* Get list of Event
Expand Down
22 changes: 7 additions & 15 deletions Api/EventRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,38 @@

namespace Mygento\Base\Api;

use Magento\Framework\Api\SearchCriteriaInterface;

interface EventRepositoryInterface
{
/**
* Save Event
* @param \Mygento\Base\Api\Data\EventInterface $entity
* @throws \Magento\Framework\Exception\LocalizedException
* @return \Mygento\Base\Api\Data\EventInterface
*/
public function save(Data\EventInterface $entity);
public function save(Data\EventInterface $entity): Data\EventInterface;

/**
* Retrieve Event
* @param int $entityId
* @throws \Magento\Framework\Exception\LocalizedException
* @return \Mygento\Base\Api\Data\EventInterface
*/
public function getById($entityId);
public function getById(int $entityId): Data\EventInterface;

/**
* Retrieve Event entities matching the specified criteria
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
* @throws \Magento\Framework\Exception\LocalizedException
* @return \Mygento\Base\Api\Data\EventSearchResultsInterface
*/
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
public function getList(SearchCriteriaInterface $searchCriteria): Data\EventSearchResultsInterface;

/**
* Delete Event
* @param \Mygento\Base\Api\Data\EventInterface $entity
* @throws \Magento\Framework\Exception\LocalizedException
* @return bool true on success
*/
public function delete(Data\EventInterface $entity);
public function delete(Data\EventInterface $entity): bool;

/**
* Delete Event
* @param int $entityId
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @throws \Magento\Framework\Exception\LocalizedException
* @return bool true on success
*/
public function deleteById($entityId);
public function deleteById(int $entityId): bool;
}
2 changes: 1 addition & 1 deletion Controller/Adminhtml/Cron/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(

/**
* Execute action based on request and return result
* @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface
*/
public function execute()
{
Expand Down
49 changes: 9 additions & 40 deletions Controller/Adminhtml/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,24 @@

namespace Mygento\Base\Controller\Adminhtml;

abstract class Event extends \Magento\Backend\App\Action
use Magento\Backend\App\Action;
use Magento\Framework\Registry;
use Mygento\Base\Api\EventRepositoryInterface;

abstract class Event extends Action
{
/**
* Authorization level
*
* @see _isAllowed()
*/
public const ADMIN_RESOURCE = 'Mygento_Base::base_event';

/**
* Core registry
*
* @var \Magento\Framework\Registry
*/
protected $coreRegistry;

/**
* Event repository
*
* @var \Mygento\Base\Api\EventRepositoryInterface
*/
protected $repository;
public const ADMIN_RESOURCE = 'Mygento_Base::event';

/**
* @param \Mygento\Base\Api\EventRepositoryInterface $repository
* @param \Magento\Framework\Registry $coreRegistry
* @param \Magento\Backend\App\Action\Context $context
*/
public function __construct(
\Mygento\Base\Api\EventRepositoryInterface $repository,
\Magento\Framework\Registry $coreRegistry,
\Magento\Backend\App\Action\Context $context,
protected readonly EventRepositoryInterface $repository,
protected readonly Registry $coreRegistry,
Action\Context $context,
) {
parent::__construct($context);
$this->repository = $repository;
$this->coreRegistry = $coreRegistry;
}

/**
* Init page
*
* @param \Magento\Backend\Model\View\Result\Page $resultPage
* @return \Magento\Backend\Model\View\Result\Page
*/
protected function initPage($resultPage)
{
$resultPage->setActiveMenu('Mygento_Base::event');

//->addBreadcrumb(__('Event'), __('Event'));
return $resultPage;
}
}
Loading
Loading