Skip to content

Commit a62a443

Browse files
authored
Merge pull request #637 from TomHAnderson/hotfix/tests-phpcs
Hotfix/tests phpcs
2 parents de450e5 + 806b106 commit a62a443

33 files changed

+147
-75
lines changed

tests/Assets/AnotherListenerStub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets;
46

57
class AnotherListenerStub

tests/Assets/Auth/AuthenticableMock.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Auth;
46

57
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;

tests/Assets/Auth/AuthenticableWithNonEmptyConstructorMock.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Auth;
46

57
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
@@ -9,6 +11,7 @@ class AuthenticableWithNonEmptyConstructorMock implements AuthenticatableContrac
911
{
1012
use Authenticatable;
1113

14+
/** @param string[] $passwords */
1215
public function __construct(array $passwords)
1316
{
1417
$this->password = $passwords[0];
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Auth\Passwords;
46

57
use Illuminate\Contracts\Auth\CanResetPassword;
@@ -8,20 +10,18 @@ class UserMock implements CanResetPassword
810
{
911
/**
1012
* Get the e-mail address where password reset links are sent.
11-
* @return string
1213
*/
13-
public function getEmailForPasswordReset()
14+
public function getEmailForPasswordReset(): string
1415
{
1516
1617
}
1718

1819
/**
1920
* Send the password reset notification.
20-
*
21-
* @param string $token
22-
* @return void
2321
*/
24-
public function sendPasswordResetNotification($token)
22+
// phpcs:disable
23+
public function sendPasswordResetNotification($token): void
2524
{
2625
}
26+
// phpcs:enable
2727
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Configuration;
46

57
use Doctrine\DBAL\Platforms\AbstractPlatform;
68
use Doctrine\DBAL\Types\Type;
79

810
class TypeMock extends Type
911
{
12+
/** @param string[] $column */
1013
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
1114
{
1215
return '';
1316
}
1417

15-
public function getName()
18+
public function getName(): void
1619
{
1720
}
1821
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Configuration;
46

57
use Doctrine\DBAL\Platforms\AbstractPlatform;
68
use Doctrine\DBAL\Types\Type;
79

810
class TypeMock2 extends Type
911
{
12+
/** @param string[] $column */
1013
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
1114
{
1215
return '';
1316
}
1417

15-
public function getName()
18+
public function getName(): void
1619
{
1720
}
1821
}

tests/Assets/Decorator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets;
46

57
use Doctrine\ORM\Decorator\EntityManagerDecorator;

tests/Assets/Entity/Foo.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Entity;
46

57
class Foo
68
{
7-
private $id;
9+
private int $id;
810

9-
private $name;
11+
private string $name;
1012
}

tests/Assets/Entity/Scientist.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Entity;
46

7+
use Doctrine\Common\Collections\Collection;
58
use Doctrine\ORM\Mapping as ORM;
9+
use Theory;
610

7-
#[ORM\Entity(repositoryClass: "LaravelDoctrineTest\ORM\Assets\Repository\ScientistRepository")]
11+
#[ORM\Entity(repositoryClass: 'LaravelDoctrineTest\ORM\Assets\Repository\ScientistRepository')]
812
class Scientist
913
{
1014
#[ORM\Id]
11-
#[ORM\Column(type: "integer")]
12-
#[ORM\GeneratedValue(strategy: "AUTO")]
13-
private $id;
15+
#[ORM\Column(type: 'integer')]
16+
#[ORM\GeneratedValue(strategy: 'AUTO')]
17+
private int $id;
1418

15-
#[ORM\Column(type: "string", nullable: true)]
16-
private $firstName;
19+
#[ORM\Column(type: 'string', nullable: true)]
20+
private string $firstName;
1721

18-
#[ORM\Column(type: "string", nullable: false)]
19-
private $lastName;
22+
#[ORM\Column(type: 'string', nullable: false)]
23+
private string $lastName;
2024

21-
#[ORM\OneToMany(targetEntity: \Theory::class, mappedBy: "scientist")]
22-
private $theories;
25+
/** @var Collection|Theory[] */
26+
#[ORM\OneToMany(targetEntity: Theory::class, mappedBy: 'scientist')]
27+
private Collection $theories;
2328
}

tests/Assets/Entity/Theory.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace LaravelDoctrineTest\ORM\Assets\Entity;
46

57
use Doctrine\ORM\Mapping as ORM;
8+
use Scientist;
69

7-
#[ORM\Entity(repositoryClass: "LaravelDoctrineTest\ORM\Assets\Repository\TheoryRepository")]
10+
#[ORM\Entity(repositoryClass: 'LaravelDoctrineTest\ORM\Assets\Repository\TheoryRepository')]
811
class Theory
912
{
1013
#[ORM\Id]
11-
#[ORM\Column(type: "integer")]
12-
#[ORM\GeneratedValue(strategy: "AUTO")]
13-
private $id;
14+
#[ORM\Column(type: 'integer')]
15+
#[ORM\GeneratedValue(strategy: 'AUTO')]
16+
private int $id;
1417

15-
#[ORM\Column(type: "string", nullable: false)]
16-
private $title;
18+
#[ORM\Column(type: 'string', nullable: false)]
19+
private string $title;
1720

18-
#[ORM\ManyToOne(targetEntity: \Scientist::class, inversedBy: "theories")]
19-
#[ORM\JoinColumn(name: "scientist_id", referencedColumnName: "id", nullable: false)]
20-
private $scientist;
21+
#[ORM\ManyToOne(targetEntity: Scientist::class, inversedBy: 'theories')]
22+
#[ORM\JoinColumn(name: 'scientist_id', referencedColumnName: 'id', nullable: false)]
23+
private Scientist $scientist;
2124
}

0 commit comments

Comments
 (0)