<?php

namespace PHPNative\Tailwind\Parser;

class State
{

    public static function parse(string $style): ?\PHPNative\Tailwind\Style\StateEnum
    {
        preg_match_all("/(hover|focus|active)\:(.*)/", $style, $output_array);
        if (count($output_array[0]) > 0) {
            $query = strtolower($output_array[1][0]);
            return \PHPNative\Tailwind\Style\StateEnum::{$query};
        }

        return null;
    }
}