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

Breadcrumb

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

function ArrayCountToken::isCountable

Returns true if object is either array or instance of \Countable

@phpstan-assert-if-true array<mixed>|\Countable $argument

Parameters

mixed $argument:

Return value

bool

1 call to ArrayCountToken::isCountable()
ArrayCountToken::scoreArgument in vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php
Scores 6 when argument has preset number of elements.

File

vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ArrayCountToken.php, line 72

Class

ArrayCountToken
Array elements count token.

Namespace

Prophecy\Argument\Token

Code

private function isCountable($argument) {
    return is_array($argument) || $argument instanceof \Countable;
}

API Navigation

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