'place', 'x' => $matches[1], 'y' => $matches[2], 'color' => $matches[3] ]; } if (preg_match($shortCommandPattern, $message, $matches)) { return [ 'command' => 'place', 'x' => $matches[1], 'y' => $matches[2], 'color' => $matches[3] ]; } return null; } }