Skip to content

Commit

Permalink
Code Sniffer: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Jan 28, 2024
1 parent 7d4f655 commit ef305b3
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 25 deletions.
6 changes: 5 additions & 1 deletion tests/Entities/Blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
/** @Entity */
class Blank
{
/** @Id @Column(type="string") @GeneratedValue */
/**
* @Id
* @Column(type="string")
* @GeneratedValue
*/
public $id;
}
6 changes: 5 additions & 1 deletion tests/Entities/BlogPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
/** @Entity */
class BlogPost
{
/** @Id @Column(type="string") @GeneratedValue */
/**
* @Id
* @Column(type="string")
* @GeneratedValue
*/
public $id;

/** @Column(type="DateTime") */
Expand Down
9 changes: 7 additions & 2 deletions tests/Entities/CarbonDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@

namespace DoctrineExtensions\Tests\Entities;

/** @Entity @Table */
/**
* @Entity
* @Table
*/
class CarbonDate
{
/**
* @Id @Column(type="integer") */
* @Id
* @Column(type="integer")
*/
public $id;

/** @Column(type="CarbonDate", nullable=true) */
Expand Down
6 changes: 5 additions & 1 deletion tests/Entities/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
/** @Entity */
class Date
{
/** @Id @Column(type="string") @GeneratedValue */
/**
* @Id
* @Column(type="string")
* @GeneratedValue
*/
public $id;

/** @Column(type="datetime") */
Expand Down
9 changes: 6 additions & 3 deletions tests/Entities/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

namespace DoctrineExtensions\Tests\Entities;

/** @Entity
*/
/** @Entity */
class Product
{
/** @Id @Column(type="string") @GeneratedValue */
/**
* @Id
* @Column(type="string")
* @GeneratedValue
*/
public $id;

/** @Column(type="string") */
Expand Down
6 changes: 5 additions & 1 deletion tests/Entities/Set.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
/** @Entity */
class Set
{
/** @Id @Column(type="string") @GeneratedValue */
/**
* @Id
* @Column(type="string")
* @GeneratedValue
*/
public $id;

/** @Column(type="String") */
Expand Down
12 changes: 9 additions & 3 deletions tests/Entities/ZendDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@

namespace DoctrineExtensions\Tests\Entities;

/** @Entity @Table */
/**
* @Entity
* @Table
*/
class ZendDate
{
/** @Id @Column(type="integer") */
/**
* @Id
* @Column(type="integer")
*/
public $id;

/** @Column(type="ZendDate") */
public $date;

public function __construct($id, $date)
{
$this->id = $id;
$this->id = $id;
$this->date = $date;
}
}
26 changes: 13 additions & 13 deletions tests/Types/CarbonDateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ public function setUp(): void
$this->em->getClassMetadata('DoctrineExtensions\Tests\Entities\CarbonDate'),
]);

$entity = new Entity();
$entity->id = 1;
$entity->date = Carbon::createFromDate(2015, 1, 1);
$entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0);
$entity->datetimeTz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');
$entity->time = Carbon::createFromTime(12, 0, 0, 'Europe/London');
$entity->dateImmutable = CarbonImmutable::createFromDate(2015, 1, 1);
$entity->datetimeImmutable = CarbonImmutable::create(2015, 1, 1, 0, 0, 0);
$entity = new Entity();
$entity->id = 1;
$entity->date = Carbon::createFromDate(2015, 1, 1);
$entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0);
$entity->datetimeTz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');
$entity->time = Carbon::createFromTime(12, 0, 0, 'Europe/London');
$entity->dateImmutable = CarbonImmutable::createFromDate(2015, 1, 1);
$entity->datetimeImmutable = CarbonImmutable::create(2015, 1, 1, 0, 0, 0);
$entity->datetimeTzImmutable = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');
$entity->timeImmutable = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London');
$entity->timeImmutable = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London');
$this->em->persist($entity);
$this->em->flush();
}
Expand Down Expand Up @@ -123,8 +123,8 @@ public function testDateTimeTzGetter(): void

public function testDateTimeTzSetter(): void
{
$entity = new Entity();
$entity->id = 2;
$entity = new Entity();
$entity->id = 2;
$entity->datetimeTz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');

$this->em->persist($entity);
Expand Down Expand Up @@ -198,8 +198,8 @@ public function testImmutableDateTimeTzGetter(): void

public function testImmutableDateTimeTzSetter(): void
{
$entity = new Entity();
$entity->id = 2;
$entity = new Entity();
$entity->id = 2;
$entity->datetimeTz = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');

$this->em->persist($entity);
Expand Down

0 comments on commit ef305b3

Please sign in to comment.