src/main/php/auth/AuthConstraint.php
public function jsonSerialize(): array
    {
        $data = ['required' => $this->requiresAuth()];
        if ($this->requiresAuth()) {
            $data['requiresLogin'] = $this->requiresLogin();
        }

        if ($this->requiresRoles()) {
            $data['requiresRoles'] = true;
            $data['requiredRole']  = $this->requiredRole();
        }

        return $data;
    }
public function jsonSerialize(): array
    {
        $data = ['required' => $this->requiresAuth()];
        if ($this->requiresAuth()) {
            $data['requiresLogin'] = $this->requiresLogin();
        }

        if ($this->requiresRoles()) {
            $data['requiresRoles'] = true;
            $data['requiredRole']  = $this->requiredRole();
        }

        return $data;
    }
public function jsonSerialize ( ) : array { $ data = [ 'required' => $ this -> requiresAuth ( ) ] ; if ( $ this -> requiresAuth ( ) ) { $ data [ 'requiresLogin' ] = $ this -> requiresLogin ( ) ; } if ( $ this -> requiresRoles ( ) ) { $ data [ 'requiresRoles' ] = true ; $ data [ 'requiredRole' ] = $ this -> requiredRole ( ) ; } return $ data ; }
returns data suitable for encoding to JSON

@return  array
@since   6.1.0
@XmlIgnore
returns data suitable for encoding to JSON