Skip to content

Commit

Permalink
Merge pull request #13 from inpsyde/fix/DEVM-39-deprecated-notices
Browse files Browse the repository at this point in the history
Fix PHP8.1 deprecated notices
  • Loading branch information
Chrico authored May 17, 2023
2 parents 08437af + 24fe3b9 commit 9c289fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/DataValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function get_error_data( $error_code = NULL ) {
/**
* @inheritdoc
*/
public function count() {
public function count(): int {

return array_sum( array_map( 'count', $this->validators ) );
}
Expand Down
6 changes: 3 additions & 3 deletions src/Error/ErrorLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ public function merge( ErrorLoggerInterface $logger ) {
/**
* @inheritdoc
*/
public function count() {
public function count(): int {

return array_sum( array_map( 'count', $this->errors ) );
}

/**
* @inheritdoc
*/
public function getIterator() {
public function getIterator() : \Traversable {

return new \RecursiveIteratorIterator( new \RecursiveArrayIterator( $this->errors ) );
}
Expand Down Expand Up @@ -326,4 +326,4 @@ private function as_string( $value ) {

return $type . (string) $value;
}
}
}
4 changes: 2 additions & 2 deletions src/Error/WordPressErrorLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function __construct( array $messages = [ ] ) {
/**
* @inheritdoc
*/
public function getIterator() {
public function getIterator(): \Traversable {

return $this->logger->getIterator();
}
Expand Down Expand Up @@ -318,7 +318,7 @@ public function merge( ErrorLoggerInterface $logger ) {
/**
* @inheritdoc
*/
public function count() {
public function count(): int {

return $this->logger->count();
}
Expand Down

0 comments on commit 9c289fc

Please sign in to comment.