Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

PHP 8.2 compatibility #690

Open thedotedge opened 1 year ago

thedotedge commented 1 year ago

Running on 8.2 yields deprecation:

Deprecated: Creation of dynamic property Luracast\Restler\Data\Validator::$restler is deprecated in /application/vendor/luracast/restler/src/Scope.php

https://php.watch/versions/8.2/dynamic-properties-deprecated#AllowDynamicProperties

tups commented 1 year ago

You can just add the property publicly to your class

class Device
{

    public $restler; // here

    public function index() {
        return [
            'success' => [
                'code' => 200,
                'message' => 'Restler is up and running!',
            ],
        ];
    }

}