├── .gitignore
├── tests
├── Bootstrap.php
└── GoogleStaticMap
│ ├── Path
│ └── PointTest.php
│ ├── PathTest.php
│ ├── MarkerTest.php
│ ├── FeatureTest.php
│ ├── Feature
│ └── StylingTest.php
│ └── MapTest.php
├── .travis.yml
├── examples
├── example1.php
├── example3.php
├── example2.php
├── example5.php
├── example4.php
└── example6.php
├── composer.json
├── phpunit.xml
├── .php_cs.dist
├── README.md
├── src
└── GoogleStaticMap
│ ├── Path
│ └── Point.php
│ ├── Feature.php
│ ├── Path.php
│ ├── Marker.php
│ ├── Feature
│ └── Styling.php
│ └── Map.php
└── composer.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/
2 | build/
--------------------------------------------------------------------------------
/tests/Bootstrap.php:
--------------------------------------------------------------------------------
1 | setCenter('London,UK');
11 | $map->setHeight(300);
12 | $map->setWidth(232);
13 | $map->setZoom(8);
14 | $map->setHttps(true);
15 |
16 | echo '
';
17 |
--------------------------------------------------------------------------------
/examples/example3.php:
--------------------------------------------------------------------------------
1 | setColor('blue');
12 | $marker->setSize('mid');
13 | $marker->setLongitude(-0.062004);
14 | $marker->setLatitude(51.462564);
15 | $marker->setLabel('D');
16 |
17 | $map = new \GoogleStaticMap\Map();
18 | $map->setCenter('London,UK');
19 | $map->setHeight(300);
20 | $map->setWidth(232);
21 | $map->setZoom(8);
22 | $map->setMapType('hybrid');
23 | $map->setFormat('png');
24 | $map->addMarker($marker);
25 |
26 | echo '
';
27 |
--------------------------------------------------------------------------------
/examples/example2.php:
--------------------------------------------------------------------------------
1 | setHue('#006400');
12 | $styling->setLightness(50);
13 |
14 | $featureStyling = new \GoogleStaticMap\Feature();
15 | $featureStyling->setFeature('all');
16 | $featureStyling->setElement('all');
17 | $featureStyling->setStyle($styling);
18 |
19 | $map = new \GoogleStaticMap\Map();
20 | $map->setCenter('London,UK');
21 | $map->setHeight(300);
22 | $map->setWidth(232);
23 | $map->setZoom(8);
24 | $map->setFormat('jpg');
25 | $map->addFeature($featureStyling);
26 |
27 | echo '
';
28 |
--------------------------------------------------------------------------------
/examples/example5.php:
--------------------------------------------------------------------------------
1 | setLatitude(51.855376);
11 | $pathPoint->setLongitude(-0.576904);
12 |
13 | $pathPoint2 = new \GoogleStaticMap\Path\Point();
14 | $pathPoint2->setLocation('Wembley, UK');
15 |
16 | $path = new \GoogleStaticMap\Path();
17 | $path->setColor('red');
18 | $path->setWeight(5);
19 | $path->addPoint($pathPoint);
20 | $path->addPoint($pathPoint2);
21 |
22 | $map = new \GoogleStaticMap\Map();
23 | $map->setHeight(600);
24 | $map->setWidth(600);
25 | $map->setMapType('hybrid');
26 | $map->setFormat('jpg');
27 | $map->setScale(2);
28 | $map->setMapPath($path);
29 |
30 | echo '
';
31 |
--------------------------------------------------------------------------------
/examples/example4.php:
--------------------------------------------------------------------------------
1 | setLongitude(-0.062004);
12 | $marker->setLatitude(51.462564);
13 | $marker->setIconUrl('https://goo.gl/5y3S82');
14 |
15 | $marker2 = new \GoogleStaticMap\Marker();
16 | $marker2->setColor('red');
17 | $marker2->setSize('large');
18 | $marker2->setLongitude(-0.576904);
19 | $marker2->setLatitude(51.855376);
20 | $marker2->setLabel('B');
21 |
22 | $map = new \GoogleStaticMap\Map();
23 | $map->setCenter('London,UK');
24 | $map->setHeight(300);
25 | $map->setWidth(300);
26 | $map->setZoom(8);
27 | $map->setMapType('hybrid');
28 | $map->setFormat('png');
29 | $map->addMarker($marker);
30 | $map->addMarker($marker2);
31 |
32 | echo '
';
33 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bensquire/php-static-maps-generator",
3 | "type": "library",
4 | "description": "A PHP library to generate Google Static Map Links.",
5 | "keywords": [
6 | "google",
7 | "maps",
8 | "php",
9 | "generator"
10 | ],
11 | "homepage": "https://github.com/bensquire/php-static-maps-generator",
12 | "license": "MIT",
13 | "authors": [
14 | {
15 | "name": "Ben Squire",
16 | "email": "b.squire@gmail.com",
17 | "homepage": "https://github.com/bensquire"
18 | }
19 | ],
20 | "support": {
21 | "issues": "https://github.com/bensquire/php-static-maps-generator/issues",
22 | "wiki": "https://github.com/bensquire/php-static-maps-generator/wiki"
23 | },
24 | "require": {
25 | "php": ">=7.1.0",
26 | "ext-hash": "*"
27 | },
28 | "require-dev": {
29 | "phpunit/phpunit": "5.*"
30 | },
31 | "autoload": {
32 | "psr-4": {
33 | "GoogleStaticMap\\": "src/GoogleStaticMap"
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/examples/example6.php:
--------------------------------------------------------------------------------
1 | setLatitude(51.855376);
11 | $pathPoint->setLongitude(-0.576904);
12 |
13 | $pathPoint2 = new \GoogleStaticMap\Path\Point();
14 | $pathPoint2->setLocation('Wembley, UK');
15 |
16 | $pathPoint3 = new \GoogleStaticMap\Path\Point();
17 | $pathPoint3->setLocation('Barnet, UK');
18 |
19 | $path = new \GoogleStaticMap\Path();
20 | $path->setColor('0x00000000');
21 | $path->setWeight(5);
22 | $path->setFillColor('0xFFFF0033');
23 | $path->addPoint($pathPoint);
24 | $path->addPoint($pathPoint2);
25 | $path->addPoint($pathPoint3);
26 |
27 | $map = new \GoogleStaticMap\Map();
28 | $map->setHeight(600);
29 | $map->setWidth(600);
30 | $map->setMapType('hybrid');
31 | $map->setFormat('png8');
32 | $map->setMapPath($path);
33 |
34 | echo '
';
35 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ./tests/GoogleStaticMap/
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | ./src/
19 |
20 |
21 |
--------------------------------------------------------------------------------
/.php_cs.dist:
--------------------------------------------------------------------------------
1 | exclude('vendor')
6 | ->in(__DIR__);
7 |
8 | return PhpCsFixer\Config::create()
9 | ->setUsingCache(false) //Remove for performance improvements
10 | ->setRiskyAllowed(true)
11 | ->setRules([
12 | '@PSR2' => true,
13 | 'psr4' => true,
14 | '@PHP71Migration' => true,
15 | 'array_syntax' => ['syntax' => 'short'],
16 | 'no_short_echo_tag' => true,
17 | 'no_unused_imports' => true,
18 | 'ordered_imports' => true,
19 | 'single_quote' => true,
20 | 'short_scalar_cast' => true,
21 | 'no_short_bool_cast' => true,
22 | 'whitespace_after_comma_in_array' => true,
23 | 'lowercase_cast' => true,
24 | 'new_with_braces' => true,
25 | 'no_blank_lines_after_phpdoc' => true,
26 | 'no_empty_statement' => true,
27 | 'no_short_bool_cast' => true,
28 | 'no_trailing_comma_in_singleline_array' => true,
29 | 'object_operator_without_whitespace' => true,
30 | 'phpdoc_add_missing_param_annotation' => []
31 | ])
32 | ->setFinder($finder);
--------------------------------------------------------------------------------
/tests/GoogleStaticMap/Path/PointTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($object, $object->setLongitude(1.0));
9 | $this->assertEquals(1.0, $object->getLongitude());
10 | }
11 |
12 | public function testSetLatitude()
13 | {
14 | $object = new \GoogleStaticMap\Path\Point();
15 | $this->assertEquals($object, $object->setLatitude(1.0));
16 | $this->assertEquals(1.0, $object->getLatitude());
17 | }
18 |
19 | public function testSetLocation()
20 | {
21 | $object = new \GoogleStaticMap\Path\Point();
22 | $this->assertEquals($object, $object->setLocation('London,UK'));
23 | $this->assertEquals('London,UK', $object->getLocation());
24 | }
25 |
26 | public function testBuild()
27 | {
28 | $object = new \GoogleStaticMap\Path\Point();
29 | $object->setLatitude(1.0);
30 | $object->setLongitude(2.0);
31 | $this->assertEquals('1,2', $object->build());
32 |
33 | $object = new \GoogleStaticMap\Path\Point();
34 | $object->setLocation('london,uk');
35 | $this->assertEquals('london%2Cuk', $object->build());
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/tests/GoogleStaticMap/PathTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($object, $object->setWeight(1));
9 | $this->assertEquals(1, $object->getWeight());
10 | }
11 |
12 | public function testSetGetColor()
13 | {
14 | $object = new \GoogleStaticMap\Path();
15 | $this->assertEquals($object, $object->setColor('green'));
16 | $this->assertEquals('green', $object->getColor());
17 | }
18 |
19 | public function testSetGetFillColor()
20 | {
21 | $object = new \GoogleStaticMap\Path();
22 | $this->assertEquals($object, $object->setFillColor('0x00000000'));
23 | $this->assertEquals('0x00000000', $object->getFillColor());
24 | }
25 |
26 | public function testAddPoint()
27 | {
28 | $point = new \GoogleStaticMap\Path\Point();
29 | $object = new \GoogleStaticMap\Path();
30 | $this->assertEquals($object, $object->addPoint($point));
31 | }
32 |
33 | public function testBuild()
34 | {
35 | $point = new \GoogleStaticMap\Path\Point();
36 | $point->setLongitude(1.0);
37 | $point->setLatitude(2.0);
38 | $point->setLocation('london,uk');
39 |
40 | $object = new \GoogleStaticMap\Path();
41 | $object->setFillColor('0x00000000');
42 | $object->setColor('red');
43 | $object->setWeight(1);
44 | $object->addPoint($point);
45 |
46 | $this->assertEquals('path=weight:1|color:red|fillcolor:0x00000000|2,1', $object->build());
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | [](https://travis-ci.org/bensquire/php-static-maps-generator)
4 |
5 |
6 | # php-static-maps-generator
7 | A PHP library to generate Google Static Map Links. The Google Static Maps Library (V2) is a free service, [made available by Google] (https://developers.google.com/maps/documentation/staticmaps/).
8 |
9 | Using simple OO methods, this project will build the URL which can be used in an image tag.
10 |
11 |
12 | ## Example Code
13 | ```php
14 | $styling = new \GoogleStaticMap\Feature\Styling();
15 | $styling->setHue('#006400');
16 | $styling->setLightness(50);
17 |
18 | $featureStyling = new \GoogleStaticMap\Feature();
19 | $featureStyling->setFeature('all');
20 | $featureStyling->setElement('all');
21 | $featureStyling->setStyle($styling);
22 |
23 | $map = new \GoogleStaticMap\Map();
24 | $map->setCenter('London,UK');
25 | $map->setHeight(300);
26 | $map->setWidth(232);
27 | $map->setZoom(8);
28 | $map->setFormat('jpg');
29 | $map->addFeature($featureStyling);
30 |
31 | echo '
';
32 |
33 | ```
34 |
35 | ## Example Output:
36 | 
37 |
38 |
39 | ## Fix coding standards:
40 | /usr/local/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run
41 |
42 |
43 | ## Google Static Maps API Documentation
44 | https://developers.google.com/maps/documentation/static-maps/intro
45 |
46 | ## Requirements:
47 | This library requires no additional software beyond a functional version of PHP
48 | 7.1 (or greater) and if you wish to retrieve the Map image, a working Internet
49 | connection.
--------------------------------------------------------------------------------
/tests/GoogleStaticMap/MarkerTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($object, $object->setLongitude(1.0));
9 | $this->assertEquals(1.0, $object->getLongitude());
10 | }
11 |
12 | public function testSetGetLatitude()
13 | {
14 | $object = new \GoogleStaticMap\Marker();
15 | $this->assertEquals($object, $object->setLatitude(2.0));
16 | $this->assertEquals(2.0, $object->getLatitude());
17 | }
18 |
19 | public function testSetGetLabel()
20 | {
21 | $object = new \GoogleStaticMap\Marker();
22 | $this->assertEquals($object, $object->setLabel('fooo'));
23 | $this->assertEquals('fooo', $object->getLabel());
24 | }
25 |
26 |
27 | public function testSetGetColor()
28 | {
29 | $object = new \GoogleStaticMap\Marker();
30 | $this->assertEquals($object, $object->setColor('red'));
31 | $this->assertEquals('red', $object->getColor());
32 | }
33 |
34 | public function testSetSize()
35 | {
36 | $object = new \GoogleStaticMap\Marker();
37 | $this->assertEquals($object, $object->setSize('tiny'));
38 | $this->assertEquals('tiny', $object->getSize());
39 | }
40 |
41 | public function testSetIconUrl()
42 | {
43 | $object = new \GoogleStaticMap\Marker();
44 | $this->assertEquals($object, $object->setIconUrl('https://www.foo.com/'));
45 | $this->assertEquals('https://www.foo.com/', $object->getIconUrl());
46 | }
47 |
48 | public function testBuild()
49 | {
50 | $object = new \GoogleStaticMap\Marker();
51 | $object->setColor('red');
52 | $object->setSize('tiny');
53 | $object->setLabel('foo');
54 | $object->setLatitude(1.0);
55 | $object->setLongitude(2.0);
56 | $object->setIconUrl('https://www.foo.com/');
57 |
58 | $this->assertEquals('markers=icon:https%3A%2F%2Fwww.foo.com%2F%7Ccolor:red%7Clabel:foo%7Csize:tiny%7C1,2', $object->build());
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/tests/GoogleStaticMap/FeatureTest.php:
--------------------------------------------------------------------------------
1 | 'administrative',
10 | 'element'=> 'geometry'
11 | ]);
12 | }
13 |
14 | /**
15 | * @expectedException \Exception
16 | * @expectedExceptionMessage Unknown Map Feature
17 | */
18 | public function testSetFeature()
19 | {
20 | $object = new Feature();
21 | $this->assertInstanceOf('\GoogleStaticMap\Feature', $object->setFeature('administrative'));
22 | $object->setFeature('administrative2');
23 | }
24 |
25 | public function testSetStyle()
26 | {
27 | $featureStyling = new \GoogleStaticMap\Feature\Styling();
28 |
29 | $object = new Feature();
30 | $this->assertInstanceOf('\GoogleStaticMap\Feature', $object->setStyle($featureStyling));
31 | }
32 |
33 | /**
34 | * @expectedException \Exception
35 | * @expectedExceptionMessage Unknown Map Element
36 | */
37 | public function testSetElement()
38 | {
39 | $object = new Feature();
40 | $this->assertInstanceOf('\GoogleStaticMap\Feature', $object->setElement('geometry'));
41 | $this->assertInstanceOf('\GoogleStaticMap\Feature', $object->setElement('geometry2'));
42 | }
43 |
44 | public function testGetFeature()
45 | {
46 | $object = new Feature();
47 | $object->setFeature('administrative');
48 | $this->assertEquals('administrative', $object->getFeature());
49 | }
50 |
51 | public function testGetStyle()
52 | {
53 | $object = new Feature();
54 | $this->assertNull($object->getStyle());
55 | }
56 |
57 | public function testGetElement()
58 | {
59 | $object = new Feature();
60 | $object->setElement('geometry');
61 | $this->assertEquals('geometry', $object->getElement());
62 | }
63 |
64 | public function testBuild()
65 | {
66 | $object = new \GoogleStaticMap\Feature();
67 | $this->assertEquals('style=feature:|element:', $object->build());
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/tests/GoogleStaticMap/Feature/StylingTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($object, $object->setGamma(1.0));
9 | $this->assertEquals(1.0, $object->getGamma());
10 | }
11 |
12 |
13 | public function testSetGetLightness()
14 | {
15 | $object = new \GoogleStaticMap\Feature\Styling();
16 | $this->assertEquals($object, $object->setLightness(1));
17 | $this->assertEquals(1, $object->getLightness());
18 | }
19 |
20 | public function testSetSaturation()
21 | {
22 | $object = new \GoogleStaticMap\Feature\Styling();
23 | $this->assertEquals($object, $object->setSaturation(1));
24 | $this->assertEquals(1, $object->getSaturation());
25 | }
26 |
27 | public function testSetGetHue()
28 | {
29 | $object = new \GoogleStaticMap\Feature\Styling();
30 | $this->assertEquals($object, $object->setHue('255,255,0'));
31 | $this->assertEquals('255,255,0', $object->getHue());
32 | }
33 |
34 |
35 | public function testGetInvertLightness()
36 | {
37 | $object = new \GoogleStaticMap\Feature\Styling();
38 | $this->assertEquals($object, $object->setInvertLightness(false));
39 | $this->assertFalse($object->getInvertLightness());
40 | }
41 |
42 |
43 | public function testSetGetVisibility()
44 | {
45 | $object = new \GoogleStaticMap\Feature\Styling();
46 | $this->assertEquals($object, $object->setVisibility('simplified'));
47 | $this->assertEquals('simplified', $object->getVisible());
48 | }
49 |
50 |
51 | public function testBuild()
52 | {
53 | $object = new \GoogleStaticMap\Feature\Styling();
54 | $object->setGamma(1.0);
55 | $object->setHue('255,255,0');
56 | $object->setLightness(1);
57 | $object->setInvertLightness(true);
58 | $object->setSaturation(2);
59 | $object->setVisibility('on');
60 |
61 | $this->assertEquals(
62 | 'gamma:1|lightness:1|saturation:2|hue:0x255,255,0|visibility:on|invert_lightness:true',
63 | $object->build()
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/GoogleStaticMap/Path/Point.php:
--------------------------------------------------------------------------------
1 |
6 | * @license Apache 2.0
7 | *
8 | * @package GoogleStaticMap
9 | *
10 | * @abstract This class abstracts the path points that can be placed onto the
11 | * Google Static Maps. Either via coordinates or as a string location.
12 | *
13 | * @see https://github.com/bensquire/php-static-maps-generator
14 | */
15 | class Point
16 | {
17 | protected $longitude = null;
18 | protected $latitude = null;
19 | protected $location = null;
20 |
21 | /**
22 | * Set the longitude of the map point.
23 | *
24 | * @param $longitude
25 | * @return $this
26 | * @throws \Exception
27 | */
28 | public function setLongitude(float $longitude)
29 | {
30 | $this->longitude = $longitude;
31 | return $this;
32 | }
33 |
34 | /**
35 | * Set the Latitude of the map point.
36 | *
37 | * @param $latitude
38 | * @return $this
39 | * @throws \Exception
40 | */
41 | public function setLatitude(float $latitude)
42 | {
43 | $this->latitude = (float) $latitude;
44 | return $this;
45 | }
46 |
47 | /**
48 | * Set a string location of the map point.
49 | *
50 | * @param string $location
51 | * @return \GoogleStaticMap\Path\Point
52 | * @throws \Exception
53 | */
54 | public function setLocation(string $location)
55 | {
56 | if (strlen($location) === 0) {
57 | throw new \Exception('No string location provided...');
58 | }
59 |
60 | $this->location = $location;
61 | return $this;
62 | }
63 |
64 | /**
65 | * Return the float longitude
66 | *
67 | * @return float
68 | */
69 | public function getLongitude(): ?float
70 | {
71 | return $this->longitude;
72 | }
73 |
74 | /**
75 | * Return the float of the latitude
76 | *
77 | * @return float
78 | */
79 | public function getLatitude(): ?float
80 | {
81 | return $this->latitude;
82 | }
83 |
84 | /**
85 | * Return the location string
86 | *
87 | * @return string
88 | */
89 | public function getLocation(): ?string
90 | {
91 | return $this->location;
92 | }
93 |
94 | /**
95 | * Recombines the coordinates of the map point
96 | *
97 | * @return string
98 | */
99 | protected function combineCoordinates(): string
100 | {
101 | return $this->latitude . ',' . $this->longitude;
102 | }
103 |
104 | /**
105 | * Build the Map Path Point Part of the URL
106 | *
107 | * @return string
108 | */
109 | public function build(): string
110 | {
111 | if (strlen($this->longitude) > 0 && strlen($this->latitude) > 0) {
112 | return $this->combineCoordinates();
113 | }
114 |
115 | if (strlen($this->location) > 0) {
116 | return urlencode($this->location);
117 | }
118 |
119 | return '';
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/src/GoogleStaticMap/Feature.php:
--------------------------------------------------------------------------------
1 |
6 | * @license Apache 2.0
7 | *
8 | * @package GoogleStaticMap
9 | *
10 | * @abstract This class abstracts the map feature part of the Google
11 | * Static map API. i.e: Determine those map features that are visible
12 | * and how they are styled.
13 | *
14 | * @see https://github.com/bensquire/php-static-maps-generator
15 | */
16 | class Feature
17 | {
18 | public const SEPARATOR = '|';
19 |
20 | protected $validFeatures = [
21 | 'administrative',
22 | 'administrative.country',
23 | 'administrative.land_parcel',
24 | 'administrative.locality',
25 | 'administrative.neighborhood',
26 | 'administrative.province',
27 | 'all',
28 | 'landscape',
29 | 'landscape.man_made',
30 | 'landscape.natural',
31 | 'poi',
32 | 'poi.attraction',
33 | 'poi.business',
34 | 'poi.government',
35 | 'poi.medical',
36 | 'poi.park',
37 | 'poi.place_of_worship',
38 | 'poi.school',
39 | 'poi.sports_complex',
40 | 'road',
41 | 'road.arterial',
42 | 'road.highway',
43 | 'road.highway.controlled_access',
44 | 'road.local',
45 | 'transit',
46 | 'transit.line',
47 | 'transit.station',
48 | 'transit.station.airport',
49 | 'transit.station.bus',
50 | 'transit.station.rail',
51 | 'water'
52 | ];
53 | protected $validElements = ['all', 'geometry', 'labels'];
54 | protected $feature = null;
55 | protected $element = null;
56 | protected $style = null;
57 |
58 | /**
59 | * Sets the type of feature the object represents
60 | *
61 | * @param $feature
62 | * @return $this
63 | * @throws \Exception
64 | */
65 | public function setFeature(string $feature)
66 | {
67 | if (!in_array($feature, $this->validFeatures)) {
68 | throw new \Exception('Unknown Map Feature');
69 | }
70 |
71 | $this->feature = $feature;
72 | return $this;
73 | }
74 |
75 | /**
76 | * Creates the feature styling object either using an associative array of values or by passing in an instance of _FeatureStyling.
77 | *
78 | * @param $style
79 | * @return $this
80 | * @throws \Exception
81 | */
82 | public function setStyle(\GoogleStaticMap\Feature\Styling $style)
83 | {
84 | $this->style = $style;
85 | return $this;
86 | }
87 |
88 | /**
89 | * Sets the element of the feature you are styling, 'all', 'geometry', 'labels'.
90 | *
91 | * @param $element
92 | * @return $this
93 | * @throws \Exception
94 | */
95 | public function setElement(string $element)
96 | {
97 | if (!in_array($element, $this->validElements)) {
98 | throw new \Exception('Unknown Map Element');
99 | }
100 |
101 | $this->element = $element;
102 | return $this;
103 | }
104 |
105 | /**
106 | * Returns the feature being edited
107 | *
108 | * @return null|string
109 | */
110 | public function getFeature(): ?string
111 | {
112 | return $this->feature;
113 | }
114 |
115 | /**
116 | * Returns the features styling object.
117 | *
118 | * @return null|\GoogleStaticMap\Feature\Styling
119 | */
120 | public function getStyle(): ?\GoogleStaticMap\Feature\Styling
121 | {
122 | return $this->style;
123 | }
124 |
125 | /**
126 | * Returns the element of the feature that's being styled
127 | *
128 | * @return null|string
129 | */
130 | public function getElement(): ?string
131 | {
132 | return $this->element;
133 | }
134 |
135 | /**
136 | * Builds the url string of the feature styling
137 | *
138 | * @return string
139 | */
140 | public function build(): string
141 | {
142 | if ($this->style instanceof \GoogleStaticMap\Feature\Styling) {
143 | $styles = $this->getStyle()->build();
144 | }
145 |
146 | return 'style=feature:' . $this->getFeature() . $this::SEPARATOR . 'element:' . $this->getElement() . ((isset($styles) ? $this::SEPARATOR . $styles : ''));
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/src/GoogleStaticMap/Path.php:
--------------------------------------------------------------------------------
1 |
8 | * @license Apache 2.0
9 | *
10 | * @package GoogleStaticMap
11 | *
12 | * @abstract This class abstracts the path that can be placed onto the
13 | * Google Static Maps. Controlling the points object and the path styling.
14 | *
15 | * @see https://github.com/bensquire/php-static-maps-generator
16 | * @todo https://developers.google.com/maps/documentation/staticmaps/#EncodedPolylines
17 | * @todo https://developers.google.com/maps/documentation/staticmaps/#Viewports
18 | */
19 | class Path
20 | {
21 | public const SEPARATOR = '|';
22 |
23 | protected $points = [];
24 | protected $validColours = [
25 | 'black',
26 | 'brown',
27 | 'green',
28 | 'purple',
29 | 'yellow',
30 | 'blue',
31 | 'gray',
32 | 'orange',
33 | 'red',
34 | 'white'
35 | ];
36 | protected $weight = null;
37 | protected $colour = null;
38 | protected $fillColour = null;
39 |
40 | /**
41 | * Set the weight of the map path line in px
42 | *
43 | * @param int $weight
44 | * @return $this
45 | * @throws \Exception
46 | */
47 | public function setWeight(int $weight)
48 | {
49 | $this->weight = $weight;
50 | return $this;
51 | }
52 |
53 | /**
54 | * Sets the color of the map path line, 24 or 32bit hex, or part of the listed color array.
55 | *
56 | * @param $colour
57 | * @return $this
58 | * @throws \Exception
59 | */
60 | public function setColor(string $colour)
61 | {
62 | $colour = strtolower($colour);
63 |
64 | if (!preg_match('/^0x[0-9A-F]{6,8}/', $colour) && !in_array($colour, $this->validColours)) {
65 | throw new \Exception('Invalid Color, 24/32bit (0x00000000) or string: ' . $colour);
66 | }
67 |
68 | $this->colour = $colour;
69 | return $this;
70 | }
71 |
72 | /**
73 | * Set the fill color of the map path (requires more than 2 points for it to become visible).
74 | *
75 | * @param $colour
76 | * @return $this
77 | * @throws \Exception
78 | */
79 | public function setFillColor(string $colour)
80 | {
81 | //fillcolor (24bit or 32bit color value) indicates its a closed loop path
82 |
83 | if (!preg_match('/^0x[0-9A-Fa-f]{6,8}/', $colour)) {
84 | throw new \Exception('Invalid Fill Color, 24/32bit (0x00000000) or string');
85 | }
86 |
87 | $this->fillColour = $colour;
88 | return $this;
89 | }
90 |
91 | /**
92 | * Return the path line weight
93 | *
94 | * @return int
95 | */
96 | public function getWeight(): int
97 | {
98 | return $this->weight;
99 | }
100 |
101 | /**
102 | * Return the polyfill color
103 | *
104 | * @return string
105 | */
106 | public function getFillColor(): string
107 | {
108 | return $this->fillColour;
109 | }
110 |
111 | /**
112 | * Return the path line color
113 | *
114 | * @return string
115 | */
116 | public function getColor(): string
117 | {
118 | return $this->colour;
119 | }
120 |
121 | /**
122 | * @param Point $point
123 | * @return $this
124 | */
125 | public function addPoint(Point $point)
126 | {
127 | $this->points[] = $point;
128 | return $this;
129 | }
130 |
131 | /**
132 | * Build the map path part of the url string.
133 | *
134 | * @return string
135 | */
136 | public function build(): string
137 | {
138 | $path = '';
139 |
140 | if (count($this->points) > 0) {
141 | $url = [];
142 |
143 | //Styling First
144 | if (strlen($this->weight) > 0) {
145 | $url[] = 'weight:' . $this->weight;
146 | }
147 |
148 | if (strlen($this->colour) > 0) {
149 | $url[] = 'color:' . $this->colour;
150 | }
151 |
152 | if (strlen($this->fillColour) > 0) {
153 | $url[] = 'fillcolor:' . $this->fillColour;
154 | }
155 |
156 | //Then the points
157 | foreach ($this->points as $point) {
158 | $url[] = $point->build();
159 | }
160 |
161 | $path .= implode($this::SEPARATOR, $url);
162 | }
163 |
164 | return ((strlen($path) > 0) ? 'path=' . $path : '');
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/src/GoogleStaticMap/Marker.php:
--------------------------------------------------------------------------------
1 |
7 | * @license Apache 2.0
8 | *
9 | * @package GoogleStaticMap
10 | *
11 | * @abstract This class abstracts the markers that can be placed onto the
12 | * Google Static Maps.
13 | *
14 | * @see https://github.com/bensquire/php-static-maps-generator
15 | */
16 | class Marker
17 | {
18 | public const SEPARATOR = '|';
19 |
20 | /**
21 | * @var array
22 | */
23 | protected $validMarkerSizes = ['tiny', 'mid', 'small'];
24 |
25 | /**
26 | * @var string
27 | */
28 | protected $longitude = '';
29 |
30 | /**
31 | * @var string
32 | */
33 | protected $latitude = '';
34 |
35 | /**
36 | * @var string
37 | */
38 | protected $label = '';
39 |
40 | /**
41 | * @var string
42 | */
43 | protected $colour = '';
44 |
45 | /**
46 | * @var string
47 | */
48 | protected $size = '';
49 |
50 | /**
51 | * @var ?string
52 | */
53 | protected $customIcon = null;
54 |
55 | /**
56 | * Output the marker url string
57 | *
58 | * @return string
59 | */
60 | public function __toString(): string
61 | {
62 | return $this->buildMarker();
63 | }
64 |
65 | /**
66 | * Set the markers Longitude
67 | *
68 | * @param float $longitude
69 | * @return Marker
70 | */
71 | public function setLongitude(float $longitude)
72 | {
73 | $this->longitude = $longitude;
74 | return $this;
75 | }
76 |
77 | /**
78 | * Set the markers Latitude
79 | *
80 | * @param float latitude
81 | * @return Marker
82 | */
83 | public function setLatitude(float $latitude)
84 | {
85 | $this->latitude = $latitude;
86 | return $this;
87 | }
88 |
89 | /**
90 | * Set the label for this marker
91 | *
92 | * @param string $string
93 | * @return Marker
94 | */
95 | public function setLabel(string $string)
96 | {
97 | $this->label = $string;
98 | return $this;
99 | }
100 |
101 | /**
102 | * Set the color for this marker
103 | *
104 | * @param string $colour
105 | * @return Marker
106 | */
107 | public function setColor(string $colour)
108 | {
109 | $this->colour = $colour;
110 | return $this;
111 | }
112 |
113 | /**
114 | * Set the size of the marker
115 | *
116 | * @param string $size
117 | * @return Marker
118 | */
119 | public function setSize(string $size)
120 | {
121 | if ((in_array($size, $this->validMarkerSizes))) {
122 | $this->size = $size;
123 | }
124 |
125 | return $this;
126 | }
127 |
128 | /**
129 | * @param string $url
130 | * @return Marker
131 | */
132 | public function setIconUrl(string $url)
133 | {
134 | $this->customIcon = $url;
135 | return $this;
136 | }
137 |
138 | /**
139 | * Return the marker longitude
140 | *
141 | * @return float
142 | */
143 | public function getLongitude(): float
144 | {
145 | return $this->longitude;
146 | }
147 |
148 | /**
149 | * Return the marker latitude
150 | *
151 | * @return float
152 | */
153 | public function getLatitude(): float
154 | {
155 | return $this->latitude;
156 | }
157 |
158 | /**
159 | * Return the marker label
160 | *
161 | * @return string
162 | */
163 | public function getLabel(): string
164 | {
165 | return $this->label;
166 | }
167 |
168 | /**
169 | * Return the marker color
170 | *
171 | * @return string
172 | */
173 | public function getColor(): string
174 | {
175 | return $this->colour;
176 | }
177 |
178 | /**
179 | * Return the marker size
180 | *
181 | * @return string
182 | */
183 | public function getSize(): string
184 | {
185 | return $this->size;
186 | }
187 |
188 | /**
189 | * @return null|string
190 | */
191 | public function getIconUrl(): ?string
192 | {
193 | return $this->customIcon;
194 | }
195 | /**
196 | * Return the marker url string
197 | *
198 | * @return string
199 | */
200 | public function build(): string
201 | {
202 | return 'markers=' .
203 | ((!empty($this->customIcon)) ? 'icon:' . urlencode($this->customIcon . $this::SEPARATOR) : '') .
204 | ((!empty($this->colour)) ? 'color:' . urlencode($this->colour . $this::SEPARATOR) : '') .
205 | ((!empty($this->label)) ? 'label:' . urlencode($this->label . $this::SEPARATOR) : '') .
206 | ((!empty($this->size)) ? 'size:' . urlencode($this->size . $this::SEPARATOR) : '') .
207 | $this->latitude . ',' . $this->longitude;
208 | }
209 | }
210 |
--------------------------------------------------------------------------------
/tests/GoogleStaticMap/MapTest.php:
--------------------------------------------------------------------------------
1 | assertInstanceOf('GoogleStaticMap\Map', $object->addMarker($marker));
10 | $this->assertEquals([$marker], $object->getMarkers());
11 | }
12 |
13 | public function testSetHttps()
14 | {
15 | $object = new \GoogleStaticMap\Map();
16 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setHttps(true));
17 | }
18 |
19 | /**
20 | * @expectedException \Exception
21 | * @expectedExceptionMessage Invalid API key
22 | */
23 | public function testSetAPIKey()
24 | {
25 | $object = new \GoogleStaticMap\Map();
26 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setAPIKey('1234'));
27 |
28 | $object->setAPIKey('---++++####');
29 | }
30 |
31 | public function testSetCenter()
32 | {
33 | $object = new \GoogleStaticMap\Map();
34 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setCenter('my centre'));
35 | $this->assertEquals('my centre', $object->getCenter());
36 | }
37 |
38 | /**
39 | * @expectedException \Exception
40 | * @expectedExceptionMessage Invalid map scale value: 8
41 | */
42 | public function testSetScale()
43 | {
44 | $object = new \GoogleStaticMap\Map();
45 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setScale(2));
46 | $this->assertEquals(2, $object->getScale());
47 |
48 | $object->setScale(8);
49 | }
50 |
51 | /**
52 | * @expectedException \Exception
53 | * @expectedExceptionMessage Invalid Zoom amount requested, 0 to 22, acceptable.
54 | */
55 | public function testSetZoom()
56 | {
57 | $object = new \GoogleStaticMap\Map();
58 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setZoom(3));
59 | $this->assertEquals(3, $object->getZoom(3));
60 |
61 | $object->setZoom(23);
62 | }
63 |
64 | /**
65 | * @expectedException \Exception
66 | * @expectedExceptionMessage Unknown map type requested.
67 | */
68 | public function testSetMapType()
69 | {
70 | $object = new \GoogleStaticMap\Map();
71 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setMapType('satellite'));
72 | $this->assertEquals('satellite', $object->getMapType());
73 |
74 | $object->setMapType('foo');
75 | }
76 |
77 | /**
78 | * @expectedException \Exception
79 | * @expectedExceptionMessage Unknown image format requested.
80 | */
81 | public function testSetFormat()
82 | {
83 | $object = new \GoogleStaticMap\Map();
84 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setFormat('png'));
85 | $this->assertEquals('png', $object->getFormat());
86 |
87 | $object->setFormat('satellite');
88 | }
89 |
90 | /**
91 | * @expectedException \Exception
92 | * @expectedExceptionMessage Height cannot be above 640.
93 | */
94 | public function testSetHeight()
95 | {
96 | $object = new \GoogleStaticMap\Map();
97 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setHeight(2));
98 | $this->assertEquals(2, $object->getHeight());
99 |
100 | $object->setHeight(641);
101 | }
102 |
103 | /**
104 | * @expectedException \Exception
105 | * @expectedExceptionMessage Width cannot be above 640.
106 | */
107 | public function testSetWidth()
108 | {
109 | $object = new \GoogleStaticMap\Map();
110 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setWidth(2));
111 | $this->assertEquals(2, $object->getWidth());
112 |
113 | $object->setWidth(641);
114 | }
115 |
116 | /**
117 | * @expectedException \Exception
118 | * @expectedExceptionMessage Unknown language requested.
119 | */
120 | public function testSetLanguage()
121 | {
122 | $object = new \GoogleStaticMap\Map();
123 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setLanguage('bg'));
124 | $this->assertEquals('bg', $object->getLanguage());
125 |
126 | $object->setLanguage('bg2');
127 | }
128 |
129 | public function testAddFeatureStyling()
130 | {
131 | $feature = new \GoogleStaticMap\Feature();
132 |
133 | $object = new \GoogleStaticMap\Map();
134 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->addFeature($feature));
135 | $this->assertEquals([$feature], $object->getFeature());
136 | }
137 |
138 | public function testSetMapPath()
139 | {
140 | $path = new \GoogleStaticMap\Path();
141 |
142 | $object = new \GoogleStaticMap\Map();
143 | $this->assertInstanceOf('GoogleStaticMap\Map', $object->setMapPath($path));
144 | $this->assertEquals($path, $object->getMapPath($path));
145 | }
146 |
147 | public function testBuildSourceMatchesToString()
148 | {
149 | $path = new \GoogleStaticMap\Path([
150 | 'weight' => 2
151 | ]);
152 |
153 | $object = new \GoogleStaticMap\Map();
154 | $object->setScale(1)
155 | ->setAPIKey('foooo')
156 | ->setMapPath($path)
157 | ->addMarker(new \GoogleStaticMap\Marker(['color' => 'red']))
158 | ->addFeature(new \GoogleStaticMap\Feature([
159 | 'feature' => 'all'
160 | ]))
161 | ->setLanguage('en')
162 | ->setMapType('roadmap')
163 | ->setZoom(2)
164 | ->setCenter('London,UK')
165 | ->setHttps(true)
166 | ->setFormat('png')
167 | ->setHeight(480)
168 | ->setWidth(480);
169 |
170 | $result = $object->buildSource();
171 | $this->assertEquals($result, $object->__toString());
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/src/GoogleStaticMap/Feature/Styling.php:
--------------------------------------------------------------------------------
1 |
6 | * @license Apache 2.0
7 | *
8 | * @package GoogleStaticMap
9 | *
10 | * @abstract This class abstracts the map feature styling part of the Google
11 | * Static map API. i.e: Determine the styling of the map features (Think map color,
12 | * opacity, build colors etc)
13 | *
14 | * @see https://github.com/bensquire/php-static-maps-generator
15 | */
16 | class Styling
17 | {
18 | public const SEPARATOR = '|';
19 |
20 | protected $gamma = null;
21 | protected $lightness = null;
22 | protected $saturation = null;
23 | protected $hue = null;
24 | protected $visibility = 'on';
25 | protected $invertLightness = false;
26 | protected $validVisibleModes = ['on', 'off', 'simplified'];
27 |
28 | /**
29 | * Sets the gamma value of the elements styling
30 | *
31 | * @param $gamma
32 | * @return $this
33 | * @throws \Exception
34 | */
35 | public function setGamma(float $gamma)
36 | {
37 | if ($gamma < 0.01 || $gamma > 10.0) {
38 | throw new \Exception('Invalid Gamma Styling Paramater Passed ' . $gamma);
39 | }
40 |
41 | $this->gamma = $gamma;
42 | return $this;
43 | }
44 |
45 | /**
46 | * Sets the lightness value of the elements styling
47 | *
48 | * @param $lightness
49 | * @return $this
50 | * @throws \Exception
51 | */
52 | public function setLightness(int $lightness)
53 | {
54 | if ($lightness > 100 || $lightness < -100) {
55 | throw new \Exception('Invalid Lightness Styling Paramater Passed ' . $lightness);
56 | }
57 |
58 | $this->lightness = $lightness;
59 | return $this;
60 | }
61 |
62 | /**
63 | * Sets the saturation of the elements styling
64 | *
65 | * @param $saturation
66 | * @return $this
67 | * @throws \Exception
68 | */
69 | public function setSaturation(int $saturation)
70 | {
71 | if ($saturation > 100 || $saturation < -100) {
72 | throw new \Exception('Invalid Saturation Styling Parameter Passed ' . $saturation);
73 | }
74 |
75 | $this->saturation = $saturation;
76 | return $this;
77 | }
78 |
79 | /**
80 | * Sets the RGB colour of the elements styling. Note: it is used for colour only, not lightness or saturation.
81 | *
82 | * @param $hue
83 | * @return $this
84 | * @throws \Exception
85 | */
86 | public function setHue(string $hue)
87 | {
88 | $hue = ltrim($hue, '#');
89 |
90 | if (!preg_match('/^[0-9A-Fa-f]{3,6}/', $hue)) {
91 | throw new \Exception('Invalid Hue (RGB) format: ' . $hue);
92 | }
93 |
94 | $this->hue = $hue;
95 | return $this;
96 | }
97 |
98 | /**
99 | * Invert the lightness of the elements styling.
100 | *
101 | * @param $invertLightness
102 | * @return $this
103 | */
104 | public function setInvertLightness(bool $invertLightness)
105 | {
106 | $this->invertLightness = ($invertLightness === true);
107 | return $this;
108 | }
109 |
110 | /**
111 | * Determines if an element should be visible, or simplified (complexity decided by google).
112 | *
113 | * @param string $visibility
114 | * @return $this
115 | * @throws \Exception
116 | */
117 | public function setVisibility(string $visibility)
118 | {
119 | if (!in_array($visibility, $this->validVisibleModes, true)) {
120 | throw new \Exception('Must be one of ' . implode($this->validVisibleModes, ', ') . '.');
121 | }
122 |
123 | $this->visibility = $visibility;
124 | return $this;
125 | }
126 |
127 | /**
128 | * Returns the elements gamma value
129 | *
130 | * @return float
131 | */
132 | public function getGamma(): float
133 | {
134 | return $this->gamma;
135 | }
136 |
137 | /**
138 | * Returns the elements lightness value
139 | *
140 | * @return int
141 | */
142 | public function getLightness(): int
143 | {
144 | return $this->lightness;
145 | }
146 |
147 | /**
148 | * Returns the elements saturation value
149 | *
150 | * @return int
151 | */
152 | public function getSaturation(): int
153 | {
154 | return $this->saturation;
155 | }
156 |
157 | /**
158 | * Returns the elements hue value
159 | *
160 | * @return string
161 | */
162 | public function getHue(): string
163 | {
164 | return $this->hue;
165 | }
166 |
167 | /**
168 | * Returns whether the lightness is inverted
169 | *
170 | * @return boolean
171 | */
172 | public function getInvertLightness(): bool
173 | {
174 | return $this->invertLightness;
175 | }
176 |
177 | /**
178 | * @return string
179 | */
180 | public function getVisible(): string
181 | {
182 | return $this->visibility;
183 | }
184 |
185 | /**
186 | * Builds the string for this specific elements styling
187 | *
188 | * @return string
189 | */
190 | public function build(): string
191 | {
192 | $url = [];
193 |
194 | if (!empty($this->gamma)) {
195 | $url[] = 'gamma:' . $this->gamma;
196 | }
197 |
198 | if (!empty($this->lightness)) {
199 | $url[] = 'lightness:' . $this->lightness;
200 | }
201 |
202 | if (!empty($this->saturation)) {
203 | $url[] = 'saturation:' . $this->saturation;
204 | }
205 |
206 | if (!empty($this->hue)) {
207 | $url[] = 'hue:0x' . $this->hue;
208 | }
209 |
210 | $url[] = 'visibility:' . ($this->visibility);
211 | $url[] = 'invert_lightness:' . ($this->invertLightness ? 'true' : 'false');
212 |
213 | return implode($this::SEPARATOR, $url);
214 | }
215 | }
216 |
--------------------------------------------------------------------------------
/src/GoogleStaticMap/Map.php:
--------------------------------------------------------------------------------
1 |
7 | * @license Apache 2.0
8 | *
9 | * @package GoogleStaticMap
10 | *
11 | * @abstract This class generates an img src which can be used to load a
12 | * 'Google Static Map', it currently supports free features,
13 | * with plans to integrate the premium features at a later date.
14 | *
15 | * Editable Features include:
16 | * - Map zoom, language, img format, scale etc
17 | * - Markers
18 | * - Feature Styling
19 | *
20 | * Please note Google restricts you to 25,000 unique map generations
21 | * each day.
22 | *
23 | * @see https://github.com/bensquire/php-static-maps-generator
24 | *
25 | * @example examples/example1.php
26 | * @example examples/example2.php
27 | * @example examples/example3.php
28 | * @example examples/example4.php
29 | * @example examples/example5.php
30 | * @example examples/example6.php
31 | */
32 | class Map
33 | {
34 | public const MAX_URL_LENGTH = 2048;
35 |
36 | protected $googleUrl = 'maps.google.com/maps/api/staticmap';
37 | protected $validLanguages = ['eu', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-AU', 'en-GB', 'es', 'eu', 'fa', 'fi', 'fil', 'fr', 'gl', 'gu', 'hi', 'hr', 'hu', 'id', 'it', 'iw', 'ja', 'kn', 'ko', 'lt', 'lv', 'ml', 'mr', 'nl', 'nn', 'no', 'or', 'pl', 'pt', 'pt-BR', 'pt-PT', 'rm', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'tl', 'ta', 'te', 'th', 'tr', 'uk', 'vi', 'zh-CN', 'zh-TW'];
38 | protected $validFormats = ['png', 'png8', 'png32', 'gif', 'jpg', 'jpg-baseline'];
39 | protected $validMapTypes = ['roadmap', 'satellite', 'hybrid', 'terrain'];
40 | protected $validScales = [1, 2, 4]; //4 is business only
41 | protected $isHttps = false;
42 | protected $apiKey = null; //TODO Finishing Adding
43 | protected $center = null; //{latitude,longitude} or ('city hall, new york, ny')
44 | protected $zoomLevel = 10;
45 | protected $height = 200;
46 | protected $width = 200;
47 | protected $scale = 1;
48 | protected $format = 'png';
49 | protected $mapType = 'roadmap'; //See $map_types;
50 | protected $languageCode = 'en-GB';
51 | protected $region = ''; //TODO Add
52 | protected $markers = [];
53 | protected $path = null;
54 | protected $visible = []; //TODO Add
55 | protected $feature = [];
56 | protected $isSensor = false;
57 |
58 | /**
59 | * Magic Method to output final image source.
60 | *
61 | * @return string
62 | */
63 | public function __toString()
64 | {
65 | return $this->buildSource();
66 | }
67 |
68 | /**
69 | * Sets a single map marker instance, using either an array of parameters, or by passing in _Marker object
70 | * e.g: $map->setMarker(array('color'=>'blue','size'=>'mid','longitude'=>-0.12437000,'latitude'=>51.59413528));
71 | *
72 | * @param $aParams
73 | * @return $this
74 | * @throws \Exception
75 | */
76 | public function addMarker(Marker $aParams)
77 | {
78 | $this->markers[] = $aParams;
79 | return $this;
80 | }
81 |
82 | /**
83 | * Sets whether we should use https to retrieve the map
84 | *
85 | * @param bool $isHttps
86 | * @return $this
87 | */
88 | public function setHttps(bool $isHttps)
89 | {
90 | $this->isHttps = $isHttps;
91 | return $this;
92 | }
93 |
94 | /**
95 | * Set the API Key used to retrieve this map (server or client)
96 | *
97 | * @param $sKey
98 | * @return $this
99 | * @throws \Exception
100 | */
101 | public function setAPIKey(string $sKey)
102 | {
103 | if (preg_match('/^[^a-zA-Z0-9]+$/i', $sKey)) {
104 | throw new \Exception('Invalid API key');
105 | }
106 |
107 | $this->apiKey = $sKey;
108 | return $this;
109 | }
110 |
111 | /**
112 | * * Sets the center location of the map, actual location worked out by google so input varies greatly:
113 | * e.g: $map->setCenter('London,UK');
114 | * e.g: $map->setCenter('-0.12437000,51.59413528');
115 | *
116 | * @param string $center
117 | * @return $this
118 | */
119 | public function setCenter(string $center)
120 | {
121 | $this->center = $center;
122 | return $this;
123 | }
124 |
125 | /**
126 | * Sets the maps resolution (1 == Normal, 2 == Double, 4 == Quad)
127 | *
128 | * @param $scale
129 | * @return $this
130 | * @throws \Exception
131 | */
132 | public function setScale(int $scale)
133 | {
134 | if (!in_array($scale, $this->validScales)) {
135 | throw new \Exception('Invalid map scale value: ' . $scale);
136 | }
137 |
138 | $this->scale = $scale;
139 | return $this;
140 | }
141 |
142 | /**
143 | * Sets the zoom level of the map, valid values 0 to 22.
144 | *
145 | * @param $zoomLevel
146 | * @return $this
147 | * @throws \Exception
148 | */
149 | public function setZoom(int $zoomLevel)
150 | {
151 | if ($zoomLevel < 0 || $zoomLevel > 22) {
152 | throw new \Exception('Invalid Zoom amount requested, 0 to 22, acceptable.');
153 | }
154 |
155 | $this->zoomLevel = $zoomLevel;
156 | return $this;
157 | }
158 |
159 | /**
160 | * Sets the map type, options are: 'roadmap', 'satellite', 'hybrid', 'terrain'
161 | *
162 | * @param $mapType
163 | * @return $this
164 | * @throws \Exception
165 | */
166 | public function setMapType(string $mapType)
167 | {
168 | if (!in_array($mapType, $this->validMapTypes)) {
169 | throw new \Exception('Unknown map type requested.');
170 | }
171 |
172 | $this->mapType = $mapType;
173 | return $this;
174 | }
175 |
176 | /**
177 | * Sets the output format of the map. Expected formats are: 'png', 'png8', 'png32', 'gif', 'jpg', 'jpg-baseline'
178 | *
179 | * @param $format
180 | * @return $this
181 | * @throws \Exception
182 | */
183 | public function setFormat(string $format)
184 | {
185 | if (!in_array($format, $this->validFormats)) {
186 | throw new \Exception('Unknown image format requested.');
187 | }
188 |
189 | $this->format = $format;
190 | return $this;
191 | }
192 |
193 | /**
194 | * Sets the height (in pixels) of the map. Maximum of 640px.
195 | *
196 | * @param $height
197 | * @return $this
198 | * @throws \Exception
199 | */
200 | public function setHeight(int $height)
201 | {
202 | if ($height > 640) {
203 | throw new \Exception('Height cannot be above 640.');
204 | }
205 |
206 | $this->height = $height;
207 | return $this;
208 | }
209 |
210 | /**
211 | * Sets the width (in pixels) of the map. Maximum of 640px.
212 | *
213 | * @param $width
214 | * @return $this
215 | * @throws \Exception
216 | */
217 | public function setWidth(int $width)
218 | {
219 | if ($width > 640) {
220 | throw new \Exception('Width cannot be above 640.');
221 | }
222 |
223 | $this->width = $width;
224 | return $this;
225 | }
226 |
227 | /**
228 | * Set the language of the map, acceptable values are: 'eu', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-AU', 'en-GB', 'es', 'eu', 'fa', 'fi', 'fil', 'fr', 'gl', 'gu', 'hi', 'hr', 'hu', 'id', 'it', 'iw', 'ja', 'kn', 'ko', 'lt', 'lv', 'ml', 'mr', 'nl', 'nn', 'no', 'or', 'pl', 'pt', 'pt-BR', 'pt-PT', 'rm', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'tl', 'ta', 'te', 'th', 'tr', 'uk', 'vi', 'zh-CN', 'zh-TW'
229 | *
230 | * @param $language
231 | * @return $this
232 | * @throws \Exception
233 | */
234 | public function setLanguage(string $language)
235 | {
236 | if (!in_array($language, $this->validLanguages)) {
237 | throw new \Exception('Unknown language requested.');
238 | }
239 |
240 | $this->languageCode = $language;
241 | return $this;
242 | }
243 |
244 | /**
245 | * Create (or adds) the styling of single the map feature, pass in either an object of _Feature or an array of parameters
246 | * e.g: $map->setFeatureStyling(array('feature'=>'all', 'element'=>'all', 'style'=>array('hue'=>'6095C6', 'saturation'=>-23, 'gamma'=>3.88, 'lightness'=>16)));
247 | *
248 | * @param $feature
249 | * @return $this
250 | * @throws \Exception
251 | */
252 | public function addFeature(Feature $feature)
253 | {
254 | $this->feature[] = $feature;
255 | return $this;
256 | }
257 |
258 | /**
259 | * Creates the GoogleMapPath object used to draw points on the map. Either pass an array of values through, or an Path object.
260 | *
261 | * @param $mPath
262 | * @return $this
263 | */
264 | public function setMapPath(Path $mPath)
265 | {
266 | $this->path = $mPath;
267 | return $this;
268 | }
269 |
270 | /**
271 | * Returns an array of set Marker objects;
272 | *
273 | * e.g: $markers = $map->getMarkers();
274 | *
275 | * @return array
276 | */
277 | public function getMarkers(): array
278 | {
279 | return $this->markers;
280 | }
281 |
282 | /**
283 | * Returns the parameter passed to set the map
284 | *
285 | * e.g: $center = $map->getCenter();
286 | *
287 | * @return string
288 | */
289 | public function getCenter(): ?string
290 | {
291 | return $this->center;
292 | }
293 |
294 | /**
295 | * @return int|null
296 | */
297 | public function getScale(): ?int
298 | {
299 | return $this->scale;
300 | }
301 |
302 | /**
303 | * Returns the zoom level set.
304 | *
305 | * e.g: $zoom = $map->getZoom();
306 | *
307 | * @return int
308 | */
309 | public function getZoom(): int
310 | {
311 | return $this->zoomLevel;
312 | }
313 |
314 | /**
315 | * Returns the set map type.
316 | *
317 | * e.g: $type = $map->getType();
318 | *
319 | * @return string
320 | */
321 | public function getMapType(): string
322 | {
323 | return $this->mapType;
324 | }
325 |
326 | /**
327 | * Returns the set format of the map
328 | *
329 | * e.g: $format = $map->getFormat();
330 | *
331 | * @return string
332 | */
333 | public function getFormat(): string
334 | {
335 | return $this->format;
336 | }
337 |
338 | /**
339 | * Returns the set height of the map
340 | *
341 | * e.g: $height = $map->getHeight();
342 | *
343 | * @return int
344 | */
345 | public function getHeight(): int
346 | {
347 | return $this->height;
348 | }
349 |
350 | /**
351 | * Returns the set width of the map
352 | *
353 | * e.g: $width = $map->getWidth();
354 | *
355 | * @return int
356 | */
357 | public function getWidth(): int
358 | {
359 | return $this->width;
360 | }
361 |
362 | /**
363 | * Returns the set language of the map;
364 | *
365 | * e.g: $language = $map->getLanguage();
366 | *
367 | * @return string
368 | */
369 | public function getLanguage(): string
370 | {
371 | return $this->languageCode;
372 | }
373 |
374 | /**
375 | * Returns the an array of map feature stylings.
376 | *
377 | * e.g: $styling = $map->getFeatureStyling();
378 | *
379 | * @return array
380 | */
381 | public function getFeature()
382 | {
383 | return $this->feature;
384 | }
385 |
386 | /**
387 | * @return Path|null
388 | */
389 | public function getMapPath(): ?Path
390 | {
391 | return $this->path;
392 | }
393 |
394 | /**
395 | * Checks whether the url is within the allowed length
396 | *
397 | * @param string $string
398 | * @return boolean
399 | */
400 | protected function validLength($string): bool
401 | {
402 | return (strlen($string) <= $this::MAX_URL_LENGTH);
403 | }
404 |
405 | /**
406 | * Creates the final url for the image tag
407 | *
408 | * @return string
409 | * @throws \Exception
410 | */
411 | public function buildSource(): string
412 | {
413 | $url = [];
414 |
415 | $url[] = 'center=' . urlencode($this->center);
416 | $url[] = 'zoom=' . $this->zoomLevel;
417 | $url[] = 'language=' . $this->languageCode;
418 | $url[] = 'maptype=' . $this->mapType;
419 | $url[] = 'format=' . $this->format;
420 | $url[] = 'size=' . $this->width . 'x' . $this->height;
421 | $url[] = 'scale=' . $this->scale;
422 |
423 |
424 | if (strlen($this->apiKey) > 0) {
425 | $url[] = 'key=' . $this->apiKey;
426 | }
427 |
428 | if (!empty($this->markers)) {
429 | foreach ($this->markers as $oMarker) {
430 | $url[] = $oMarker->build();
431 | }
432 | }
433 |
434 | if (!empty($this->feature)) {
435 | foreach ($this->feature as $oFeature) {
436 | $url[] = $oFeature->build();
437 | }
438 | }
439 |
440 |
441 | if ($this->path instanceof Path) {
442 | $url[] = $this->path->build();
443 | }
444 |
445 | $url[] = 'sensor=' . (($this->isSensor) ? 'true' : 'false');
446 |
447 | $sSrcTag = 'http' . (($this->isHttps) ? 's' : '') . '://' . $this->googleUrl . '?' . implode('&', $url);
448 |
449 | if (!$this->validLength($sSrcTag)) {
450 | throw new \Exception('URL Exceeded maxiumum length of ' . $this::MAX_URL_LENGTH . ' characters.');
451 | }
452 |
453 | return $sSrcTag;
454 | }
455 | }
456 |
--------------------------------------------------------------------------------
/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 | "This file is @generated automatically"
6 | ],
7 | "content-hash": "fe5820b759f0ac7537336fc06f77c0d9",
8 | "packages": [],
9 | "packages-dev": [
10 | {
11 | "name": "doctrine/instantiator",
12 | "version": "1.1.0",
13 | "source": {
14 | "type": "git",
15 | "url": "https://github.com/doctrine/instantiator.git",
16 | "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
17 | },
18 | "dist": {
19 | "type": "zip",
20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
21 | "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
22 | "shasum": ""
23 | },
24 | "require": {
25 | "php": "^7.1"
26 | },
27 | "require-dev": {
28 | "athletic/athletic": "~0.1.8",
29 | "ext-pdo": "*",
30 | "ext-phar": "*",
31 | "phpunit/phpunit": "^6.2.3",
32 | "squizlabs/php_codesniffer": "^3.0.2"
33 | },
34 | "type": "library",
35 | "extra": {
36 | "branch-alias": {
37 | "dev-master": "1.2.x-dev"
38 | }
39 | },
40 | "autoload": {
41 | "psr-4": {
42 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
43 | }
44 | },
45 | "notification-url": "https://packagist.org/downloads/",
46 | "license": [
47 | "MIT"
48 | ],
49 | "authors": [
50 | {
51 | "name": "Marco Pivetta",
52 | "email": "ocramius@gmail.com",
53 | "homepage": "http://ocramius.github.com/"
54 | }
55 | ],
56 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
57 | "homepage": "https://github.com/doctrine/instantiator",
58 | "keywords": [
59 | "constructor",
60 | "instantiate"
61 | ],
62 | "time": "2017-07-22T11:58:36+00:00"
63 | },
64 | {
65 | "name": "myclabs/deep-copy",
66 | "version": "1.6.1",
67 | "source": {
68 | "type": "git",
69 | "url": "https://github.com/myclabs/DeepCopy.git",
70 | "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102"
71 | },
72 | "dist": {
73 | "type": "zip",
74 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102",
75 | "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102",
76 | "shasum": ""
77 | },
78 | "require": {
79 | "php": ">=5.4.0"
80 | },
81 | "require-dev": {
82 | "doctrine/collections": "1.*",
83 | "phpunit/phpunit": "~4.1"
84 | },
85 | "type": "library",
86 | "autoload": {
87 | "psr-4": {
88 | "DeepCopy\\": "src/DeepCopy/"
89 | }
90 | },
91 | "notification-url": "https://packagist.org/downloads/",
92 | "license": [
93 | "MIT"
94 | ],
95 | "description": "Create deep copies (clones) of your objects",
96 | "homepage": "https://github.com/myclabs/DeepCopy",
97 | "keywords": [
98 | "clone",
99 | "copy",
100 | "duplicate",
101 | "object",
102 | "object graph"
103 | ],
104 | "time": "2017-04-12T18:52:22+00:00"
105 | },
106 | {
107 | "name": "phpdocumentor/reflection-common",
108 | "version": "1.0",
109 | "source": {
110 | "type": "git",
111 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
112 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
113 | },
114 | "dist": {
115 | "type": "zip",
116 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
117 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
118 | "shasum": ""
119 | },
120 | "require": {
121 | "php": ">=5.5"
122 | },
123 | "require-dev": {
124 | "phpunit/phpunit": "^4.6"
125 | },
126 | "type": "library",
127 | "extra": {
128 | "branch-alias": {
129 | "dev-master": "1.0.x-dev"
130 | }
131 | },
132 | "autoload": {
133 | "psr-4": {
134 | "phpDocumentor\\Reflection\\": [
135 | "src"
136 | ]
137 | }
138 | },
139 | "notification-url": "https://packagist.org/downloads/",
140 | "license": [
141 | "MIT"
142 | ],
143 | "authors": [
144 | {
145 | "name": "Jaap van Otterdijk",
146 | "email": "opensource@ijaap.nl"
147 | }
148 | ],
149 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
150 | "homepage": "http://www.phpdoc.org",
151 | "keywords": [
152 | "FQSEN",
153 | "phpDocumentor",
154 | "phpdoc",
155 | "reflection",
156 | "static analysis"
157 | ],
158 | "time": "2015-12-27T11:43:31+00:00"
159 | },
160 | {
161 | "name": "phpdocumentor/reflection-docblock",
162 | "version": "3.2.3",
163 | "source": {
164 | "type": "git",
165 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
166 | "reference": "86e24012a3139b42a7b71155cfaa325389f00f1f"
167 | },
168 | "dist": {
169 | "type": "zip",
170 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/86e24012a3139b42a7b71155cfaa325389f00f1f",
171 | "reference": "86e24012a3139b42a7b71155cfaa325389f00f1f",
172 | "shasum": ""
173 | },
174 | "require": {
175 | "php": "^7.0",
176 | "phpdocumentor/reflection-common": "^1.0@dev",
177 | "phpdocumentor/type-resolver": "^0.4.0",
178 | "webmozart/assert": "^1.0"
179 | },
180 | "require-dev": {
181 | "mockery/mockery": "^0.9.4",
182 | "phpunit/phpunit": "^4.4"
183 | },
184 | "type": "library",
185 | "autoload": {
186 | "psr-4": {
187 | "phpDocumentor\\Reflection\\": [
188 | "src/"
189 | ]
190 | }
191 | },
192 | "notification-url": "https://packagist.org/downloads/",
193 | "license": [
194 | "MIT"
195 | ],
196 | "authors": [
197 | {
198 | "name": "Mike van Riel",
199 | "email": "me@mikevanriel.com"
200 | }
201 | ],
202 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
203 | "time": "2017-08-29T19:37:41+00:00"
204 | },
205 | {
206 | "name": "phpdocumentor/type-resolver",
207 | "version": "0.4.0",
208 | "source": {
209 | "type": "git",
210 | "url": "https://github.com/phpDocumentor/TypeResolver.git",
211 | "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
212 | },
213 | "dist": {
214 | "type": "zip",
215 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
216 | "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
217 | "shasum": ""
218 | },
219 | "require": {
220 | "php": "^5.5 || ^7.0",
221 | "phpdocumentor/reflection-common": "^1.0"
222 | },
223 | "require-dev": {
224 | "mockery/mockery": "^0.9.4",
225 | "phpunit/phpunit": "^5.2||^4.8.24"
226 | },
227 | "type": "library",
228 | "extra": {
229 | "branch-alias": {
230 | "dev-master": "1.0.x-dev"
231 | }
232 | },
233 | "autoload": {
234 | "psr-4": {
235 | "phpDocumentor\\Reflection\\": [
236 | "src/"
237 | ]
238 | }
239 | },
240 | "notification-url": "https://packagist.org/downloads/",
241 | "license": [
242 | "MIT"
243 | ],
244 | "authors": [
245 | {
246 | "name": "Mike van Riel",
247 | "email": "me@mikevanriel.com"
248 | }
249 | ],
250 | "time": "2017-07-14T14:27:02+00:00"
251 | },
252 | {
253 | "name": "phpspec/prophecy",
254 | "version": "v1.7.0",
255 | "source": {
256 | "type": "git",
257 | "url": "https://github.com/phpspec/prophecy.git",
258 | "reference": "93d39f1f7f9326d746203c7c056f300f7f126073"
259 | },
260 | "dist": {
261 | "type": "zip",
262 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073",
263 | "reference": "93d39f1f7f9326d746203c7c056f300f7f126073",
264 | "shasum": ""
265 | },
266 | "require": {
267 | "doctrine/instantiator": "^1.0.2",
268 | "php": "^5.3|^7.0",
269 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
270 | "sebastian/comparator": "^1.1|^2.0",
271 | "sebastian/recursion-context": "^1.0|^2.0|^3.0"
272 | },
273 | "require-dev": {
274 | "phpspec/phpspec": "^2.5|^3.2",
275 | "phpunit/phpunit": "^4.8 || ^5.6.5"
276 | },
277 | "type": "library",
278 | "extra": {
279 | "branch-alias": {
280 | "dev-master": "1.6.x-dev"
281 | }
282 | },
283 | "autoload": {
284 | "psr-0": {
285 | "Prophecy\\": "src/"
286 | }
287 | },
288 | "notification-url": "https://packagist.org/downloads/",
289 | "license": [
290 | "MIT"
291 | ],
292 | "authors": [
293 | {
294 | "name": "Konstantin Kudryashov",
295 | "email": "ever.zet@gmail.com",
296 | "homepage": "http://everzet.com"
297 | },
298 | {
299 | "name": "Marcello Duarte",
300 | "email": "marcello.duarte@gmail.com"
301 | }
302 | ],
303 | "description": "Highly opinionated mocking framework for PHP 5.3+",
304 | "homepage": "https://github.com/phpspec/prophecy",
305 | "keywords": [
306 | "Double",
307 | "Dummy",
308 | "fake",
309 | "mock",
310 | "spy",
311 | "stub"
312 | ],
313 | "time": "2017-03-02T20:05:34+00:00"
314 | },
315 | {
316 | "name": "phpunit/php-code-coverage",
317 | "version": "4.0.8",
318 | "source": {
319 | "type": "git",
320 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
321 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
322 | },
323 | "dist": {
324 | "type": "zip",
325 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
326 | "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
327 | "shasum": ""
328 | },
329 | "require": {
330 | "ext-dom": "*",
331 | "ext-xmlwriter": "*",
332 | "php": "^5.6 || ^7.0",
333 | "phpunit/php-file-iterator": "^1.3",
334 | "phpunit/php-text-template": "^1.2",
335 | "phpunit/php-token-stream": "^1.4.2 || ^2.0",
336 | "sebastian/code-unit-reverse-lookup": "^1.0",
337 | "sebastian/environment": "^1.3.2 || ^2.0",
338 | "sebastian/version": "^1.0 || ^2.0"
339 | },
340 | "require-dev": {
341 | "ext-xdebug": "^2.1.4",
342 | "phpunit/phpunit": "^5.7"
343 | },
344 | "suggest": {
345 | "ext-xdebug": "^2.5.1"
346 | },
347 | "type": "library",
348 | "extra": {
349 | "branch-alias": {
350 | "dev-master": "4.0.x-dev"
351 | }
352 | },
353 | "autoload": {
354 | "classmap": [
355 | "src/"
356 | ]
357 | },
358 | "notification-url": "https://packagist.org/downloads/",
359 | "license": [
360 | "BSD-3-Clause"
361 | ],
362 | "authors": [
363 | {
364 | "name": "Sebastian Bergmann",
365 | "email": "sb@sebastian-bergmann.de",
366 | "role": "lead"
367 | }
368 | ],
369 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
370 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
371 | "keywords": [
372 | "coverage",
373 | "testing",
374 | "xunit"
375 | ],
376 | "time": "2017-04-02T07:44:40+00:00"
377 | },
378 | {
379 | "name": "phpunit/php-file-iterator",
380 | "version": "1.4.2",
381 | "source": {
382 | "type": "git",
383 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
384 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5"
385 | },
386 | "dist": {
387 | "type": "zip",
388 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
389 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
390 | "shasum": ""
391 | },
392 | "require": {
393 | "php": ">=5.3.3"
394 | },
395 | "type": "library",
396 | "extra": {
397 | "branch-alias": {
398 | "dev-master": "1.4.x-dev"
399 | }
400 | },
401 | "autoload": {
402 | "classmap": [
403 | "src/"
404 | ]
405 | },
406 | "notification-url": "https://packagist.org/downloads/",
407 | "license": [
408 | "BSD-3-Clause"
409 | ],
410 | "authors": [
411 | {
412 | "name": "Sebastian Bergmann",
413 | "email": "sb@sebastian-bergmann.de",
414 | "role": "lead"
415 | }
416 | ],
417 | "description": "FilterIterator implementation that filters files based on a list of suffixes.",
418 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
419 | "keywords": [
420 | "filesystem",
421 | "iterator"
422 | ],
423 | "time": "2016-10-03T07:40:28+00:00"
424 | },
425 | {
426 | "name": "phpunit/php-text-template",
427 | "version": "1.2.1",
428 | "source": {
429 | "type": "git",
430 | "url": "https://github.com/sebastianbergmann/php-text-template.git",
431 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
432 | },
433 | "dist": {
434 | "type": "zip",
435 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
436 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
437 | "shasum": ""
438 | },
439 | "require": {
440 | "php": ">=5.3.3"
441 | },
442 | "type": "library",
443 | "autoload": {
444 | "classmap": [
445 | "src/"
446 | ]
447 | },
448 | "notification-url": "https://packagist.org/downloads/",
449 | "license": [
450 | "BSD-3-Clause"
451 | ],
452 | "authors": [
453 | {
454 | "name": "Sebastian Bergmann",
455 | "email": "sebastian@phpunit.de",
456 | "role": "lead"
457 | }
458 | ],
459 | "description": "Simple template engine.",
460 | "homepage": "https://github.com/sebastianbergmann/php-text-template/",
461 | "keywords": [
462 | "template"
463 | ],
464 | "time": "2015-06-21T13:50:34+00:00"
465 | },
466 | {
467 | "name": "phpunit/php-timer",
468 | "version": "1.0.9",
469 | "source": {
470 | "type": "git",
471 | "url": "https://github.com/sebastianbergmann/php-timer.git",
472 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
473 | },
474 | "dist": {
475 | "type": "zip",
476 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
477 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
478 | "shasum": ""
479 | },
480 | "require": {
481 | "php": "^5.3.3 || ^7.0"
482 | },
483 | "require-dev": {
484 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
485 | },
486 | "type": "library",
487 | "extra": {
488 | "branch-alias": {
489 | "dev-master": "1.0-dev"
490 | }
491 | },
492 | "autoload": {
493 | "classmap": [
494 | "src/"
495 | ]
496 | },
497 | "notification-url": "https://packagist.org/downloads/",
498 | "license": [
499 | "BSD-3-Clause"
500 | ],
501 | "authors": [
502 | {
503 | "name": "Sebastian Bergmann",
504 | "email": "sb@sebastian-bergmann.de",
505 | "role": "lead"
506 | }
507 | ],
508 | "description": "Utility class for timing",
509 | "homepage": "https://github.com/sebastianbergmann/php-timer/",
510 | "keywords": [
511 | "timer"
512 | ],
513 | "time": "2017-02-26T11:10:40+00:00"
514 | },
515 | {
516 | "name": "phpunit/php-token-stream",
517 | "version": "2.0.1",
518 | "source": {
519 | "type": "git",
520 | "url": "https://github.com/sebastianbergmann/php-token-stream.git",
521 | "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0"
522 | },
523 | "dist": {
524 | "type": "zip",
525 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0",
526 | "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0",
527 | "shasum": ""
528 | },
529 | "require": {
530 | "ext-tokenizer": "*",
531 | "php": "^7.0"
532 | },
533 | "require-dev": {
534 | "phpunit/phpunit": "^6.2.4"
535 | },
536 | "type": "library",
537 | "extra": {
538 | "branch-alias": {
539 | "dev-master": "2.0-dev"
540 | }
541 | },
542 | "autoload": {
543 | "classmap": [
544 | "src/"
545 | ]
546 | },
547 | "notification-url": "https://packagist.org/downloads/",
548 | "license": [
549 | "BSD-3-Clause"
550 | ],
551 | "authors": [
552 | {
553 | "name": "Sebastian Bergmann",
554 | "email": "sebastian@phpunit.de"
555 | }
556 | ],
557 | "description": "Wrapper around PHP's tokenizer extension.",
558 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
559 | "keywords": [
560 | "tokenizer"
561 | ],
562 | "time": "2017-08-20T05:47:52+00:00"
563 | },
564 | {
565 | "name": "phpunit/phpunit",
566 | "version": "5.7.21",
567 | "source": {
568 | "type": "git",
569 | "url": "https://github.com/sebastianbergmann/phpunit.git",
570 | "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db"
571 | },
572 | "dist": {
573 | "type": "zip",
574 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db",
575 | "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db",
576 | "shasum": ""
577 | },
578 | "require": {
579 | "ext-dom": "*",
580 | "ext-json": "*",
581 | "ext-libxml": "*",
582 | "ext-mbstring": "*",
583 | "ext-xml": "*",
584 | "myclabs/deep-copy": "~1.3",
585 | "php": "^5.6 || ^7.0",
586 | "phpspec/prophecy": "^1.6.2",
587 | "phpunit/php-code-coverage": "^4.0.4",
588 | "phpunit/php-file-iterator": "~1.4",
589 | "phpunit/php-text-template": "~1.2",
590 | "phpunit/php-timer": "^1.0.6",
591 | "phpunit/phpunit-mock-objects": "^3.2",
592 | "sebastian/comparator": "^1.2.4",
593 | "sebastian/diff": "^1.4.3",
594 | "sebastian/environment": "^1.3.4 || ^2.0",
595 | "sebastian/exporter": "~2.0",
596 | "sebastian/global-state": "^1.1",
597 | "sebastian/object-enumerator": "~2.0",
598 | "sebastian/resource-operations": "~1.0",
599 | "sebastian/version": "~1.0.3|~2.0",
600 | "symfony/yaml": "~2.1|~3.0"
601 | },
602 | "conflict": {
603 | "phpdocumentor/reflection-docblock": "3.0.2"
604 | },
605 | "require-dev": {
606 | "ext-pdo": "*"
607 | },
608 | "suggest": {
609 | "ext-xdebug": "*",
610 | "phpunit/php-invoker": "~1.1"
611 | },
612 | "bin": [
613 | "phpunit"
614 | ],
615 | "type": "library",
616 | "extra": {
617 | "branch-alias": {
618 | "dev-master": "5.7.x-dev"
619 | }
620 | },
621 | "autoload": {
622 | "classmap": [
623 | "src/"
624 | ]
625 | },
626 | "notification-url": "https://packagist.org/downloads/",
627 | "license": [
628 | "BSD-3-Clause"
629 | ],
630 | "authors": [
631 | {
632 | "name": "Sebastian Bergmann",
633 | "email": "sebastian@phpunit.de",
634 | "role": "lead"
635 | }
636 | ],
637 | "description": "The PHP Unit Testing framework.",
638 | "homepage": "https://phpunit.de/",
639 | "keywords": [
640 | "phpunit",
641 | "testing",
642 | "xunit"
643 | ],
644 | "time": "2017-06-21T08:11:54+00:00"
645 | },
646 | {
647 | "name": "phpunit/phpunit-mock-objects",
648 | "version": "3.4.4",
649 | "source": {
650 | "type": "git",
651 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
652 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
653 | },
654 | "dist": {
655 | "type": "zip",
656 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
657 | "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
658 | "shasum": ""
659 | },
660 | "require": {
661 | "doctrine/instantiator": "^1.0.2",
662 | "php": "^5.6 || ^7.0",
663 | "phpunit/php-text-template": "^1.2",
664 | "sebastian/exporter": "^1.2 || ^2.0"
665 | },
666 | "conflict": {
667 | "phpunit/phpunit": "<5.4.0"
668 | },
669 | "require-dev": {
670 | "phpunit/phpunit": "^5.4"
671 | },
672 | "suggest": {
673 | "ext-soap": "*"
674 | },
675 | "type": "library",
676 | "extra": {
677 | "branch-alias": {
678 | "dev-master": "3.2.x-dev"
679 | }
680 | },
681 | "autoload": {
682 | "classmap": [
683 | "src/"
684 | ]
685 | },
686 | "notification-url": "https://packagist.org/downloads/",
687 | "license": [
688 | "BSD-3-Clause"
689 | ],
690 | "authors": [
691 | {
692 | "name": "Sebastian Bergmann",
693 | "email": "sb@sebastian-bergmann.de",
694 | "role": "lead"
695 | }
696 | ],
697 | "description": "Mock Object library for PHPUnit",
698 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
699 | "keywords": [
700 | "mock",
701 | "xunit"
702 | ],
703 | "time": "2017-06-30T09:13:00+00:00"
704 | },
705 | {
706 | "name": "sebastian/code-unit-reverse-lookup",
707 | "version": "1.0.1",
708 | "source": {
709 | "type": "git",
710 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
711 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
712 | },
713 | "dist": {
714 | "type": "zip",
715 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
716 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
717 | "shasum": ""
718 | },
719 | "require": {
720 | "php": "^5.6 || ^7.0"
721 | },
722 | "require-dev": {
723 | "phpunit/phpunit": "^5.7 || ^6.0"
724 | },
725 | "type": "library",
726 | "extra": {
727 | "branch-alias": {
728 | "dev-master": "1.0.x-dev"
729 | }
730 | },
731 | "autoload": {
732 | "classmap": [
733 | "src/"
734 | ]
735 | },
736 | "notification-url": "https://packagist.org/downloads/",
737 | "license": [
738 | "BSD-3-Clause"
739 | ],
740 | "authors": [
741 | {
742 | "name": "Sebastian Bergmann",
743 | "email": "sebastian@phpunit.de"
744 | }
745 | ],
746 | "description": "Looks up which function or method a line of code belongs to",
747 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
748 | "time": "2017-03-04T06:30:41+00:00"
749 | },
750 | {
751 | "name": "sebastian/comparator",
752 | "version": "1.2.4",
753 | "source": {
754 | "type": "git",
755 | "url": "https://github.com/sebastianbergmann/comparator.git",
756 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
757 | },
758 | "dist": {
759 | "type": "zip",
760 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
761 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
762 | "shasum": ""
763 | },
764 | "require": {
765 | "php": ">=5.3.3",
766 | "sebastian/diff": "~1.2",
767 | "sebastian/exporter": "~1.2 || ~2.0"
768 | },
769 | "require-dev": {
770 | "phpunit/phpunit": "~4.4"
771 | },
772 | "type": "library",
773 | "extra": {
774 | "branch-alias": {
775 | "dev-master": "1.2.x-dev"
776 | }
777 | },
778 | "autoload": {
779 | "classmap": [
780 | "src/"
781 | ]
782 | },
783 | "notification-url": "https://packagist.org/downloads/",
784 | "license": [
785 | "BSD-3-Clause"
786 | ],
787 | "authors": [
788 | {
789 | "name": "Jeff Welch",
790 | "email": "whatthejeff@gmail.com"
791 | },
792 | {
793 | "name": "Volker Dusch",
794 | "email": "github@wallbash.com"
795 | },
796 | {
797 | "name": "Bernhard Schussek",
798 | "email": "bschussek@2bepublished.at"
799 | },
800 | {
801 | "name": "Sebastian Bergmann",
802 | "email": "sebastian@phpunit.de"
803 | }
804 | ],
805 | "description": "Provides the functionality to compare PHP values for equality",
806 | "homepage": "http://www.github.com/sebastianbergmann/comparator",
807 | "keywords": [
808 | "comparator",
809 | "compare",
810 | "equality"
811 | ],
812 | "time": "2017-01-29T09:50:25+00:00"
813 | },
814 | {
815 | "name": "sebastian/diff",
816 | "version": "1.4.3",
817 | "source": {
818 | "type": "git",
819 | "url": "https://github.com/sebastianbergmann/diff.git",
820 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
821 | },
822 | "dist": {
823 | "type": "zip",
824 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
825 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
826 | "shasum": ""
827 | },
828 | "require": {
829 | "php": "^5.3.3 || ^7.0"
830 | },
831 | "require-dev": {
832 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
833 | },
834 | "type": "library",
835 | "extra": {
836 | "branch-alias": {
837 | "dev-master": "1.4-dev"
838 | }
839 | },
840 | "autoload": {
841 | "classmap": [
842 | "src/"
843 | ]
844 | },
845 | "notification-url": "https://packagist.org/downloads/",
846 | "license": [
847 | "BSD-3-Clause"
848 | ],
849 | "authors": [
850 | {
851 | "name": "Kore Nordmann",
852 | "email": "mail@kore-nordmann.de"
853 | },
854 | {
855 | "name": "Sebastian Bergmann",
856 | "email": "sebastian@phpunit.de"
857 | }
858 | ],
859 | "description": "Diff implementation",
860 | "homepage": "https://github.com/sebastianbergmann/diff",
861 | "keywords": [
862 | "diff"
863 | ],
864 | "time": "2017-05-22T07:24:03+00:00"
865 | },
866 | {
867 | "name": "sebastian/environment",
868 | "version": "2.0.0",
869 | "source": {
870 | "type": "git",
871 | "url": "https://github.com/sebastianbergmann/environment.git",
872 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
873 | },
874 | "dist": {
875 | "type": "zip",
876 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
877 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
878 | "shasum": ""
879 | },
880 | "require": {
881 | "php": "^5.6 || ^7.0"
882 | },
883 | "require-dev": {
884 | "phpunit/phpunit": "^5.0"
885 | },
886 | "type": "library",
887 | "extra": {
888 | "branch-alias": {
889 | "dev-master": "2.0.x-dev"
890 | }
891 | },
892 | "autoload": {
893 | "classmap": [
894 | "src/"
895 | ]
896 | },
897 | "notification-url": "https://packagist.org/downloads/",
898 | "license": [
899 | "BSD-3-Clause"
900 | ],
901 | "authors": [
902 | {
903 | "name": "Sebastian Bergmann",
904 | "email": "sebastian@phpunit.de"
905 | }
906 | ],
907 | "description": "Provides functionality to handle HHVM/PHP environments",
908 | "homepage": "http://www.github.com/sebastianbergmann/environment",
909 | "keywords": [
910 | "Xdebug",
911 | "environment",
912 | "hhvm"
913 | ],
914 | "time": "2016-11-26T07:53:53+00:00"
915 | },
916 | {
917 | "name": "sebastian/exporter",
918 | "version": "2.0.0",
919 | "source": {
920 | "type": "git",
921 | "url": "https://github.com/sebastianbergmann/exporter.git",
922 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
923 | },
924 | "dist": {
925 | "type": "zip",
926 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
927 | "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
928 | "shasum": ""
929 | },
930 | "require": {
931 | "php": ">=5.3.3",
932 | "sebastian/recursion-context": "~2.0"
933 | },
934 | "require-dev": {
935 | "ext-mbstring": "*",
936 | "phpunit/phpunit": "~4.4"
937 | },
938 | "type": "library",
939 | "extra": {
940 | "branch-alias": {
941 | "dev-master": "2.0.x-dev"
942 | }
943 | },
944 | "autoload": {
945 | "classmap": [
946 | "src/"
947 | ]
948 | },
949 | "notification-url": "https://packagist.org/downloads/",
950 | "license": [
951 | "BSD-3-Clause"
952 | ],
953 | "authors": [
954 | {
955 | "name": "Jeff Welch",
956 | "email": "whatthejeff@gmail.com"
957 | },
958 | {
959 | "name": "Volker Dusch",
960 | "email": "github@wallbash.com"
961 | },
962 | {
963 | "name": "Bernhard Schussek",
964 | "email": "bschussek@2bepublished.at"
965 | },
966 | {
967 | "name": "Sebastian Bergmann",
968 | "email": "sebastian@phpunit.de"
969 | },
970 | {
971 | "name": "Adam Harvey",
972 | "email": "aharvey@php.net"
973 | }
974 | ],
975 | "description": "Provides the functionality to export PHP variables for visualization",
976 | "homepage": "http://www.github.com/sebastianbergmann/exporter",
977 | "keywords": [
978 | "export",
979 | "exporter"
980 | ],
981 | "time": "2016-11-19T08:54:04+00:00"
982 | },
983 | {
984 | "name": "sebastian/global-state",
985 | "version": "1.1.1",
986 | "source": {
987 | "type": "git",
988 | "url": "https://github.com/sebastianbergmann/global-state.git",
989 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
990 | },
991 | "dist": {
992 | "type": "zip",
993 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
994 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
995 | "shasum": ""
996 | },
997 | "require": {
998 | "php": ">=5.3.3"
999 | },
1000 | "require-dev": {
1001 | "phpunit/phpunit": "~4.2"
1002 | },
1003 | "suggest": {
1004 | "ext-uopz": "*"
1005 | },
1006 | "type": "library",
1007 | "extra": {
1008 | "branch-alias": {
1009 | "dev-master": "1.0-dev"
1010 | }
1011 | },
1012 | "autoload": {
1013 | "classmap": [
1014 | "src/"
1015 | ]
1016 | },
1017 | "notification-url": "https://packagist.org/downloads/",
1018 | "license": [
1019 | "BSD-3-Clause"
1020 | ],
1021 | "authors": [
1022 | {
1023 | "name": "Sebastian Bergmann",
1024 | "email": "sebastian@phpunit.de"
1025 | }
1026 | ],
1027 | "description": "Snapshotting of global state",
1028 | "homepage": "http://www.github.com/sebastianbergmann/global-state",
1029 | "keywords": [
1030 | "global state"
1031 | ],
1032 | "time": "2015-10-12T03:26:01+00:00"
1033 | },
1034 | {
1035 | "name": "sebastian/object-enumerator",
1036 | "version": "2.0.1",
1037 | "source": {
1038 | "type": "git",
1039 | "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1040 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
1041 | },
1042 | "dist": {
1043 | "type": "zip",
1044 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
1045 | "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
1046 | "shasum": ""
1047 | },
1048 | "require": {
1049 | "php": ">=5.6",
1050 | "sebastian/recursion-context": "~2.0"
1051 | },
1052 | "require-dev": {
1053 | "phpunit/phpunit": "~5"
1054 | },
1055 | "type": "library",
1056 | "extra": {
1057 | "branch-alias": {
1058 | "dev-master": "2.0.x-dev"
1059 | }
1060 | },
1061 | "autoload": {
1062 | "classmap": [
1063 | "src/"
1064 | ]
1065 | },
1066 | "notification-url": "https://packagist.org/downloads/",
1067 | "license": [
1068 | "BSD-3-Clause"
1069 | ],
1070 | "authors": [
1071 | {
1072 | "name": "Sebastian Bergmann",
1073 | "email": "sebastian@phpunit.de"
1074 | }
1075 | ],
1076 | "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1077 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1078 | "time": "2017-02-18T15:18:39+00:00"
1079 | },
1080 | {
1081 | "name": "sebastian/recursion-context",
1082 | "version": "2.0.0",
1083 | "source": {
1084 | "type": "git",
1085 | "url": "https://github.com/sebastianbergmann/recursion-context.git",
1086 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
1087 | },
1088 | "dist": {
1089 | "type": "zip",
1090 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1091 | "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1092 | "shasum": ""
1093 | },
1094 | "require": {
1095 | "php": ">=5.3.3"
1096 | },
1097 | "require-dev": {
1098 | "phpunit/phpunit": "~4.4"
1099 | },
1100 | "type": "library",
1101 | "extra": {
1102 | "branch-alias": {
1103 | "dev-master": "2.0.x-dev"
1104 | }
1105 | },
1106 | "autoload": {
1107 | "classmap": [
1108 | "src/"
1109 | ]
1110 | },
1111 | "notification-url": "https://packagist.org/downloads/",
1112 | "license": [
1113 | "BSD-3-Clause"
1114 | ],
1115 | "authors": [
1116 | {
1117 | "name": "Jeff Welch",
1118 | "email": "whatthejeff@gmail.com"
1119 | },
1120 | {
1121 | "name": "Sebastian Bergmann",
1122 | "email": "sebastian@phpunit.de"
1123 | },
1124 | {
1125 | "name": "Adam Harvey",
1126 | "email": "aharvey@php.net"
1127 | }
1128 | ],
1129 | "description": "Provides functionality to recursively process PHP variables",
1130 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1131 | "time": "2016-11-19T07:33:16+00:00"
1132 | },
1133 | {
1134 | "name": "sebastian/resource-operations",
1135 | "version": "1.0.0",
1136 | "source": {
1137 | "type": "git",
1138 | "url": "https://github.com/sebastianbergmann/resource-operations.git",
1139 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
1140 | },
1141 | "dist": {
1142 | "type": "zip",
1143 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1144 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1145 | "shasum": ""
1146 | },
1147 | "require": {
1148 | "php": ">=5.6.0"
1149 | },
1150 | "type": "library",
1151 | "extra": {
1152 | "branch-alias": {
1153 | "dev-master": "1.0.x-dev"
1154 | }
1155 | },
1156 | "autoload": {
1157 | "classmap": [
1158 | "src/"
1159 | ]
1160 | },
1161 | "notification-url": "https://packagist.org/downloads/",
1162 | "license": [
1163 | "BSD-3-Clause"
1164 | ],
1165 | "authors": [
1166 | {
1167 | "name": "Sebastian Bergmann",
1168 | "email": "sebastian@phpunit.de"
1169 | }
1170 | ],
1171 | "description": "Provides a list of PHP built-in functions that operate on resources",
1172 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1173 | "time": "2015-07-28T20:34:47+00:00"
1174 | },
1175 | {
1176 | "name": "sebastian/version",
1177 | "version": "2.0.1",
1178 | "source": {
1179 | "type": "git",
1180 | "url": "https://github.com/sebastianbergmann/version.git",
1181 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
1182 | },
1183 | "dist": {
1184 | "type": "zip",
1185 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
1186 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
1187 | "shasum": ""
1188 | },
1189 | "require": {
1190 | "php": ">=5.6"
1191 | },
1192 | "type": "library",
1193 | "extra": {
1194 | "branch-alias": {
1195 | "dev-master": "2.0.x-dev"
1196 | }
1197 | },
1198 | "autoload": {
1199 | "classmap": [
1200 | "src/"
1201 | ]
1202 | },
1203 | "notification-url": "https://packagist.org/downloads/",
1204 | "license": [
1205 | "BSD-3-Clause"
1206 | ],
1207 | "authors": [
1208 | {
1209 | "name": "Sebastian Bergmann",
1210 | "email": "sebastian@phpunit.de",
1211 | "role": "lead"
1212 | }
1213 | ],
1214 | "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1215 | "homepage": "https://github.com/sebastianbergmann/version",
1216 | "time": "2016-10-03T07:35:21+00:00"
1217 | },
1218 | {
1219 | "name": "symfony/yaml",
1220 | "version": "v3.3.8",
1221 | "source": {
1222 | "type": "git",
1223 | "url": "https://github.com/symfony/yaml.git",
1224 | "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0"
1225 | },
1226 | "dist": {
1227 | "type": "zip",
1228 | "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0",
1229 | "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0",
1230 | "shasum": ""
1231 | },
1232 | "require": {
1233 | "php": "^5.5.9|>=7.0.8"
1234 | },
1235 | "require-dev": {
1236 | "symfony/console": "~2.8|~3.0"
1237 | },
1238 | "suggest": {
1239 | "symfony/console": "For validating YAML files using the lint command"
1240 | },
1241 | "type": "library",
1242 | "extra": {
1243 | "branch-alias": {
1244 | "dev-master": "3.3-dev"
1245 | }
1246 | },
1247 | "autoload": {
1248 | "psr-4": {
1249 | "Symfony\\Component\\Yaml\\": ""
1250 | },
1251 | "exclude-from-classmap": [
1252 | "/Tests/"
1253 | ]
1254 | },
1255 | "notification-url": "https://packagist.org/downloads/",
1256 | "license": [
1257 | "MIT"
1258 | ],
1259 | "authors": [
1260 | {
1261 | "name": "Fabien Potencier",
1262 | "email": "fabien@symfony.com"
1263 | },
1264 | {
1265 | "name": "Symfony Community",
1266 | "homepage": "https://symfony.com/contributors"
1267 | }
1268 | ],
1269 | "description": "Symfony Yaml Component",
1270 | "homepage": "https://symfony.com",
1271 | "time": "2017-07-29T21:54:42+00:00"
1272 | },
1273 | {
1274 | "name": "webmozart/assert",
1275 | "version": "1.2.0",
1276 | "source": {
1277 | "type": "git",
1278 | "url": "https://github.com/webmozart/assert.git",
1279 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
1280 | },
1281 | "dist": {
1282 | "type": "zip",
1283 | "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
1284 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
1285 | "shasum": ""
1286 | },
1287 | "require": {
1288 | "php": "^5.3.3 || ^7.0"
1289 | },
1290 | "require-dev": {
1291 | "phpunit/phpunit": "^4.6",
1292 | "sebastian/version": "^1.0.1"
1293 | },
1294 | "type": "library",
1295 | "extra": {
1296 | "branch-alias": {
1297 | "dev-master": "1.3-dev"
1298 | }
1299 | },
1300 | "autoload": {
1301 | "psr-4": {
1302 | "Webmozart\\Assert\\": "src/"
1303 | }
1304 | },
1305 | "notification-url": "https://packagist.org/downloads/",
1306 | "license": [
1307 | "MIT"
1308 | ],
1309 | "authors": [
1310 | {
1311 | "name": "Bernhard Schussek",
1312 | "email": "bschussek@gmail.com"
1313 | }
1314 | ],
1315 | "description": "Assertions to validate method input/output with nice error messages.",
1316 | "keywords": [
1317 | "assert",
1318 | "check",
1319 | "validate"
1320 | ],
1321 | "time": "2016-11-23T20:04:58+00:00"
1322 | }
1323 | ],
1324 | "aliases": [],
1325 | "minimum-stability": "stable",
1326 | "stability-flags": [],
1327 | "prefer-stable": false,
1328 | "prefer-lowest": false,
1329 | "platform": {
1330 | "php": ">=7.1.0",
1331 | "ext-hash": "*"
1332 | },
1333 | "platform-dev": []
1334 | }
1335 |
--------------------------------------------------------------------------------