承接 jan-wennrich/logic-gates 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jan-wennrich/logic-gates

最新稳定版本:1.0.0

Composer 安装命令:

composer require jan-wennrich/logic-gates

包简介

Library to simulate circuits using gates like AND, OR, XOR.

README 文档

README

A tiny PHP library for building and simulating digital circuits from simple logic gates (e.g., AND, OR, NOT, XOR) and composing them into larger combinational networks.

✨ Features

  • All common boolean gates:
    • AND & NAND
    • OR & NOR
    • XOR & XNOR
    • NOT & BUFFER
    • IMPLY & NIMPLY
    • TRUE & FALSE
  • Compose gates into circuits by wiring outputs to inputs
  • Zero dependencies
  • Unit tested

📦 Installation

This project is a standard Composer library.

composer require jan-wennrich/logic-gates

🚀 Example

The example shows how the AND gate works:

<?php

require __DIR__ . '/vendor/autoload.php';

use JanW\LogicGates\AndGate;
use JanW\LogicGates\BinaryFalseGate;
use JanW\LogicGates\BinaryTrueGate;

$falseInput = new BinaryFalseGate();
$trueInput = new BinaryTrueGate();

(new AndGate($falseInput, $falseInput))->getOutput()); // returns "false"
(new AndGate($falseInput, $trueInput))->getOutput()); // returns "false"
(new AndGate($trueInput, $falseInput))->getOutput()); // returns "false"
(new AndGate($trueInput, $trueInput))->getOutput()); // returns "true"

🧪 Testing

This library is thoroughly tested in multiple ways:

  • Unit tests via PHPUnit
  • Static analysis via PHPStan
  • PSR-12 code style via PHP_CodeSniffer
  • Dependency validity via Composer Dependency Analyser
  • composer.json schema via composer validate

The tests can be executed after cloning this repository and installing all dev-dependencies:

git clone git@github.com:JanWennrich/Logic-Gates.git
composer install

All tests can be run via the Composer test script:

composer test

Specific tests can be run via their corresponding binaries in vendor/bin/.
To run PHPUnit for example use this command:

vendor/bin/phpunit

📄 License

GPL-3.0 - see LICENSE

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-10-04