Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlagouveia committed Oct 11, 2023
0 parents commit 0f2d702
Show file tree
Hide file tree
Showing 12 changed files with 3,786 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php: [8.2, 8.1]

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate --strict --no-check-version

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run unit test suite
run: composer test

- name: Validate coding standards
run: composer lint

- name: Run static analysis
run: composer static-analysis
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.phpunit.cache/
vendor/
.idea/
.php-cs-fixer.cache
14 changes: 14 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
;

$config = new PhpCsFixer\Config();

return $config->setRules([
'@Symfony' => true,
])
->setFinder($finder)
;
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2023 Carla Gouveia

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.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: test
test:
vendor/bin/phpunit
vendor/bin/phpstan
vendor/bin/php-cs-fixer check
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# bitset-php
![Build Status](https://github.com/carlagouveia/bitset-php/actions/workflows/build.yml/badge.svg)
[![GitHub release](https://img.shields.io/github/release/carlagouveia/bitset-php.svg)](https://github.com/carlagouveia/bitset-php/releases/latest)
[![License](https://img.shields.io/github/license/carlagouveia/bitset-php)](https://github.com/carlagouveia/bitset-php/blob/master/LICENSE)

bitset-php is a reimplementation of `std::bitset` that allows PHP to interface with C++. It aims to provide a stable
interface instead of a full bitwise replacement.

## Install
$ composer require carlagouveia/bitset-php

## Development
$ composer install
$ make test
29 changes: 29 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "carlagouveia/bitset-php",
"description": "bitset-php is a reimplementation of `std::bitset` that allows PHP to interface with C++.",
"keywords": ["bitset", "cpp"],
"homepage": "https://github.com/carlagouveia/bitset-php",
"type": "library",
"license": "MIT",
"autoload": {
"psr-4": {
"Cpp\\Std\\": "src/"
}
},
"authors": [
{
"name": "Carla Gouveia",
"email": "[email protected]"
}
],
"require-dev": {
"phpunit/phpunit": "^10.3",
"friendsofphp/php-cs-fixer": "^3.34",
"phpstan/phpstan": "^1.10"
},
"scripts": {
"test": "vendor/bin/phpunit",
"static-analysis": "vendor/bin/phpstan",
"lint": "vendor/bin/php-cs-fixer check"
}
}
Loading

0 comments on commit 0f2d702

Please sign in to comment.