Skip to content

Commit

Permalink
Also adjust variables to camelBacked.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed May 8, 2014
1 parent e18162f commit 610f250
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions src/Console/Command/BakeShell.php
Expand Up @@ -169,18 +169,18 @@ protected function _findClassFiles($path, $namespace) {
*/
protected function _findTaskClasses($files) {
$classes = [];
foreach ($files as $classname) {
if (!class_exists($classname)) {
foreach ($files as $className) {
if (!class_exists($className)) {
continue;
}
$reflect = new \ReflectionClass($classname);
$reflect = new \ReflectionClass($className);
if (!$reflect->isInstantiable()) {
continue;
}
if (!$reflect->isSubclassOf('Cake\Console\Command\Task\BakeTask')) {
continue;
}
$classes[] = $classname;
$classes[] = $className;
}
return $classes;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/Task/TestTask.php
Expand Up @@ -253,7 +253,7 @@ public function buildTestSubject($type, $class) {
*
* @param string $type The Type of object you are generating tests for eg. controller.
* @param string $class the Classname of the class the test is being generated for.
* @return string Real classname
* @return string Real class name
*/
public function getRealClassName($type, $class) {
$namespace = Configure::read('App.namespace');
Expand Down
10 changes: 5 additions & 5 deletions src/Console/ShellDispatcher.php
Expand Up @@ -173,14 +173,14 @@ protected function _dispatch() {
* @throws \Cake\Console\Error\MissingShellException when errors are encountered.
*/
public function findShell($shell) {
$classname = $this->_shellExists($shell);
if (!$classname && isset(static::$_aliases[$shell])) {
$className = $this->_shellExists($shell);
if (!$className && isset(static::$_aliases[$shell])) {
$shell = static::$_aliases[$shell];
$classname = $this->_shellExists($shell);
$className = $this->_shellExists($shell);
}
if ($classname) {
if ($className) {
list($plugin) = pluginSplit($shell);
$instance = new $classname();
$instance = new $className();
$instance->plugin = Inflector::camelize(trim($plugin, '.'));
return $instance;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Controller/Component/AclComponent.php
Expand Up @@ -65,14 +65,14 @@ class AclComponent extends Component {
*/
public function __construct(ComponentRegistry $collection, array $config = array()) {
parent::__construct($collection, $config);
$classname = $name = Configure::read('Acl.classname');
if (!class_exists($classname)) {
$classname = App::className($name, 'Controller/Component/Acl');
if (!$classname) {
$className = $name = Configure::read('Acl.classname');
if (!class_exists($className)) {
$className = App::className($name, 'Controller/Component/Acl');
if (!$className) {
throw new Error\Exception(sprintf('Could not find %s.', $name));
}
}
$this->adapter($classname);
$this->adapter($className);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/Network/Email/Email.php
Expand Up @@ -947,15 +947,15 @@ protected function _constructTransport($name) {
}

$config = static::$_transportConfig[$name];
$classname = App::className($config['className'], 'Network/Email', 'Transport');
if (!$classname) {
$className = App::className($config['className'], 'Network/Email', 'Transport');
if (!$className) {
throw new Exception(sprintf('Transport class "%s" not found.', $name));
} elseif (!method_exists($classname, 'send')) {
throw new Exception(sprintf('The "%s" does not have a send() method.', $classname));
} elseif (!method_exists($className, 'send')) {
throw new Exception(sprintf('The "%s" does not have a send() method.', $className));
}

unset($config['className']);
return new $classname($config);
return new $className($config);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/TestSuite/ControllerTestCase.php
Expand Up @@ -312,8 +312,8 @@ protected function _testAction($url = '', $options = array()) {
* @throws \Cake\Controller\Error\MissingComponentException When components could not be created.
*/
public function generate($controller, array $mocks = array()) {
$classname = App::className($controller, 'Controller', 'Controller');
if (!$classname) {
$className = App::className($controller, 'Controller', 'Controller');
if (!$className) {
list($plugin, $controller) = pluginSplit($controller);
throw new MissingControllerException(array(
'class' => $controller . 'Controller',
Expand All @@ -326,13 +326,13 @@ public function generate($controller, array $mocks = array()) {
'models' => array(),
'components' => array()
), $mocks);
list(, $controllerName) = namespaceSplit($classname);
list(, $controllerName) = namespaceSplit($className);
$name = substr($controllerName, 0, -10);

$request = $this->getMock('Cake\Network\Request');
$response = $this->getMock('Cake\Network\Response', array('_sendHeader', 'stop'));
$controller = $this->getMock(
$classname,
$className,
$mocks['methods'],
array($request, $response, $name)
);
Expand Down
2 changes: 1 addition & 1 deletion src/basics.php
Expand Up @@ -235,7 +235,7 @@ function pluginSplit($name, $dotAppend = false, $plugin = null) {
/**
* Split the namespace from the classname.
*
* Commonly used like `list($namespace, $classname) = namespaceSplit($class);`
* Commonly used like `list($namespace, $className) = namespaceSplit($class);`
*
* @param string $class The full class name, ie `Cake\Core\App`
* @return array Array with 2 indexes. 0 => namespace, 1 => classname
Expand Down

0 comments on commit 610f250

Please sign in to comment.