Skip to content

Commit e580520

Browse files
author
Alexander Miertsch
committed
Merge pull request #3 from sandrokeil/hotfix/autoload-path
fixed include paths
2 parents 9490430 + 0e889a8 commit e580520

6 files changed

Lines changed: 38 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# prooph Command Line Interface CHANGELOG
2+
3+
All notable changes to this project will be documented in this file, in reverse chronological order by release.
4+
5+
## 0.1.1 (2016-01-20)
6+
7+
### Added
8+
9+
* Nothing
10+
11+
### Deprecated
12+
13+
* Nothing
14+
15+
### Removed
16+
17+
* Nothing
18+
19+
### Fixed
20+
21+
* Fixed include paths
22+
* Fixed directory separator for class path

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# prooph Command Line Interface
22

33
## Overview
4-
The prooph command line interfaces generates classes to increase development speed. For available commands run
4+
The prooph command line interface generates classes to increase development speed. For available commands run
55

66
```bash
77
$ php bin/prooph-cli list

bin/prooph-cli

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if (!ini_get('date.timezone')) {
2323

2424
foreach (
2525
array(
26+
__DIR__ . '/../../../autoload.php',
2627
__DIR__ . '/../../autoload.php',
2728
__DIR__ . '/../vendor/autoload.php',
2829
__DIR__ . '/vendor/autoload.php'
@@ -76,8 +77,3 @@ $application->add($container->get(Command\GenerateEvent::class));
7677
$application->add($container->get(Command\GenerateAggregate::class));
7778

7879
$application->run();
79-
80-
81-
82-
83-

config/services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
use Zend\ServiceManager\Config;
1111
use Zend\ServiceManager\ServiceManager;
1212

13-
return new ServiceManager(new Config(require 'config/dependencies.php'));
13+
return new ServiceManager(new Config(require __DIR__ . '/dependencies.php'));

src/Console/Command/GenerateAll.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
8181
'event' => $input->getArgument('event-name'),
8282
];
8383

84-
// if ($path = rtrim($input->getArgument('path'), '/')) {
85-
// $path .= '/';
86-
// }
8784
$path = $input->getArgument('path');
8885

8986
$aggregatePath = '';
9087

9188
foreach ($commands as $commandName => $name) {
9289
$command = $this->getApplication()->find('prooph:generate:' . $commandName);
93-
// $commandPath = $path . $command->getDefinition()->getArgument('path')->getDefault();
9490

9591
$arguments = [
9692
'name' => $name,

src/Console/Helper/Psr4Info.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getFilename($path, $name)
110110
{
111111
$filename = $this->getSourceFolder() . DIRECTORY_SEPARATOR;
112112

113-
if ($path = rtrim($path, '/')) {
113+
if ($path = trim($path, '/')) {
114114
$filename .= $path . DIRECTORY_SEPARATOR;
115115
}
116116

@@ -140,8 +140,12 @@ private function filterDirectoryToNamespace()
140140
{
141141
if (null === $this->filterDirectoryToNamespace) {
142142
$this->filterDirectoryToNamespace = new FilterChain();
143-
$this->filterDirectoryToNamespace->attachByName('wordseparatortocamelcase', ['separator' => DIRECTORY_SEPARATOR]);
144-
$this->filterDirectoryToNamespace->attachByName('wordcamelcasetoseparator', ['separator' => '\\\\']);
143+
$this->filterDirectoryToNamespace->attachByName(
144+
'wordseparatortocamelcase', ['separator' => DIRECTORY_SEPARATOR]
145+
);
146+
$this->filterDirectoryToNamespace->attachByName(
147+
'wordcamelcasetoseparator', ['separator' => '\\\\']
148+
);
145149
}
146150
return $this->filterDirectoryToNamespace;
147151
}
@@ -153,8 +157,12 @@ private function filterNamespaceToDirectory()
153157
{
154158
if (null === $this->filterNamespaceToDirectory) {
155159
$this->filterNamespaceToDirectory = new FilterChain();
156-
$this->filterNamespaceToDirectory->attachByName('wordseparatortocamelcase', ['separator' => '\\']);
157-
$this->filterNamespaceToDirectory->attachByName('wordcamelcasetoseparator', ['separator' => '/']);
160+
$this->filterNamespaceToDirectory->attachByName(
161+
'wordseparatortocamelcase', ['separator' => '\\']
162+
);
163+
$this->filterNamespaceToDirectory->attachByName(
164+
'wordcamelcasetoseparator', ['separator' => DIRECTORY_SEPARATOR]
165+
);
158166
}
159167
return $this->filterNamespaceToDirectory;
160168
}

0 commit comments

Comments
 (0)