Codebase Renovation

We elevate your project to its peak potential with software upgrade service.

While every project is unique, we offer you concrete examples of transformation.
That way you can envision the improvements your project will achieve once Rector handles it.


1. Exact PHP Version

Before

PHP version is ambiguous, defined in multiple places and with upper bracket.

                        {
    "requires": {
        "php": "^7.2"
    },
    "config": {
        "platform": {
            "php": "7.3.4"
        }
    }
}
                    

After

Single and exact PHP version. The latest available stable version to get the best performance and code quality.

                        {
    "requires": {
        "php": "8.3"
    }
}
                    

2. Static Analysis Tailored

Before

Multiple tools, mutually covering the same features, taking time of CI and energy of developers. Huge files with 1000+ ignored errors.

                        {
    "requires-dev": {
        "phpstan/phpstan": "^1.11",
        "phpmd/phpmd": "^2.13",
        "vimeo/psalm": "^4.30"
    }
}
                    

After

Neat setup with phpstan.neon. No ignores. The best tool to do the job with fast parallel run. Custom PHPStan rules to deal with your domain.

                        {
    "requires-dev": {
        "phpstan/phpstan": "^1.11"
    }
}
                    

3. Autoloading Perfected

Before

Various classmap/PSR-0/files autoloading allows conflicts and make project class loading. In some cases classes can be loaded incorrectly and cause server to crash. It's not clear, where to put new classes.

                        {
    "autoload": {
        "classmap": [
            "src",
            "libraries",
            "classes",
            "tests"
            "spec"
        ]
        "files": [
            "src/AppModule/SomeClass.php",
        ]
    }
}
                    

After

Single PSR-4 loading root, simple and clear.
Fast composer loading, clear rules.

                        {
    "autoload": {
        "psr-4": {
            "App\\": "src"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests"
        }
    }
}
                    

4. Coding Standard Working for You

Before

Your project has overwhelming mix of IDE setup, code sniffer/php-cs-fixer XML/stringy-PHP, pre-commit hook and PSR-2 coding standard (deprecated since 2019).
This setup makes you change code manually, put your developers under stress and distracts them from delivering business features.

                        <?php

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__ . '/src')
    ->append([
        __DIR__ . '/rector.php',
        __DIR__ . '/composer-dependency-analyser.php'
    ]);

return PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->setRiskyAllowed(true)
    ->setRules([
        '@Symfony' => true,
        '@Symfony:risky' => true,
        'linebreak_after_opening_tag' => true,
        'mb_str_functions' => true,
        'no_php4_constructor' => true,
        'blank_line_between_import_groups' => false,
    ])
    ->setFinder($finder);
                    

After

Single tool that fixes coding standard in blazing fast parallel CLI run.

Run ECS with prepared sets beyond PSR-12. Including neatly indented arrays, clean and meaningful docblocks, removed unused imports, and standardized spacing of every element.

                        <?php

use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
    ->withPaths([__DIR__ . '/src'])
    ->withRootFiles()
    ->withPreparedSets(
        psr12: true, common: true, symplify: true
    );
                    

5. Automated Instant CI Feedback

Before

Knowledge of your project is scattered in multiple places, from README, through Confluence, to senior developers' memory. To achieve a change, you have to verify multiple places and ask multiple people about best practices. Verification of a single change takes hour of manual testing and is prone to human error.

                        // 1. verify in README

// 2. check internal wiki
      (mostly outdated and leading to wrong path)

// 3. run tests on server manually
      (re-run for new commit)

// 4. don't forget to ping responsible devs on Slack
                    

After

The source of truth is in the CI. Every change is verified through exactly defined up-to-date steps. If any knowledge needs update or is obsolete, it will be change in CI setup.
That way any developer, junior, senior or contractor, has access to very same knowledge.

                        name: Code Analysis

on:
  pull_request: null

jobs:
  code_analysis:
    strategy:
      matrix:
        actions:
          - run: vendor/bin/class-leak check src
          - run: php bin/verify-aws-secrets.php
          - run: docker compose up