Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling TeamSpeak3::factory fails without username and password #213

Closed
Wruczek opened this issue Jan 6, 2024 · 1 comment
Closed

Calling TeamSpeak3::factory fails without username and password #213

Wruczek opened this issue Jan 6, 2024 · 1 comment

Comments

@Wruczek
Copy link
Contributor

Wruczek commented Jan 6, 2024

The framework should support creating TeamSpeak3 node instances without requiring username and password to be provided.
Even the URL examples included in the description of TeamSpeak3::factory fail, as they do not contain username and password.

I'm using TeamSpeak 3 PHP Framework 1.2.1 on PHP 8.2.12.

Example code:

<?php

use PlanetTeamSpeak\TeamSpeak3Framework\TeamSpeak3;

require_once __DIR__ . '/vendor/autoload.php';

TeamSpeak3::factory('serverquery://127.0.0.1:10011/?timeout=3');

Error:

Fatal error: Uncaught Error: Call to a member function toString() on null in vendor\planetteamspeak\ts3-php-framework\src\Helper\Uri.php:371
Stack trace:
#0 vendor\planetteamspeak\ts3-php-framework\src\Helper\Uri.php(173): PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri->checkPort()
#1 vendor\planetteamspeak\ts3-php-framework\src\Helper\Uri.php(131): PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri->isValid()
#2 vendor\planetteamspeak\ts3-php-framework\src\TeamSpeak3.php(346): PlanetTeamSpeak\TeamSpeak3Framework\Helper\Uri->__construct(Array)
#3 (myfile): PlanetTeamSpeak\TeamSpeak3Framework\TeamSpeak3::factory('serverquery://1...')
#4 {main}
  thrown in vendor\planetteamspeak\ts3-php-framework\src\Helper\Uri.php on line 371
@Wruczek Wruczek changed the title Calling TeamSpeak3::factory without username and password in query string fails Calling TeamSpeak3::factory fails without username and password Jan 6, 2024
Sebbo94BY added a commit to Sebbo94BY/ts3phpframework that referenced this issue May 31, 2024
Sebbo94BY added a commit to Sebbo94BY/ts3phpframework that referenced this issue Jun 1, 2024
- Allow factory() without username and password
- Use PHP native parse_url() function to simplify code
- Improve and refactor some validations in general
Sebbo94BY added a commit to Sebbo94BY/ts3phpframework that referenced this issue Jun 1, 2024
- Fix `Call to a member function toString()` on null when using `factory()` without credentials
- Allow `factory()` without username and password
- Use PHP native `parse_url()` function to simplify code
- Improve and refactor some validations in general
- Adjust and extend PHPUnit tests
Sebbo94BY added a commit that referenced this issue Jun 1, 2024
…rname-and-password

#213 Improve and fix URI parsing
@Sebbo94BY
Copy link
Collaborator

Fixed in the linked pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants