Skip to content

Commit

Permalink
[CS] Apply Doctrine CS 4.0
Browse files Browse the repository at this point in the history
* Exclude abstract/exception naming sniff
* Exclude EntityManagerInterface from interface naming sniff
* Use inline comments for single `@var` annotations
* Use short type casts
* Remove empty comments
* Apply other fixes
  • Loading branch information
Majkl578 committed Mar 4, 2018
1 parent cf548e9 commit bb1fe1d
Show file tree
Hide file tree
Showing 208 changed files with 577 additions and 1,692 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"require-dev": {
"ext-pdo": "*",
"doctrine/coding-standard": "^3.0",
"doctrine/coding-standard": "^4.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
Expand Down
24 changes: 7 additions & 17 deletions lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ abstract class AbstractQuery
*/
protected $hydrationMode = self::HYDRATE_OBJECT;

/**
* @var QueryCacheProfile
*/
/** @var QueryCacheProfile */
protected $queryCacheProfile;

/**
Expand All @@ -106,9 +104,7 @@ abstract class AbstractQuery
*/
protected $expireResultCache = false;

/**
* @var QueryCacheProfile
*/
/** @var QueryCacheProfile */
protected $hydrationCacheProfile;

/**
Expand All @@ -118,9 +114,7 @@ abstract class AbstractQuery
*/
protected $cacheable = false;

/**
* @var bool
*/
/** @var bool */
protected $hasCache = false;

/**
Expand All @@ -137,14 +131,10 @@ abstract class AbstractQuery
*/
protected $cacheMode;

/**
* @var CacheLogger|null
*/
/** @var CacheLogger|null */
protected $cacheLogger;

/**
* @var int
*/
/** @var int */
protected $lifetime = 0;

/**
Expand Down Expand Up @@ -233,7 +223,7 @@ public function getLifetime()
*/
public function setLifetime($lifetime)
{
$this->lifetime = (integer) $lifetime;
$this->lifetime = (int) $lifetime;

return $this;
}
Expand All @@ -253,7 +243,7 @@ public function getCacheMode()
*/
public function setCacheMode($cacheMode)
{
$this->cacheMode = (integer) $cacheMode;
$this->cacheMode = (int) $cacheMode;

return $this;
}
Expand Down
4 changes: 1 addition & 3 deletions lib/Doctrine/ORM/Annotation/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ final class Cache implements Annotation
*/
public $usage = 'READ_ONLY';

/**
* @var string Cache region name.
*/
/** @var string Cache region name. */
public $region;
}
24 changes: 6 additions & 18 deletions lib/Doctrine/ORM/Annotation/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@
*/
final class Column implements Annotation
{
/**
* @var string
*/
/** @var string */
public $name;

/**
* @var mixed
*/
/** @var mixed */
public $type = 'string';

/**
Expand All @@ -41,23 +37,15 @@ final class Column implements Annotation
*/
public $scale = 0;

/**
* @var bool
*/
/** @var bool */
public $unique = false;

/**
* @var bool
*/
/** @var bool */
public $nullable = false;

/**
* @var array
*/
/** @var array */
public $options = [];

/**
* @var string
*/
/** @var string */
public $columnDefinition;
}
8 changes: 2 additions & 6 deletions lib/Doctrine/ORM/Annotation/CustomIdGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
*/
final class CustomIdGenerator implements Annotation
{
/**
* @var string
*/
/** @var string */
public $class;

/**
* @var array
*/
/** @var array */
public $arguments = [];
}
16 changes: 4 additions & 12 deletions lib/Doctrine/ORM/Annotation/DiscriminatorColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@
*/
final class DiscriminatorColumn implements Annotation
{
/**
* @var string
*/
/** @var string */
public $name;

/**
* @var string
*/
/** @var string */
public $type;

/**
* @var int
*/
/** @var int */
public $length;

/**
Expand All @@ -32,8 +26,6 @@ final class DiscriminatorColumn implements Annotation
*/
public $fieldName;

/**
* @var string
*/
/** @var string */
public $columnDefinition;
}
4 changes: 1 addition & 3 deletions lib/Doctrine/ORM/Annotation/DiscriminatorMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/
final class DiscriminatorMap implements Annotation
{
/**
* @var array<string>
*/
/** @var array<string> */
public $value;
}
4 changes: 1 addition & 3 deletions lib/Doctrine/ORM/Annotation/Embedded.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ final class Embedded implements Annotation
*/
public $class;

/**
* @var mixed
*/
/** @var mixed */
public $columnPrefix;
}
8 changes: 2 additions & 6 deletions lib/Doctrine/ORM/Annotation/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
*/
final class Entity implements Annotation
{
/**
* @var string
*/
/** @var string */
public $repositoryClass;

/**
* @var bool
*/
/** @var bool */
public $readOnly = false;
}
20 changes: 5 additions & 15 deletions lib/Doctrine/ORM/Annotation/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,18 @@
*/
final class Index implements Annotation
{
/**
* @var string
*/
/** @var string */
public $name;

/**
* @var array<string>
*/
/** @var array<string> */
public $columns;

/**
* @var bool
*/
/** @var bool */
public $unique = false;

/**
* @var array<string>
*/
/** @var array<string> */
public $flags = [];

/**
* @var array
*/
/** @var array */
public $options = [];
}
24 changes: 6 additions & 18 deletions lib/Doctrine/ORM/Annotation/JoinColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,22 @@
*/
final class JoinColumn implements Annotation
{
/**
* @var string
*/
/** @var string */
public $name;

/**
* @var string
*/
/** @var string */
public $referencedColumnName = 'id';

/**
* @var bool
*/
/** @var bool */
public $unique = false;

/**
* @var bool
*/
/** @var bool */
public $nullable = true;

/**
* @var mixed
*/
/** @var mixed */
public $onDelete;

/**
* @var string
*/
/** @var string */
public $columnDefinition;

/**
Expand Down
4 changes: 1 addition & 3 deletions lib/Doctrine/ORM/Annotation/JoinColumns.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/
final class JoinColumns implements Annotation
{
/**
* @var array<\Doctrine\ORM\Annotation\JoinColumn>
*/
/** @var array<\Doctrine\ORM\Annotation\JoinColumn> */
public $value;
}
16 changes: 4 additions & 12 deletions lib/Doctrine/ORM/Annotation/JoinTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,15 @@
*/
final class JoinTable implements Annotation
{
/**
* @var string
*/
/** @var string */
public $name;

/**
* @var string
*/
/** @var string */
public $schema;

/**
* @var array<\Doctrine\ORM\Annotation\JoinColumn>
*/
/** @var array<\Doctrine\ORM\Annotation\JoinColumn> */
public $joinColumns = [];

/**
* @var array<\Doctrine\ORM\Annotation\JoinColumn>
*/
/** @var array<\Doctrine\ORM\Annotation\JoinColumn> */
public $inverseJoinColumns = [];
}
24 changes: 6 additions & 18 deletions lib/Doctrine/ORM/Annotation/ManyToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,16 @@
*/
final class ManyToMany implements Annotation
{
/**
* @var string
*/
/** @var string */
public $targetEntity;

/**
* @var string
*/
/** @var string */
public $mappedBy;

/**
* @var string
*/
/** @var string */
public $inversedBy;

/**
* @var array<string>
*/
/** @var array<string> */
public $cascade = [];

/**
Expand All @@ -39,13 +31,9 @@ final class ManyToMany implements Annotation
*/
public $fetch = 'LAZY';

/**
* @var bool
*/
/** @var bool */
public $orphanRemoval = false;

/**
* @var string
*/
/** @var string */
public $indexBy;
}
Loading

0 comments on commit bb1fe1d

Please sign in to comment.