PHP code example of lukaszmakuch / class-based-registry
1. Go to this page and download the library: Download lukaszmakuch/class-based-registry 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/ */
lukaszmakuch / class-based-registry example snippets
class Animal {}
class Elephant extends Animal {}
class Plant {}
$r = new \lukaszmakuch\ClassBasedRegistry\ClassBasedRegistry();
$r->fetchValueByObjects([new Plant(), new Elephant()]); //1970
try {
$r->fetchValueByObjects([new Plant()]);
} catch (\lukaszmakuch\ClassBasedRegistry\Exception\ValueNotFound $e) {
//it was not possible to fetch any value by a plant
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.