@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | -foreach($json as $address) { |
|
| 28 | +foreach ($json as $address) { |
|
| 29 | 29 | $addresses[] = Address::fromArray($address); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $parameters = RouteParameters::fromArray(array( |
| 33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
| 34 | 34 | "route_name" => "Single Depot, Multiple Driver, No Time Window", |
| 35 | - "route_date" => time() + 24*60*60, |
|
| 35 | + "route_date" => time() + 24 * 60 * 60, |
|
| 36 | 36 | "route_time" => 60 * 60 * 7, |
| 37 | 37 | "rt" => TRUE, |
| 38 | 38 | "distance_unit" => DistanceUnit::MILES, |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | 28 | |
| 29 | -foreach($json as $address) { |
|
| 29 | +foreach ($json as $address) { |
|
| 30 | 30 | $addresses[] = Address::fromArray($address); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Member; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | // Set the API key in the Route4Me class |
| 13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 14 | 14 | |
| 15 | -$recordParameters=Member::fromArray(array( |
|
| 15 | +$recordParameters = Member::fromArray(array( |
|
| 16 | 16 | 'device_id' => '546546516', |
| 17 | 17 | 'device_type' => 'IPAD', |
| 18 | 18 | 'format' => 'json', |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
| 5 | -require $root . '/vendor/autoload.php'; |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | +require $root.'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
| 8 | 8 | use Route4Me\Member; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | // Set the API key in the Route4Me class |
| 13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 14 | 14 | |
| 15 | -$recordParameters=Member::fromArray(array( |
|
| 15 | +$recordParameters = Member::fromArray(array( |
|
| 16 | 16 | 'member_id' => 777777, |
| 17 | 17 | 'session_guid' => '454563', |
| 18 | 18 | 'device_id' => '54564', |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | // Set the api key in the Route4Me class |
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | -$territory=new Territory(); |
|
| 16 | +$territory = new Territory(); |
|
| 17 | 17 | |
| 18 | 18 | // Select a terriotry with the addresses from the list |
| 19 | 19 | $params = array( |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
| 26 | 26 | |
| 27 | 27 | $addresses = array(); |
| 28 | -foreach($json as $address) { |
|
| 28 | +foreach ($json as $address) { |
|
| 29 | 29 | $addresses[] = Address::fromArray($address); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | $parameters = RouteParameters::fromArray(array( |
| 33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
| 34 | 34 | "route_name" => "Multiple Depot, Multiple Driver, Time Window", |
| 35 | - "route_date" => time() + 24*60*60, |
|
| 35 | + "route_date" => time() + 24 * 60 * 60, |
|
| 36 | 36 | "route_time" => 60 * 60 * 7, |
| 37 | 37 | "rt" => TRUE, |
| 38 | 38 | "distance_unit" => DistanceUnit::MILES, |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | { |
| 34 | 34 | $activityparameters = new ActivityParameters(); |
| 35 | 35 | |
| 36 | - foreach($params as $key => $value) { |
|
| 36 | + foreach ($params as $key => $value) { |
|
| 37 | 37 | if (property_exists($activityparameters, $key)) { |
| 38 | 38 | $activityparameters->{$key} = $value; |
| 39 | 39 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class Territory extends Common |
| 9 | 9 | { |
| 10 | - public $territory_id; // Territory id |
|
| 10 | + public $territory_id; // Territory id |
|
| 11 | 11 | public $territory_name; |
| 12 | 12 | public $territory_color; |
| 13 | 13 | public $addresses; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $territoryparameters = new Territory(); |
| 31 | 31 | |
| 32 | - foreach($params as $key => $value) { |
|
| 32 | + foreach ($params as $key => $value) { |
|
| 33 | 33 | if (property_exists($territoryparameters, $key)) { |
| 34 | 34 | $territoryparameters->{$key} = $value; |
| 35 | 35 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $param->setParameters(RouteParameters::fromArray($params['parameters'])); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - foreach($params['addresses'] as $address) { |
|
| 37 | + foreach ($params['addresses'] as $address) { |
|
| 38 | 38 | if (!($address instanceof Address)) { |
| 39 | 39 | $address = Address::fromArray($address); |
| 40 | 40 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $addresses = array(); |
| 79 | 79 | |
| 80 | - foreach($this->addresses as $address) { |
|
| 80 | + foreach ($this->addresses as $address) { |
|
| 81 | 81 | $addresses[] = $address->toArray(); |
| 82 | 82 | } |
| 83 | 83 | |