Updated syntax for ``integer
` and
`boolean
`` types
| Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Used short syntax for ```integer``` and ```boolean``` types. **Before** ```php /** * @var integer * * @ORM\Column(name="some_integer_field", type="integer") */ private $someIntegerField; /** * @var boolean * * @ORM\Column(name="some_boolean_field", type="boolean") */ private $someBooleanField; ``` **After** ```php /** * @var int * * @ORM\Column(name="some_integer_field", type="integer") */ private $someIntegerField; /** * @var bool * * @ORM\Column(name="some_boolean_field", type="boolean") */ private $someBooleanField; ```
This commit is contained in:
parent
33c2ae465d
commit
97cc49033e
@ -157,13 +157,15 @@ class EntityGenerator
|
|||||||
Type::DATE => '\DateTime',
|
Type::DATE => '\DateTime',
|
||||||
Type::TIME => '\DateTime',
|
Type::TIME => '\DateTime',
|
||||||
Type::OBJECT => '\stdClass',
|
Type::OBJECT => '\stdClass',
|
||||||
Type::BIGINT => 'integer',
|
Type::INTEGER => 'int',
|
||||||
Type::SMALLINT => 'integer',
|
Type::BIGINT => 'int',
|
||||||
|
Type::SMALLINT => 'int',
|
||||||
Type::TEXT => 'string',
|
Type::TEXT => 'string',
|
||||||
Type::BLOB => 'string',
|
Type::BLOB => 'string',
|
||||||
Type::DECIMAL => 'string',
|
Type::DECIMAL => 'string',
|
||||||
Type::JSON_ARRAY => 'array',
|
Type::JSON_ARRAY => 'array',
|
||||||
Type::SIMPLE_ARRAY => 'array',
|
Type::SIMPLE_ARRAY => 'array',
|
||||||
|
Type::BOOLEAN => 'bool',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +37,7 @@ class DDC1476EntityWithDefaultFieldType
|
|||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ abstract class DDC1590Entity
|
|||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ class DDC964Address
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -51,7 +51,7 @@ class DDC964User
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ class DDC1657Screen
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Identifier
|
* Identifier
|
||||||
* @var integer
|
* @var int
|
||||||
*
|
*
|
||||||
* @Id
|
* @Id
|
||||||
* @GeneratedValue(strategy="IDENTITY")
|
* @GeneratedValue(strategy="IDENTITY")
|
||||||
@ -187,7 +187,7 @@ class DDC1657Avatar
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Identifier
|
* Identifier
|
||||||
* @var integer
|
* @var int
|
||||||
*
|
*
|
||||||
* @Id
|
* @Id
|
||||||
* @GeneratedValue(strategy="IDENTITY")
|
* @GeneratedValue(strategy="IDENTITY")
|
||||||
|
@ -240,7 +240,7 @@ class DDC1080FooBar
|
|||||||
*/
|
*/
|
||||||
protected $_bar = null;
|
protected $_bar = null;
|
||||||
/**
|
/**
|
||||||
* @var integer orderNr
|
* @var int orderNr
|
||||||
* @Column(name="orderNr", type="integer", nullable=false)
|
* @Column(name="orderNr", type="integer", nullable=false)
|
||||||
*/
|
*/
|
||||||
protected $_orderNr = null;
|
protected $_orderNr = null;
|
||||||
@ -292,7 +292,7 @@ class DDC1080FooBar
|
|||||||
/**
|
/**
|
||||||
* Retrieve the orderNr property
|
* Retrieve the orderNr property
|
||||||
*
|
*
|
||||||
* @return integer|null
|
* @return int|null
|
||||||
*/
|
*/
|
||||||
public function getOrderNr()
|
public function getOrderNr()
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ class DDC1300Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
class DDC1300Foo
|
class DDC1300Foo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer fooID
|
* @var int fooID
|
||||||
* @Column(name="fooID", type="integer", nullable=false)
|
* @Column(name="fooID", type="integer", nullable=false)
|
||||||
* @GeneratedValue(strategy="AUTO")
|
* @GeneratedValue(strategy="AUTO")
|
||||||
* @Id
|
* @Id
|
||||||
|
@ -75,7 +75,7 @@ class DDC1404ParentEntity
|
|||||||
protected $id;
|
protected $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ class DDC1430Order
|
|||||||
private $products;
|
private $products;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
@ -253,7 +253,7 @@ class DDC1430OrderProduct
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ class DDC144Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
class DDC144FlowElement {
|
class DDC144FlowElement {
|
||||||
/**
|
/**
|
||||||
* @Id @Column(type="integer") @GeneratedValue
|
* @Id @Column(type="integer") @GeneratedValue
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
/** @Column */
|
/** @Column */
|
||||||
|
@ -77,7 +77,7 @@ abstract class DDC1595BaseInheritance
|
|||||||
* @Id @GeneratedValue
|
* @Id @GeneratedValue
|
||||||
* @Column(type="integer")
|
* @Column(type="integer")
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class DDC1695Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
class DDC1695News
|
class DDC1695News
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer $idNews
|
* @var int $idNews
|
||||||
*
|
*
|
||||||
* @Column(name="`IdNews`", type="integer", nullable=false)
|
* @Column(name="`IdNews`", type="integer", nullable=false)
|
||||||
* @Id
|
* @Id
|
||||||
@ -45,42 +45,42 @@ class DDC1695News
|
|||||||
private $idUser;
|
private $idUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $idLanguage
|
* @var int $idLanguage
|
||||||
*
|
*
|
||||||
* @Column(name="`IdLanguage`", type="integer", nullable=false)
|
* @Column(name="`IdLanguage`", type="integer", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $idLanguage;
|
private $idLanguage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $idCondition
|
* @var int $idCondition
|
||||||
*
|
*
|
||||||
* @Column(name="`IdCondition`", type="integer", nullable=true)
|
* @Column(name="`IdCondition`", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
private $idCondition;
|
private $idCondition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $idHealthProvider
|
* @var int $idHealthProvider
|
||||||
*
|
*
|
||||||
* @Column(name="`IdHealthProvider`", type="integer", nullable=true)
|
* @Column(name="`IdHealthProvider`", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
private $idHealthProvider;
|
private $idHealthProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $idSpeciality
|
* @var int $idSpeciality
|
||||||
*
|
*
|
||||||
* @Column(name="`IdSpeciality`", type="integer", nullable=true)
|
* @Column(name="`IdSpeciality`", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
private $idSpeciality;
|
private $idSpeciality;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $idMedicineType
|
* @var int $idMedicineType
|
||||||
*
|
*
|
||||||
* @Column(name="`IdMedicineType`", type="integer", nullable=true)
|
* @Column(name="`IdMedicineType`", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
private $idMedicineType;
|
private $idMedicineType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $idTreatment
|
* @var int $idTreatment
|
||||||
*
|
*
|
||||||
* @Column(name="`IdTreatment`", type="integer", nullable=true)
|
* @Column(name="`IdTreatment`", type="integer", nullable=true)
|
||||||
*/
|
*/
|
||||||
@ -122,35 +122,35 @@ class DDC1695News
|
|||||||
private $idxNews;
|
private $idxNews;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $highlight
|
* @var bool $highlight
|
||||||
*
|
*
|
||||||
* @Column(name="`Highlight`", type="boolean", nullable=false)
|
* @Column(name="`Highlight`", type="boolean", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $highlight;
|
private $highlight;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $order
|
* @var int $order
|
||||||
*
|
*
|
||||||
* @Column(name="`Order`", type="integer", nullable=false)
|
* @Column(name="`Order`", type="integer", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $order;
|
private $order;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $deleted
|
* @var bool $deleted
|
||||||
*
|
*
|
||||||
* @Column(name="`Deleted`", type="boolean", nullable=false)
|
* @Column(name="`Deleted`", type="boolean", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $deleted;
|
private $deleted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $active
|
* @var bool $active
|
||||||
*
|
*
|
||||||
* @Column(name="`Active`", type="boolean", nullable=false)
|
* @Column(name="`Active`", type="boolean", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $active;
|
private $active;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $updateToHighlighted
|
* @var bool $updateToHighlighted
|
||||||
*
|
*
|
||||||
* @Column(name="`UpdateToHighlighted`", type="boolean", nullable=true)
|
* @Column(name="`UpdateToHighlighted`", type="boolean", nullable=true)
|
||||||
*/
|
*/
|
||||||
|
@ -42,7 +42,7 @@ class DDC1925Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
class DDC1925Product
|
class DDC1925Product
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer $id
|
* @var int $id
|
||||||
*
|
*
|
||||||
* @Column(name="id", type="integer")
|
* @Column(name="id", type="integer")
|
||||||
* @Id
|
* @Id
|
||||||
@ -76,7 +76,7 @@ class DDC1925Product
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
@ -133,7 +133,7 @@ class DDC1925Product
|
|||||||
class DDC1925User
|
class DDC1925User
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer
|
* @var int
|
||||||
*
|
*
|
||||||
* @Column(name="id", type="integer")
|
* @Column(name="id", type="integer")
|
||||||
* @Id
|
* @Id
|
||||||
@ -151,7 +151,7 @@ class DDC1925User
|
|||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ class DDC2138Structure
|
|||||||
abstract class DDC2138UserFollowedObject
|
abstract class DDC2138UserFollowedObject
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer $id
|
* @var int $id
|
||||||
*
|
*
|
||||||
* @Column(name="id", type="integer")
|
* @Column(name="id", type="integer")
|
||||||
* @Id
|
* @Id
|
||||||
@ -86,7 +86,7 @@ abstract class DDC2138UserFollowedObject
|
|||||||
/**
|
/**
|
||||||
* Get id
|
* Get id
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ class DDC2931User
|
|||||||
/**
|
/**
|
||||||
* Return Rank recursively
|
* Return Rank recursively
|
||||||
* My rank is 1 + rank of my parent
|
* My rank is 1 + rank of my parent
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getRank()
|
public function getRank()
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,7 @@ class DDC3033Product
|
|||||||
public $changeSet = array();
|
public $changeSet = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $id
|
* @var int $id
|
||||||
*
|
*
|
||||||
* @Column(name="id", type="integer")
|
* @Column(name="id", type="integer")
|
||||||
* @Id
|
* @Id
|
||||||
@ -120,7 +120,7 @@ class DDC3033Product
|
|||||||
class DDC3033User
|
class DDC3033User
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer
|
* @var int
|
||||||
*
|
*
|
||||||
* @Column(name="id", type="integer")
|
* @Column(name="id", type="integer")
|
||||||
* @Id
|
* @Id
|
||||||
|
@ -81,7 +81,7 @@ class DDC742User
|
|||||||
* @Id
|
* @Id
|
||||||
* @GeneratedValue(strategy="AUTO")
|
* @GeneratedValue(strategy="AUTO")
|
||||||
* @Column(type="integer")
|
* @Column(type="integer")
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
/**
|
/**
|
||||||
@ -114,7 +114,7 @@ class DDC742Comment
|
|||||||
* @Id
|
* @Id
|
||||||
* @GeneratedValue(strategy="AUTO")
|
* @GeneratedValue(strategy="AUTO")
|
||||||
* @Column(type="integer")
|
* @Column(type="integer")
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
/**
|
/**
|
||||||
|
@ -1235,7 +1235,7 @@ class DDC1170Entity
|
|||||||
private $value;
|
private $value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -2312,7 +2312,7 @@ class DDC1474Entity
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
@ -993,13 +993,13 @@ class EntityGeneratorTest extends OrmTestCase
|
|||||||
)),
|
)),
|
||||||
array(array(
|
array(array(
|
||||||
'fieldName' => 'bigint',
|
'fieldName' => 'bigint',
|
||||||
'phpType' => 'integer',
|
'phpType' => 'int',
|
||||||
'dbType' => 'bigint',
|
'dbType' => 'bigint',
|
||||||
'value' => 11
|
'value' => 11
|
||||||
)),
|
)),
|
||||||
array(array(
|
array(array(
|
||||||
'fieldName' => 'smallint',
|
'fieldName' => 'smallint',
|
||||||
'phpType' => 'integer',
|
'phpType' => 'int',
|
||||||
'dbType' => 'smallint',
|
'dbType' => 'smallint',
|
||||||
'value' => 22
|
'value' => 22
|
||||||
)),
|
)),
|
||||||
|
@ -10,7 +10,7 @@ namespace Doctrine\Tests;
|
|||||||
class OrmPerformanceTestCase extends OrmFunctionalTestCase
|
class OrmPerformanceTestCase extends OrmFunctionalTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var integer
|
* @var int
|
||||||
*/
|
*/
|
||||||
protected $maxRunningTime = 0;
|
protected $maxRunningTime = 0;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ class OrmPerformanceTestCase extends OrmFunctionalTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return int
|
||||||
*
|
*
|
||||||
* @since Method available since Release 2.3.0
|
* @since Method available since Release 2.3.0
|
||||||
*/
|
*/
|
||||||
|
@ -25,12 +25,12 @@ abstract class OrmTestCase extends DoctrineTestCase
|
|||||||
private static $_queryCacheImpl = null;
|
private static $_queryCacheImpl = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $isSecondLevelCacheEnabled = false;
|
protected $isSecondLevelCacheEnabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $isSecondLevelCacheLogEnabled = false;
|
protected $isSecondLevelCacheLogEnabled = false;
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ use Doctrine\DBAL\DriverManager;
|
|||||||
class TestUtil
|
class TestUtil
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var boolean Whether the database schema is initialized.
|
* @var bool Whether the database schema is initialized.
|
||||||
*/
|
*/
|
||||||
private static $initialized = false;
|
private static $initialized = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user