Skip to content

Commit

Permalink
Lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
tchapi committed Jul 17, 2023
1 parent 69cd7bc commit f8d5537
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 3 deletions.
3 changes: 1 addition & 2 deletions migrations/Version20230209142217.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Doctrine\Migrations\AbstractMigration;

/**
* PostgreSQL - Add missing defaults to IDs (to use sequences)
* PostgreSQL - Add missing defaults to IDs (to use sequences).
*/
final class Version20230209142217 extends AbstractMigration
{
Expand Down Expand Up @@ -59,4 +59,3 @@ public function down(Schema $schema): void
$this->addSql('ALTER TABLE calendars ALTER COLUMN synctoken TYPE varchar(255);');
}
}

2 changes: 1 addition & 1 deletion src/Controller/DAVController.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function initServer(string $authMethod, string $authRealm = User::DEFAUL
} else {
$pdo = $this->em->getConnection()->getWrappedConnection();
}
if (!($pdo instanceof PDO)) {
if (!($pdo instanceof \PDO)) {
$pdo = $pdo->getNativeConnection();
}

Expand Down
5 changes: 5 additions & 0 deletions src/Entity/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

/**
* @ORM\Table(name="addressbooks")
*
* @ORM\Entity()
*
* @UniqueEntity(
* fields={"principalUri", "uri"},
* errorPath="uri",
Expand All @@ -21,7 +23,9 @@ class AddressBook
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand All @@ -38,6 +42,7 @@ class AddressBook

/**
* @ORM\Column(type="string", length=255)
*
* @Assert\Regex("/[0-9a-z\-]+/")
*/
private $uri;
Expand Down
4 changes: 4 additions & 0 deletions src/Entity/AddressBookChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

/**
* @ORM\Table(name="addressbookchanges")
*
* @ORM\Entity()
*/
class AddressBookChange
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand All @@ -29,6 +32,7 @@ class AddressBookChange

/**
* @ORM\ManyToOne(targetEntity="App\Entity\AddressBook", inversedBy="changes")
*
* @ORM\JoinColumn(name="addressbookid", nullable=false)
*/
private $addressBook;
Expand Down
3 changes: 3 additions & 0 deletions src/Entity/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* @ORM\Table(name="calendars")
*
* @ORM\Entity()
*/
class Calendar
Expand All @@ -18,7 +19,9 @@ class Calendar

/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand Down
4 changes: 4 additions & 0 deletions src/Entity/CalendarChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

/**
* @ORM\Table(name="calendarchanges")
*
* @ORM\Entity()
*/
class CalendarChange
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand All @@ -29,6 +32,7 @@ class CalendarChange

/**
* @ORM\ManyToOne(targetEntity="App\Entity\Calendar", inversedBy="changes")
*
* @ORM\JoinColumn(name="calendarid", nullable=false)
*/
private $calendar;
Expand Down
7 changes: 7 additions & 0 deletions src/Entity/CalendarInstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

/**
* @ORM\Table(name="calendarinstances")
*
* @ORM\Entity(repositoryClass="App\Repository\CalendarInstanceRepository")
*
* @UniqueEntity(
* fields={"principalUri", "uri"},
* errorPath="uri",
Expand All @@ -28,13 +30,16 @@ class CalendarInstance

/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity="App\Entity\Calendar", cascade={"persist"})
*
* @ORM\JoinColumn(name="calendarid", nullable=false)
*/
private $calendar;
Expand All @@ -56,6 +61,7 @@ class CalendarInstance

/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @Assert\Regex("/[0-9a-z\-]+/")
*/
private $uri;
Expand All @@ -72,6 +78,7 @@ class CalendarInstance

/**
* @ORM\Column(name="calendarcolor", type="string", length=10, nullable=true)
*
* @Assert\Regex("/\#[0-9A-F]{6}/")
*/
private $calendarColor;
Expand Down
4 changes: 4 additions & 0 deletions src/Entity/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

/**
* @ORM\Table(name="calendarobjects")
*
* @ORM\Entity()
*/
class CalendarObject
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand All @@ -29,6 +32,7 @@ class CalendarObject

/**
* @ORM\ManyToOne(targetEntity="App\Entity\Calendar", inversedBy="objects")
*
* @ORM\JoinColumn(name="calendarid", nullable=false)
*/
private $calendar;
Expand Down
3 changes: 3 additions & 0 deletions src/Entity/CalendarSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

/**
* @ORM\Table(name="calendarsubscriptions")
*
* @ORM\Entity()
*/
class CalendarSubscription
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand Down
4 changes: 4 additions & 0 deletions src/Entity/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@

/**
* @ORM\Table(name="cards")
*
* @ORM\Entity()
*/
class Card
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity="App\Entity\AddressBook", inversedBy="cards")
*
* @ORM\JoinColumn(name="addressbookid", nullable=false)
*/
private $addressBook;
Expand Down
3 changes: 3 additions & 0 deletions src/Entity/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

/**
* @ORM\Table(name="locks")
*
* @ORM\Entity()
*/
class Lock
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand Down
12 changes: 12 additions & 0 deletions src/Entity/Principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

/**
* @ORM\Table(name="principals")
*
* @ORM\Entity(repositoryClass="App\Repository\PrincipalRepository")
*
* @UniqueEntity("uri")
*/
class Principal
Expand All @@ -22,23 +24,29 @@ class Principal

/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\Column(type="string", length=255, unique=true)
*
* @Assert\NotBlank
*
* @Assert\Unique
*/
private $uri;

/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @Assert\Email(
* message = "The email '{{ value }}' is not a valid email."
* )
*
* @Assert\NotBlank
*/
private $email;
Expand All @@ -50,21 +58,25 @@ class Principal

/**
* @ORM\Column(type="boolean")
*
* @Assert\NotBlank
*/
private $isMain;

/**
* @ORM\Column(type="boolean")
*
* @Assert\NotBlank
*/
private $isAdmin;

/**
* @ORM\ManyToMany(targetEntity="Principal")
*
* @ORM\JoinTable(
* name="groupmembers",
* joinColumns={
*
* @ORM\JoinColumn(name="principal_id", referencedColumnName="id")
* },
* inverseJoinColumns={
Expand Down
3 changes: 3 additions & 0 deletions src/Entity/PropertyStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

/**
* @ORM\Table(name="propertystorage")
*
* @ORM\Entity()
*/
class PropertyStorage
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand Down
4 changes: 4 additions & 0 deletions src/Entity/SchedulingObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

/**
* @ORM\Table(name="schedulingobjects")
*
* @ORM\Entity()
*/
class SchedulingObject
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
Expand All @@ -30,6 +33,7 @@ class SchedulingObject

/**
* @ORM\Column(type="string", length=255, nullable=true)
*
* @Assert\Regex("/[0-9a-z\-]+/")
*/
private $uri;
Expand Down
5 changes: 5 additions & 0 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

/**
* @ORM\Table(name="users")
*
* @ORM\Entity()
*
* @UniqueEntity("username")
*/
class User
Expand All @@ -17,13 +19,16 @@ class User

/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\Column(type="string", length=255, unique=true)
*
* @Assert\NotBlank
*/
private $username;
Expand Down

0 comments on commit f8d5537

Please sign in to comment.