PHPackages                             bggardner/static-tools - 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. bggardner/static-tools

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

bggardner/static-tools
======================

Helpful static class methods for data-driven web apps

02PHP

Since Oct 29Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/bggardner/static-tools)[ Packagist](https://packagist.org/packages/bggardner/static-tools)[ RSS](/packages/bggardner-static-tools/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Common utility classes and methods with (mostly) static usage
=============================================================

[](#common-utility-classes-and-methods-with-mostly-static-usage)

About
-----

[](#about)

These tools represent functionality common to many website I have created, in which most interface with a relational database. Many of these sites use multiple files with `includes` that make variable management cumbersome, as top-level PHP variables are globally scoped across all included files. While moving from globally scoped variables to static class methods doesn't exactly solve anything, I believe it to be slight more elegant. Two of the most command and/or useful "static" classes in this repository are `PDO` and `QueryString`.

### PDO

[](#pdo)

The `PDO` class is simply a wrapper for a `\PDO` instance, so you can statically call any `\PDO` method as you would with a normal instance. The `PDO` class has two additional static methods:

- `connect(...)`, which follows the syntax for `\_PDO::construct()` and must be called before calling any other static method.
- `execute(string $query, array $values)`, which is a combination of `\PDO::prepare()` and `\PDO::bindValue`. The first argument is a SQL query, and the second argument is an array of typed parameters whose values are to be bound to the query, having the format `['value' => $value, 'type' => \PDO::PARAM_*]`.

### QueryString

[](#querystring)

While accessing query string variables is simple using `$_GET`, the QueryString class allows for easy manipulation and generation of complete query strings. It extends the `\ArrayObject` class, and is manipulated using non-static methods, but the `get()` static method returns a new instance.

### Bootstrap

[](#bootstrap)

Many of the sites I create use the [Bootstrap](https://getbootstrap.com/) frontend toolkit, and this static class provides simple creation for a few common elements, including:

- Alerts (optionally dismissible)
- Modals (optionally static)
- Pagination
- Hyperlinked Sort-control icons for multi-column sorting of data (uses [Bootstrap Icons](https://icons.getbootstrap.com/))

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance43

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1537777?v=4)[bggardner](/maintainers/bggardner)[@bggardner](https://github.com/bggardner)

---

Top Contributors

[![bggardner](https://avatars.githubusercontent.com/u/1537777?v=4)](https://github.com/bggardner "bggardner (2 commits)")

### Embed Badge

![Health badge](/badges/bggardner-static-tools/health.svg)

```
[![Health](https://phpackages.com/badges/bggardner-static-tools/health.svg)](https://phpackages.com/packages/bggardner-static-tools)
```

###  Alternatives

[viison/address-splitter

Tries to split an address line into street name, house number and other additional information like building, apartment information etc.

1044.9M24](/packages/viison-address-splitter)

PHPackages © 2026

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