Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nulxrd committed Feb 1, 2024
0 parents commit 5878845
Show file tree
Hide file tree
Showing 13 changed files with 376 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig http://EditorConfig.org

# top-most EditorConfig file
root = true

# This applies to all files
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_size = 2
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/tests/ export-ignore
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "composer"
allow:
- dependency-type: all
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 1
versioning-strategy: "increase-if-necessary"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 1
45 changes: 45 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Coding Standards"

on:
pull_request:
branches:
- "*.x"
paths:
- composer.*
- phpcs.xml.dist
- src/**
- tests/**
push:
branches:
- "*.x"
paths:
- composer.*
- phpcs.xml.dist
- src/**
- tests/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
coding-standards:
name: Coding Standards
runs-on: "ubuntu-latest"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: cs2pr
php-version: '8.2'

- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Coding standards
run: "composer run lint-check -- -q --no-colors --report=checkstyle | cs2pr"
61 changes: 61 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Continuous Integration"

on:
pull_request:
branches:
- "*.x"
paths:
- .github/workflows/continuous-integration.yml
- composer.*
- src/**
- tests/**
- phpunit.xml.dist
push:
branches:
- "*.x"
paths:
- .github/workflows/continuous-integration.yml
- composer.*
- src/**
- tests/**
- phpunit.xml.dist

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
fail-fast: true

permissions:
contents: read

jobs:
build:
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: [ '8.2', '8.3' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.2'
tools: cs2pr

- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Coding standards
run: "composer run lint-check -- -q --no-colors --report=checkstyle | cs2pr"

- name: Static Analysis
run: "composer run static-analysis"

- name: PHPUnit tests
run: "composer run test"
44 changes: 44 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Static Analysis"

on:
pull_request:
branches:
- "*.x"
paths:
- composer.*
- psalm*
- src/**
- tests/**

push:
branches:
- "*.x"
paths:
- composer.*
- psalm*
- src/**
- tests/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
static-analysis:
name: Static Analysis
runs-on: "ubuntu-latest"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '8.2'
- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Static Analysis
run: "composer run static-analysis"
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
./Icon?
ehthumbs.db
Thumbs.db

/.idea/
/.fleet/

composer.lock
/composer.phar
/auth.json
/vendor/*

.phpunit.cache/
phpunit.xml
.phpstan.cache/
phpstan.neon
.phpcs-cache
phpcs.xml
19 changes: 19 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2024 Charon Lab Development Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# charonlab/charon-cache

[![Build Status](https://github.com/charonlab/charon-cache/workflows/Continuous%20Integration/badge.svg)](https://github.com/charonlab/charon-cache/actions?query=workflow%3A"Continuous+Integration")

An Implementation of caching system based on the PSR-6 & PSR-16 standard.

## Installation

Run the following to install this library:

```bash
$ composer require charonlab/charon-cache
```

## Support

- [Issues](https://github.com/charonlab/charon-cache/issues/)
48 changes: 48 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "charonlab/charon-cache",
"description": "An Implementation of caching system based on the PSR-6 & PSR-16 standard.",
"license": "MIT",
"type": "library",
"provide": {
"psr/cache-implementation": "1.0",
"psr/simple-cache-implementation": "1.0"
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"psr/cache": "dev-master",
"psr/simple-cache": "dev-master"
},
"require-dev": {
"charonlab/coding-standard": "1.2.x-dev",
"phpunit/phpunit": "10.5.x-dev",
"vimeo/psalm": "6.x-dev"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Charon\\Cache\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Charon\\Tests\\Unit\\": "tests/unit/"
}
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "8.2.15"
},
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"lint-check": "phpcs",
"lint-fix": "phpcbf",
"static-analysis": "psalm --shepherd --stats",
"test": "phpunit --colors=always"
}
}
20 changes: 20 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">

<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>

<!-- Show progress -->
<arg value="sp"/>

<!-- Paths to check -->
<file>src</file>
<file>tests</file>

<!-- Include all rules from the Charon Coding Standard -->
<rule ref="Charon"/>
</ruleset>
36 changes: 36 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
cacheDirectory=".phpunit.cache"
executionOrder="depends,defects"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true"
>
<coverage/>

<testsuites>
<testsuite name="unit test">
<directory>./tests/unit</directory>
</testsuite>
</testsuites>

<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true">
<include>
<directory>src/</directory>
</include>
</source>

<php>
<ini name="error_reporting" value="32767" />
<ini name="display_errors" value="1" />
<ini name="display_startup_errors" value="1" />
<ini name="memory_limit" value="-1" />
<ini name="intl.default_locale" value="en" />
<ini name="intl.error_level" value="0" />
</php>
</phpunit>
22 changes: 22 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<psalm
xmlns="https://getpsalm.org/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="1"
hoistConstants="true"
findUnusedPsalmSuppress="true"
findUnusedVariablesAndParams="true"
ensureArrayStringOffsetsExist="true"
addParamDefaultToDocblockType="true"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name=".github"/>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>

0 comments on commit 5878845

Please sign in to comment.