コード例 #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;
 }
コード例 #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;
 }
コード例 #3
0
 public function testGetNameCamelCased()
 {
     $projectName = new ProjectName('cpliakas/my-project');
     $this->assertEquals($projectName->getNameCamelCased(), 'MyProject');
 }