Download the PHP package wojciech.nawalaniec/phlambda without Composer

On this page you can find all versions of the php package wojciech.nawalaniec/phlambda. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phlambda

[![Build Status](https://travis-ci.com/wnnawalaniec/phlambda.svg?branch=master)](https://travis-ci.com/wnnawalaniec/phlambda) [![Version](http://poser.pugx.org/wojciech.nawalaniec/phlambda/version)](https://packagist.org/packages/wojciech.nawalaniec/phlambda) [![Coverage Status](https://coveralls.io/repos/github/wnnawalaniec/phlambda/badge.svg?branch=master)](https://coveralls.io/github/wnnawalaniec/phlambda?branch=master) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fwnnawalaniec%2Fphlambda%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/wnnawalaniec/phlambda/master) [![Latest Stable Version](http://poser.pugx.org/wojciech.nawalaniec/phlambda/v)](https://packagist.org/packages/wojciech.nawalaniec/phlambda) [![Total Downloads](http://poser.pugx.org/wojciech.nawalaniec/phlambda/downloads)](https://packagist.org/packages/wojciech.nawalaniec/phlambda) [![License](http://poser.pugx.org/wojciech.nawalaniec/phlambda/license)](https://packagist.org/packages/wojciech.nawalaniec/phlambda) [![PHP Version Require](http://poser.pugx.org/wojciech.nawalaniec/phlambda/require/php)](https://packagist.org/packages/wojciech.nawalaniec/phlambda) Small library for PHP with set of usefull functions for functional programming. Features: - set of useful functions helpful in functional programming - all functions are automatically currying - every array can be wrapped with special class which allows for method chaining - first param is always function and the data to be operated will be last param # Table of contents - [Installation](#installation) - [Usage](#usage) - [Docs](#docs) - [Currying](#currying) - [Development Guides](#development-guides) - [Tools](#tools) - [Backstory](#backstory) # Installation To install run: # Usage All functions and constants are in one namespace, so it won't create any conflict with existing ones in your project or other libraries. You can simply import namespaces with alias (for simplification), like this: You can import one or few functions using import like this: There are also constants which can be used in places accepting callbacks, because PHP will resolve them as functions: If you have some array and wish to perform multiple, chained operations on it. You can wrapp it with special object with `_()` function: If you wish to have more readable code you can use a static method from that class instead: `Wrapper::wrap($array)`. If you don't want to use objects you can use just functions. Wrapper's methods are just delegates to those functions, and exists only for chaining purposes. # Docs [Here you can find documentation.](https://wnnawalaniec.github.io/phlambda/packages/Application.html) # Currying What makes that library different from other functional libraries for PHP is that all function are automatically curried. If you don't know what currying functions are let me try to change it. According to [Wikipedia](https://en.wikipedia.org/wiki/Currying): > In mathematics and computer science, currying is the technique of converting a function that takes multiple arguments into a sequence of functions that each takes a single argument. Let's see an example: Because I've decided to implement currying, I've also added placeholder feature. A placeholder is special type you can pass to currying function, if you want to postpone passing of some arguments. Example of placeholder usage: # Development Guides Check out [CONTRIBUTING file](https://github.com/wnnawalaniec/phlambda/blob/master/CONTRIBUTING.md) ## Tools - `make build-docs` - generates HTML documentation. *Requires [Docker](https://www.docker.com/) installed* - `make generate-constants` - generates `src/constants.php` file, for all functions # Backstory PHP was not designed as functional programming language, that's one thing I'm sure. We can create and use anonymous functions, and in `7.4` we even got arrow functions `fn () =>`. Language itself is providing us with some functions like `array_map()` etc. where we can pass an array and some callable to perform some operations on the input. But its... so cumbersome. One day at the company my friend joked about PHP and said that it's sad we can't do something like this in PHP: I thought for a while, and respond with something like this: Both examples are similar, but we can see that with PHP solution we have no way of chaining methods together, also we must write most of that method our selves. After while another idea came up to my mind. We could leverage OOP and create class which implements `\ArrayAccess` so it can be considered array like, and have all that nice methods we can chain together. I thought about something like this: It seemed as a great weekend project so here it is. There are some great functional libraries for JS, but one (pointed by earlier mentioned friend) seemed interesting. It's [Ramda](https://github.com/ramda/ramda). It's interesting because it has all function automatically curried, and it adds some complexity to that project.


All versions of phlambda with dependencies

PHP Build Version
Package Version
Requires php Version ^8
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wojciech.nawalaniec/phlambda contains the following files

Loading the files please wait ...