imports:
    - { resource: 'nette-to-symfony/*.yaml' }

services:
    Rector\NetteToSymfony\Rector\MethodCall\FromHttpRequestGetHeaderToHeadersGetRector: ~
    Rector\NetteToSymfony\Rector\MethodCall\FromRequestGetParameterToAttributesGetRector: ~
    Rector\NetteToSymfony\Rector\ClassMethod\RouterListToControllerAnnotationsRector: ~

    # run(Request $appRequest): IResponse -> run(Request $appRequest): \Symfony\Component\HttpFoundation\Response
    Rector\Rector\ClassMethod\AddReturnTypeDeclarationRector:
        Nette\Application\IPresenter:
            run: Symfony\Component\HttpFoundation\Response

    Rector\Rector\Class_\RenameClassRector:
        # run(Request $appRequest) -> run(\Symfony\Component\HttpFoundation\Request $appRequest)
        Nette\Application\Request: Symfony\Component\HttpFoundation\Request
        Nette\Http\Request: Symfony\Component\HttpFoundation\Request
        Nette\Http\IRequest: Symfony\Component\HttpFoundation\Request

        # extends Nette\Application\UI\Presenter -> extends Symfony\Bundle\FrameworkBundle\Controller\AbstractController
        Nette\Application\UI\Presenter: Symfony\Bundle\FrameworkBundle\Controller\AbstractController

        # Nette\Application\IResponse-> Symfony\Component\HttpFoundation\Response
        Nette\Application\IResponse: Symfony\Component\HttpFoundation\Response

    Rector\Rector\MethodCall\RenameMethodRector:
        # IPresenter::run() -> IPresenter->__invoke
        Nette\Application\IPresenter:
            run: __invoke

        Nette\DI\Container:
            getByType: get

        # load configs
        Nette\Configurator:
            addConfig: load
        Symfony\Component\Config\Loader\LoaderInterface:
            addConfig: load

    Rector\Rector\Interface_\RemoveInterfacesRector:
        # Removes "implements IPresenter"
        - Nette\Application\IPresenter

    Rector\Rector\Constant\RenameClassConstantRector:
        Nette\Http\*Response:
            S100_CONTINUE: Symfony\Component\HttpFoundation\Response::HTTP_CONTINUE
            S101_SWITCHING_PROTOCOLS: Symfony\Component\HttpFoundation\Response::HTTP_SWITCHING_PROTOCOLS
            S102_PROCESSING: Symfony\Component\HttpFoundation\Response::HTTP_PROCESSING
            S200_OK: Symfony\Component\HttpFoundation\Response::HTTP_OK
            S201_CREATED: Symfony\Component\HttpFoundation\Response::HTTP_CREATED
            S202_ACCEPTED: Symfony\Component\HttpFoundation\Response::HTTP_ACCEPTED
            S203_NON_AUTHORITATIVE_INFORMATION: Symfony\Component\HttpFoundation\Response::HTTP_NON_AUTHORITATIVE_INFORMATION
            S204_NO_CONTENT: Symfony\Component\HttpFoundation\Response::HTTP_NO_CONTENT
            S205_RESET_CONTENT: Symfony\Component\HttpFoundation\Response::HTTP_RESET_CONTENT
            S206_PARTIAL_CONTENT: Symfony\Component\HttpFoundation\Response::HTTP_PARTIAL_CONTENT
            S207_MULTI_STATUS: Symfony\Component\HttpFoundation\Response::HTTP_MULTI_STATUS
            S208_ALREADY_REPORTED: Symfony\Component\HttpFoundation\Response::HTTP_ALREADY_REPORTED
            S226_IM_USED: Symfony\Component\HttpFoundation\Response::HTTP_IM_USED
            S300_MULTIPLE_CHOICES: Symfony\Component\HttpFoundation\Response::HTTP_MULTIPLE_CHOICES
            S301_MOVED_PERMANENTLY: Symfony\Component\HttpFoundation\Response::HTTP_MOVED_PERMANENTLY
            S302_FOUND: Symfony\Component\HttpFoundation\Response::HTTP_FOUND
            S303_SEE_OTHER: Symfony\Component\HttpFoundation\Response::HTTP_SEE_OTHER
            S303_POST_GET: Symfony\Component\HttpFoundation\Response::HTTP_SEE_OTHER
            S304_NOT_MODIFIED: Symfony\Component\HttpFoundation\Response::HTTP_NOT_MODIFIED
            S305_USE_PROXY: Symfony\Component\HttpFoundation\Response::HTTP_USE_PROXY
            S307_TEMPORARY_REDIRECT: Symfony\Component\HttpFoundation\Response::HTTP_TEMPORARY_REDIRECT
            S308_PERMANENT_REDIRECT: Symfony\Component\HttpFoundation\Response::HTTP_PERMANENTLY_REDIRECT
            S400_BAD_REQUEST: Symfony\Component\HttpFoundation\Response::HTTP_BAD_REQUEST
            S401_UNAUTHORIZED: Symfony\Component\HttpFoundation\Response::HTTP_UNAUTHORIZED
            S402_PAYMENT_REQUIRED: Symfony\Component\HttpFoundation\Response::HTTP_PAYMENT_REQUIRED
            S403_FORBIDDEN: Symfony\Component\HttpFoundation\Response::HTTP_FORBIDDEN
            S404_NOT_FOUND: Symfony\Component\HttpFoundation\Response::HTTP_NOT_FOUND
            S405_METHOD_NOT_ALLOWED: Symfony\Component\HttpFoundation\Response::HTTP_METHOD_NOT_ALLOWED
            S406_NOT_ACCEPTABLE: Symfony\Component\HttpFoundation\Response::HTTP_NOT_ACCEPTABLE
            S407_PROXY_AUTHENTICATION_REQUIRED: Symfony\Component\HttpFoundation\Response::HTTP_PROXY_AUTHENTICATION_REQUIRED
            S408_REQUEST_TIMEOUT: Symfony\Component\HttpFoundation\Response::HTTP_REQUEST_TIMEOUT
            S409_CONFLICT: Symfony\Component\HttpFoundation\Response::HTTP_CONFLICT
            S410_GONE: Symfony\Component\HttpFoundation\Response::HTTP_GONE
            S411_LENGTH_REQUIRED: Symfony\Component\HttpFoundation\Response::HTTP_LENGTH_REQUIRED
            S412_PRECONDITION_FAILED: Symfony\Component\HttpFoundation\Response::HTTP_PRECONDITION_FAILED
            S413_REQUEST_ENTITY_TOO_LARGE: Symfony\Component\HttpFoundation\Response::HTTP_REQUEST_ENTITY_TOO_LARGE
            S414_REQUEST_URI_TOO_LONG: Symfony\Component\HttpFoundation\Response::HTTP_REQUEST_URI_TOO_LONG
            S415_UNSUPPORTED_MEDIA_TYPE: Symfony\Component\HttpFoundation\Response::HTTP_UNSUPPORTED_MEDIA_TYPE
            S416_REQUESTED_RANGE_NOT_SATISFIABLE: Symfony\Component\HttpFoundation\Response::HTTP_REQUESTED_RANGE_NOT_SATISFIABLE
            S417_EXPECTATION_FAILED: Symfony\Component\HttpFoundation\Response::HTTP_EXPECTATION_FAILED
            S421_MISDIRECTED_REQUEST: Symfony\Component\HttpFoundation\Response::HTTP_MISDIRECTED_REQUEST
            S422_UNPROCESSABLE_ENTITY: Symfony\Component\HttpFoundation\Response::HTTP_UNPROCESSABLE_ENTITY
            S423_LOCKED: Symfony\Component\HttpFoundation\Response::HTTP_LOCKED
            S424_FAILED_DEPENDENCY: Symfony\Component\HttpFoundation\Response::HTTP_FAILED_DEPENDENCY
            S426_UPGRADE_REQUIRED: Symfony\Component\HttpFoundation\Response::HTTP_UPGRADE_REQUIRED
            S428_PRECONDITION_REQUIRED: Symfony\Component\HttpFoundation\Response::HTTP_PRECONDITION_REQUIRED
            S429_TOO_MANY_REQUESTS: Symfony\Component\HttpFoundation\Response::HTTP_TOO_MANY_REQUESTS
            S431_REQUEST_HEADER_FIELDS_TOO_LARGE: Symfony\Component\HttpFoundation\Response::HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
            S451_UNAVAILABLE_FOR_LEGAL_REASONS: Symfony\Component\HttpFoundation\Response::HTTP_UNAVAILABLE_FOR_LEGAL_REASONS
            S500_INTERNAL_SERVER_ERROR: Symfony\Component\HttpFoundation\Response::HTTP_INTERNAL_SERVER_ERROR
            S501_NOT_IMPLEMENTED: Symfony\Component\HttpFoundation\Response::HTTP_NOT_IMPLEMENTED
            S502_BAD_GATEWAY: Symfony\Component\HttpFoundation\Response::HTTP_BAD_GATEWAY
            S503_SERVICE_UNAVAILABLE: Symfony\Component\HttpFoundation\Response::HTTP_SERVICE_UNAVAILABLE
            S504_GATEWAY_TIMEOUT: Symfony\Component\HttpFoundation\Response::HTTP_GATEWAY_TIMEOUT
            S505_HTTP_VERSION_NOT_SUPPORTED: Symfony\Component\HttpFoundation\Response::HTTP_VERSION_NOT_SUPPORTED
            S506_VARIANT_ALSO_NEGOTIATES: Symfony\Component\HttpFoundation\Response::HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL
            S507_INSUFFICIENT_STORAGE: Symfony\Component\HttpFoundation\Response::HTTP_INSUFFICIENT_STORAGE
            S508_LOOP_DETECTED: Symfony\Component\HttpFoundation\Response::HTTP_LOOP_DETECTED
            S510_NOT_EXTENDED: Symfony\Component\HttpFoundation\Response::HTTP_NOT_EXTENDED
            S511_NETWORK_AUTHENTICATION_REQUIRED: Symfony\Component\HttpFoundation\Response::HTTP_NETWORK_AUTHENTICATION_REQUIRED

        Nette\Http\*Request:
            GET: Symfony\Component\HttpFoundation\Request::METHOD_GET
            POST: Symfony\Component\HttpFoundation\Request::METHOD_POST
            HEAD: Symfony\Component\HttpFoundation\Request::METHOD_HEAD
            PUT: Symfony\Component\HttpFoundation\Request::METHOD_PUT
            DELETE: Symfony\Component\HttpFoundation\Request::METHOD_DELETE
            PATCH: Symfony\Component\HttpFoundation\Request::METHOD_PATCH
            OPTIONS: Symfony\Component\HttpFoundation\Request::METHOD_OPTIONS
