Skip to content

Commit

Permalink
Add #[Override] where useful
Browse files Browse the repository at this point in the history
New PHP 8.3 attribute to check if the marked method is still
overriding a parent method. Unfortunately, this is -still- a
runtime check and not something for static analysis.
  • Loading branch information
tomudding committed Jan 26, 2024
1 parent 4d46d8c commit 5fa41e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 7 additions & 11 deletions docker/glide/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use League\Glide\Signatures\Signature;
use League\Glide\Signatures\SignatureException;
use League\Glide\Signatures\SignatureFactory;
use Override;

/**
* Override the actual `ServerFactory`, such that our custom `Server` is returned.
Expand All @@ -25,10 +26,9 @@ class GlideServerFactory extends ServerFactory
/**
* Get configured custom server.
*
* TODO: Mark with #[Override]
*
* @return GlideServer Configured Glide server.
*/
#[Override]
public function getServer(): GlideServer
{
$server = new GlideServer(
Expand Down Expand Up @@ -60,10 +60,9 @@ public function getServer(): GlideServer
class GlideServer extends Server
{
/**
* TODO: Mark with #[Override]
* *
* * @inheritDoc
* @inheritDoc
*/
#[Override]
public function outputImage($path, array $params): void
{
// MODIFIED: unset the 'expires' parameter to ensure that we do not generate daily cache files.
Expand Down Expand Up @@ -92,10 +91,9 @@ public function outputImage($path, array $params): void
class GlideSignatureFactory extends SignatureFactory
{
/**
* TODO: Mark with #[Override]
*
* @inheritDoc
*/
#[Override]
public static function create($signKey)
{
return new GlideSignature($signKey);
Expand All @@ -107,10 +105,9 @@ class GlideSignature extends Signature
/**
* MODIFIED: check expiration from the parameters.
*
* TODO: Mark with #[Override]
*
* @inheritDoc
*/
#[Override]
public function validateRequest($path, array $params)
{
if (!isset($params['s'])) {
Expand All @@ -130,10 +127,9 @@ public function validateRequest($path, array $params)
/**
* MODIFIED: use SHA3-256 instead of MD5.
*
* TODO: Mark with #[Override]
*
* @inheritDoc
*/
#[Override]
public function generateSignature($path, array $params): string
{
unset($params['s']);
Expand Down
2 changes: 2 additions & 0 deletions module/Decision/src/Model/SubDecision/Board/Installation.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\OneToOne;
use Override;

/**
* Installation as board member.
Expand Down Expand Up @@ -91,6 +92,7 @@ public function setFunction(string $function): void
*
* @psalm-suppress InvalidNullableReturnType
*/
#[Override]
public function getMember(): Member
{
return $this->member;
Expand Down
2 changes: 2 additions & 0 deletions module/Decision/src/Model/SubDecision/Installation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\ORM\Mapping\OneToOne;
use Override;

/**
* Installation into organ.
Expand Down Expand Up @@ -94,6 +95,7 @@ public function setFunction(string $function): void
*
* @psalm-suppress InvalidNullableReturnType
*/
#[Override]
public function getMember(): Member
{
return $this->member;
Expand Down

0 comments on commit 5fa41e8

Please sign in to comment.