SilverStripe 4 and Namespacing

This commit is contained in:
Simon Erkelens 2016-10-10 18:44:28 +13:00 committed by Robbie Averill
parent 5f8d2af0d1
commit b757c3dc6d
8 changed files with 31 additions and 8 deletions

View File

@ -8,4 +8,7 @@
*
* @package spamprotection
*/
Deprecation::notification_version('1.1', 'spamprotection');
use SilverStripe\Dev\Deprecation;
Deprecation::notification_version('3.0', 'spamprotection');

View File

@ -1,6 +1,6 @@
---
name: spamprotection
---
Form:
SilverStripe\Forms\Form:
extensions:
- FormSpamProtectionExtension
- SilverStripe\Spamprotection\FormSpamProtectionExtension

View File

@ -1,4 +1,5 @@
<?php
namespace SilverStripe\Spamprotection;
/**
* Editable Spam Protecter Field. Used with the User Defined Forms module (if

View File

@ -1,4 +1,7 @@
<?php
namespace SilverStripe\Spamprotection;
use SilverStripe\Dev\Deprecation;
/**
* @package spamprotection
@ -18,7 +21,7 @@ class SpamProtectorManager
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
);
self::$spam_protector = $protector;
static::$spam_protector = $protector;
}
public static function get_spam_protector()
@ -29,7 +32,7 @@ class SpamProtectorManager
'Use the new config system. FormSpamProtectorExtension.default_spam_protector'
);
return self::$spam_protector;
return static::$spam_protector;
}
public static function update_form($form, $before = null, $fieldsToSpamServiceMapping = array(), $title = null, $rightTitle = null)

View File

@ -1,5 +1,9 @@
<?php
namespace SilverStripe\Spamprotection;
use SilverStripe\Core\Extension;
/**
* Apply the spam protection to the comments module if it is installed.
*

View File

@ -1,4 +1,9 @@
<?php
namespace SilverStripe\Spamprotection;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Extension;
use SilverStripe\Core\Injector\Injector;
/**
* An extension to the {@link Form} class which provides the method
@ -76,6 +81,7 @@ class FormSpamProtectionExtension extends Extension
* Activates the spam protection module.
*
* @param array $options
* @return Object
*/
public function enableSpamProtection($options = array())
{

View File

@ -1,4 +1,7 @@
<?php
namespace SilverStripe\Spamprotection;
use SilverStripe\Forms\FormField;
/**
* SpamProtector base interface.

View File

@ -11,15 +11,18 @@
"email": "will@fullscreen.io"
}],
"require": {
"silverstripe/framework": "~3.1"
"silverstripe/framework": "^4@dev"
},
"require-dev": {
"phpunit/PHPUnit": "~3.7@stable"
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.0"
},
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"license": "BSD-3-Clause"
"license": "BSD-3-Clause",
"minimum-stability": "dev",
"prefer-stable": true
}