-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
641 additions
and
918 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.github export-ignore | ||
changelog.md export-ignore | ||
phpstan.neon export-ignore | ||
tests export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['8.0', '8.1', '8.2'] | ||
|
||
fail-fast: false | ||
|
||
name: PHP ${{ matrix.php }} tests | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: curl, simplexml, json | ||
coverage: none | ||
|
||
- run: composer install --no-progress --prefer-dist | ||
- run: composer tests | ||
- if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: output | ||
path: tests/**/output | ||
|
||
|
||
# code_coverage: | ||
# name: Code Coverage | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: shivammathur/setup-php@v2 | ||
# with: | ||
# php-version: 8.0 | ||
# extensions: json, mbstring, tokenizer, fileinfo | ||
# coverage: none | ||
# | ||
# - run: composer install --no-progress --prefer-dist | ||
# - run: vendor/bin/tester -p phpdbg tests -s -C --coverage ./coverage.xml --coverage-src ./src | ||
# - run: wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.3/php-coveralls.phar | ||
# - env: | ||
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# run: php php-coveralls.phar --verbose --config tests/.coveralls.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/.idea/ | ||
coveralls.phar | ||
/nbproject/ | ||
/vendor/ | ||
composer.lock | ||
/tests/temp/ | ||
*~ | ||
/tests/**/output/ | ||
coverage.html |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,15 @@ | ||
## Data type | ||
|
||
[![Build Status](https://travis-ci.org/h4kuna/data-type.svg?branch=master)](https://travis-ci.org/h4kuna/data-type) | ||
[![Latest stable](https://img.shields.io/packagist/v/h4kuna/data-type.svg)](https://packagist.org/packages/h4kuna/data-type) | ||
[![Downloads this Month](https://img.shields.io/packagist/dm/h4kuna/data-type.svg)](https://packagist.org/packages/h4kuna/data-type) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/h4kuna/data-type/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/h4kuna/data-type/?branch=master) | ||
[![Coverage Status](https://coveralls.io/repos/github/h4kuna/data-type/badge.svg?branch=master)](https://coveralls.io/github/h4kuna/data-type?branch=master) | ||
|
||
Previous version [v1.0.5] has object classes now are static, because PHP7 has scalar type hint. | ||
|
||
Installation to project | ||
Installation by composer | ||
----------------------- | ||
The best way to install h4kuna/data-type is using Composer: | ||
```sh | ||
$ composer require h4kuna/data-type | ||
``` | ||
|
||
- [Basic](src/Basic) | ||
- czech [Date](src/Date) | ||
- [Immutable](src/Immutable) | ||
- [GPS](src/Location) | ||
- [Number](src/Number) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
parameters: | ||
level: max | ||
paths: | ||
- src | ||
- tests/src | ||
|
||
includes: | ||
- phpstan-baseline.neon | ||
- vendor/phpstan/phpstan-strict-rules/rules.neon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace h4kuna\DataType\Basic; | ||
|
||
class BitwiseOperations | ||
{ | ||
|
||
public static function check(int $number, int $flag): bool | ||
{ | ||
return ($number & $flag) !== 0; | ||
} | ||
|
||
|
||
public static function checkStrict(int $number, int $flag): bool | ||
{ | ||
return ($number & $flag) === $number; | ||
} | ||
|
||
|
||
public static function add(int &$number, int $flag): void | ||
{ | ||
$number |= $flag; | ||
} | ||
|
||
|
||
public static function remove(int &$number, int $flag): void | ||
{ | ||
$number &= ~$flag; | ||
} | ||
|
||
} |
Oops, something went wrong.