From 0317670e92c1359a201131435e8c1ab8ec9e104c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thiago=20R=C3=A9gis?= Date: Mon, 22 Jul 2024 13:38:52 -0300 Subject: [PATCH] attempt phpstan --- .../social_event/src/EdaHandler.php | 1 - phpstan.neon | 14 +++++++------- src/PHPStan/Stubs/social_eda/DateTime.stub | 16 +++++----------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/modules/social_features/social_event/src/EdaHandler.php b/modules/social_features/social_event/src/EdaHandler.php index 86ff6f0946d..06891cfa63e 100644 --- a/modules/social_features/social_event/src/EdaHandler.php +++ b/modules/social_features/social_event/src/EdaHandler.php @@ -4,7 +4,6 @@ use CloudEvents\V1\CloudEvent; use Drupal\Component\Uuid\UuidInterface; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\node\NodeInterface; use Drupal\social_eda\Types\Address; diff --git a/phpstan.neon b/phpstan.neon index c4a6c169642..76d7fa03926 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -72,10 +72,10 @@ parameters: # Stub files provide type information for classes and functions that are # otherwise difficult to analyze, improving the accuracy of PHPStan's checks. stubFiles: - - src/PHPStan/Stubs/social_eda/Address.stub - - src/PHPStan/Stubs/social_eda/DateTime.stub - - src/PHPStan/Stubs/social_eda/Entity.stub - - src/PHPStan/Stubs/social_eda/Href.stub - - src/PHPStan/Stubs/social_eda/User.stub - - src/PHPStan/Stubs/social_eda_dispatcher/Dispatcher.stub - - src/PHPStan/Stubs/social_eda_dispatcher/CloudEvent.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda/Address.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda/DateTime.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda/Entity.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda/Href.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda/User.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda_dispatcher/Dispatcher.stub + - %currentWorkingDirectory%/html/profiles/contrib/social/src/PHPStan/Stubs/social_eda_dispatcher/CloudEvent.stub diff --git a/src/PHPStan/Stubs/social_eda/DateTime.stub b/src/PHPStan/Stubs/social_eda/DateTime.stub index c306e002c5c..2ac9ca863b9 100644 --- a/src/PHPStan/Stubs/social_eda/DateTime.stub +++ b/src/PHPStan/Stubs/social_eda/DateTime.stub @@ -6,31 +6,25 @@ namespace Drupal\social_eda\Types; class DateTime { /** - * Creates a DateTime object from a timestamp. - * - * @param int $timestamp + * @param callable $timestamp * * @return self */ - public static function fromTimestamp(int $timestamp): self { - return new self(); + public static function fromTimestamp(callable $timestamp): self { + // TODO: Implement fromTimestamp() method. } /** - * Converts the DateTime object to a string. - * * @return string */ public function toString(): string { - return ''; + // TODO: Implement toString() method. } /** - * Converts the DateTime object to an immutable DateTime. - * * @return \DateTimeImmutable */ public function toImmutableDateTime(): \DateTimeImmutable { - return new \DateTimeImmutable(); + // TODO: Implement toImmutableDateTime() method. } }