coral-media / php-ml

Fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing, Feature Extraction and much more in one library.
MIT License
1 stars 1 forks source link

PHP8.3 compatibility fixes #7

Closed divinity76 closed 4 months ago

divinity76 commented 4 months ago

fixes https://github.com/coral-media/php-ml/issues/3

this was fixed automatically with Rector using the config

<?php

declare(strict_types=1);

return (static function (\Rector\Config\RectorConfig $rectorConfig): void {
    $rectorConfig->paths([
        '/home/hans/projects/php-ml/',
    ]);
    $rectorConfig->sets([
        //\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_82,
        \Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_83,
    ]);
    $rectorConfig->skip([
        Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector::class,
        \Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector::class,
        \Rector\Php80\Rector\FunctionLike\MixedTypeRector::class,
        \Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class,
        \Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class,
        \Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector::class,
        \Rector\Php80\Rector\Class_\StringableForToStringRector::class,
        \Rector\Php70\Rector\FuncCall\RandomFunctionRector::class,
        \Rector\Php83\Rector\ClassConst\AddTypeToConstRector::class,
        \Rector\Php81\Rector\ClassMethod\NewInInitializerRector::class,
    ]);
});

as for why i disabled many of the rules: many of them are just personal-preference changes, and some of them break php7.4 compatibility, and none of the disabled ones are required for php8.3 compatibility.

rernesto commented 4 months ago

On it, please make sure you follow conventional commits next time, I use some automation to generate CHANGELOG.MD. Rigth now is not a big deal because there is not a release yet.

rernesto commented 4 months ago

@divinity76 I am merging into wip/php-8.2-deprecations to run test first. I know a lot of test are failing (related to SVM) but just making sure whatever was working before is not broken.