-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
932 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,10 @@ | |
/** | ||
* The AbstractTrackingListener provides generic functions for all listeners. | ||
* | ||
* @phpstan-template TConfig of array | ||
* @phpstan-template TEventAdapter of AdapterInterface | ||
* @template TConfig of array | ||
* @template TEventAdapter of AdapterInterface | ||
* | ||
* @phpstan-extends MappedEventSubscriber<TConfig, TEventAdapter> | ||
* @template-extends MappedEventSubscriber<TConfig, TEventAdapter> | ||
* | ||
* @author Gediminas Morkevicius <[email protected]> | ||
*/ | ||
|
@@ -207,9 +207,9 @@ public function prePersist(EventArgs $args) | |
/** | ||
* Get the value for an updated field. | ||
* | ||
* @param ClassMetadata $meta | ||
* @param string $field | ||
* @param AdapterInterface $eventAdapter | ||
* @param ClassMetadata<object> $meta | ||
* @param string $field | ||
* @param TEventAdapter $eventAdapter | ||
* | ||
* @return mixed | ||
*/ | ||
|
@@ -218,10 +218,10 @@ abstract protected function getFieldValue($meta, $field, $eventAdapter); | |
/** | ||
* Updates a field. | ||
* | ||
* @param object $object | ||
* @param AdapterInterface $eventAdapter | ||
* @param ClassMetadata $meta | ||
* @param string $field | ||
* @param object $object | ||
* @param TEventAdapter $eventAdapter | ||
* @param ClassMetadata<object> $meta | ||
* @param string $field | ||
* | ||
* @return void | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,29 +25,25 @@ | |
* | ||
* @author Gediminas Morkevicius <[email protected]> | ||
* | ||
* @phpstan-template T of Loggable|object | ||
* @template T of Loggable|object | ||
* | ||
* @phpstan-extends EntityRepository<AbstractLogEntry<T>> | ||
* @template-extends EntityRepository<AbstractLogEntry<T>> | ||
*/ | ||
class LogEntryRepository extends EntityRepository | ||
{ | ||
/** | ||
* Currently used loggable listener | ||
* | ||
* @phpstan-var LoggableListener<T>|null | ||
* @var LoggableListener<T>|null | ||
*/ | ||
private ?LoggableListener $listener = null; | ||
|
||
/** | ||
* Loads all log entries for the given entity | ||
* | ||
* @param object $entity | ||
* @param T $entity | ||
* | ||
* @return AbstractLogEntry[] | ||
* | ||
* @phpstan-param T $entity | ||
* | ||
* @phpstan-return array<array-key, AbstractLogEntry<T>> | ||
* @return array<array-key, AbstractLogEntry<T>> | ||
*/ | ||
public function getLogEntries($entity) | ||
{ | ||
|
@@ -57,11 +53,9 @@ public function getLogEntries($entity) | |
/** | ||
* Get the query for loading of log entries | ||
* | ||
* @param object $entity | ||
* @param T $entity | ||
* | ||
* @return Query | ||
* | ||
* @phpstan-param T $entity | ||
*/ | ||
public function getLogEntriesQuery($entity) | ||
{ | ||
|
@@ -89,14 +83,12 @@ public function getLogEntriesQuery($entity) | |
* After this operation you will need to | ||
* persist and flush the $entity. | ||
* | ||
* @param object $entity | ||
* @param int $version | ||
* @param T $entity | ||
* @param int $version | ||
* | ||
* @throws UnexpectedValueException | ||
* | ||
* @return void | ||
* | ||
* @phpstan-param T $entity | ||
*/ | ||
public function revert($entity, $version = 1) | ||
{ | ||
|
@@ -151,12 +143,11 @@ public function revert($entity, $version = 1) | |
} | ||
|
||
/** | ||
* @param string $field | ||
* @param mixed $value | ||
* @param ClassMetadata<T> $objectMeta | ||
* @param string $field | ||
* @param mixed $value | ||
* | ||
* @return void | ||
* | ||
* @phpstan-param ClassMetadata<T> $objectMeta | ||
*/ | ||
protected function mapValue(ClassMetadata $objectMeta, $field, &$value) | ||
{ | ||
|
@@ -173,7 +164,7 @@ protected function mapValue(ClassMetadata $objectMeta, $field, &$value) | |
* | ||
* @throws RuntimeException if listener is not found | ||
* | ||
* @phpstan-return LoggableListener<T> | ||
* @return LoggableListener<T> | ||
*/ | ||
private function getLoggableListener(): LoggableListener | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.