Skip to content

Commit

Permalink
phpcs Assets/Middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Oct 28, 2024
1 parent ef30dc0 commit 8f7e1c3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
12 changes: 8 additions & 4 deletions tests/Assets/Middleware/BindableEntity.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<?php

declare(strict_types=1);

namespace LaravelDoctrineTest\ORM\Assets\Middleware;

use function strtolower;

class BindableEntity
{
public $id;
public int $id;

public $name;
public string $name;

public function getId()
public function getId(): int
{
return $this->id;
}

public function getName()
public function getName(): string
{
return strtolower($this->name);
}
Expand Down
12 changes: 8 additions & 4 deletions tests/Assets/Middleware/BindableEntityWithInterface.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?php

declare(strict_types=1);

namespace LaravelDoctrineTest\ORM\Assets\Middleware;

use LaravelDoctrine\ORM\Contracts\UrlRoutable;

use function strtolower;

class BindableEntityWithInterface implements UrlRoutable
{
public $id;
public int $id;

public $name;
public string $name;

public function getId()
public function getId(): int
{
return $this->id;
}

public function getName()
public function getName(): string
{
return strtolower($this->name);
}
Expand Down
17 changes: 11 additions & 6 deletions tests/Assets/Middleware/EntityController.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
<?php

declare(strict_types=1);

namespace LaravelDoctrineTest\ORM\Assets\Middleware;

use Illuminate\Http\Request;

class EntityController
{
public function index(BindableEntity $entity)
public function index(BindableEntity $entity): string
{
return $entity->getName();
}

public function interfacer(BindableEntityWithInterface $entity)
public function interfacer(BindableEntityWithInterface $entity): int
{
return $entity->getId();
}

public function returnValue(string $value)
public function returnValue(string $value): string
{
return $value;
}

public function returnEntity(BindableEntity $entity = null) {
public function returnEntity(BindableEntity|null $entity = null): BindableEntity|null
{
return $entity;
}

public function returnEntityName(BindableEntity $entity) {
public function returnEntityName(BindableEntity $entity): string
{
return $entity->getName();
}

public function checkRequest(Request $request) {
public function checkRequest(Request $request): string
{
return $request instanceof Request ? 'request' : 'something else';
}
}

0 comments on commit 8f7e1c3

Please sign in to comment.