Skip to content

Commit 917758b

Browse files
committed
Initial commit
0 parents  commit 917758b

File tree

7 files changed

+763
-0
lines changed

7 files changed

+763
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on: [push,pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Validate composer.json and composer.lock
16+
run: composer validate --strict
17+
18+
- name: Cache Composer packages
19+
id: composer-cache
20+
uses: actions/cache@v3
21+
with:
22+
path: vendor
23+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-php-
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress
29+
30+
- name: Run test suite
31+
run: composer run-script test .

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.idea
2+
/composer.lock
3+
/vendor

LICENSE.md

Lines changed: 636 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# yocLib - Netstring (PHP)
2+
3+
This yocLibrary enables your project to encode and decode Netstring values in PHP.
4+
5+
## Status
6+
7+
[![CI](https://github.com/yocto/yoclib-netstring-php/actions/workflows/ci.yml/badge.svg)](https://github.com/yocto/yoclib-netstring-php/actions/workflows/ci.yml)
8+
9+
## Installation
10+
11+
`composer require yocto/yoclib-netstring`
12+
13+
## Use
14+
15+
### Serialization
16+
17+
```php
18+
//TODO
19+
```
20+
21+
### Deserialization
22+
23+
```php
24+
//TODO
25+
```

composer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "yocto/yoclib-netstring",
3+
"type": "library",
4+
"description": "This yocLibrary enables your project to encode and decode Netstring values in PHP.",
5+
"keywords":[
6+
"composer",
7+
"netstring",
8+
"php",
9+
"qmqp",
10+
"qmtp",
11+
"yocto",
12+
"yoclib"
13+
],
14+
"license": "GPL-3.0-or-later",
15+
"require": {
16+
"php": "^7||^8",
17+
},
18+
"require-dev": {
19+
"phpunit/phpunit": "^7||^8||^9"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"YOCLIB\\Netstring\\": "src/"
24+
}
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"YOCLIB\\Netstring\\Tests\\": "tests/"
29+
}
30+
},
31+
"scripts": {
32+
"test": "phpunit"
33+
}
34+
}

src/Netstring.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
namespace YOCLIB\Netstring;
3+
4+
class Netstring{
5+
6+
private $string;
7+
8+
/**
9+
* @return string
10+
*/
11+
public function getString(){
12+
return $this->string;
13+
}
14+
15+
/**
16+
* @param string string
17+
*/
18+
public function setString($string): void{
19+
$this->string = $string;
20+
}
21+
22+
}

tests/NetstringTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
namespace YOCLIB\Netstring\Tests;
3+
4+
use PHPUnit\Framework\TestCase;
5+
6+
use YOCLIB\Netstring\Netstring;
7+
8+
class NetstringTest extends TestCase{
9+
10+
//TODO Create tests
11+
12+
}

0 commit comments

Comments
 (0)