State::count()

Counts the number of states.

Table of Contents
  1. Description
  2. Example

Description

State::count(): int;

This method is a requirement to be able to implement the Countable interface and aims to make the object countable via the count() function. This method is public, so it can also be called as how you would call any public methods in general.

Example

$state = new State(['test' => 5]);

test($state->count()); // Returns `1`
test(count($state)); // Returns `1`

State::count()

Counts the number of states.