Compare commits

...

7 commits

7 changed files with 67 additions and 2210 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
/vendor/
/composer.lock

14
.php_cs.dist Normal file
View file

@ -0,0 +1,14 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(['fixtures']);
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => true,
'phpdoc_order' => true,
])
->setFinder($finder);

17
.travis.yml Normal file
View file

@ -0,0 +1,17 @@
language: php
php:
- 7.2
- 7.3
- 7.4
env:
matrix:
- COMPOSER_FLAGS="--prefer-lowest"
- COMPOSER_FLAGS=""
before_script:
- composer install --dev --prefer-source --no-interaction
script:
- vendor/bin/phpunit

View file

@ -1,7 +1,28 @@
# Drupal Module Generator (dmg)
A scaffolding tool for generating new modules for Drupal 7 and 8.
A scaffolding tool for generating new modules for Drupal 7 and (soon) 8.
[Watch a short demo][demo].
[demo]: https://opdavi.es/6i3YZ 'A short demo video on YouTube'
## Installation
The Drupal Module Generator is installed via [Composer][]:
```bash
composer global require opdavies/drupal-module-generator
```
[composer]: https://getcomposer.org
## Usage
TODO
### Drupal 7
```bash
dmg generate:drupal-7-module {name}
```
Generated Drupal 7 modules contain the appropriately named `.info` and `.module` files,
as well as a test case located in `src/Tests/Functional` which [is loaded automatically](https://www.oliverdavies.uk/articles/psr4-autoloading-test-cases-drupal-7).

View file

@ -3,16 +3,17 @@
"description": "Generates boilerplate code for Drupal modules.",
"type": "project",
"require": {
"symfony/console": "^3.0 || ^4.0 || ^5.0",
"symfony/dependency-injection": "^3.0 || ^4.0 || ^5.0",
"symfony/filesystem": "^3.0 || ^4.0 || ^5.0",
"symfony/finder": "^3.0 || ^4.0 || ^5.0",
"php": "^7.2",
"symfony/console": "^4.0 || ^5.0",
"symfony/dependency-injection": "^4.0 || ^5.0",
"symfony/filesystem": "^4.0 || ^5.0",
"symfony/finder": "^4.0 || ^5.0",
"tightenco/collect": "^6.14"
},
"require-dev": {
"php": "5.6 || ^7.0",
"phpunit/phpunit": "^9.0",
"symfony/var-dumper": "^3.0 || ^4.0 || ^5.0"
"friendsofphp/php-cs-fixer": "^2.16",
"phpunit/phpunit": "^8.5",
"symfony/var-dumper": "^4.0 || ^5.0"
},
"license": "MIT",
"authors": [
@ -35,6 +36,9 @@
"bin/dmg"
],
"config": {
"platform": {
"php": "7.2.5"
},
"sort-packages": true
}
}

2200
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -62,7 +62,7 @@ final class GenerateDrupal7Command extends Command
{
$this->io = new SymfonyStyle($input, $output);
$this->io->title("{$this->getApplication()->getName()} (D7)");
$this->io->title("Drupal Module Generator (D7)");
$this->machineName = $input->getArgument('module-name');
$this->moduleName = $this->moduleNameConverter->__invoke($this->machineName);