PHPackages                             myskewhell/tuple - 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. myskewhell/tuple

Abandoned → [bentools/where](/?search=bentools%2Fwhere)Library[Utility &amp; Helpers](/categories/utility)

myskewhell/tuple
================

Tuple management

1.5(10y ago)03381MITPHPPHP &gt;=5.4

Since Mar 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bpolaszek/myskewhell-tuple)[ Packagist](https://packagist.org/packages/myskewhell/tuple)[ Docs](https://github.com/bpolaszek/myskewhell-tuple)[ RSS](/packages/myskewhell-tuple/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (10)Used By (0)

**This package is abandoned. Consider upgrading to [bentools/where](https://github.com/bpolaszek/where), a very easy way to generate conditions and full queries on the fly.**

MySkewHell - Tuple
==================

[](#myskewhell---tuple)

An intuitive way to work with MySql prepared statements.

Use the PHP array syntax to dynamically add conditions on a SQL query.

Each value will be transfomed to a placeholder ; you can then bind each placeholder to its value.

Building a query : working with placeholders and values
-------------------------------------------------------

[](#building-a-query--working-with-placeholders-and-values)

#### positional placeholders (default)

[](#positional-placeholders-default)

```
$sql        =   "SELECT * FROM users WHERE 1" . PHP_EOL;
$tuples     =   new TupleANDWrapper();
$tuples[]   =   ['nickname' => 'johndoe'];
$tuples[]   =   ['firstname', '=', 'John'];
$tuples[]   =   ['lastname', 'LIKE', 'Doe'];
$tuples[]   =   new TupleORWrapper([
                                    ['active' => true],
                                    ['date_registered', 'BETWEEN', ['2015-01-01', '2015-01-30']]
                                    ]);
$tuples[]   =   ['id_group', 'NOT IN', [5, 8, 15]];
$tuples[]   =   ['nb_logins', '>=', 2];
$tuples[]   =   "lastloggedin = ?"
['my_column', '>', 2]; // will output "`my_column` > ?"
['my_column', ' 'my_string']; // will output "`my_column` = ?"
```

Wrappers
--------

[](#wrappers)

#### "AND" wrapper

[](#and-wrapper)

```
$tuples     =   new TupleANDWrapper();
$tuples[]   =   ['my_column', 'IN', [5, 3]]; // will output "`my_column` IN (?, ?)"
$tuples[]   =   ['my_column', 'NOT IN', [8, 6, 9, 12]]; // will output "`my_column` NOT IN (?, ?, ?, ?)"
var_dump((string) $tuples)); // will output "(`my_column` IN (?, ?) AND `my_column` NOT IN (?, ?, ?, ?))"
```

#### "OR" wrapper

[](#or-wrapper)

```
$tuples     =   new TupleORWrapper();
$tuples[]   =   ['my_column', 'IN', [5, 3]]; // will output "`my_column` IN (?, ?)"
$tuples[]   =   ['my_column', 'NOT IN', [8, 6, 9, 12]]; // will output "`my_column` NOT IN (?, ?, ?, ?)"
var_dump((string) $tuples)); // will output "(`my_column` IN (?, ?) OR `my_column` NOT IN (?, ?, ?, ?))"
```

#### "String" wrapper

[](#string-wrapper)

```
$tuples     =   new TupleORWrapper();
$tuples[]   =   ['my_column', 'BETWEEN', ['2015-01-01', '2015-01-30']]
$tuples[]   =   "`another_column` >= CURRENT_DATE - INTERVAL 3 DAY"
var_dump((string) $tuples)); // will output "(`my_column` BETWEEN ? AND ? OR `another_column` >= CURRENT_DATE - INTERVAL 3 DAY"
```

Installation
============

[](#installation)

Add the following line into your composer.json :

```
{
    "require": {
        "myskewhell/tuple": "dev-master"
    }
}

```

Enjoy.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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

Every ~33 days

Recently: every ~46 days

Total

9

Last Release

3812d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acdd1a8ee0e657ddd06cf11f98a32100ef7121afb8aa270a5b295f5c29c038b3?d=identicon)[bpolaszek](/maintainers/bpolaszek)

---

Top Contributors

[![ben-synapse](https://avatars.githubusercontent.com/u/36077477?v=4)](https://github.com/ben-synapse "ben-synapse (5 commits)")[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (3 commits)")[![marwahaha](https://avatars.githubusercontent.com/u/2541209?v=4)](https://github.com/marwahaha "marwahaha (1 commits)")

### Embed Badge

![Health badge](/badges/myskewhell-tuple/health.svg)

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

PHPackages © 2026

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