@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | function color() { |
| 40 | 40 | |
| 41 | - return (string)$this->_color; |
|
| 41 | + return ( string ) $this->_color; |
|
| 42 | 42 | |
| 43 | 43 | } |
| 44 | 44 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | function font_family() { |
| 49 | 49 | |
| 50 | - return (string)$this->_font_family; |
|
| 50 | + return ( string ) $this->_font_family; |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | function font_size() { |
| 58 | 58 | |
| 59 | - return (string)$this->_font_size; |
|
| 59 | + return ( string ) $this->_font_size; |
|
| 60 | 60 | |
| 61 | 61 | } |
| 62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | function font_weight() { |
| 67 | 67 | |
| 68 | - return (string)$this->_font_weight; |
|
| 68 | + return ( string ) $this->_font_weight; |
|
| 69 | 69 | |
| 70 | 70 | } |
| 71 | 71 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | function text() { |
| 76 | 76 | |
| 77 | - return (string)$this->_text; |
|
| 77 | + return ( string ) $this->_text; |
|
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
@@ -101,10 +101,10 @@ discard block |
||
| 101 | 101 | ]; |
| 102 | 102 | |
| 103 | 103 | $args = array_filter( $args, function( $value ) { |
| 104 | - return ! is_null( $value ); |
|
| 104 | + return !is_null( $value ); |
|
| 105 | 105 | } ); |
| 106 | 106 | |
| 107 | - if ( empty( $args['text'] ) ) { |
|
| 107 | + if ( empty($args['text']) ) { |
|
| 108 | 108 | $args = ''; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | private $_location; |
| 20 | 20 | |
| 21 | 21 | public function setUp() { |
| 22 | - $this->_location = new Location_Model([ |
|
| 22 | + $this->_location = new Location_Model( [ |
|
| 23 | 23 | 'address' => '1600 Amphitheatre Parkway Mountain View CA', |
| 24 | 24 | 'formatted_address' => '1600 Amphitheatre Parkway, Mountain View, CA, 12345', |
| 25 | 25 | 'latitude' => 100.12345, |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | * @covers ::__call |
| 34 | 34 | */ |
| 35 | 35 | public function testAddress() { |
| 36 | - $this->assertEquals('1600 Amphitheatre Parkway Mountain View CA', $this->_location->address()); |
|
| 36 | + $this->assertEquals( '1600 Amphitheatre Parkway Mountain View CA', $this->_location->address() ); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * @covers ::__call |
| 41 | 41 | */ |
| 42 | 42 | public function testFormattedAddress() { |
| 43 | - $this->assertEquals('1600 Amphitheatre Parkway, Mountain View, CA, 12345', $this->_location->formatted_address()); |
|
| 43 | + $this->assertEquals( '1600 Amphitheatre Parkway, Mountain View, CA, 12345', $this->_location->formatted_address() ); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * @covers ::__call |
| 48 | 48 | */ |
| 49 | 49 | public function testLatitude() { |
| 50 | - $this->assertEquals(100.12345, $this->_location->latitude()); |
|
| 50 | + $this->assertEquals( 100.12345, $this->_location->latitude() ); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | * @covers ::__call |
| 62 | 62 | */ |
| 63 | 63 | public function testPlaceId() { |
| 64 | - $this->assertEquals('foobar', $this->_location->place_id()); |
|
| 64 | + $this->assertEquals( 'foobar', $this->_location->place_id() ); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * @covers ::__call |
| 69 | 69 | */ |
| 70 | 70 | public function testViewport() { |
| 71 | - $this->assertEquals(['foo', 'bar'], $this->_location->viewport()); |
|
| 71 | + $this->assertEquals( ['foo', 'bar'], $this->_location->viewport() ); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | \ No newline at end of file |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | static function geocoder() { |
| 50 | 50 | |
| 51 | - if ( ! isset( static::$_geocoder ) ) { |
|
| 52 | - static::$_geocoder = new Geocoder( ['api_key' => self::api_key() ] ); |
|
| 51 | + if ( !isset(static::$_geocoder) ) { |
|
| 52 | + static::$_geocoder = new Geocoder( ['api_key' => self::api_key()] ); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return static::$_geocoder; |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $source = home_url( '/vendor/clubdeuce/wplib-olm-google-maps/assets/maps.js' ); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - wp_register_script('google-maps', "https://maps.google.com/maps/api/js?v=3&key={$key}", false, '3.0', true ); |
|
| 98 | - wp_register_script('map-control', $source, array( 'jquery', 'google-maps' ), '0.1.2', true ); |
|
| 97 | + wp_register_script( 'google-maps', "https://maps.google.com/maps/api/js?v=3&key={$key}", false, '3.0', true ); |
|
| 98 | + wp_register_script( 'map-control', $source, array( 'jquery', 'google-maps' ), '0.1.2', true ); |
|
| 99 | 99 | |
| 100 | 100 | $conditions = array_map( function( &$function ) { |
| 101 | 101 | return is_callable( $function ) ? call_user_func( $function ) : $function; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @param array $args |
| 128 | 128 | * @return string |
| 129 | 129 | */ |
| 130 | - static function driving_directions_href($destination, $args = array() ) { |
|
| 130 | + static function driving_directions_href( $destination, $args = array() ) { |
|
| 131 | 131 | |
| 132 | 132 | $args = wp_parse_args( $args, array( |
| 133 | 133 | 'start' => 'My Location', |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $markers = $this->_make_markers_args(); |
| 19 | 19 | $info_windows = $this->_make_info_windows(); |
| 20 | 20 | |
| 21 | - require dirname( __DIR__) . '/templates/map-view.php'; |
|
| 21 | + require dirname( __DIR__ ).'/templates/map-view.php'; |
|
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * @var Marker $marker |
| 48 | 48 | */ |
| 49 | - foreach( $this->item->markers() as $marker ) { |
|
| 49 | + foreach ( $this->item->markers() as $marker ) { |
|
| 50 | 50 | $info_window = $marker->info_window(); |
| 51 | 51 | $windows[] = array( |
| 52 | 52 | 'content' => $info_window->content(), |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function latitude() { |
| 84 | 84 | $latitude = 0; |
| 85 | - if ( ! is_wp_error( $this->location() ) ) { |
|
| 85 | + if ( !is_wp_error( $this->location() ) ) { |
|
| 86 | 86 | $latitude = $this->location()->latitude(); |
| 87 | 87 | } |
| 88 | 88 | return $latitude; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @return Location|\WP_Error |
| 93 | 93 | */ |
| 94 | 94 | function location() { |
| 95 | - if ( ! is_object( $this->_location ) ) { |
|
| 95 | + if ( !is_object( $this->_location ) ) { |
|
| 96 | 96 | $this->_location = $this->_geocoder()->geocode( $this->_address ); |
| 97 | 97 | } |
| 98 | 98 | return $this->_location; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function longitude() { |
| 105 | 105 | $longitude = 0; |
| 106 | - if ( ! is_wp_error( $this->location() ) ) { |
|
| 106 | + if ( !is_wp_error( $this->location() ) ) { |
|
| 107 | 107 | $longitude = $this->location()->longitude(); |
| 108 | 108 | } |
| 109 | 109 | return $longitude; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @return Geocoder |
| 150 | 150 | */ |
| 151 | 151 | private function _geocoder() { |
| 152 | - if (! is_object( $this->_geocoder ) ) { |
|
| 152 | + if ( !is_object( $this->_geocoder ) ) { |
|
| 153 | 153 | $this->_geocoder = new Geocoder(); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -1,41 +1,41 @@ |
||
| 1 | 1 | <?php |
| 2 | -define('VENDOR_DIRECTORY', dirname(__DIR__) . '/vendor'); |
|
| 3 | -define('TEST_INCLUDES_DIR', dirname(__FILE__) . '/includes'); |
|
| 2 | +define( 'VENDOR_DIRECTORY', dirname( __DIR__ ).'/vendor' ); |
|
| 3 | +define( 'TEST_INCLUDES_DIR', dirname( __FILE__ ).'/includes' ); |
|
| 4 | 4 | |
| 5 | -if (! file_exists( dirname(__DIR__) . '/build' ) ) { |
|
| 6 | - mkdir(dirname(__DIR__) . '/build'); |
|
| 5 | +if ( !file_exists( dirname( __DIR__ ).'/build' ) ) { |
|
| 6 | + mkdir( dirname( __DIR__ ).'/build' ); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -require_once getenv( 'WP_TESTS_DIR' ) . '/tests/phpunit/includes/functions.php'; |
|
| 10 | -require getenv( 'WP_TESTS_DIR' ) . '/tests/phpunit/includes/bootstrap.php'; |
|
| 9 | +require_once getenv( 'WP_TESTS_DIR' ).'/tests/phpunit/includes/functions.php'; |
|
| 10 | +require getenv( 'WP_TESTS_DIR' ).'/tests/phpunit/includes/bootstrap.php'; |
|
| 11 | 11 | |
| 12 | 12 | require 'includes/testCase.php'; |
| 13 | 13 | |
| 14 | -require VENDOR_DIRECTORY . '/autoload.php'; |
|
| 14 | +require VENDOR_DIRECTORY.'/autoload.php'; |
|
| 15 | 15 | |
| 16 | -if ( ! function_exists( 'wplib_define' ) ) { |
|
| 17 | - require( VENDOR_DIRECTORY . '/wplib/wplib/defines.php' ); |
|
| 16 | +if ( !function_exists( 'wplib_define' ) ) { |
|
| 17 | + require(VENDOR_DIRECTORY.'/wplib/wplib/defines.php'); |
|
| 18 | 18 | wplib_define( 'WPLib_Runmode', 'PRODUCTION' ); |
| 19 | 19 | wplib_define( 'WPLib_Stability', 'EXPERIMENTAL' ); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -require VENDOR_DIRECTORY . '/wplib/wplib/wplib.php'; |
|
| 22 | +require VENDOR_DIRECTORY.'/wplib/wplib/wplib.php'; |
|
| 23 | 23 | WPLib::initialize(); |
| 24 | 24 | |
| 25 | -require_once dirname(__DIR__) . '/includes/class-geocoder.php'; |
|
| 26 | -require_once dirname(__DIR__) . '/includes/class-info-window-model.php'; |
|
| 27 | -require_once dirname(__DIR__) . '/includes/class-info-window-view.php'; |
|
| 28 | -require_once dirname(__DIR__) . '/includes/class-info-window.php'; |
|
| 29 | -require_once dirname(__DIR__) . '/includes/class-location.php'; |
|
| 30 | -require_once dirname(__DIR__) . '/includes/class-location-model.php'; |
|
| 31 | -require_once dirname(__DIR__) . '/includes/class-location-view.php'; |
|
| 32 | -require_once dirname(__DIR__) . '/includes/class-map.php'; |
|
| 33 | -require_once dirname(__DIR__) . '/includes/class-map-model.php'; |
|
| 34 | -require_once dirname(__DIR__) . '/includes/class-map-view.php'; |
|
| 35 | -require_once dirname(__DIR__) . '/includes/class-marker.php'; |
|
| 36 | -require_once dirname(__DIR__) . '/includes/class-marker-label.php'; |
|
| 37 | -require_once dirname(__DIR__) . '/includes/class-marker-label-model.php'; |
|
| 38 | -require_once dirname(__DIR__) . '/includes/class-marker-label-view.php'; |
|
| 39 | -require_once dirname(__DIR__) . '/includes/class-marker-model.php'; |
|
| 40 | -require_once dirname(__DIR__) . '/includes/class-marker-view.php'; |
|
| 41 | -require_once dirname(__DIR__) . '/component-google-maps.php'; |
|
| 25 | +require_once dirname( __DIR__ ).'/includes/class-geocoder.php'; |
|
| 26 | +require_once dirname( __DIR__ ).'/includes/class-info-window-model.php'; |
|
| 27 | +require_once dirname( __DIR__ ).'/includes/class-info-window-view.php'; |
|
| 28 | +require_once dirname( __DIR__ ).'/includes/class-info-window.php'; |
|
| 29 | +require_once dirname( __DIR__ ).'/includes/class-location.php'; |
|
| 30 | +require_once dirname( __DIR__ ).'/includes/class-location-model.php'; |
|
| 31 | +require_once dirname( __DIR__ ).'/includes/class-location-view.php'; |
|
| 32 | +require_once dirname( __DIR__ ).'/includes/class-map.php'; |
|
| 33 | +require_once dirname( __DIR__ ).'/includes/class-map-model.php'; |
|
| 34 | +require_once dirname( __DIR__ ).'/includes/class-map-view.php'; |
|
| 35 | +require_once dirname( __DIR__ ).'/includes/class-marker.php'; |
|
| 36 | +require_once dirname( __DIR__ ).'/includes/class-marker-label.php'; |
|
| 37 | +require_once dirname( __DIR__ ).'/includes/class-marker-label-model.php'; |
|
| 38 | +require_once dirname( __DIR__ ).'/includes/class-marker-label-view.php'; |
|
| 39 | +require_once dirname( __DIR__ ).'/includes/class-marker-model.php'; |
|
| 40 | +require_once dirname( __DIR__ ).'/includes/class-marker-view.php'; |
|
| 41 | +require_once dirname( __DIR__ ).'/component-google-maps.php'; |
|