Download the PHP package chippyash/logic-matrix without Composer

On this page you can find all versions of the php package chippyash/logic-matrix. 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 logic-matrix

chippyash/logical-matrix

Quality Assurance

PHP 5.6 PHP 7 Build Status Test Coverage Code Climate

See the Test Contract

Please note that developer support for PHP5.4 & 5.5 was withdrawn at version 3.0.0 of this library. If you need support for PHP 5.4 or 5.5, please use a version >=2,<3

What?

This library aims to provide logic matrix functionality and builds on the chippyash/Matrix matrix data structure library:

When

The current library covers basic logical matrix manipulation.

If you want more, either suggest it, or better still, fork it and provide a pull request.

Check out chippyash/Matrix for Matrix data type support.

Check out chippyash/Math-Matrix for mathematical matrix operations

Check out ZF4 Packages for more packages

Operations supported

The library is released under the GNU GPL V3 or later license

How

Please see the chippyash/Matrix for underlying functionality. Anything you can do with a Matrix, you can do with a LogicalMatrix.

Coding Basics

A LogicalMatrix is a matrix for which all entries are a boolean value; true or false

A shortcut for a single item matrix is to supply a single array

    use chippyash\Logic\Matrix\LogicalMatrix;

    $mA = new LogicalMatrix([]);  //empty matrix
    $mA = new LogicalMatrix([[]]);  //empty matrix
    $mA = new LogicalMatrix([true]);  //single item matrix
    $mA = new LogicalMatrix([2, false]);  //1x2 matrix
    $mA = new LogicalMatrix([2, false],[true, 'foo']);  //2x2 matrix

N.B. A matrix construction values are converted to their boolean equivalent, so '' = false, 'foo' = true, 1 = true, 0 = false etc, according to normal PHP casting rules for boolean.

As with any TDD application, the tests tell you everything you need to know about the SUT. Read them! However for the short of temper amongst us, the salient points are:

A Logical Matrix type is supplied

Logical Matrices have additional attributes over and above a Matrix

    //assuming $mA is a LogicalMatrix - this will return true
    if ($mA->is('Logical')) {}
    //is the same as, which can also be used on ordinary matrices
    $attr = new Logic\Matrix\Attribute\IsLogical();
    if ($attr($mA) {}

Logical Matrices have operations

    $mC = $mA("AndMatrix", $mB);
    //same as :
    $op = new Logic\Matrix\Operation\AndMatrix;
    $mC = $op($mA, $mB);

The following operations are supplied:

The magic invoke methods allow you to write in a functional way

        $fAnd = new AndMatrix();
        $fOr = new OrOperand();
        //($mA && $mB) || true
        return $fOr($fAnd($mA, $mB), true);

Changing the library

  1. fork it
  2. write the test
  3. amend it
  4. do a pull request

Found a bug you can't figure out?

  1. fork it
  2. write the test
  3. do a pull request

NB. Make sure you rebase to HEAD before your pull request

Where?

The library is hosted at Github. It is available at Packagist.org

Installation

Install Composer

For production

add

    "chippyash/logical-matrix": "~2.0"

to your composer.json "requires" section

For development

Clone this repo, and then run Composer in local repo root to pull in dependencies

    git clone [email protected]:chippyash/Logical-matrix.git LogicMatrix
    cd LogicMatrix
    composer update

To run the tests:

    cd LogicMatrix
    vendor/bin/phpunit -c test/phpunit.xml test/

License

This software library is released under the BSD 3 Clause license

This software library is Copyright (c) 2014-2018, Ashley Kitson, UK

History

V0... pre releases

V1.0.0 Original release

V1.0.5 Update for underlying library dependency

V1.0.6 Update phpunit version

V2.0.0 BC Break: change namespace from chippyash to Chippyash

V2.0.1 Add link to packages

V2.0.2 Verify PHP7 compatibility

V2.0.3 Update build script

V3.0.0 BC Break. Withdraw support for old PHP versions

V3.1.0 Change of license from GPL V3 to BSD 3 Clause


All versions of logic-matrix with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
chippyash/matrix Version >=3,<4
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 chippyash/logic-matrix contains the following files

Loading the files please wait ...