szepeviktor / empty-string
Global helper to check whether a value is a non-empty string.
v1.0.1
2026-06-07 03:35 UTC
Requires
- php: ^8.1
Requires (Dev)
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-06-07 03:41:32 UTC
README
Minimal Composer package that exposes one global helper:
is_non_empty_string(mixed $value): bool
It returns true only when the value is a string and not exactly ''.
Installation
composer require szepeviktor/empty-string
Usage
<?php require __DIR__ . '/vendor/autoload.php'; is_non_empty_string('hello'); // true is_non_empty_string(' '); // true is_non_empty_string(''); // false is_non_empty_string(123); // false
Contract
truefor any string except''truefor whitespace-only stringsfalsefor all non-string values
Local QA
composer lint composer phpunit composer phpstan composer qa