-
-
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.
Introduce the Revisionable extension
- Loading branch information
Showing
91 changed files
with
5,962 additions
and
33 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
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 |
---|---|---|
|
@@ -34,6 +34,11 @@ | |
* @phpstan-extends MappedEventSubscriber<TConfig, TEventAdapter> | ||
* | ||
* @author Gediminas Morkevicius <[email protected]> | ||
* | ||
* @template TConfig of array | ||
* @template TEventAdapter of AdapterInterface | ||
* | ||
* @extends MappedEventSubscriber<TConfig, TEventAdapter> | ||
*/ | ||
abstract class AbstractTrackingListener extends MappedEventSubscriber | ||
{ | ||
|
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 |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
* | ||
* @author Gediminas Morkevicius <[email protected]> | ||
* | ||
* @extends AbstractTrackingListener<array, BlameableAdapter> | ||
* | ||
* @final since gedmo/doctrine-extensions 3.11 | ||
*/ | ||
class BlameableListener extends AbstractTrackingListener | ||
|
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 |
---|---|---|
|
@@ -23,6 +23,8 @@ | |
* | ||
* @author Pierre-Charles Bertineau <[email protected]> | ||
* | ||
* @extends AbstractTrackingListener<array, IpTraceableAdapter> | ||
* | ||
* @final since gedmo/doctrine-extensions 3.11 | ||
*/ | ||
class IpTraceableListener extends AbstractTrackingListener | ||
|
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Doctrine Behavioral Extensions package. | ||
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Gedmo\Mapping\Annotation; | ||
|
||
use Doctrine\Common\Annotations\Annotation; | ||
use Doctrine\Deprecations\Deprecation; | ||
use Gedmo\Mapping\Annotation\Annotation as GedmoAnnotation; | ||
use Gedmo\Revisionable\RevisionInterface; | ||
|
||
/** | ||
* Revisionable annotation for the revisionable behavioral extension | ||
* | ||
* @phpstan-template T of RevisionInterface | ||
* | ||
* @Annotation | ||
* | ||
* @NamedArgumentConstructor | ||
* | ||
* @Target("CLASS") | ||
* | ||
* @author Gediminas Morkevicius <[email protected]> | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_CLASS)] | ||
final class Revisionable implements GedmoAnnotation | ||
{ | ||
use ForwardCompatibilityTrait; | ||
|
||
/** | ||
* @phpstan-var class-string<T>|null | ||
*/ | ||
public ?string $revisionClass; | ||
|
||
/** | ||
* @param array<string, mixed> $data | ||
* | ||
* @phpstan-param class-string<T>|null $revisionClass | ||
*/ | ||
public function __construct(array $data = [], ?string $revisionClass = null) | ||
{ | ||
if ([] !== $data) { | ||
Deprecation::trigger( | ||
'gedmo/doctrine-extensions', | ||
'https://github.com/doctrine-extensions/DoctrineExtensions/pull/2357', | ||
'Passing an array as first argument to "%s()" is deprecated. Use named arguments instead.', | ||
__METHOD__ | ||
); | ||
|
||
$args = func_get_args(); | ||
|
||
$this->revisionClass = $this->getAttributeValue($data, 'revisionClass', $args, 1, $revisionClass); | ||
|
||
return; | ||
} | ||
|
||
$this->revisionClass = $revisionClass; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -44,6 +44,9 @@ | |
* @phpstan-template TEventAdapter of AdapterInterface | ||
* | ||
* @author Gediminas Morkevicius <[email protected]> | ||
* | ||
* @template TConfig of array | ||
* @template TEventAdapter of AdapterInterface | ||
*/ | ||
abstract class MappedEventSubscriber implements EventSubscriber | ||
{ | ||
|
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 |
---|---|---|
|
@@ -27,6 +27,8 @@ | |
* | ||
* @author Evert Harmeling <[email protected]> | ||
* | ||
* @extends MappedEventSubscriber<array, AdapterInterface> | ||
* | ||
* @final since gedmo/doctrine-extensions 3.11 | ||
*/ | ||
class ReferenceIntegrityListener extends MappedEventSubscriber | ||
|
Oops, something went wrong.