PHP code example of filmtools / ndeviation

1. Go to this page and download the library: Download filmtools/ndeviation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

filmtools / ndeviation example snippets



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"

use FilmTools\NDeviation\NDeviationInterface;

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


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

public function getNDeviation() : NDeviationInterface;