filmtools/ndeviation

用于电影制作中区域系统偏差的接口、类和特性

1.1.2 2021-01-17 11:22 UTC

This package is auto-updated.

Last update: 2024-09-17 19:27:16 UTC


README

区域系统偏差的接口、类和特性

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status

安装

$ composer require filmtools/ndeviation

NDeviation 类

<?php
use FilmTools\NDeviation\NDeviation;
use FilmTools\NDeviation\NDeviationFormatter;

// Short title is optional;
$ndev = new NDeviation( 2 );
$ndev = new NDeviation( 2, "push +2" );

// Grab values
$ndev->getValue(); // 2.0
$ndev->getType(); // "push +2"

// Nice formatting:
$formatter = new NDeviationFormatter;
echo $formatter( $ndev ); // "𝑵 +2"

// …can cope with strings
echo $formatter( "2.2" ); // "𝑵 +2.2"
echo $formatter( "foo" ); // "foo"

接口

NDeviationInterface

use FilmTools\NDeviation\NDeviationInterface;

public function getValue() : ?float;
public function getType() : ?string;
public function valid() : bool;

NDeviationProviderInterface

use FilmTools\NDeviation\NDeviationInterface;
use FilmTools\NDeviation\NDeviationProviderInterface;

public function getNDeviation() : NDeviationInterface;