Skip to content

Commit

Permalink
Update to PHP 8.2 for latest XDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour committed May 24, 2024
1 parent e8f3286 commit 8136117
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class Middleware
private $_info;

/** @var null|string */
private $_plugin;
private string $_plugin;
private $_pluginInstance;

/** @var resource[] */
Expand All @@ -33,7 +33,7 @@ final class Middleware
/** @var array */
private $_eventQueue = [];

public function __construct($plugin, $debug = FALSE)
public function __construct(string $plugin, bool $debug = FALSE)
{
// Ensure that user cannot instantiate Middleware
if (self::$_instance) {
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.4-fpm
FROM php:8.2-fpm

# Install SOAP
RUN apt-get update -y \
Expand Down
11 changes: 5 additions & 6 deletions lib/Middleware/Autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@

class Middleware_Autoload
{
private string $_pluginPrefix;
private array $_pluginLoader;

/**
* Register SPL autoload function
*/
static public function register($pluginPrefix, $pluginLoader)
static public function register(string $pluginPrefix, array $pluginLoader)
{
$autoloader = new Middleware_Autoload($pluginPrefix, $pluginLoader);
spl_autoload_register(array($autoloader, 'autoload'));
}

public function __construct($pluginPrefix, $pluginLoader)
public function __construct(string $pluginPrefix, array $pluginLoader)
{
$this->_pluginPrefix = $pluginPrefix;
$this->_pluginLoader = $pluginLoader;
}

/**
* Load class source code
*
* @param string $class
* @return bool
*/
public function autoload($class)
public function autoload(string $class): bool
{
if (strpos($class, $this->_pluginPrefix) === 0) {
return call_user_func($this->_pluginLoader, str_replace($this->_pluginPrefix, '', $class));
Expand Down
4 changes: 2 additions & 2 deletions lib/Plugin/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ final public function isDebug($isDebug = NULL)
* @return Middleware_JsonClient
* @throws Exception
*/
final private function _getClient()
private function _getClient()
{
if ( ! $this->_client) {
$this->_client = new Middleware_JsonClient(
Expand All @@ -750,7 +750,7 @@ final private function _getClient()
* @return string Example: "http://example.com/"
* @throws Exception
*/
final private function _getBaseUrl()
private function _getBaseUrl()
{
$baseUrl = trim($this->middleware->getConfig('middleware/system/base_url'));
if ( ! $baseUrl) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Simplexml/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Varien_Simplexml_Element extends SimpleXMLElement
*
* @return boolean
*/
public function hasChildren()
public function hasChildren(): bool
{
if (!$this->children()) {
return false;
Expand Down

0 comments on commit 8136117

Please sign in to comment.