Skip to content

Commit

Permalink
fixing code analysis: public method and case mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Jun 1, 2017
1 parent e86cc55 commit 7685259
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/extensions/CMSPageAddControllerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class CMSPageAddControllerExtension extends Extension
{

function updatePageOptions(&$fields)
public function updatePageOptions(&$fields)
{
$fields->push(new HiddenField('SubsiteID', 'SubsiteID', Subsite::currentSubsiteID()));
}
Expand Down
4 changes: 2 additions & 2 deletions code/extensions/LeftAndMainSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function init()
*/
public function getCMSTreeTitle()
{
$subsite = Subsite::currentSubSite();
$subsite = Subsite::currentSubsite();
return $subsite ? Convert::raw2xml($subsite->Title) : _t('LeftAndMain.SITECONTENTLEFT');
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public function ListSubsites()
$list = $this->Subsites();
$currentSubsiteID = Subsite::currentSubsiteID();

if ($list == null || $list->Count() == 1 && $list->First()->DefaultSite == true) {
if ($list == null || $list->count() == 1 && $list->first()->DefaultSite == true) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion code/extensions/SiteTreeSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function updateCMSFields(FieldList $fields)
{
$subsites = Subsite::accessible_sites("CMS_ACCESS_CMSMain");
$subsitesMap = array();
if ($subsites && $subsites->Count()) {
if ($subsites && $subsites->count()) {
$subsitesToMap = $subsites->exclude('ID', $this->owner->SubsiteID);
$subsitesMap = $subsitesToMap->map('ID', 'Title');
}
Expand Down
2 changes: 1 addition & 1 deletion code/model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static function getSubsiteIDForDomain($host = null, $checkPermissions = t
"\"Subsite\".\"ID\" = \"SubsiteDomain\".\"SubsiteID\" AND \"Subsite\".\"IsPublic\"=1");
}

if ($matchingDomains && $matchingDomains->Count()) {
if ($matchingDomains && $matchingDomains->count()) {
$subsiteIDs = array_unique($matchingDomains->column('SubsiteID'));
$subsiteDomains = array_unique($matchingDomains->column('Domain'));
if (sizeof($subsiteIDs) > 1) {
Expand Down
2 changes: 1 addition & 1 deletion tests/php/LeftAndMainSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testSectionSites()
public function testAccessChecksDontChangeCurrentSubsite()
{
$admin = $this->objFromFixture(Member::class, "admin");
$this->loginAs($admin);
$this->logInAs($admin);
$ids = array();

$subsite1 = $this->objFromFixture(Subsite::class, 'domaintest1');
Expand Down
2 changes: 1 addition & 1 deletion tests/php/SubsiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testSubsiteCreation()

// Publish all the pages in the template, testing that DataObject::get only returns pages from the chosen subsite
$pages = DataObject::get(SiteTree::class);
$totalPages = $pages->Count();
$totalPages = $pages->count();
foreach ($pages as $page) {
$this->assertEquals($template->ID, $page->SubsiteID);
$page->publish('Stage', 'Live');
Expand Down

0 comments on commit 7685259

Please sign in to comment.