various sensiolab fixes

This commit is contained in:
Andy Miller
2015-07-06 21:50:05 -06:00
parent fc3c0e7fa5
commit dc7362c70b
4 changed files with 4 additions and 25 deletions

View File

@@ -139,8 +139,6 @@ class Page
}
$this->published();
$this->extension();
// $this->setupLanguage();
}
/**
@@ -1214,7 +1212,7 @@ class Page
*/
public function routeAliases($var = null)
{
if ($var != null) {
if ($var !== null) {
$this->routes['aliases'] = (array) $var;
}
@@ -1235,7 +1233,7 @@ class Page
*/
public function routeCanonical($var = null)
{
if ($var != null) {
if ($var !== null) {
$this->routes['canonical'] = (array)$var;
}
@@ -1623,7 +1621,6 @@ class Page
{
/** @var Uri $uri */
$uri = self::getGrav()['uri'];
$config = self::getGrav()['config'];
// Special check when item is home
if ($this->home()) {
@@ -1839,19 +1836,6 @@ class Page
return $results;
}
public function setupLanguage()
{
/** @var Language $language */
$language = self::getGrav()['language'];
// add the language pre route back to the route
if ($language->enabled() && $language->getActive()) {
$this->route = '/' . $language->getActive() . $this->route;
}
}
/**
* Returns whether or not this Page object has a .md file associated with it or if its just a directory.
*

View File

@@ -723,11 +723,7 @@ class Pages
}
}
/** @var Config $config */
$config = $this->grav['config'];
// Alias and set default route to home page.
if ($home && isset($this->routes['/' . $home])) {
$this->routes['/'] = $this->routes['/' . $home];
$this->get($this->routes['/' . $home])->route('/');

View File

@@ -1,6 +1,7 @@
<?php
namespace Grav\Common;
use Grav\Common\Page\Page;
use Grav\Common\Page\Pages;
/**
@@ -469,7 +470,7 @@ class Uri
*
* @return string the more friendly formatted url
*/
public static function convertUrl($page, $markdown_url)
public static function convertUrl(Page $page, $markdown_url)
{
$grav = Grav::instance();

View File

@@ -142,8 +142,6 @@ class UninstallCommand extends Command
*/
private function uninstallPackage($slug, $package)
{
$locator = self::getGrav()['locator'];
$path = self::getGrav()['locator']->findResource($package->package_type . '://' .$slug);
Installer::uninstall($path);
$errorCode = Installer::lastErrorCode();