PHPackages                             francalek/datatype - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. francalek/datatype

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

francalek/datatype
==================

Useful data types for PHP.

v0.1(3y ago)010MITPHPPHP &gt;=7.1

Since Jul 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/francalek/DataType)[ Packagist](https://packagist.org/packages/francalek/datatype)[ RSS](/packages/francalek-datatype/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Useful data types for PHP
=========================

[](#useful-data-types-for-php)

[![](https://camo.githubusercontent.com/c1ab3b9750dc52878ab47a16baa5ee17e30da8fdd74b557578dc3573e0d05301/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6672616e63616c656b2f64617461747970652e7376673f7374796c653d666c617426736f72743d73656d766572)](https://github.com/francalek/datatype/releases/)[![](https://camo.githubusercontent.com/fa0113281f86b56f8ba61f583e25726cf57179da88060c54e1b98629e6a03ec4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6672616e63616c656b2f64617461747970652e7376673f7374796c653d666c6174)](https://github.com/francalek/datatype/blob/main/LICENSE.md)[![](https://camo.githubusercontent.com/8ff6192f39e51af0836de6a03d261b1bb18bada0260c0e617969157727373da3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6672616e63616c656b2f64617461747970652e7376673f7374796c653d666c6174)](https://github.com/francalek/datatype/blob/main/LICENSE.md)[![](https://camo.githubusercontent.com/faa754b9c2d081eea51386f90a405dd68c4113ede95934ba267e1728b179145b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6672616e63616c656b2f64617461747970652f7068702e796d6c3f7374796c653d666c6174)](https://github.com/francalek/DataType/actions/workflows/php.yml)

Requirements
------------

[](#requirements)

This package works with **PHP &gt;= 7.1**

Installation
------------

[](#installation)

The best way to install this package is using [Composer](https://getcomposer.org/):

```
$ composer require francalek/datatype
```

Usage
-----

[](#usage)

### CountableIterator

[](#countableiterator)

This abstract class implements only [\\Countable](https://www.php.net/manual/en/class.countable.php) and [\\Iterator](https://www.php.net/manual/en/class.iterator) interfaces and has own storage.

Data for iterating and counting must be in protected property `$this->countableIterator`.

```
use Francalek\DataType\CountableIterator;

class Sheeps extends CountableIterator
{
	public function __construct(int $sheeps = 5)
	{
		$herd = array_fill(0, $sheeps, 'Sheep');
		$this->countableIterator = $herd;
	}
}
```

And now you can iterating through your class:

```
echo "I can't sleep :(\n";

$sheeps = new Sheeps();
foreach ($sheeps as $nr => $sheep) {
	echo $sheep.' '.(++$nr)."\n";
}

exit("Chrrr...\n");
```

Or counting:

```
echo "I can't sleep :(\n";

$sheeps = new Sheeps();
echo "I have ".count($sheeps)." sheeps in total.\n";

exit("Chrrr...\n");
```

Run tests
---------

[](#run-tests)

To run tests:

```
$ git clone https://github.com/francalek/DataType.git
$ cd DataType/
$ ./tests/run.sh

# Or over Composer
$ composer tests
```

Contribute
----------

[](#contribute)

- If you found a bug or have an idea for a new feature, you can create [new Issue](https://github.com/francalek/DataType/issues).
- [Fork this repository](https://github.com/francalek/DataType/fork) to start adding new features, fixing bugs or creating more tests.
- Don't forget send a pull request to get your changes in this package.
- Read full text of [Contributing](./CONTRIBUTING.md).

License
-------

[](#license)

This package is licensed under the [MIT License](./LICENSE.md).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1404d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/181b8b984946e62372a42c6535166fd4cbce5c8daecc4a80a82bc07f771e00f9?d=identicon)[francalek](/maintainers/francalek)

---

Top Contributors

[![francalek](https://avatars.githubusercontent.com/u/25299545?v=4)](https://github.com/francalek "francalek (8 commits)")

---

Tags

phpdatatype

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/francalek-datatype/health.svg)

```
[![Health](https://phpackages.com/badges/francalek-datatype/health.svg)](https://phpackages.com/packages/francalek-datatype)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
