Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
🎉 Begin the sikessem/value package
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Oct 30, 2023
1 parent 9ad6138 commit edef58d
Show file tree
Hide file tree
Showing 13 changed files with 5,725 additions and 1,941 deletions.
18 changes: 9 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
*.jpg binary
*.jpeg binary

/.github export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
/tests export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
psalm.xml.dist export-ignore
rector.php export-ignore
/src/Program.php export-ignore
/tests/Feat/ExampleTest.php export-ignore
/tests/Unit/ProgramTest.php export-ignore
# CHANGELOG.md export-ignore
# .editorconfig export-ignore
# .gitattributes export-ignore
# .gitignore export-ignore
# /.github export-ignore
# /tests export-ignore
90 changes: 47 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
name: CI

permissions:
contents: read

on: ['push', 'pull_request']

jobs:
ci:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
php: [8.1, 8.2]
dependency-version: [prefer-lowest, prefer-stable]

name: Tests PHP-${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
dependencies: [lowest, highest]
experimental: [false]
name: 👷 CI PHP-${{ matrix.php }} ${{ matrix.dependencies }} on ${{ matrix.os }}

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, mbstring, zip
coverage: none
tools: vimeo/psalm

- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist

- name: 🧹 Check code lint
run: composer lint

- name: ⚗️ Run static analysis
run: |
composer analyse
composer inspect
- name: Run unit tests
run: composer test

- name: 🐛 Check all code bugs
run: composer debug
- name: 🚚 Get latest code
uses: actions/checkout@v4

- name: 📂 Cache dependencies
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-dependencies-php-${{ matrix.php }}-composer-
- name: ⚡️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, dom, gd, intl, mbstring, openssl, tokenizer, zip
ini-values: error_reporting=E_ALL
tools: composer:v2, php-cs-fixer, phpunit, vimeo/psalm
coverage: pcov

- name: 🍱 Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist

- name: Check code lint
run: composer lint

- name: ⚗️ Run static analysis
run: |
composer analyse
composer inspect
- name: 🧪 Run unit tests
run: composer test

- name: 🐛 Check all code bugs
run: composer debug
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release Notes for the Sikessem Skeleton
# Release Notes for the Sikessem Values

All notable changes to [Skeleton](https://github.com/sikessem/skeleton) will be documented in this file.
All notable changes to [Values](https://github.com/sikessem/values) will be documented in this file.

## [Unreleased](https://github.com/sikessem/skeleton/compare/v0.0.0...HEAD)
## [Unreleased](https://github.com/sikessem/values/compare/v0.0.0...HEAD)

**Full Changelog:** [v0.0.0...v0.x](https://github.com/sikessem/skeleton/compare/v0.0.0...v0.x)
**Full Changelog:** [v0.0.0...v0.x](https://github.com/sikessem/values/compare/v0.0.0...v0.x)
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
[sikessem-link]: https://github.com/sikessem "Sikessem"

[php-icon]: https://img.shields.io/badge/PHP-ccc.svg?style=flat&logo=php
[php-link]: https://github.com/sikessem/skeleton/search?l=php "PHP code"
[php-link]: https://github.com/sikessem/values/search?l=php "PHP code"

[packagist-version-icon]: https://img.shields.io/packagist/v/sikessem/skeleton
[packagist-version-link]: https://packagist.org/packages/sikessem/skeleton "Skeleton Releases"
[packagist-version-icon]: https://img.shields.io/packagist/v/sikessem/values
[packagist-version-link]: https://packagist.org/packages/sikessem/values "Values Releases"

[packagist-download-icon]: https://img.shields.io/packagist/dt/sikessem/skeleton
[packagist-download-link]: https://packagist.org/packages/sikessem/skeleton "Skeleton Downloads"
[packagist-download-icon]: https://img.shields.io/packagist/dt/sikessem/values
[packagist-download-link]: https://packagist.org/packages/sikessem/values "Values Downloads"

[actions-icon]: https://github.com/sikessem/skeleton/workflows/CI/badge.svg
[actions-link]: https://github.com/sikessem/skeleton/actions "Skeleton status"
[actions-icon]: https://github.com/sikessem/values/workflows/CI/badge.svg
[actions-link]: https://github.com/sikessem/values/actions "Values status"

[pr-icon]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?color=brightgreen
[pr-link]: https://github.com/sikessem/.github/blob/HEAD/CONTRIBUTING.md "PRs welcome!"
Expand All @@ -36,20 +36,20 @@
[twitter-link]: https://twitter.com/intent/follow?screen_name=sikessem_tweets "Ping Sikessem"

[license-icon]: https://img.shields.io/badge/license-MIT-blue.svg
[license-link]: https://github.com/sikessem/skeleton/blob/HEAD/LICENSE "Skeleton License"
[conduct-link]: https://github.com/sikessem/skeleton/blob/HEAD/CODE_OF_CONDUCT.md
[license-link]: https://github.com/sikessem/values/blob/HEAD/LICENSE "Values License"
[conduct-link]: https://github.com/sikessem/values/blob/HEAD/CODE_OF_CONDUCT.md
[discuss-link]: https://github.com/orgs/sikessem/discussions
[docs-link]: https://github.com/sikessem/skeleton#readme "Skeleton Documentation"
[docs-link]: https://github.com/sikessem/values#readme "Values Documentation"

***

# 📦️ Sikessem Skeleton
# PHP Value Objects

Create a new [Sikessem][sikessem-link] project based on this template.
Objects with strict types to manage PHP variables and values.

## 🔖 Contents

- [📦️ Sikessem Skeleton](#️-sikessem-skeleton)
- [PHP Value Objects](#php-value-objects)
- [🔖 Contents](#-contents)
- [📋 Requirements](#-requirements)
- [🎉 Getting Started](#-getting-started)
Expand All @@ -74,24 +74,22 @@ Create a new [Sikessem][sikessem-link] project based on this template.

### ⚡️ Installation

[Use this template](https://github.com/sikessem/skeleton/generate) or create a new [Sikessem][sikessem-link] library via the [Composer](https://getcomposer.org/) `create-project` command (recommended):
Use [Composer](https://getcomposer.org/) to install `sikessem/values`:

```bash
composer create-project sikessem/skeleton --prefer-source my-lib
composer require sikessem/values
```

### 🧑‍💻 Usage

```php
<?php

use Sikessem\Skeleton\Program;
use Sikessem\Values\Value;

$vendor_dir = __DIR__.'/vendor'; // Replace it by your vendor directory

include_once $vendor_dir.'/autoload.php';

Program::main(); // Print "Hello World!"
$two = Value::from(2); // 2
$two->update(fn($val) => $val * $val); // 4
$two->set(5); // 5
```

### 🧪 Testing and debugging
Expand Down Expand Up @@ -136,7 +134,7 @@ composer fix

## 📖 Documentation

The full documentation for the Sikessem Skeleton can be found on [this address][docs-link].
The full documentation for the Sikessem Values can be found on [this address][docs-link].

## 👏 Contribution

Expand All @@ -155,7 +153,7 @@ Read our [**Contributing Guide**][pr-link] to learn about our development proces

We have a list of [good first issues][gfi] that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

[gfi]: https://github.com/sikessem/skeleton/labels/good%20first%20issue
[gfi]: https://github.com/sikessem/values/labels/good%20first%20issue

### 💬 Discussions

Expand All @@ -167,7 +165,7 @@ If you discover a security vulnerability within [Sikessem][sikessem-link], pleas

## 📄 License

The Sikessem Skeleton is open-sourced software licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE][license-link] file for details.
The Sikessem Values is open-sourced software licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE][license-link] file for details.

***

Expand Down
33 changes: 0 additions & 33 deletions bootstrap.php

This file was deleted.

30 changes: 17 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"type": "project",
"name": "sikessem/skeleton",
"description": "📦️ Sikessem library builder template.",
"homepage": "https://packagist.com/packages/sikessem/skeleton",
"name": "sikessem/values",
"description": "Objects with strict types to manage PHP variables and values.",
"homepage": "https://packagist.com/packages/sikessem/values",
"license": "MIT",
"keywords": [
"php",
"sikessem",
"package-skeleton",
"repository-template",
"php"
"values"
],
"authors": [
{
Expand All @@ -18,30 +17,31 @@
}
],
"support": {
"source": "https://github.com/sikessem/skeleton",
"issues": "https://github.com/sikessem/skeleton/issues",
"source": "https://github.com/sikessem/values",
"issues": "https://github.com/sikessem/values/issues",
"chat": "https://github.com/orgs/sikessem/discussions"
},
"require": {
"php": "^8.1|^8.2"
},
"require-dev": {
"sikessem/devtools": "^0.0"
"sikessem/devtools": "^0.4.0"
},
"autoload": {
"psr-4": {
"Sikessem\\Skeleton\\": "src/"
"Sikessem\\Values\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Sikessem\\Skeleton\\Tests\\": "tests/"
"Sikessem\\Values\\Tests\\": "tests/"
}
},
"scripts": {
"analyse": "phpstan analyse --ansi --memory-limit=-1 --debug",
"check": "pint --test -v",
"debug": [
"@validate",
"@check",
"@analyse",
"@inspect",
Expand All @@ -55,6 +55,7 @@
],
"fix": [
"@refactor",
"@sanitize",
"@format",
"@lint"
],
Expand All @@ -63,7 +64,9 @@
"lint": "pint -v",
"test": "pest --colors=always",
"review": "rector --dry-run --debug",
"refactor": "rector"
"refactor": "rector",
"sanitize": "phpinsights fix",
"validate": "phpinsights analyse"
},
"extra": {
"branch-alias": {
Expand All @@ -75,7 +78,8 @@
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"minimum-stability": "stable",
Expand Down
Loading

0 comments on commit edef58d

Please sign in to comment.