Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer and PSR-2 refactoritzation #582

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ dwsync.xml
intermediate
.idea
cache

# composer
vendor/
composer.lock
26 changes: 26 additions & 0 deletions plugin-name/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

.DEFAULT_GOAL := help
.PHONY: $(filter-out vendor node_modules, $(MAKECMDGOALS))

install:
composer install
composer phpunit

install-prod:
composer install-prod

test:
@composer test

build:
@composer build

help:
@echo Silence is golden

vendor: composer.json $(wildcard composer.lock) ## Install PHP application
@composer install

node_modules: $(wildcard package.json) $(wildcard package.lock) ## Install Node modules
@npm install
103 changes: 0 additions & 103 deletions plugin-name/admin/class-plugin-name-admin.php

This file was deleted.

1 change: 0 additions & 1 deletion plugin-name/admin/index.php

This file was deleted.

46 changes: 46 additions & 0 deletions plugin-name/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "usuari/plugin-name",
"type": "wordpress-plugin",
"keywords": [
"wordpress",
"plugin",
"composer",
"domain driven design",
"test driven design",
"php"
],
"authors": [
{
"name": "Your Name",
"email": "email@example.com"
}
],
"autoload": {
"psr-4": {
"PluginName\\": "src/",
"PluginName\\Includes\\": "src/includes",
"PluginName\\AdminDomain\\": "src/admin",
"PluginName\\PublicDomain\\": "src/public"
}
},
"autoload-dev": {
"psr-4": {
"PluginNameTest\\": "tests/",
"PluginNameTest\\Unit\\": "tests/unit/"
}
},
"require": {},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.3",
"php-parallel-lint/php-console-highlighter": "^1.0",
"squizlabs/php_codesniffer": "^3.7"
},
"scripts": {
"style": "phpcs -p --standard=PSR2 --ignore=*.js,*.css,*.pot plugin-name.php uninstall.php src tests",
"fix-style": "phpcbf -p --standard=PSR2 --ignore=*.js,*.css,*.pot plugin-name.php uninstall.php src tests",
"test": [
"phpunit --configuration phpunit.xml"
],
"build": "composer install --no-dev"
}
}
129 changes: 0 additions & 129 deletions plugin-name/includes/class-plugin-name-loader.php

This file was deleted.