Ejemplo n.º 1
0
 /**
  * Set class name, name must not include default namespace and postfix.
  *
  * @param string $name
  * @return $this
  */
 public function setName($name)
 {
     if (strpos($name, '/') !== false || strpos($name, '\\') !== false) {
         $name = str_replace('/', '\\', $name);
         //Let's split namespace
         $this->setNamespace(substr($name, 0, strrpos($name, '\\')));
         $name = substr($name, strrpos($name, '\\') + 1);
     }
     $this->class->setName(Inflector::classify($name) . $this->options['postfix']);
     return $this;
 }