Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ApproximateValueToken.php

function ApproximateValueToken::scoreArgument

Overrides TokenInterface::scoreArgument

File

vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ApproximateValueToken.php, line 37

Class

ApproximateValueToken
Approximate value token

Namespace

Prophecy\Argument\Token

Code

public function scoreArgument($argument) {
    if (!\is_float($argument) && !\is_int($argument) && !\is_numeric($argument)) {
        return false;
    }
    return round((double) $argument, $this->precision) === round($this->value, $this->precision) ? 10 : false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal