Skip to content

Commit

Permalink
attempt phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
tregismoreira committed Jul 22, 2024
1 parent 6c2df10 commit 0317670
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
1 change: 0 additions & 1 deletion modules/social_features/social_event/src/EdaHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 5 additions & 11 deletions src/PHPStan/Stubs/social_eda/DateTime.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}

0 comments on commit 0317670

Please sign in to comment.