Skip to content
[Package] A compatibility library like "Six", but between Python and PHP :)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests/array
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
Makefile
README.md
composer.json
composer.lock
phpunit.xml

README.md

Build Status codecov

Seven

Seven: a compatibility library like "Six", but between Python and PHP :)

A simple toolbox containing all the pieces of Python (functions, methods, etc.) that are missing or differently implemented in PHP.
It's useful for making easier the porting of a project (Python to PHP) or as a support for a polyglot or Python developer writing in PHP.

Table of Contents

Setup

PHP

Tested and developed on version: 7.2.*

Requirements

Use Composer to install the requirements needed

composer install

Usage

All the helper functions are outside namespaces and autoloaded by Composer to be used wherever in the code as globals.

Example

Example: use the array_setdefault helper function

// With default value
$result = array_setdefault($array, $key, $default);
// Without default value
$result = array_setdefault($array, $key);

Development

General

All the needed commands are listed as GNU make target rules in the Makefile file.
Each subfolder could contain a local Makefile file, if needed.

Code

The source code is hosted on GitHub.

Setup

Use Composer to install also the requirements for development and testing (Composer's default behavior)

composer install

or use the make rule:

make develop

Testing

Tests are executed using PHPUnit also for coverage.

Contributing

Pull requests are welcome!

For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Author

Nicola Costantino

License

MIT as listed in LICENSE file
Copyright (c) 2019 Nicola Costantino

You can’t perform that action at this time.