Skip to content

Fix deprecated use of "parent" in callables for php8.3. #113

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
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
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "rusticisoftware/tincan",
"name": "opigno/tincan",
"type": "library",
"description": "Experience API (Tin Can API) Library",
"homepage": "http://rusticisoftware.github.io/TinCanPHP/",
Expand All @@ -11,6 +11,9 @@
"e-learning",
"scorm"
],
"replace": {
"rusticisoftware/tincan": "*"
},
"license": "Apache-2.0",
"authors": [
{
Expand All @@ -24,7 +27,7 @@
"issues": "https://github.com/RusticiSoftware/TinCanPHP/issues"
},
"require": {
"php": "~5.5 || ^7.0.3",
"php": "~5.5 || ^7 || ^8",
"ext-openssl": "*",
"namshi/jose": "^7.2.1",
"willdurand/negotiation": "^2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/RemoteLRS.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected function sendRequest($method, $resource) {
}
}
if (isset($options['params']) && count($options['params']) > 0) {
$url .= '?' . http_build_query($options['params'], null, '&', PHP_QUERY_RFC3986);
$url .= '?' . http_build_query($options['params'], '', '&', PHP_QUERY_RFC3986);
}

if (($method === 'PUT' || $method === 'POST') && isset($options['content'])) {
Expand All @@ -137,7 +137,7 @@ protected function sendRequest($method, $resource) {
// normal handling
//
set_error_handler(
function ($errno, $errstr, $errfile, $errline, array $errcontext) {
function ($errno, $errstr, $errfile, $errline) {
// "!== false" is intentional. strpos() can return 0, which is falsey, but returning
// 0 matches our "true" condition. Using strict equality to avoid that confusion.
if ($errno == E_NOTICE && strpos($errstr, 'Array to string conversion') !== false) {
Expand Down
2 changes: 1 addition & 1 deletion src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Statement extends StatementBase
protected $attachments;

public function __construct() {
call_user_func_array('parent::__construct', func_get_args());
parent::__construct(...func_get_args());

if (func_num_args() == 1) {
$arg = func_get_arg(0);
Expand Down
2 changes: 1 addition & 1 deletion src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function getTimestamp() {
$microseconds = sprintf('%06d', ($time - floor($time)) * 1000000);
$millseconds = round($microseconds, -3)/1000;
$millsecondsStr = str_pad($millseconds, 3, '0', STR_PAD_LEFT);
$date = (new \DateTime(null, new \DateTimeZone("UTC")))->format('c');
$date = (new \DateTime('now', new \DateTimeZone("UTC")))->format('c');

$position = strrpos($date, '+');
$date = substr($date,0,$position).'.'.$millsecondsStr.substr($date,$position);
Expand Down