Skip to content

Commit

Permalink
Code Sniffer: fix "Member variable ... is not in valid camel caps for…
Browse files Browse the repository at this point in the history
…mat"
  • Loading branch information
connorhu committed Jan 28, 2024
1 parent c80cdc1 commit 7d4f655
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions tests/Entities/CarbonDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ class CarbonDate
public $datetime;

/** @Column(type="CarbonDateTimeTz", nullable=true) */
public $datetime_tz;
public $datetimeTz;

/** @Column(type="CarbonTime", nullable=true) */
public $time;

/** @Column(type="CarbonImmutableDate", nullable=true) */
public $date_immutable;
public $dateImmutable;

/** @Column(type="CarbonImmutableDateTime", nullable=true) */
public $datetime_immutable;
public $datetimeImmutable;

/** @Column(type="CarbonImmutableDateTimeTz", nullable=true) */
public $datetime_tz_immutable;
public $datetimeTzImmutable;

/** @Column(type="CarbonImmutableTime", nullable=true) */
public $time_immutable;
public $timeImmutable;
}
28 changes: 14 additions & 14 deletions tests/Types/CarbonDateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public function setUp(): void
$entity->id = 1;

Check failure on line 64 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 18 spaces but found 20 spaces
$entity->date = Carbon::createFromDate(2015, 1, 1);

Check failure on line 65 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 16 spaces but found 18 spaces
$entity->datetime = Carbon::create(2015, 1, 1, 0, 0, 0);

Check failure on line 66 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 12 spaces but found 14 spaces
$entity->datetime_tz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');
$entity->datetimeTz = Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');

Check failure on line 67 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 10 spaces but found 11 spaces
$entity->time = Carbon::createFromTime(12, 0, 0, 'Europe/London');

Check failure on line 68 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 16 spaces but found 18 spaces
$entity->date_immutable = CarbonImmutable::createFromDate(2015, 1, 1);
$entity->datetime_immutable = CarbonImmutable::create(2015, 1, 1, 0, 0, 0);
$entity->datetime_tz_immutable = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');
$entity->time_immutable = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London');
$entity->dateImmutable = CarbonImmutable::createFromDate(2015, 1, 1);

Check failure on line 69 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 7 spaces but found 8 spaces
$entity->datetimeImmutable = CarbonImmutable::create(2015, 1, 1, 0, 0, 0);

Check failure on line 70 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 3 spaces but found 4 spaces
$entity->datetimeTzImmutable = CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific');
$entity->timeImmutable = CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London');

Check failure on line 72 in tests/Types/CarbonDateTest.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (8.3)

Equals sign not aligned with surrounding assignments; expected 7 spaces but found 8 spaces
$this->em->persist($entity);
$this->em->flush();
}
Expand Down Expand Up @@ -117,15 +117,15 @@ public function testDateTimeTzGetter(): void
{
$entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1);

$this->assertInstanceOf('Carbon\Carbon', $entity->datetime_tz);
$this->assertEquals(Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetime_tz);
$this->assertInstanceOf('Carbon\Carbon', $entity->datetimeTz);
$this->assertEquals(Carbon::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetimeTz);
}

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

$this->em->persist($entity);
$this->assertNull($this->em->flush());
Expand Down Expand Up @@ -153,7 +153,7 @@ public function testImmutableDateGetter(): void
{
$entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1);

$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->date_immutable);
$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->dateImmutable);
$this->assertEquals(
CarbonImmutable::createFromDate(2015, 1, 1, $entity->date->timezone)->format('Y-m-d'),
$entity->date->format('Y-m-d')
Expand All @@ -174,7 +174,7 @@ public function testImmutableDateTimeGetter(): void
{
$entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1);

$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetime_immutable);
$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetimeImmutable);
$this->assertEquals(CarbonImmutable::create(2015, 1, 1, 0, 0, 0), $entity->datetime);
}

Expand All @@ -192,15 +192,15 @@ public function testImmutableDateTimeTzGetter(): void
{
$entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1);

$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetime_tz_immutable);
$this->assertEquals(CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetime_tz);
$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->datetimeTzImmutable);
$this->assertEquals(CarbonImmutable::create(2012, 1, 1, 0, 0, 0, 'US/Pacific'), $entity->datetimeTz);
}

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

$this->em->persist($entity);
$this->assertNull($this->em->flush());
Expand All @@ -210,7 +210,7 @@ public function testImmutableTimeGetter(): void
{
$entity = $this->em->find('DoctrineExtensions\Tests\Entities\CarbonDate', 1);

$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->time_immutable);
$this->assertInstanceOf('Carbon\CarbonImmutable', $entity->timeImmutable);
$this->assertEquals(CarbonImmutable::createFromTime(12, 0, 0, 'Europe/London'), $entity->time);
}

Expand Down

0 comments on commit 7d4f655

Please sign in to comment.