Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
20.00% covered (danger)
20.00%
1 / 5
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Null_Validator
20.00% covered (danger)
20.00%
1 / 5
50.00% covered (danger)
50.00%
1 / 2
4.05
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 validate
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 */
4
5namespace BrianHenryIE\WC_Address_Validation\API\Validators;
6
7use BrianHenryIE\WC_Address_Validation\API\Address_Validator_Interface;
8use Psr\Log\LoggerAwareTrait;
9use Psr\Log\LoggerInterface;
10
11class Null_Validator implements Address_Validator_Interface {
12
13    use LoggerAwareTrait;
14
15    public function __construct( LoggerInterface $logger ) {
16
17        $this->setLogger( $logger );
18    }
19
20    /**
21     * @param array{address_1: string, address_2: string, city: string, state: string, postcode: string, country: string} $address
22     * @return array{success: bool, original_address: array, updated_address: ?array, message: ?string, error_message: ?string}
23     */
24    public function validate( array $address ): array {
25
26        $result                     = array();
27        $result['original_address'] = $address;
28        $result['success']          = true;
29        return $result;
30    }
31}