mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #1321 from silverstripe-rebelalliance/feature/config
FIX ConfigStaticManifest persisting access level after parsing a static
This commit is contained in:
commit
bfab74ac6e
@ -80,7 +80,7 @@ class SS_ConfigStaticManifest {
|
|||||||
if ($static['access'] != T_PRIVATE) {
|
if ($static['access'] != T_PRIVATE) {
|
||||||
Deprecation::notice('3.2.0', "Config static $class::\$$name must be marked as private", Deprecation::SCOPE_GLOBAL);
|
Deprecation::notice('3.2.0', "Config static $class::\$$name must be marked as private", Deprecation::SCOPE_GLOBAL);
|
||||||
// Don't warn more than once per static
|
// Don't warn more than once per static
|
||||||
$static['access'] = T_PRIVATE;
|
$this->statics[$class][$name]['access'] = T_PRIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $static['value'];
|
return $static['value'];
|
||||||
@ -231,11 +231,12 @@ class SS_ConfigStaticManifest_Parser {
|
|||||||
else if($type == T_PUBLIC || $type == T_PRIVATE || $type == T_PROTECTED) {
|
else if($type == T_PUBLIC || $type == T_PRIVATE || $type == T_PROTECTED) {
|
||||||
$access = $type;
|
$access = $type;
|
||||||
}
|
}
|
||||||
else if($type == T_STATIC) {
|
else if($type == T_STATIC && $class && $depth == $clsdepth) {
|
||||||
if($class && $depth == $clsdepth) $this->parseStatic($access, $namespace ? $namespace.'\\'.$class : $class);
|
$this->parseStatic($access, $namespace ? $namespace.'\\'.$class : $class);
|
||||||
|
$access = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$access = '';
|
$access = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ class ConfigStaticManifestTest extends SapphireTest {
|
|||||||
static public $public2;
|
static public $public2;
|
||||||
static protected $protected2;
|
static protected $protected2;
|
||||||
static private $private2;
|
static private $private2;
|
||||||
|
static $nolevel_after_private;
|
||||||
|
|
||||||
// Assigning values
|
// Assigning values
|
||||||
static $snone;
|
static $snone;
|
||||||
@ -96,7 +97,8 @@ DOC;
|
|||||||
'protected' => T_PROTECTED,
|
'protected' => T_PROTECTED,
|
||||||
'protected2' => T_PROTECTED,
|
'protected2' => T_PROTECTED,
|
||||||
'private' => T_PRIVATE,
|
'private' => T_PRIVATE,
|
||||||
'private2' => T_PRIVATE
|
'private2' => T_PRIVATE,
|
||||||
|
'nolevel_after_private' => null
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach($levels as $var => $level) {
|
foreach($levels as $var => $level) {
|
||||||
|
Loading…
Reference in New Issue
Block a user