Skip to content

Commit

Permalink
Merge pull request doctrine#8457 from greg0ire/cs-20210206
Browse files Browse the repository at this point in the history
CS Batch 2/many
  • Loading branch information
greg0ire committed Feb 6, 2021
2 parents 2693a93 + b06679c commit 2d7acbd
Show file tree
Hide file tree
Showing 70 changed files with 756 additions and 236 deletions.
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/CMS/CmsComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class CmsComment
public $id;
/** @Column(type="string", length=255) */
public $topic;
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $text;
/**
* @ManyToOne(targetEntity="CmsArticle", inversedBy="comments")
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Company/CompanyAuction.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
/** @Entity @Table(name="company_auctions") */
class CompanyAuction extends CompanyEvent
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
private $data;

public function setData($data): void
Expand Down
12 changes: 6 additions & 6 deletions tests/Doctrine/Tests/Models/DDC117/DDC117Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DDC117Article
private $title;

/**
* @psalm-var ArrayCollection<int, DDC117Reference>
* @psalm-var Collection<int, DDC117Reference>
* @OneToMany(targetEntity="DDC117Reference", mappedBy="source", cascade={"remove"})
*/
private $references;
Expand All @@ -37,7 +37,7 @@ class DDC117Article
private $details;

/**
* @psalm-var ArrayCollection<int, DDC117Translation>
* @psalm-var Collection<int, DDC117Translation>
* @OneToMany(targetEntity="DDC117Translation", mappedBy="article", cascade={"persist", "remove"})
*/
private $translations;
Expand Down Expand Up @@ -80,17 +80,17 @@ public function addTranslation(string $language, string $title): void
$this->translations[] = new DDC117Translation($this, $language, $title);
}

public function getText()
public function getText(): string
{
return $this->details->getText();
}

public function getDetails()
public function getDetails(): DDC117ArticleDetails
{
return $this->details;
}

public function getLinks()
public function getLinks(): Collection
{
return $this->links;
}
Expand All @@ -100,7 +100,7 @@ public function resetText(): void
$this->details = null;
}

public function getTranslations()
public function getTranslations(): Collection
{
return $this->translations;
}
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ class DDC117Editor
/** @Id @Column(type="integer") @GeneratedValue */
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name;

/**
Expand Down
22 changes: 15 additions & 7 deletions tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,34 @@
class DDC117Reference
{
/**
* @var DDC117Article
* @Id
* @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
* @JoinColumn(name="source_id", referencedColumnName="article_id")
*/
private $source;

/**
* @var DDC117Article
* @Id
* @ManyToOne(targetEntity="DDC117Article")
* @JoinColumn(name="target_id", referencedColumnName="article_id")
*/
private $target;

/** @column(type="string") */
/**
* @var string
* @column(type="string")
*/
private $description;

/** @column(type="datetime") */
/**
* @var DateTime
* @column(type="datetime")
*/
private $created;

public function __construct($source, $target, $description)
public function __construct(DDC117Article $source, DDC117Article $target, string $description)
{
$source->addReference($this);
$target->addReference($this);
Expand All @@ -42,22 +50,22 @@ public function __construct($source, $target, $description)
$this->created = new DateTime('now');
}

public function source()
public function source(): DDC117Article
{
return $this->source;
}

public function target()
public function target(): DDC117Article
{
return $this->target;
}

public function setDescription($desc): void
public function setDescription(string $desc): void
{
$this->description = $desc;
}

public function getDescription()
public function getDescription(): string
{
return $this->description;
}
Expand Down
1 change: 1 addition & 0 deletions tests/Doctrine/Tests/Models/DDC3346/DDC3346Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class DDC3346Article
{
/**
* @var int
* @Id
* @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/DDC3699/DDC3699Child.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class DDC3699Child extends DDC3699Parent
/** @Id @Column(type="integer") */
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $childField;

/** @OneToOne(targetEntity="DDC3699RelationOne", inversedBy="child") */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/DDC3699/DDC3699Parent.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
/** @MappedSuperclass */
abstract class DDC3699Parent
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $parentField;
}
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
*/
class DDC869ChequePayment extends DDC869Payment
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
protected $serialNumber;

public static function loadMetadata(ClassMetadataInfo $metadata): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
*/
class DDC869CreditCardPayment extends DDC869Payment
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
protected $creditCardNumber;

public static function loadMetadata(ClassMetadataInfo $metadata): void
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/DirectoryTree/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
*/
class Directory extends AbstractContentItem
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
protected $path;

public function setPath($path): void
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/DirectoryTree/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
*/
class File extends AbstractContentItem
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
protected $extension = 'html';

public function __construct(?Directory $parent = null)
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ class DoctrineGlobal_Article
*/
protected $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
protected $headline;

/** @column(type="text") */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Navigation/NavCountry.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ class NavCountry
*/
private $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
private $name;

/** @OneToMany(targetEntity="NavPointOfInterest", mappedBy="country") */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Pagination/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class Company
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name;

/** @Column(type="string", name="jurisdiction_code", nullable=true) */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Pagination/Department.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class Department
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name;

/** @ManyToOne(targetEntity="Company", inversedBy="departments", cascade={"persist"}) */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Pagination/Logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ class Logo
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $image;

/** @Column(type="integer") */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Pagination/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ abstract class User
*/
private $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name;
}
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Pagination/User1.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
class User1 extends User
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $email;
}
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Routing/RoutingLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ class RoutingLocation
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name;

public function getName()
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class RoutingRouteBooking
*/
public $route;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $passengerName = null;

public function getPassengerName()
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Tweet/Tweet.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ class Tweet
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $content;

/** @ManyToOne(targetEntity="User", inversedBy="tweets") */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Tweet/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ class User
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name;

/** @OneToMany(targetEntity="Tweet", mappedBy="author", cascade={"persist"}, fetch="EXTRA_LAZY") */
Expand Down
5 changes: 4 additions & 1 deletion tests/Doctrine/Tests/Models/Tweet/UserList.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ class UserList
*/
public $id;

/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $listName;

/** @ManyToOne(targetEntity="User", inversedBy="userLists") */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ public function setRelated($related): void
*/
class CTIChild extends CTIParent
{
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
private $data;

public function getData()
Expand Down
10 changes: 8 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ class DefaultValueUser
* @GeneratedValue(strategy="AUTO")
*/
public $id;
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $name = '';
/** @Column(type="string") */
/**
* @var string
* @Column(type="string")
*/
public $type = 'Poweruser';
/** @OneToOne(targetEntity="DefaultValueAddress", mappedBy="user", cascade={"persist"}) */
public $address;
Expand Down
Loading

0 comments on commit 2d7acbd

Please sign in to comment.