dszczer/oscillator

PHP硬件振荡器或任何同步驱动系统的模拟器

1.0.0 2024-03-04 22:34 UTC

This package is auto-updated.

Last update: 2024-09-04 23:50:22 UTC


README

驱动系统的摘要

抽象类型

双稳态振荡器

具有2个稳态的双稳态多谐振荡器。通常实现为具体的布尔值

declare(strict_types=1);

namespace Dszczer\Oscillator;

use Dszczer\Oscillator\BistableOscillatorInterface;

final class BistableOscillator implements BistableOscillatorInterface
{
    private $oscillatorState = false;

    /**
     * @inheritDoc
     */
    public function getOscillatorState(): bool
    {
        return $this->oscillatorState;
    }

    /**
     * @inheritDoc
     */
    public function tick(): void
    {
        $this->oscillatorState = !$this->oscillatorState;
    }
}