PHPackages                             phariscope/safephp - 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. phariscope/safephp

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

phariscope/safephp
==================

A PHP library complementary to SafePHP containing currently unsupported functions.

1.0.3(1y ago)04.3k↑183.3%3MITPHPPHP &gt;=8.0

Since Oct 15Pushed 8mo agoCompare

[ Source](https://github.com/phariscope/SafePHP)[ Packagist](https://packagist.org/packages/phariscope/safephp)[ Docs](https://github.com/phariscope/SafePHP)[ RSS](/packages/phariscope-safephp/feed)WikiDiscussions 1.x Synced yesterday

READMEChangelog (5)Dependencies (6)Versions (6)Used By (3)

Phariscope Safe PHP
===================

[](#phariscope-safe-php)

A set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered.

These functions complement those of the excellent SafePHP tool .

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

[](#installation)

```
composer require phariscope/safephp
```

Usage
=====

[](#usage)

```
use function SafePHP\boolval;
use function SafePHP\floatval;
use function SafePHP\intval;
use function SafePHP\strval;

use function SafePHP\hash_file;

use function SafePHP\getenv;
use function SafePHP\getenvOrWithENV;

$value = boolval(1); // return true
$value = floatval("123.456"); // return 123.456
$value = intval("123"); // return 123
$value = strval(1); // return "1"

$value = hash_file("md2", $filename); // return a string like "080bf15137e26254e9cd8870b68aec86"

$value = getenv('PWD'); // return string of current PWD
$value = getenv(); // return array of all getenv (be carreful some $_ENV may hav been forgotten)

$value = getenvOrWithENV('PWD'); // return string of current PWD even if it is in $_ENV only
```

To Contribute to phariscope/SafePHP
===================================

[](#to-contribute-to-phariscopesafephp)

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

[](#requirements)

- docker
- git

Install
-------

[](#install)

- git clone :phariscope/Event.git

Unit test
---------

[](#unit-test)

```
bin/phpunit
```

Using Test-Driven Development (TDD) principles (thanks to Kent Beck and others), following good practices (thanks to Uncle Bob and others).

Quality
-------

[](#quality)

- phpcs PSR12
- phpstan level 9
- coverage 100%
- infection MSI &gt;99%

Quick check with:

```
./codecheck
```

Check coverage with:

```
bin/phpunit --coverage-html var
```

and view 'var/index.html' with your browser

Check infection with:

```
bin/infection
```

and view 'var/infection.html' with your browser

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance50

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Every ~183 days

Total

5

Last Release

259d ago

### Community

Maintainers

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

---

Top Contributors

[![frederic100](https://avatars.githubusercontent.com/u/50176793?v=4)](https://github.com/frederic100 "frederic100 (11 commits)")

---

Tags

floatvalSafe PHPstrvalintvalboolval

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phariscope-safephp/health.svg)

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

###  Alternatives

[monsieurbiz/sylius-cms-page-plugin

This plugins allows you to add manage CMS pages using the Rich Editor

44132.6k1](/packages/monsieurbiz-sylius-cms-page-plugin)[the_it_nerd/module-performance

The IT Nerd - Magento 2 Performance Module.

147.6k](/packages/the-it-nerd-module-performance)

PHPackages © 2026

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