Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigParser.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
17  const TYPE_NAME = 'typeName';
18  const METHOD_NAME = 'methodName';
19 
27  public function parseServiceMethod($serviceMethod)
28  {
29  $pattern = '/^([a-zA-Z]+[a-zA-Z0-9\\\\]+)::([a-zA-Z0-9]+)$/';
30  preg_match($pattern, $serviceMethod, $matches);
31  if (!isset($matches[1]) || !isset($matches[2])) {
32  throw new LocalizedException(
33  new Phrase(
34  'The "%serviceMethod" service method must match the "%pattern" pattern.',
35  ['serviceMethod' => $serviceMethod, 'pattern' => $pattern]
36  )
37  );
38  }
39  $className = $matches[1];
40  $methodName = $matches[2];
41  return [self::TYPE_NAME => $className, self::METHOD_NAME => $methodName];
42  }
43 }
$pattern
Definition: website.php:22
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31