private -> protected
This commit is contained in:
parent
34bedb0b33
commit
6388ecef52
|
|
@ -349,7 +349,7 @@ class FormController extends ControllerBehavior
|
|||
* @param array $extras Any extra params to include in the language string variables
|
||||
* @return string The translated string.
|
||||
*/
|
||||
private function getLang($name, $default = null, $extras = [])
|
||||
protected function getLang($name, $default = null, $extras = [])
|
||||
{
|
||||
$name = $this->getConfig($name, $default);
|
||||
$vars = [
|
||||
|
|
@ -567,7 +567,7 @@ class FormController extends ControllerBehavior
|
|||
// Internals
|
||||
//
|
||||
|
||||
private function prepareModelsToSave($model, $saveData)
|
||||
protected function prepareModelsToSave($model, $saveData)
|
||||
{
|
||||
$this->modelsToSave = [];
|
||||
$this->setModelAttributes($model, $saveData);
|
||||
|
|
@ -580,7 +580,7 @@ class FormController extends ControllerBehavior
|
|||
* @param Model $model Model to save to
|
||||
* @return array The collection of models to save.
|
||||
*/
|
||||
private function setModelAttributes($model, $saveData)
|
||||
protected function setModelAttributes($model, $saveData)
|
||||
{
|
||||
$this->modelsToSave[] = $model;
|
||||
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ class RelationController extends ControllerBehavior
|
|||
* @param string $field The relationship field.
|
||||
* @return string The active field name.
|
||||
*/
|
||||
private function validateField($field = null)
|
||||
protected function validateField($field = null)
|
||||
{
|
||||
$field = $field ?: post(self::PARAM_FIELD);
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ class RelationController extends ControllerBehavior
|
|||
/**
|
||||
* Returns the existing record IDs for the relation.
|
||||
*/
|
||||
private function findExistingRelationIds($checkIds = null)
|
||||
protected function findExistingRelationIds($checkIds = null)
|
||||
{
|
||||
$results = $this->relationObject
|
||||
->getBaseQuery()
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class UserPreferencesModel extends SettingsModel
|
|||
* Checks if a key is legitimate or should be added to
|
||||
* the field value collection
|
||||
*/
|
||||
private function isKeyAllowed($key)
|
||||
protected function isKeyAllowed($key)
|
||||
{
|
||||
/*
|
||||
* Let the core columns through
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class BackendController extends ControllerBase
|
|||
* @param string $action Specifies a method name to execute.
|
||||
* @return ControllerBase Returns the backend controller object
|
||||
*/
|
||||
private function findController($controller, $action, $dirPrefix = null)
|
||||
protected function findController($controller, $action, $dirPrefix = null)
|
||||
{
|
||||
/*
|
||||
* Workaround: Composer does not support case insensitivity.
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ class NavigationManager
|
|||
* @param array $items A collection of menu items
|
||||
* @return array The filtered menu items
|
||||
*/
|
||||
private function filterItemPermissions($user, array $items)
|
||||
protected function filterItemPermissions($user, array $items)
|
||||
{
|
||||
$items = array_filter($items, function($item) use ($user) {
|
||||
if (!$item->permissions || !count($item->permissions))
|
||||
|
|
@ -436,7 +436,7 @@ class NavigationManager
|
|||
* @param object $item
|
||||
* @return string
|
||||
*/
|
||||
private function makeItemKey($owner, $code)
|
||||
protected function makeItemKey($owner, $code)
|
||||
{
|
||||
return strtoupper($owner).'.'.strtoupper($code);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Form extends WidgetBase
|
|||
/**
|
||||
* @var boolean Determines if field definitions have been created.
|
||||
*/
|
||||
private $fieldsDefined = false;
|
||||
protected $fieldsDefined = false;
|
||||
|
||||
/**
|
||||
* @var array Collection of all fields used in this form.
|
||||
|
|
@ -218,7 +218,7 @@ class Form extends WidgetBase
|
|||
/**
|
||||
* Prepares the list data
|
||||
*/
|
||||
public function prepareVars()
|
||||
protected function prepareVars()
|
||||
{
|
||||
$this->defineFormFields();
|
||||
$this->vars['sessionKey'] = $this->getSessionKey();
|
||||
|
|
@ -517,7 +517,7 @@ class Form extends WidgetBase
|
|||
* @param string $fieldType
|
||||
* @return boolean
|
||||
*/
|
||||
private function isFormWidget($fieldType)
|
||||
protected function isFormWidget($fieldType)
|
||||
{
|
||||
if ($fieldType === null)
|
||||
return false;
|
||||
|
|
@ -539,7 +539,7 @@ class Form extends WidgetBase
|
|||
/**
|
||||
* Makes a widget object from a form field object.
|
||||
*/
|
||||
public function makeFormWidget($field)
|
||||
protected function makeFormWidget($field)
|
||||
{
|
||||
if ($field->type != 'widget')
|
||||
return null;
|
||||
|
|
@ -687,7 +687,7 @@ class Form extends WidgetBase
|
|||
/**
|
||||
* Looks at the model for defined options.
|
||||
*/
|
||||
private function getOptionsFromModel($field, $fieldOptions)
|
||||
protected function getOptionsFromModel($field, $fieldOptions)
|
||||
{
|
||||
/*
|
||||
* Advanced usage, supplied options are callable
|
||||
|
|
@ -751,7 +751,7 @@ class Form extends WidgetBase
|
|||
* @param string $method
|
||||
* @return boolean
|
||||
*/
|
||||
private function methodExists($object, $method)
|
||||
protected function methodExists($object, $method)
|
||||
{
|
||||
if (method_exists($object, 'methodExists'))
|
||||
return $object->methodExists($method);
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ class Lists extends WidgetBase
|
|||
* @param string $table
|
||||
* @return string
|
||||
*/
|
||||
private function parseTableName($sql, $table)
|
||||
protected function parseTableName($sql, $table)
|
||||
{
|
||||
return str_replace('@', $table.'.', $sql);
|
||||
}
|
||||
|
|
@ -679,7 +679,7 @@ class Lists extends WidgetBase
|
|||
/**
|
||||
* Validates a column type as a date
|
||||
*/
|
||||
private function validateDateTimeValue($value, $column)
|
||||
protected function validateDateTimeValue($value, $column)
|
||||
{
|
||||
if ($value instanceof DateTime)
|
||||
$value = Carbon::instance($value);
|
||||
|
|
|
|||
|
|
@ -821,7 +821,7 @@ class Controller extends BaseController
|
|||
* Searches the layout and page components by an alias
|
||||
* @return ComponentBase The component object, if found
|
||||
*/
|
||||
private function findComponentByName($name)
|
||||
protected function findComponentByName($name)
|
||||
{
|
||||
if (isset($this->page->components[$name]))
|
||||
return $this->page->components[$name];
|
||||
|
|
@ -836,7 +836,7 @@ class Controller extends BaseController
|
|||
* Searches the layout and page components by an AJAX handler
|
||||
* @return ComponentBase The component object, if found
|
||||
*/
|
||||
private function findComponentByHandler($handler)
|
||||
protected function findComponentByHandler($handler)
|
||||
{
|
||||
foreach ($this->page->components as $component) {
|
||||
if (method_exists($component, $handler))
|
||||
|
|
@ -855,7 +855,7 @@ class Controller extends BaseController
|
|||
* Searches the layout and page components by a partial file
|
||||
* @return ComponentBase The component object, if found
|
||||
*/
|
||||
private function findComponentByPartial($partial)
|
||||
protected function findComponentByPartial($partial)
|
||||
{
|
||||
foreach ($this->page->components as $component) {
|
||||
$fileName = ComponentPartial::getFilePath($component, $partial);
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ class Index extends Controller
|
|||
* @param string $markup The markup to convert to unix style endings
|
||||
* @return string
|
||||
*/
|
||||
private function convertLineEndings($markup)
|
||||
protected function convertLineEndings($markup)
|
||||
{
|
||||
$markup = str_replace("\r\n", "\n", $markup);
|
||||
$markup = str_replace("\r", "\n", $markup);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class SettingsModel extends ModelBehavior
|
|||
* Checks if a key is legitimate or should be added to
|
||||
* the field value collection
|
||||
*/
|
||||
private function isKeyAllowed($key)
|
||||
protected function isKeyAllowed($key)
|
||||
{
|
||||
/*
|
||||
* Let the core columns through
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ class ExceptionBase extends Exception
|
|||
* @param array $traceInfo The trace information from getTrace() or debug_backtrace().
|
||||
* @return array The filtered array containing the trace information.
|
||||
*/
|
||||
private function filterCallStack($traceInfo)
|
||||
protected function filterCallStack($traceInfo)
|
||||
{
|
||||
/*
|
||||
* Determine if filter should be used at all.
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ class SettingsManager
|
|||
* @param array $items A collection of setting items
|
||||
* @return array The filtered settings items
|
||||
*/
|
||||
private function filterItemPermissions($user, array $items)
|
||||
protected function filterItemPermissions($user, array $items)
|
||||
{
|
||||
array_filter($items, function($item) use ($user) {
|
||||
if (!$item->permissions || !count($item->permissions))
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ class UpdateManager
|
|||
* @param string $fileCode A unique file code
|
||||
* @return string Full path on the disk
|
||||
*/
|
||||
private function getFilePath($fileCode)
|
||||
protected function getFilePath($fileCode)
|
||||
{
|
||||
$name = md5($fileCode) . '.arc';
|
||||
return $this->tempDirectory . '/' . $name;
|
||||
|
|
@ -628,7 +628,7 @@ class UpdateManager
|
|||
* @param string $uri URI
|
||||
* @return string URL
|
||||
*/
|
||||
private function createServerUrl($uri)
|
||||
protected function createServerUrl($uri)
|
||||
{
|
||||
$gateway = Config::get('cms.updateServer', 'http://octobercms.com/api');
|
||||
if (substr($gateway, -1) != '/')
|
||||
|
|
@ -643,7 +643,7 @@ class UpdateManager
|
|||
* @param array $postData Post data
|
||||
* @return void
|
||||
*/
|
||||
private function applyHttpAttributes($http, $postData)
|
||||
protected function applyHttpAttributes($http, $postData)
|
||||
{
|
||||
$postData['url'] = base64_encode(URL::to('/'));
|
||||
|
||||
|
|
@ -664,7 +664,7 @@ class UpdateManager
|
|||
* Create a nonce based on millisecond time
|
||||
* @return int
|
||||
*/
|
||||
private function createNonce()
|
||||
protected function createNonce()
|
||||
{
|
||||
$mt = explode(' ', microtime());
|
||||
return $mt[1] . substr($mt[0], 2, 6);
|
||||
|
|
@ -674,7 +674,7 @@ class UpdateManager
|
|||
* Create a unique signature for transmission.
|
||||
* @return string
|
||||
*/
|
||||
private function createSignature($data, $secret)
|
||||
protected function createSignature($data, $secret)
|
||||
{
|
||||
return base64_encode(hash_hmac('sha512', http_build_query($data, '', '&'), base64_decode($secret), true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ class VersionManager
|
|||
/**
|
||||
* Returns the absolute path to a version file for a plugin.
|
||||
*/
|
||||
private function getVersionFile($code)
|
||||
protected function getVersionFile($code)
|
||||
{
|
||||
$versionFile = $this->pluginManager->getPluginPath($code) . '/updates/version.yaml';
|
||||
return $versionFile;
|
||||
|
|
@ -252,7 +252,7 @@ class VersionManager
|
|||
/**
|
||||
* Checks if a plugin has a version file.
|
||||
*/
|
||||
private function hasVersionFile($code)
|
||||
protected function hasVersionFile($code)
|
||||
{
|
||||
$versionFile = $this->getVersionFile($code);
|
||||
return File::isFile($versionFile);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class Settings extends Controller
|
|||
/**
|
||||
* Locates a setting item for a module or plugin
|
||||
*/
|
||||
private function findSettingItem($author, $plugin, $code)
|
||||
protected function findSettingItem($author, $plugin, $code)
|
||||
{
|
||||
$manager = SettingsManager::instance();
|
||||
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ class Updates extends Controller
|
|||
return $this->makePartial('execute');
|
||||
}
|
||||
|
||||
private function buildUpdateSteps($core, $plugins, $themes)
|
||||
protected function buildUpdateSteps($core, $plugins, $themes)
|
||||
{
|
||||
if (!is_array($core))
|
||||
$core = [null, null];
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ trait AssetMaker
|
|||
* @param array $asset Stored asset array
|
||||
* @return string
|
||||
*/
|
||||
private function getAssetEntryBuildPath($asset)
|
||||
protected function getAssetEntryBuildPath($asset)
|
||||
{
|
||||
$path = $asset['path'];
|
||||
if (isset($asset['attributes']['build'])) {
|
||||
|
|
@ -234,7 +234,7 @@ trait AssetMaker
|
|||
* @param string $asset Specifies a path (URL) to the asset.
|
||||
* @return string
|
||||
*/
|
||||
private function getAssetScheme($asset)
|
||||
protected function getAssetScheme($asset)
|
||||
{
|
||||
if (preg_match("/(\/\/|http|https)/", $asset))
|
||||
return $asset;
|
||||
|
|
|
|||
Loading…
Reference in New Issue