Skip to content

Commit

Permalink
Merge pull request #21 from QualityUnit/php_7.1_compatible
Browse files Browse the repository at this point in the history
Make it php 7.1+ compatible
  • Loading branch information
Jakub Žernovič committed Jan 9, 2024
2 parents ed6bb4e + d89e8ea commit cd5c1aa
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci-php-oldest.yml
Expand Up @@ -8,13 +8,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.1'
- uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.OS }}-build-oldest-${{ hashFiles('**/composer.lock') }}
- uses: php-actions/composer@v6
env:
COMPOSER: "composer-php-oldest.json"
with:
php_version: "7.1"
version: 1
- name: PHP Lint
run: vendor/bin/phplint --exclude=vendor
- name: PHP Unit
Expand Down
21 changes: 21 additions & 0 deletions composer-php-oldest.json
@@ -0,0 +1,21 @@
{
"name": "qualityunit/tnef-decoder",
"description": "TNEF Decoder library extracted from squirell mail plugin to decode winmail.dat file in email attachment",
"keywords": ["tnef decoder", "winmail.dat"],
"license": "GPL-2.0-or-later",
"type": "library",
"homepage": "https://github.com/QualityUnit/TNEFDecoder",
"require": {
"php": ">=7.0",
"ext-mbstring": "*"
},
"require-dev": {
"overtrue/phplint": "3.2.0",
"phpunit/phpunit": "7.5.20"
},
"autoload": {
"psr-4": {
"TNEFDecoder\\": "src/TNEFDecoder/"
}
}
}
10 changes: 6 additions & 4 deletions src/TNEFDecoder/TNEFBuffer.php
@@ -1,4 +1,6 @@
<?php namespace TNEFDecoder;
<?php

namespace TNEFDecoder;

/**
* SquirrelMail TNEF Decoder Plugin
Expand All @@ -16,16 +18,16 @@

class TNEFBuffer
{
private string $data;
private int $offset;
private $data;
private $offset;

function __construct(string $data)
{
$this->data = $data;
$this->offset = 0;
}

function getBytes(int $numBytes): ?string
function getBytes(int $numBytes)
{
if ($this->getRemainingBytes() < $numBytes) {
$this->offset = strlen($this->data);
Expand Down

0 comments on commit cd5c1aa

Please sign in to comment.