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

initial commit #3

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/php:1": {
"installComposer": true,
"version": "latest"
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"junstyle.php-cs-fixer",
"recca0120.vscode-phpunit",
"SanderRonde.phpstan-vscode",
"GitHub.copilot",
"GitHub.copilot-chat"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
42 changes: 42 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PHPStan
on:
push:
branches:
- main
- develop
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
phpunit:
name: PHPStan (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.3' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, simplexml
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Check with PHPStan
run: vendor/bin/phpstan --configuration=phpstan.neon
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ composer.phar
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

.php-cs-fixer.cache
.phpunit.cache
23 changes: 23 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

require 'vendor/autoload.php';

/**
* PHP CS Fixer Configuration File.
*/

// paths for ignore formatting
$finder = \PhpCsFixer\Finder::create()
->exclude([
'vendor',
])
->in(__DIR__);

$config = new \WizDevelop\PhpCsFixerConfig\Config(allowRisky: true);

// custom rules
return $config
->setRiskyAllowed(true)
->setFinder($finder);
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// IntelliSense を使用して利用可能な属性を学べます。
// 既存の属性の説明をホバーして表示します。
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch built-in server and debug",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-S",
"localhost:8000",
"-t",
"."
],
"port": 9003,
"serverReadyAction": {
"action": "openExternally"
}
},
{
"name": "Debug current script in console",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"externalConsole": false,
"port": 9003
},
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
}
44 changes: 44 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
// formatter settings
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"[php]": {
"editor.defaultFormatter": "junstyle.php-cs-fixer"
},
"php-cs-fixer.executablePath": "${extensionPath}/php-cs-fixer.phar",
// PHPStan (LaraStan) settings
"phpstan.configFile": "phpstan.neon",
"phpstan.singleFileMode": true,
"phpstan.showProgress": true,
"phpstan.checkValidity": false,
"phpstan.enableLanguageServer": false,
// NOTE: https://github.com/SanderRonde/phpstan-vscode/issues/26
"phpstan.ignoreErrors": [
"XDebug: .*",
"! .*",
"[Step Debug] .*"
],
// vscode visualize settings
"todohighlight.keywords": [
{
"text": "BUG:",
"color": "#FFFFFF",
"backgroundColor": "#DC3545"
},
{
"text": "NOTE:",
"color": "#FFFFFF",
"backgroundColor": "#98C379"
},
{
"text": "HACK:",
"color": "#FFFFFF",
"backgroundColor": "#C678DD"
},
{
"text": "DEBUG:",
"color": "#FFFFFF",
"backgroundColor": "#61AFEF"
}
],
}
24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "endou-mame/php-monad",
"description": "📦 Implemented the concept of monads in functional programming in PHP.",
"type": "library",
"license": "MIT",
"autoload": {
"psr-4": {
"EndouMame\\PhpMonad\\": "src/"
}
},
"authors": [
{
"name": "kakiuchi-shigenao",
"email": "[email protected]"
}
],
"minimum-stability": "stable",
"require-dev": {
"wiz-develop/php-cs-fixer-config": "^8.3",
"phpstan/phpstan": "^1.10",
"phpunit/php-code-coverage": "^11.0",
"phpunit/phpunit": "^11.1"
}
}
Loading
Loading