protected function registerProjectConfigEvents()
    {
        if (!version_compare(Craft::$app->getVersion(), '3.1', '>=')) {
            return;
        }

        // Project Config
        Craft::$app->projectConfig
            ->onAdd(
                'patronProviders.{uid}',
                [
                    ProjectConfigHandler::class,
                    'handleChangedProvider'
                ]
            )
            ->onUpdate(
                'patronProviders.{uid}',
                [ProjectConfigHandler::class,
                    'handleChangedProvider'
                ]
            )
            ->onRemove(
                'patronProviders.{uid}',
                [ProjectConfigHandler::class,
                    'handleDeletedProvider'
                ]
            )
            ->onAdd(
                'patronTokens.{uid}',
                [ProjectConfigHandler::class,
                    'handleChangedToken'
                ]
            )
            ->onUpdate(
                'patronTokens.{uid}',
                [ProjectConfigHandler::class,
                    'handleChangedToken'
                ]
            )
            ->onRemove(
                'patronTokens.{uid}',
                [ProjectConfigHandler::class,
                    'handleDeletedToken'
                ]
            );

        Event::on(
            ProjectConfig::class,
            ProjectConfig::EVENT_REBUILD,
            [
                events\handlers\ProjectConfigHandler::class,
                'rebuild'
            ]
        );

        Event::on(
            Provider::class,
            Provider::EVENT_AFTER_INSERT,
            [
                events\ManageProviderProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Provider::class,
            Provider::EVENT_AFTER_UPDATE,
            [
                events\ManageProviderProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Provider::class,
            Provider::EVENT_AFTER_DELETE,
            [
                events\ManageProviderProjectConfig::class,
                'delete'
            ]
        );

        Event::on(
            Token::class,
            Token::EVENT_AFTER_INSERT,
            [
                events\ManageTokenProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Token::class,
            Token::EVENT_AFTER_UPDATE,
            [
                events\ManageTokenProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Token::class,
            Token::EVENT_AFTER_DELETE,
            [
                events\ManageTokenProjectConfig::class,
                'delete'
            ]
        );
    }
protected function registerProjectConfigEvents()
    {
        if (!version_compare(Craft::$app->getVersion(), '3.1', '>=')) {
            return;
        }

        // Project Config
        Craft::$app->projectConfig
            ->onAdd(
                'patronProviders.{uid}',
                [
                    ProjectConfigHandler::class,
                    'handleChangedProvider'
                ]
            )
            ->onUpdate(
                'patronProviders.{uid}',
                [ProjectConfigHandler::class,
                    'handleChangedProvider'
                ]
            )
            ->onRemove(
                'patronProviders.{uid}',
                [ProjectConfigHandler::class,
                    'handleDeletedProvider'
                ]
            )
            ->onAdd(
                'patronTokens.{uid}',
                [ProjectConfigHandler::class,
                    'handleChangedToken'
                ]
            )
            ->onUpdate(
                'patronTokens.{uid}',
                [ProjectConfigHandler::class,
                    'handleChangedToken'
                ]
            )
            ->onRemove(
                'patronTokens.{uid}',
                [ProjectConfigHandler::class,
                    'handleDeletedToken'
                ]
            );

        Event::on(
            ProjectConfig::class,
            ProjectConfig::EVENT_REBUILD,
            [
                events\handlers\ProjectConfigHandler::class,
                'rebuild'
            ]
        );

        Event::on(
            Provider::class,
            Provider::EVENT_AFTER_INSERT,
            [
                events\ManageProviderProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Provider::class,
            Provider::EVENT_AFTER_UPDATE,
            [
                events\ManageProviderProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Provider::class,
            Provider::EVENT_AFTER_DELETE,
            [
                events\ManageProviderProjectConfig::class,
                'delete'
            ]
        );

        Event::on(
            Token::class,
            Token::EVENT_AFTER_INSERT,
            [
                events\ManageTokenProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Token::class,
            Token::EVENT_AFTER_UPDATE,
            [
                events\ManageTokenProjectConfig::class,
                'save'
            ]
        );

        Event::on(
            Token::class,
            Token::EVENT_AFTER_DELETE,
            [
                events\ManageTokenProjectConfig::class,
                'delete'
            ]
        );
    }
protected function registerProjectConfigEvents ( ) { if ( ! version_compare ( Craft :: $ app -> getVersion ( ) , '3.1' , '>=' ) ) { return ; } // Project Config Craft :: $ app -> projectConfig -> onAdd ( 'patronProviders.{uid}' , [ ProjectConfigHandler :: class , 'handleChangedProvider' ] ) -> onUpdate ( 'patronProviders.{uid}' , [ ProjectConfigHandler :: class , 'handleChangedProvider' ] ) -> onRemove ( 'patronProviders.{uid}' , [ ProjectConfigHandler :: class , 'handleDeletedProvider' ] ) -> onAdd ( 'patronTokens.{uid}' , [ ProjectConfigHandler :: class , 'handleChangedToken' ] ) -> onUpdate ( 'patronTokens.{uid}' , [ ProjectConfigHandler :: class , 'handleChangedToken' ] ) -> onRemove ( 'patronTokens.{uid}' , [ ProjectConfigHandler :: class , 'handleDeletedToken' ] ) ; Event :: on ( ProjectConfig :: class , ProjectConfig :: EVENT_REBUILD , [ events \ handlers \ ProjectConfigHandler :: class , 'rebuild' ] ) ; Event :: on ( Provider :: class , Provider :: EVENT_AFTER_INSERT , [ events \ ManageProviderProjectConfig :: class , 'save' ] ) ; Event :: on ( Provider :: class , Provider :: EVENT_AFTER_UPDATE , [ events \ ManageProviderProjectConfig :: class , 'save' ] ) ; Event :: on ( Provider :: class , Provider :: EVENT_AFTER_DELETE , [ events \ ManageProviderProjectConfig :: class , 'delete' ] ) ; Event :: on ( Token :: class , Token :: EVENT_AFTER_INSERT , [ events \ ManageTokenProjectConfig :: class , 'save' ] ) ; Event :: on ( Token :: class , Token :: EVENT_AFTER_UPDATE , [ events \ ManageTokenProjectConfig :: class , 'save' ] ) ; Event :: on ( Token :: class , Token :: EVENT_AFTER_DELETE , [ events \ ManageTokenProjectConfig :: class , 'delete' ] ) ; }
Register project config events, if we're able to
Register project config events if we re able to