@@ -30,7 +30,6 @@ |
||
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Marker_Model constructor. |
| 33 | - * @param array|object|string $address |
|
| 34 | 33 | * @param array $args |
| 35 | 34 | */ |
| 36 | 35 | function __construct( $args = array() ) { |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | * @return Location |
| 56 | 56 | */ |
| 57 | 57 | function location() { |
| 58 | - if ( ! is_object( $this->_location ) ) { |
|
| 59 | - $this->_location = $this->_geocoder()->geocode($this->_address); |
|
| 58 | + if ( !is_object( $this->_location ) ) { |
|
| 59 | + $this->_location = $this->_geocoder()->geocode( $this->_address ); |
|
| 60 | 60 | } |
| 61 | 61 | return $this->_location; |
| 62 | 62 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @return Geocoder |
| 80 | 80 | */ |
| 81 | 81 | private function _geocoder() { |
| 82 | - if (! is_object($this->_geocoder)) { |
|
| 82 | + if ( !is_object( $this->_geocoder ) ) { |
|
| 83 | 83 | $this->_geocoder = new Geocoder(); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -56,10 +56,10 @@ |
||
| 56 | 56 | |
| 57 | 57 | $key = static::api_key(); |
| 58 | 58 | |
| 59 | - wp_register_script('google-maps', "https://maps.google.com/maps/api/js?key={$key}", false, '3.0', true ); |
|
| 60 | - wp_register_script('map-control', home_url( '/vendor/clubdeuce/wplib-olm-google-maps/assets/maps.js' ), array( 'jquery', 'google-maps' ), '0.1', true ); |
|
| 59 | + wp_register_script( 'google-maps', "https://maps.google.com/maps/api/js?key={$key}", false, '3.0', true ); |
|
| 60 | + wp_register_script( 'map-control', home_url( '/vendor/clubdeuce/wplib-olm-google-maps/assets/maps.js' ), array( 'jquery', 'google-maps' ), '0.1', true ); |
|
| 61 | 61 | |
| 62 | - array_walk(static::$_script_conditions, function( $function ) { |
|
| 62 | + array_walk( static::$_script_conditions, function( $function ) { |
|
| 63 | 63 | return is_callable( $function ) ? call_user_func( $function ) : $function; |
| 64 | 64 | } ); |
| 65 | 65 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | public function setUp() { |
| 35 | - $this->_location = new Location([ |
|
| 35 | + $this->_location = new Location( [ |
|
| 36 | 36 | 'address' => '123 Anywhere Street Anywhere NY', |
| 37 | 37 | 'formatted_address' => '123 Anywhere Street, Anywhere, NY 12345 USA', |
| 38 | 38 | 'latitude' => 100.12345, |
@@ -40,15 +40,15 @@ discard block |
||
| 40 | 40 | 'place_id' => 'foobar', |
| 41 | 41 | 'types' => ['foo', 'bar'], |
| 42 | 42 | 'viewport' => ['northeast' => ['lat' => 100.12346, 'lng' => -100.12344], 'southwest' => ['lat' => 100.12344, 'lng' => -100.12346]], |
| 43 | - ]); |
|
| 43 | + ] ); |
|
| 44 | 44 | |
| 45 | - $this->_geocoder = \Mockery::mock('\Clubdeuce\WPLib\Components\GoogleMaps\Geocoder'); |
|
| 46 | - $this->_geocoder->shouldReceive('geocode')->andReturn($this->_location); |
|
| 45 | + $this->_geocoder = \Mockery::mock( '\Clubdeuce\WPLib\Components\GoogleMaps\Geocoder' ); |
|
| 46 | + $this->_geocoder->shouldReceive( 'geocode' )->andReturn( $this->_location ); |
|
| 47 | 47 | |
| 48 | - $this->_model = new Marker_Model([ |
|
| 48 | + $this->_model = new Marker_Model( [ |
|
| 49 | 49 | 'address' => $this->_address, |
| 50 | 50 | 'geocoder' => $this->_geocoder, |
| 51 | - ]); |
|
| 51 | + ] ); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | * @covers ::latitude |
| 57 | 57 | */ |
| 58 | 58 | public function testLatitude() { |
| 59 | - $this->assertEquals(100.12345, $this->_model->latitude()); |
|
| 59 | + $this->assertEquals( 100.12345, $this->_model->latitude() ); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * @covers ::location |
| 64 | 64 | */ |
| 65 | 65 | public function testLocation() { |
| 66 | - $this->assertEquals($this->_location, $this->_model->location()); |
|
| 66 | + $this->assertEquals( $this->_location, $this->_model->location() ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @covers ::_geocoder |
| 78 | 78 | */ |
| 79 | 79 | public function testGeocoder() { |
| 80 | - $this->assertEquals($this->_geocoder, $this->reflectionMethodInvoke($this->_model, '_geocoder')); |
|
| 80 | + $this->assertEquals( $this->_geocoder, $this->reflectionMethodInvoke( $this->_model, '_geocoder' ) ); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -85,6 +85,6 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function testCreateGeocoder() { |
| 87 | 87 | $marker_model = new Marker_Model(); |
| 88 | - $this->assertInstanceOf('\Clubdeuce\WPLib\Components\GoogleMaps\Geocoder', $this->reflectionMethodInvoke($marker_model, '_geocoder')); |
|
| 88 | + $this->assertInstanceOf( '\Clubdeuce\WPLib\Components\GoogleMaps\Geocoder', $this->reflectionMethodInvoke( $marker_model, '_geocoder' ) ); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | \ No newline at end of file |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | function the_map() { |
| 13 | 13 | |
| 14 | - wp_localize_script( 'map-control', 'objMapParams', $this->_make_map_args() ); |
|
| 14 | + wp_localize_script( 'map-control', 'objMapParams', $this->_make_map_args() ); |
|
| 15 | 15 | wp_localize_script( 'map-control', 'objMapMarkers', $this->_make_markers_args() ); |
| 16 | 16 | |
| 17 | 17 | echo '<div id="map" class="google-map" style="height: 400px; width: 100%"></div>'; |