Completed
Push — master ( 2724b8...8680a4 )
by Johnny
01:51
created

examples/index.php (2 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require '../vendor/autoload.php';
3
use Redbox\Distance;
4
5
$p1 = new Distance\GeoPoint(52.364533, 4.820374); /* Amsterdam */
6
$p2 = new Distance\GeoPoint(51.925538, 4.471867); /* Rotterdam */
7
8
$tool = new Distance\CalculateDistance();
9
$distance = $tool->setSource($p1)
0 ignored issues
show
The method setDestination() does not seem to exist on object<Redbox\Distance\CalculateDistance>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
10
                 ->setDestination($p2)
11
                 ->setUseSslVerifier(false)
12
                 ->getDistanceInKM();
13
14
echo "<h2>Example 1</h2><br>";
15
echo 'The calculated distance is: '.$distance.' KM<br>';
16
17
$p1 = new Distance\GeoZipCode('1781 GC'); /* Den Helder */
18
$p2 = new Distance\GeoZipCode("2011 SR"); /* Haarlem */
19
20
21
$tool = new Distance\CalculateDistance();
22
$distance = $tool->setSource($p1)
0 ignored issues
show
The method setDestination() does not seem to exist on object<Redbox\Distance\CalculateDistance>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
                 ->setDestination($p2)
24
                 ->setUseSslVerifier(false)
25
                 ->getDistanceInKM();
26
27
echo "<h2>Example 2</h2><br>";
28
echo 'The calculated distance is: '.$distance.' KM';
29