Skip to content
Open
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.2', '8.3', '8.4', '8.5']
experimental: [false]

steps:
Expand All @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.2', '8.3', '8.4', '8.5']
experimental: [false]
steps:
- name: Checkout
Expand All @@ -64,14 +64,14 @@ jobs:
run: tools/phpunit --testsuite="BigBlueButton unit test suite,BigBlueButton integration test suite"
continue-on-error: true
- name: Upload coverage
if: ${{ matrix.php-versions == '8.1' }}
if: ${{ matrix.php-versions == '8.2' }}
uses: codecov/codecov-action@v3
- name: Run rector
if: ${{ matrix.php-versions == '8.1' }}
if: ${{ matrix.php-versions == '8.2' }}
run: tools/rector process --dry-run
- name: Run psalm
if: ${{ matrix.php-versions == '8.1' }}
if: ${{ matrix.php-versions == '8.2' }}
run: tools/psalm
- name: Run phpstan
if: ${{ matrix.php-versions == '8.1' }}
if: ${{ matrix.php-versions == '8.2' }}
run: tools/phpstan
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ reports
# The library does not locks down the dependencies for several reasons:
#
# * In the outer world, the lock is not effective. Only the lock of the requiring application is accounted.
# * It makes it hard, to run the library with its deps in the CI as when running `composer require` under PHP 8.1,
# * It makes it hard, to run the library with its deps in the CI as when running `composer require` under PHP 8.2,
# an incompatible lock file is created which is unsuable unter PHP 7.x.
#
# See https://github.com/littleredbutton/bigbluebutton-api-php/pull/115 for the discussion.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# :tada: Best BigBlueButton API for PHP

The unofficial and easiest to use **BigBlueButton API for PHP**, makes easy for
developers to use [BigBlueButton API] v2.2+ for **PHP 8.1+**.
developers to use [BigBlueButton API] v2.2+ for **PHP 8.2+**.

![Build Status](https://github.com/littleredbutton/bigbluebutton-api-php/workflows/CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/littleredbutton/bigbluebutton-api-php/badge.svg?branch=master)](https://coveralls.io/github/littleredbutton/bigbluebutton-api-php?branch=master)
Expand Down Expand Up @@ -56,15 +56,15 @@ following advantages:
- Development is simplified through git hooks and contributor guidelines
- Documentation is up-to-date and complete
- API is fixed and extended to exploit the full potential
- Require at least PHP 8.1, which allows to make the code more efficient and
- Require at least PHP 8.2, which allows to make the code more efficient and
readable

## :gear: Installation and usage
### Requirements
In order to use this library you have to make sure to meet the following
requirements:

- PHP 8.1 or above.
- PHP 8.2 or above.
- curl library installed.
- mbstring library installed.
- xml library installed.
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"docs": "https://github.com/littleredbutton/bigbluebutton-api-php/blob/master/README.md"
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-curl": "*",
"ext-simplexml": "*",
"ext-mbstring": "*",
Expand Down Expand Up @@ -114,7 +114,7 @@
"cs-test": "tools/php-cs-fixer fix --dry-run --allow-risky=yes",
"psalm": "tools/psalm --threads=1",
"psalm-clear": "tools/psalm --clear-cache && tools/psalm --clear-global-cache",
"psalm-fix": "tools/psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm-fix": "tools/psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType,MissingOverrideAttribute",
"phpstan": "tools/phpstan analyse",
"rector": "tools/rector process --dry-run src/ tests/",
"rector-fix": "tools/rector process src/ tests/",
Expand Down Expand Up @@ -143,10 +143,10 @@
}
},
"friendsofphp/php-cs-fixer": "^3.3",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10",
"rector/rector": "^1.0",
"vimeo/psalm": "^5.23"
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11",
"rector/rector": "^2.0",
"vimeo/psalm": "^6.0"
}
}
}
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ parameters:
bootstrapFiles:
- tools/bootstrap.php
ignoreErrors:
-
identifier: method.alreadyNarrowedType
-
message: '#^Offset ''input'' does not exist on array\{\}\.$#'
path: tests/integration/Http/Transport/CurlTransportTest.php
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
Expand Down
14 changes: 7 additions & 7 deletions src/Core/Hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
/**
* Class Meeting.
*/
final class Hook
final readonly class Hook
{
private readonly string $hookId;
private string $hookId;

private readonly string $meetingId;
private string $meetingId;

private readonly string $callbackUrl;
private string $callbackUrl;

private readonly bool $permanentHook;
private bool $permanentHook;

private readonly bool $rawData;
private bool $rawData;

public function __construct(private readonly \SimpleXMLElement $rawXml)
public function __construct(private \SimpleXMLElement $rawXml)
{
$this->hookId = $this->rawXml->hookID->__toString();
$this->callbackUrl = $this->rawXml->callbackURL->__toString();
Expand Down
10 changes: 5 additions & 5 deletions src/Core/ImagePreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

namespace BigBlueButton\Core;

final class ImagePreview
final readonly class ImagePreview
{
public function __construct(
private readonly int $width,
private readonly int $height,
private readonly string $alt,
private readonly string $url,
private int $width,
private int $height,
private string $alt,
private string $url,
) {
}

Expand Down
15 changes: 7 additions & 8 deletions src/Core/InlinePresentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,25 @@

final class InlinePresentation extends Presentation
{
public function __construct(private readonly string $content, string $filename)
public function __construct(private readonly string $content, private readonly string $filename)
{
$this->filename = $filename;
}

#[\Override]
public function getArrayKey(): string
{
return $this->filename;
}

public function addDocumentToXML(SimpleXMLElementExtended $module): ?SimpleXMLElementExtended
#[\Override]
public function addDocumentToXML(SimpleXMLElementExtended $module): SimpleXMLElementExtended
{
$document = parent::addDocumentToXML($module);

/* @phpstan-ignore-next-line */
$document[0] = base64_encode($this->content);
$element = dom_import_simplexml($document);
$element->nodeValue = base64_encode($this->content);

if (isset($this->filename)) {
$document->addAttribute('name', $this->filename);
}
$document->addAttribute('name', $this->filename);

return $document;
}
Expand Down
14 changes: 0 additions & 14 deletions src/Core/Presentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

abstract class Presentation
{
protected ?string $filename = null;

protected ?bool $current = null;

protected ?bool $downloadable = null;
Expand Down Expand Up @@ -55,18 +53,6 @@ public function addDocumentToXML(SimpleXMLElementExtended $module): ?SimpleXMLEl

abstract public function getArrayKey(): string;

public function getFilename(): ?string
{
return $this->filename;
}

public function setFilename(string $filename): self
{
$this->filename = $filename;

return $this;
}

public function getCurrent(): ?bool
{
return $this->current;
Expand Down
12 changes: 6 additions & 6 deletions src/Core/Track.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
/**
* Class Track.
*/
final class Track
final readonly class Track
{
private readonly string $href;
private string $href;

private readonly string $kind;
private string $kind;

private readonly string $label;
private string $label;

private readonly string $lang;
private string $lang;

private readonly string $source;
private string $source;

public function __construct(object $track)
{
Expand Down
11 changes: 11 additions & 0 deletions src/Core/UrlPresentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@

final class UrlPresentation extends Presentation
{
private ?string $filename = null;

public function __construct(private readonly string $url)
{
}

#[\Override]
public function getArrayKey(): string
{
return $this->url;
}

#[\Override]
public function addDocumentToXML(SimpleXMLElementExtended $module): ?SimpleXMLElementExtended
{
$document = parent::addDocumentToXML($module);
Expand All @@ -46,4 +50,11 @@ public function addDocumentToXML(SimpleXMLElementExtended $module): ?SimpleXMLEl

return $document;
}

public function setFilename(string $filename): self
{
$this->filename = $filename;

return $this;
}
}
Loading
Loading