Passed
Branch master (0e8760)
by 4kizuki
02:17
created
src/Enum.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
         self::_init( );
32 32
 
33
-        if( !self::_validate_constants( $scalar ) or !isset( self::$___constants[ static::class ][ 1 ][ $scalar ] ) )
33
+        if ( !self::_validate_constants( $scalar ) or !isset( self::$___constants[ static::class ][ 1 ][ $scalar ] ) )
34 34
             throw new InvalidInitializerException;
35 35
 
36 36
         $this->scalar = $scalar;
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 
40 40
     final public static function __callStatic( string $name, array $args ) {
41 41
 
42
-        if( !empty( $args ) ) throw new BadMethodCallException;
42
+        if ( !empty( $args ) ) throw new BadMethodCallException;
43 43
 
44 44
         self::_init( );
45 45
 
46
-        if( !isset( self::$___constants[ static::class ][ 0 ][ $name ] ) )
46
+        if ( !isset( self::$___constants[ static::class ][ 0 ][ $name ] ) )
47 47
             throw new InvalidInitializerException;
48 48
 
49 49
         $class = static::class;
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 
54 54
     private static function _init( ) {
55 55
 
56
-        if( isset( self::$___constants[ static::class ] ) ) return;
56
+        if ( isset( self::$___constants[ static::class ] ) ) return;
57 57
 
58 58
         $csts = ( new ReflectionClass( static::class ) )->getConstants();
59 59
         $vals = [ ];
60 60
 
61
-        foreach( $csts as $key => $value ) {
61
+        foreach ( $csts as $key => $value ) {
62 62
 
63 63
             assert( static::_validate_constants( $value ), new EnumConstantTypeException( static::class, $key, gettype( $value ) ) );
64 64
             assert( !isset( $vals[ $value ] ), new DuplicatedConstantException( static::class, $key ) );
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 
75 75
     protected static function _validate_constants( $value ) : bool {
76 76
 
77
-        if( is_int( $value ) ) return true;
78
-        if( is_string( $value ) && $value !== '' ) return true;
77
+        if ( is_int( $value ) ) return true;
78
+        if ( is_string( $value ) && $value !== '' ) return true;
79 79
         return false;
80 80
 
81 81
     }
Please login to merge, or discard this patch.