More code style fixes

This commit is contained in:
Daniel Hensby 2017-12-05 14:19:59 +00:00
parent 2aa1d8f2c4
commit 8d1a5ed8b7
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
8 changed files with 28 additions and 15 deletions

View File

@ -23,10 +23,13 @@ class CMSBatchActionHandler extends RequestHandler {
'handleConfirmation',
);
/**
* @var Controller
*/
protected $parentController;
/**
* @var String
* @var string
*/
protected $urlSegment;
@ -38,7 +41,7 @@ class CMSBatchActionHandler extends RequestHandler {
protected $recordClass = 'SiteTree';
/**
* @param string $parentController
* @param Controller $parentController
* @param string $urlSegment
* @param string $recordClass
*/

View File

@ -41,7 +41,7 @@ class CMSMenuItem extends Object {
* Attributes for the link. For instance, custom data attributes or standard
* HTML anchor properties.
*
* @var string
* @var array
*/
protected $attributes = array();

View File

@ -398,7 +398,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
Requirements::css(FRAMEWORK_DIR . '/css/GridField.css');
// Browser-specific requirements
$ie = isset($_SERVER['HTTP_USER_AGENT']) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') : false;
$ie = isset($_SERVER['HTTP_USER_AGENT']) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false : false;
if($ie) {
$version = substr($_SERVER['HTTP_USER_AGENT'], $ie + 5, 3);
@ -1838,6 +1838,16 @@ class LeftAndMainMarkingFilter {
*/
protected $params = array();
/**
* @var array
*/
public $ids = array();
/**
* @var array
*/
public $expanded = array();
/**
* @param array $params Request params (unsanitized)
*/

View File

@ -171,7 +171,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
$groupsTab->addExtraClass('ui-state-active');
} elseif($actionParam == 'users') {
$usersTab->addExtraClass('ui-state-active');
} elseif($actionParam == 'roles') {
} elseif($actionParam == 'roles' && isset($rolesTab)) {
$rolesTab->addExtraClass('ui-state-active');
}

View File

@ -420,7 +420,7 @@ class RestfulService extends ViewableData implements Flushable {
if($element)
$childElements = $xml->{$collection}->{$element};
if($childElements){
if(isset($childElements) && $childElements){
foreach($childElements as $child){
$data = array();
foreach($child->attributes() as $key => $value){
@ -450,7 +450,7 @@ class RestfulService extends ViewableData implements Flushable {
if($element)
$childElements = $xml->{$collection}->{$element};
if($childElements)
if(isset($childElements[$attr]))
$attr_value = (string) $childElements[$attr];
return Convert::raw2xml($attr_value);
@ -476,7 +476,7 @@ class RestfulService extends ViewableData implements Flushable {
if($element)
$childElements = $xml->{$collection}->{$element};
if($childElements){
if(isset($childElements) && $childElements){
foreach($childElements as $child){
$data = array();
$this->getRecurseValues($child,$data);
@ -525,7 +525,7 @@ class RestfulService extends ViewableData implements Flushable {
if($element)
$childElements = $xml->{$collection}->{$element};
if($childElements)
if(isset($childElements) && $childElements)
return Convert::raw2xml($childElements);
}
@ -575,7 +575,7 @@ class RestfulService_Response extends SS_HTTPResponse {
protected $simpleXML;
/**
* @var boolean It should be populated with cached request
* @var RestfulService_Response|false It should be populated with cached request
* when a request referring to this response was unsuccessful
*/
protected $cachedResponse = false;
@ -602,14 +602,14 @@ class RestfulService_Response extends SS_HTTPResponse {
* get the cached response object. This allows you to access the cached
* eaders, not just the cached body.
*
* @return RestfulSerivice_Response The cached response object
* @return RestfulService_Response|false The cached response object
*/
public function getCachedResponse() {
return $this->cachedResponse;
}
/**
* @return string
* @return string|false
*/
public function getCachedBody() {
if ($this->cachedResponse) {

View File

@ -41,7 +41,7 @@ if(isset($_SERVER['argv'][2])) {
if(!isset($_GET)) $_GET = array();
if(!isset($_REQUEST)) $_REQUEST = array();
foreach($args as $arg) {
if(strpos($arg,'=') == false) {
if(strpos($arg,'=') === false) {
$_GET['args'][] = $arg;
} else {
$newItems = array();

View File

@ -144,7 +144,7 @@ class CookieJar implements Cookie_Backend {
* @see http://uk3.php.net/manual/en/function.setcookie.php
*
* @param string $name The name of the cookie
* @param string|array $value The value for the cookie to hold
* @param string|array|false $value The value for the cookie to hold
* @param int $expiry The number of days until expiry
* @param string $path The path to save the cookie on (falls back to site base)
* @param string $domain The domain to make the cookie available on

View File

@ -139,7 +139,7 @@ class ListboxField extends DropdownField {
function($key) {
return strpos($key, ",") !== FALSE;
});
if($hasCommas) {
if(!empty($hasCommas)) {
throw new InvalidArgumentException('No commas allowed in $source keys');
}
}