Skip to content

Commit

Permalink
Apply CS
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Aug 19, 2023
1 parent e622ecc commit 3a2d911
Show file tree
Hide file tree
Showing 275 changed files with 680 additions and 70 deletions.
14 changes: 14 additions & 0 deletions example/app/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@

/**
* @Gedmo\Tree(type="nested")
*
* @ORM\Table(name="ext_categories")
* @ORM\Entity(repositoryClass="App\Entity\Repository\CategoryRepository")
*
* @Gedmo\TranslationEntity(class="App\Entity\CategoryTranslation")
*/
class Category
Expand All @@ -34,6 +36,7 @@ class Category
* @var string|null
*
* @Gedmo\Translatable
*
* @ORM\Column(length=64)
*/
private $title;
Expand All @@ -42,6 +45,7 @@ class Category
* @var string|null
*
* @Gedmo\Translatable
*
* @ORM\Column(type="text", nullable=true)
*/
private $description;
Expand All @@ -51,37 +55,43 @@ class Category
*
* @Gedmo\Translatable
* @Gedmo\Slug(fields={"created", "title"})
*
* @ORM\Column(length=64, unique=true)
*/
private $slug;

/**
* @Gedmo\TreeLeft
*
* @ORM\Column(type="integer")
*/
private $lft;

/**
* @Gedmo\TreeRight
*
* @ORM\Column(type="integer")
*/
private $rgt;

/**
* @Gedmo\TreeParent
*
* @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $parent;

/**
* @Gedmo\TreeRoot
*
* @ORM\Column(type="integer", nullable=true)
*/
private $root;

/**
* @Gedmo\TreeLevel
*
* @ORM\Column(name="lvl", type="integer")
*/
private $level;
Expand All @@ -93,24 +103,28 @@ class Category

/**
* @Gedmo\Timestampable(on="create")
*
* @ORM\Column(type="datetime")
*/
private $created;

/**
* @Gedmo\Timestampable(on="update")
*
* @ORM\Column(type="datetime")
*/
private $updated;

/**
* @Gedmo\Blameable(on="create")
*
* @ORM\Column(type="string")
*/
private $createdBy;

/**
* @Gedmo\Blameable(on="update")
*
* @ORM\Column(type="string")
*/
private $updatedBy;
Expand Down
6 changes: 3 additions & 3 deletions src/Blameable/Mapping/Driver/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public function readExtendedMetadata($meta, array &$config)
$class = $this->getMetaReflectionClass($meta);
// property annotations
foreach ($class->getProperties() as $property) {
if ($meta->isMappedSuperclass && !$property->isPrivate() ||
$meta->isInheritedField($property->name) ||
isset($meta->associationMappings[$property->name]['inherited'])
if ($meta->isMappedSuperclass && !$property->isPrivate()
|| $meta->isInheritedField($property->name)
|| isset($meta->associationMappings[$property->name]['inherited'])
) {
continue;
}
Expand Down
4 changes: 4 additions & 0 deletions src/Blameable/Traits/BlameableDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ trait BlameableDocument
{
/**
* @var string
*
* @Gedmo\Blameable(on="create")
*
* @ODM\Field(type="string")
*/
#[ODM\Field(type: Type::STRING)]
Expand All @@ -31,7 +33,9 @@ trait BlameableDocument

/**
* @var string
*
* @Gedmo\Blameable(on="update")
*
* @ODM\Field(type="string")
*/
#[ODM\Field(type: Type::STRING)]
Expand Down
4 changes: 4 additions & 0 deletions src/Blameable/Traits/BlameableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ trait BlameableEntity
{
/**
* @var string
*
* @Gedmo\Blameable(on="create")
*
* @ORM\Column(nullable=true)
*/
#[ORM\Column(nullable: true)]
Expand All @@ -30,7 +32,9 @@ trait BlameableEntity

/**
* @var string
*
* @Gedmo\Blameable(on="update")
*
* @ORM\Column(nullable=true)
*/
#[ORM\Column(nullable: true)]
Expand Down
6 changes: 3 additions & 3 deletions src/IpTraceable/Mapping/Driver/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function readExtendedMetadata($meta, array &$config)
$class = $this->getMetaReflectionClass($meta);
// property annotations
foreach ($class->getProperties() as $property) {
if ($meta->isMappedSuperclass && !$property->isPrivate() ||
$meta->isInheritedField($property->name) ||
isset($meta->associationMappings[$property->name]['inherited'])
if ($meta->isMappedSuperclass && !$property->isPrivate()
|| $meta->isInheritedField($property->name)
|| isset($meta->associationMappings[$property->name]['inherited'])
) {
continue;
}
Expand Down
4 changes: 4 additions & 0 deletions src/IpTraceable/Traits/IpTraceableDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ trait IpTraceableDocument
{
/**
* @var string
*
* @Gedmo\IpTraceable(on="create")
*
* @ODM\Field(type="string")
*/
#[ODM\Field(type: Type::STRING)]
Expand All @@ -31,7 +33,9 @@ trait IpTraceableDocument

/**
* @var string
*
* @Gedmo\IpTraceable(on="update")
*
* @ODM\Field(type="string")
*/
#[ODM\Field(type: Type::STRING)]
Expand Down
4 changes: 4 additions & 0 deletions src/IpTraceable/Traits/IpTraceableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ trait IpTraceableEntity
{
/**
* @var string
*
* @Gedmo\IpTraceable(on="create")
*
* @ORM\Column(length=45, nullable=true)
*/
#[ORM\Column(length: 45, nullable: true)]
Expand All @@ -30,7 +32,9 @@ trait IpTraceableEntity

/**
* @var string
*
* @Gedmo\IpTraceable(on="update")
*
* @ORM\Column(length=45, nullable=true)
*/
#[ORM\Column(length: 45, nullable: true)]
Expand Down
1 change: 1 addition & 0 deletions src/Loggable/Document/LogEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Gedmo\Loggable\Document\LogEntry
*
* @MongoODM\Document(repositoryClass="Gedmo\Loggable\Document\Repository\LogEntryRepository")
*
* @MongoODM\Index(keys={"objectId": "asc", "objectClass": "asc", "version": "asc"})
* @MongoODM\Index(keys={"loggedAt": "asc"})
* @MongoODM\Index(keys={"objectClass": "asc"})
Expand Down
2 changes: 2 additions & 0 deletions src/Loggable/LoggableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,11 @@ public function onFlush(EventArgs $eventArgs)
* Get the LogEntry class
*
* @param string $class
*
* @phpstan-param class-string $class
*
* @return string
*
* @phpstan-return class-string<LogEntryInterface<T>>
*/
protected function getLogEntryClass(LoggableAdapter $ea, $class)
Expand Down
1 change: 1 addition & 0 deletions src/Loggable/Mapping/Event/LoggableAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface LoggableAdapter extends AdapterInterface
* Get the default object class name used to store the log entries.
*
* @return string
*
* @phpstan-return class-string
*/
public function getDefaultLogEntryClass();
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/Blameable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* Blameable annotation for Blameable behavioral extension
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*
* @author David Buchmann <mail@davidbu.ch>
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/IpTraceable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* IpTraceable annotation for IpTraceable behavioral extension
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*
* @author Pierre-Charles Bertineau <pc.bertineau@alterphp.com>
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/Annotation/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Language annotation for Translatable behavioral extension
*
* @Annotation
*
* @Target("PROPERTY")
*
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/Annotation/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Locale annotation for Translatable behavioral extension
*
* @Annotation
*
* @Target("PROPERTY")
*
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
* @phpstan-template T of LogEntryInterface
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
Expand Down
3 changes: 3 additions & 0 deletions src/Mapping/Annotation/Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* to be user like "@ReferenceMany(type="entity", class="MyEntity", identifier="entity_id")"
*
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
*
* @Annotation
*/
abstract class Reference implements GedmoAnnotation
Expand All @@ -25,12 +26,14 @@ abstract class Reference implements GedmoAnnotation

/**
* @var string|null
*
* @phpstan-var 'entity'|'document'|null
*/
public $type;

/**
* @var string|null
*
* @phpstan-var class-string|null
*/
public $class;
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/ReferenceIntegrity.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* ReferenceIntegrity annotation for ReferenceIntegrity behavioral extension
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*
* @author Evert Harmeling <evert.harmeling@freshheads.com>
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/ReferenceMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* to be user like "@ReferenceMany(type="entity", class="MyEntity", identifier="entity_id")"
*
* @author Bulat Shakirzyanov <mallluhuct@gmail.com>
*
* @NamedArgumentConstructor
*
* @Annotation
*
* @final since gedmo/doctrine-extensions 3.11
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/Annotation/ReferenceManyEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

/**
* @NamedArgumentConstructor
*
* @Annotation
*
* @final since gedmo/doctrine-extensions 3.11
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/Slug.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* Slug annotation for Sluggable behavioral extension
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/SlugHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* SlugHandler annotation for Sluggable behavioral extension
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
Expand All @@ -29,6 +30,7 @@ final class SlugHandler implements GedmoAnnotation

/**
* @var string
*
* @phpstan-var string|class-string<SlugHandlerInterface>
*/
public $class = '';
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/Annotation/SlugHandlerOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* SlugHandlerOption annotation for Sluggable behavioral extension
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
Expand Down
2 changes: 2 additions & 0 deletions src/Mapping/Annotation/SoftDeleteable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
* @author Gustavo Falco <comfortablynumb84@gmail.com>
*
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/Annotation/SortableGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @author Lukas Botsch <lukas.botsch@gmail.com>
*
* @Annotation
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY)]
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/Annotation/SortablePosition.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* @author Lukas Botsch <lukas.botsch@gmail.com>
*
* @Annotation
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY)]
Expand Down
Loading

0 comments on commit 3a2d911

Please sign in to comment.