Exemplo n.º 1
0
 /**
  * @return array
  */
 public function getReplacements()
 {
     if (!isset($this->replacements)) {
         $this->replacements = ['{{ project.name }}' => $this->projectName->get(), '{{ project.label }}' => $this->getConfig('label'), '{{ project.description }}' => $this->getConfig('description'), '{{ project.namespace }}' => $this->getConfig('namespace'), '{{ project.namespace.esc }}' => str_replace('\\', '\\\\', $this->getConfig('namespace')), '{{ project.class }}' => $this->getConfig('class'), '{{ copyright.year }}' => $this->getConfig('copyright.year'), '{{ copyright.holders }}' => $this->getConfig('copyright.holders') ?: $this->getGitUsername()];
     }
     return $this->replacements;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function create()
 {
     $client = $this->newHttpClient();
     if (!$this->sslVerification) {
         $client->setSslVerification(false, false);
     }
     $job = str_replace('{{ project.name }}', $this->projectName->get(), $this->getConfigTemplate());
     $headers = ['Content-Type' => 'text/xml'];
     $options = ['query' => array('name' => $this->projectName->getName())];
     $client->post($this->url . '/createItem', $headers, $job, $options)->send();
     return true;
 }
 public function testSetProjectName()
 {
     $projectName = new ProjectName('cpliakas/my-project');
     $projectName->set('cpliakas/another-project');
     $this->assertEquals($projectName->get(), 'cpliakas/another-project');
 }