If you walk through a big city and try to find your way around, you might try asking people for directions. However, asking nn people for directions might result in nn different sets of directions. But you believe in the law of averages: if you consider everyone’s advice, then you will have a good idea of where to go by computing the average destination that they all lead to. You would also like to know how far off were the worst directions. You compute this as the maximum straight-line distance between each direction’s destination and the averaged destination.
- PHP >= 7
$ composer install
$ docker-compose up -d$ docker exec -i -t test_php bash$ composer install./bin/console filename
$ docker-compose up -d$ docker exec -i -t test_php bash$ composer install./vendor/bin/phpunit
$file = new SplFileObject($filePath);
$dd = new DifferentDirections($file, new Directions());
echo (string)$dd;$filePath - Path to exist file