Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Releases: caltechlibrary/safer-php

0.0.3, legacy release

29 Oct 20:27

Choose a tag to compare

Updated safer.php and safer_test.php to PHP 8.3. This release for done to support porting legacy etd-workflow repository to run under PHP 8.3.

Full Changelog: v0.0.2...v0.0.3

Enforce Defaults option

17 Feb 19:09

Choose a tag to compare

The safer() function now has an enforceDefaults option. If true then keys defined in the validation map are will be returned with defaults values in the associative array from calls to safer().

     $a = safer([], [
        'i' => 'integer',
        'name' => 'text',
     ], false, true);
     print('i is ' . $a['i'] . ' (zero) and name is "' . $a['name'] . '" (an empty string)' . PHP_EOL);

This would display something like

    i is 0 (zero) and name is "" (an empty string) 

Initial proof of concept

03 Jan 23:38

Choose a tag to compare

This is a tiny library for retrofitting legacy PHP apps with some simple input vetting.