filmtools / films
PHP classes for photo films
1.0.1
2018-01-03 10:22 UTC
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-12-22 09:54:33 UTC
README
PHP classes for photo films
Installation
$ composer require filmtools/films
Usage
Class FilmTools\Films\Film
extends FilmTools\Films\FilmAbstract
implements FilmTools\Films\FilmInterface
<?php use FilmTools\Films\Film; $film = new Film; $film->setManufacturer( "Ilford" ); $film->setName( "HP5+" ); $film->setAsa( 400 ); // Outputs: Ilford HP5+ 400 echo $film; $film->setName(""); $film->setManufacturer("Kentmere"); // Outputs: Kentmere 400 echo $film;
Interfaces
FilmInterface
<?php use FilmTools\Films\FilmInterface; /** * @return string|null */ public function getName(); /** * @return string|null */ public function getManufacturer(); /** * @return int|null */ public function getAsa();
FilmProviderInterface
<?php use FilmTools\Films\FilmProviderInterface; /** * @return FilmInterface|null */ public function getFilm();
FilmAwareInterface extends FilmProviderInterface
<?php use FilmTools\Films\FilmAwareInterface; /** * @param FilmInterface|FilmProviderInterface $film */ public function setFilm( $film );
Traits
FilmProviderTrait
<?php use FilmTools\Films\FilmProviderInterface; use FilmTools\Films\FilmProviderTrait; class MyClass implements FilmProviderInterface { use FilmProviderTrait; }
FilmAwareTrait extends FilmProviderTrait
<?php use FilmTools\Films\FilmAwareInterface; use FilmTools\Films\FilmAwareTrait; class MyClass implements FilmAwareInterface { use FilmAwareTrait; }
Unit testing
$ vendor/bin/phpunit