Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into remove-configToken
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelWei committed Aug 30, 2023
2 parents d7099ed + 7ea8e13 commit 3d76cc4
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 64 deletions.
2 changes: 2 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
'yoda_style' => false,
'single_line_throw' => false,
'increment_style' => false,
'modernize_strpos' => false,
'get_class_to_class_keyword' => false,
])
->setRiskyAllowed(true)
->setFinder($finder);
7 changes: 3 additions & 4 deletions src/BigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
use BigBlueButton\Responses\PutRecordingTextTrackResponse;
use BigBlueButton\Responses\UpdateRecordingsResponse;
use BigBlueButton\Util\UrlBuilder;
use SimpleXMLElement;

/**
* Class BigBlueButton.
Expand Down Expand Up @@ -108,7 +107,7 @@ class BigBlueButton
*
* @throws ConfigException
*/
public function __construct(?string $baseUrl = null, ?string $secret = null, ?TransportInterface $transport = null)
public function __construct(string $baseUrl = null, string $secret = null, TransportInterface $transport = null)
{
// Keeping backward compatibility with older deployed versions
$this->securitySecret = $secret ?: getenv('BBB_SECURITY_SALT') ?: getenv('BBB_SECRET');
Expand Down Expand Up @@ -478,10 +477,10 @@ public function setJSessionId(string $jSessionId): void
* @throws ParsingException
* @throws RuntimeException
*/
private function processXmlResponse(string $url, string $payload = '', string $contentType = 'application/xml'): SimpleXMLElement
private function processXmlResponse(string $url, string $payload = '', string $contentType = 'application/xml'): \SimpleXMLElement
{
try {
return new SimpleXMLElement($this->requestUrl($url, $payload, $contentType));
return new \SimpleXMLElement($this->requestUrl($url, $payload, $contentType));
} catch (NetworkException|RuntimeException $e) {
throw $e;
} catch (\Throwable $e) {
Expand Down
4 changes: 1 addition & 3 deletions src/Exceptions/BaseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@

namespace BigBlueButton\Exceptions;

use Exception;

/**
* @abstract since 4.0.
*/
class BaseException extends Exception
class BaseException extends \Exception
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ public function __construct(
$this->defaultHeaders = $defaultHeaders;
}

/**
* {@inheritDoc}
*/
public function request(TransportRequest $request): TransportResponse
{
if ('' !== $payload = $request->getPayload()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ public static function create(array $defaultHeaders = [], array $defaultOptions
// @codeCoverageIgnoreEnd
}

/**
* {@inheritDoc}
*/
public function request(TransportRequest $request): TransportResponse
{
$headers = $this->defaultHeaders;
Expand Down
3 changes: 0 additions & 3 deletions src/Http/Transport/CurlTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ public static function createWithDefaultOptions(array $additionalCurlOptions = [
// @codeCoverageIgnoreEnd
}

/**
* {@inheritDoc}
*/
public function request(TransportRequest $request): TransportResponse
{
// @codeCoverageIgnoreStart
Expand Down
3 changes: 0 additions & 3 deletions src/Parameters/BaseParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public function __call(string $name, array $arguments)
return null;
}

/**
* @return mixed
*/
protected function getter(string $name)
{
if (property_exists($this, $name)) {
Expand Down
7 changes: 1 addition & 6 deletions src/Parameters/CreateMeetingParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ public function setGuestPolicyAlwaysAccept(): self

/**
* @deprecated old flash client parameter, not used anymore
* @return string
*/
public function getConfigToken(): ?string
{
Expand All @@ -492,7 +491,6 @@ public function getConfigToken(): ?string

/**
* @deprecated old flash client parameter, not used anymore
* @param string $configToken
*
* @return JoinMeetingParameters
*/
Expand All @@ -503,7 +501,7 @@ public function setConfigToken(string $configToken): self
return $this;
}

public function addPresentation(string $nameOrUrl, ?string $content = null, ?string $filename = null): self
public function addPresentation(string $nameOrUrl, string $content = null, string $filename = null): self
{
if (!$filename) {
$this->presentations[$nameOrUrl] = !$content ?: base64_encode($content);
Expand All @@ -519,9 +517,6 @@ public function getPresentations(): array
return $this->presentations;
}

/**
* @return mixed
*/
public function getPresentationsAsXML()
{
$result = '';
Expand Down
5 changes: 1 addition & 4 deletions src/Parameters/InsertDocumentParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(string $meetingID)
$this->meetingID = $meetingID;
}

public function addPresentation(string $url, string $filename, ?bool $downloadable = null, ?bool $removable = null): self
public function addPresentation(string $url, string $filename, bool $downloadable = null, bool $removable = null): self
{
$this->presentations[$url] = [
'filename' => $filename,
Expand All @@ -60,9 +60,6 @@ public function removePresentation(string $url): self
return $this;
}

/**
* @return mixed
*/
public function getPresentationsAsXML()
{
$result = '';
Expand Down
5 changes: 0 additions & 5 deletions src/Parameters/PutRecordingTextTrackParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,10 @@ class PutRecordingTextTrackParameters extends BaseParameters
*/
protected $contentType;

/**
* @var mixed
*/
protected $file;

/**
* GetRecordingTextTracksParameters constructor.
*
* @param $recordID
*/
public function __construct(string $recordID, string $kind, string $lang, string $label)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Responses/BaseResponseAsJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ abstract class BaseResponseAsJson
public const FAILED = 'FAILED';
public const CHECKSUM_ERROR = 'checksumError';

/**
* @var mixed
*/
protected $data;

/**
Expand Down
7 changes: 0 additions & 7 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ class TestCase extends \PHPUnit\Framework\TestCase
*/
protected $faker;

/**
* {@inheritdoc}
*/
protected function setUp(): void
{
parent::setUp();
Expand Down Expand Up @@ -127,8 +124,6 @@ protected function generateCreateParams()
}

/**
* @param $createParams
*
* @return array
*/
protected function generateBreakoutCreateParams($createParams)
Expand Down Expand Up @@ -202,8 +197,6 @@ protected function getCreateMock($params)
}

/**
* @param $params
*
* @return CreateMeetingParameters
*/
protected function getBreakoutCreateMock($params)
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/BigBlueButtonWithCurlTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@

final class BigBlueButtonWithCurlTransportTest extends AbstractBigBlueButtonFunctionalTest
{
/**
* {@inheritDoc}
*/
protected static function createTransport(): TransportInterface
{
return CurlTransport::createWithDefaultOptions();
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/BigBlueButtonWithPsrHttpClientTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

final class BigBlueButtonWithPsrHttpClientTransport extends AbstractBigBlueButtonFunctionalTest
{
/**
* {@inheritDoc}
*/
protected static function createTransport(): TransportInterface
{
$psr17Factory = new Psr17Factory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@

final class BigBlueButtonWithSymfonyHttpClientTransportTest extends AbstractBigBlueButtonFunctionalTest
{
/**
* {@inheritDoc}
*/
protected static function createTransport(): TransportInterface
{
return SymfonyHttpClientTransport::create();
Expand Down
9 changes: 3 additions & 6 deletions tests/integration/Http/Transport/CurlTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
*/
final class CurlTransportTest extends TestCase
{
/**
* {@inheritDoc}
*/
public static function setUpBeforeClass(): void
{
TestHttpServer::start();
Expand All @@ -45,9 +42,9 @@ public static function setUpBeforeClass(): void
public function provideBadResponseCodes(): iterable
{
// cURL does not understand codes below 200 properly.
// foreach (range(100, 199) as $badCode) {
// yield 'HTTP code ' . $badCode => [$badCode];
// }
// foreach (range(100, 199) as $badCode) {
// yield 'HTTP code ' . $badCode => [$badCode];
// }

foreach (range(300, 599) as $badCode) {
yield 'HTTP code '.$badCode => [$badCode];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ final class PsrHttpClientTransportTest extends TestCase
*/
private $streamFactoryMock;

/**
* {@inheritDoc}
*/
protected function setUp(): void
{
$this->transport = $this->createTransport();
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/Http/Transport/HeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public function provideNonStringHeaders(): iterable

/**
* @dataProvider provideNonStringHeaders
*
* @param mixed $badHeader
*/
public function testMergeCurlHeadersWithNonStringHeaders($badHeader): void
{
Expand Down

0 comments on commit 3d76cc4

Please sign in to comment.