Release#6
Merged
Merged
Conversation
Apply the PHP-CS-Fixer ruleset across src/ (Yoda conditions removed, fully-qualified built-in functions and classes, import cleanups, PHPDoc ordering, concatenation spacing). No behaviour changes; the actual bug fixes follow in their own commits so they aren't buried in reformatting.
Classic Votifier encryption used OPENSSL_SSLV23_PADDING, a constant OpenSSL 3.0 removed and that is undefined on PHP 8, so encryption failed on modern stacks. Encrypt with openssl_public_encrypt's default PKCS#1 v1.5 padding instead, which is exactly what Votifier decrypts with (Cipher.getInstance("RSA") resolves to PKCS#1 v1.5 via the JDK's SunJCE provider).
The public key is now parsed with openssl_pkey_get_public up front, so an invalid key throws an InvalidArgumentException instead of silently producing an empty packet, and the PEM body is wrapped at 64 characters.
Replace the deprecated call_user_func_array([$this, 'parent::sendVote'], ...) parent-call form, which no longer works as a callable on newer PHP, with parent::sendVote(...$votes).
fsockopen only set a connect timeout, so the first read blocked for php.ini's default_socket_timeout (60s) before failing with the vague "package not received". Set an explicit read timeout via stream_set_timeout and, when a read times out, throw a PackageNotReceivedException explaining that the server accepted the connection but sent nothing and that the host and Votifier port (default 8192, not the Minecraft port 25565) should be checked. Closes #5
…e opened When fsockopen fails, the OS-level reason (connection refused, timed out, no route to host, DNS failure) was discarded and the caller only saw a generic "could not create a connection". Surface that reason, along with the host and port, in the NoConnectionException message so the cause is visible. Closes #4
Generate the CC BY-NC-SA license page from the official source, pull the community-health files from the Team-MaRo/.github submodule instead of duplicating them, and drop the committed phpDocumentor API dump.
Migrate the test metadata to PHP attributes while keeping the annotations so the suite runs on PHPUnit 7 to 13 (PHP 7.1 to 8.5), type the mock properties as Socket&Stub intersections so static analysis resolves the stubbed methods, and add a test covering an invalid public key.
…ames Move .github/workflows/ci-cd.yml to ci.yml and .php_cs.dist to .php-cs-fixer.dist.php with their contents unchanged, so the history records a rename; the rebuilt pipeline and v3 config land in the following commit.
Split the workflow into a style/compatibility job on a modern PHP and a PHP 7.1 to 8.5 test matrix, reduce PHP_CodeSniffer to the PHPCompatibility gate while PHP-CS-Fixer owns style, add PHPStan at level 6 with a baseline, drive coverage from the CLI so the config stays valid across PHPUnit versions, and adopt release-please for releases.
Add a standalone PHP app under public/ that drives the library against a real server, a compose.yml with spigot and web services, and a classic-Votifier feedback listener under tools/ for confirming that votes are received.
Relicense the code from GNU GPL v3 to MIT, update the file headers and repository links to the Team-MaRo organization, refresh the README and project metadata, and stop tracking IDE and editor configuration.
Contributor
|
Thank you for taking your precious time to create a pull request on this repository for the first time. Your work might actually benefit many others. |
Contributor
|
✅dependabot config looks good 👍 |
Add an explicit least-privilege permissions block (contents: read) so the style and test jobs run with a read-only token, resolving the CodeQL "workflow does not contain permissions" finding. The jobs only read the repo and upload coverage to external services, so no write scopes are needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.