Skip to content

Commit

Permalink
feat: adding template code
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Jul 16, 2022
1 parent 068f2a7 commit e758c21
Show file tree
Hide file tree
Showing 24 changed files with 7,861 additions and 2,796 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ on: # yamllint disable-line rule:truthy

jobs:
integration:
name: Testing on PHP ${{ matrix.php }} - ${{ matrix.os }}
name: PHP ${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-22.04"]
php: ["8.1"]
laravel: ["9.*"]
steps:
- name: Check out the codebase
uses: actions/checkout@v3
Expand All @@ -32,6 +33,11 @@ jobs:
tools: composer:v2
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Load cached dependencies
id: cached-composer-dependencies
uses: actions/cache@v3
Expand All @@ -46,10 +52,12 @@ jobs:
- name: Run coding standards task
run: make cs-diff

- name: Execute phpunit tests
- name: Execute phpunit and pest tests
run: make test

- name: Run static analysis using phpstan
run: make stan
env:
PHPSTAN_OUTPUT_FORMAT: github

...
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: php-package-tpl
package-name: laravel-package-tpl
default-branch: master
changelog-types: |
[
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

require_once 'vendor/autoload.php';

$config = ConfigBuilder::createFromRuleSet(new DefaultSet())
$config = ConfigBuilder::createFromRuleSet(new DefaultSet(['static_lambda' => false]))
->inDir(__DIR__ . '/src')
->inDir(__DIR__ . '/tests')
->addFiles([__FILE__])
Expand Down
39 changes: 0 additions & 39 deletions CHANGELOG.md

This file was deleted.

15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ else
WHITE := ""
RST := ""
endif
MAKE_LOGFILE = /tmp/wayofdev-php-package-tpl.log
MAKE_LOGFILE = /tmp/wayofdev-laravel-package-tpl.log
MAKE_CMD_COLOR := $(BLUE)

# https://phpstan.org/user-guide/output-format
export PHPSTAN_OUTPUT_FORMAT ?= table

help:
@echo 'Management commands for package:'
@echo 'Usage:'
Expand All @@ -40,7 +43,7 @@ help:
@echo
@echo ' 📑 Logs are stored in $(MAKE_LOGFILE)'
@echo
@echo ' 📦 Package php-package-tpl (github.com/wayofdev/php-package-tpl)'
@echo ' 📦 Package laravel-package-tpl (github.com/wayofdev/laravel-package-tpl)'
@echo ' 🤠 Author Andrij Orlenko (github.com/lotyp)'
@echo ' 🏢 ${YELLOW}Org wayofdev (github.com/wayofdev)${RST}'
.PHONY: help
Expand Down Expand Up @@ -73,15 +76,15 @@ cs-fix: prepare ## Fixes code to follow coding standards using php-cs-fixer
.PHONY: cs-fix

stan: ## Runs phpstan – static analysis tool
$(COMPOSER_RUN) stan
$(COMPOSER_RUN) stan --error-format=$(PHPSTAN_OUTPUT_FORMAT)
.PHONY: stan

test: ## Run project php-unit tests
test: ## Run project php-unit and pest tests
$(COMPOSER_RUN) test
.PHONY: test

test-cc: ## Run project php-unit tests in coverage mode and build report
XDEBUG_MODE="coverage" $(COMPOSER_RUN) test-cc
test-cc: ## Run project php-unit and pest tests in coverage mode and build report
$(COMPOSER_RUN) test-cc
.PHONY: test-cc

# Yaml Actions
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,23 @@
</div>



<br>

<br>

<div align="center">
<a href="https://github.com/wayofdev/php-package-tpl/actions"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fphp-package-tpl%2Fbadge&style=flat-square"/></a>
<a href="https://packagist.org/packages/wayofdev/package-tpl"><img src="https://img.shields.io/packagist/dt/wayofdev/package-tpl?&style=flat-square" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/wayofdev/package-tpl"><img src="https://img.shields.io/packagist/v/wayofdev/package-tpl?&style=flat-square" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/wayofdev/package-tpl"><img src="https://img.shields.io/packagist/l/wayofdev/package-tpl?style=flat-square&color=blue" alt="Software License"/></a>
<a href="https://packagist.org/packages/wayofdev/package-tpl"><img alt="Commits since latest release" src="https://img.shields.io/github/commits-since/wayofdev/php-package-tpl/latest?style=flat-square"></a>
<a href="https://github.com/wayofdev/laravel-package-tpl/actions"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Flaravel-package-tpl%2Fbadge&style=flat-square"/></a>
<a href="https://packagist.org/packages/wayofdev/laravel-package-tpl"><img src="https://img.shields.io/packagist/dt/wayofdev/laravel-package-tpl?&style=flat-square" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/wayofdev/laravel-package-tpl"><img src="https://img.shields.io/packagist/v/wayofdev/laravel-package-tpl?&style=flat-square" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/wayofdev/laravel-package-tpl"><img src="https://img.shields.io/packagist/l/wayofdev/laravel-package-tpl?style=flat-square&color=blue" alt="Software License"/></a>
<a href="https://packagist.org/packages/wayofdev/laravel-package-tpl"><img alt="Commits since latest release" src="https://img.shields.io/github/commits-since/wayofdev/laravel-package-tpl/latest?style=flat-square"></a>
</div>

<br>

# PHP Package Template
# Laravel Package Template

This is minimal PHP template which is used by other PHP projects in wayofdev organization.
This is minimal Laravel template which is used by other PHP projects in wayofdev organization.

If you **like/use** this package, please consider **starring** it. Thanks!

Expand All @@ -36,7 +35,7 @@ If you **like/use** this package, please consider **starring** it. Thanks!
Require as dependency:

```bash
$ composer req wayofdev/package-tpl
$ composer req wayofdev/laravel-package-tpl
```

<br>
Expand Down Expand Up @@ -71,7 +70,7 @@ $ make cs-fix

## 🤝 License

[![Licence](https://img.shields.io/github/license/wayofdev/php-package-tpl?style=for-the-badge&color=blue)](./LICENSE)
[![Licence](https://img.shields.io/github/license/wayofdev/laravel-package-tpl?style=for-the-badge&color=blue)](./LICENSE)

<br>

Expand Down
35 changes: 26 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "wayofdev/package-tpl",
"name": "wayofdev/laravel-package-tpl",
"description": "PHP package template with GitHub Actions",
"type": "library",
"license": "MIT",
"homepage": "https://wayof.dev",
"support": {
"issues": "https://github.com/wayofdev/php-package-tpl/issues",
"source": "https://github.com/wayofdev/php-package-tpl"
"issues": "https://github.com/wayofdev/laravel-package-tpl/issues",
"source": "https://github.com/wayofdev/laravel-package-tpl"
},
"authors": [
{
Expand All @@ -15,44 +15,61 @@
}
],
"require": {
"php": "^8.1"
"php": "^8.1",
"illuminate/contracts": "^9.20"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.28",
"nunomaduro/collision": "^6.2",
"nunomaduro/larastan": "^2.1",
"orchestra/testbench": "^7.6",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.2",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-strict-rules": "^1.3",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-latest",
"spatie/laravel-package-tools": "^1.12",
"wayofdev/cs-fixer-config": "^1.0"
},
"autoload": {
"psr-4": {
"WayOfDev\\PackageTpl\\": "src/"
"WayOfDev\\Laravel\\Package\\": "src/",
"WayOfDev\\Laravel\\Package\\Database\\Factories\\": "database/factories"
}
},
"autoload-dev": {
"psr-4": {
"WayOfDev\\PackageTpl\\Tests\\": "tests/"
"WayOfDev\\Laravel\\Package\\Tests\\": "tests/"
}
},
"scripts": {
"cs-fix": "php vendor/bin/php-cs-fixer fix -v",
"cs-diff": "php vendor/bin/php-cs-fixer fix --dry-run -v --diff",
"test": "php vendor/bin/phpunit",
"test-cc": "php vendor/bin/phpunit --coverage-text --colors=never",
"test": "php vendor/bin/pest",
"test-cc": "php vendor/bin/pest --coverage",
"stan": "php vendor/bin/phpstan analyse"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"pestphp/pest-plugin": true
}
},
"extra": {
"laravel": {
"providers": [
"WayOfDev\\Laravel\\Package\\PackageServiceProvider"
],
"aliases": {
"Package": "WayOfDev\\Laravel\\Package\\Facades\\Package"
}
},
"composer-normalize": {
"indent-size": 4,
"indent-style": "space"
Expand Down

0 comments on commit e758c21

Please sign in to comment.