Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci-php-oldest.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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