Skip to content

Commit

Permalink
Deprecation removal
Browse files Browse the repository at this point in the history
  • Loading branch information
antograssiot committed Jan 3, 2017
1 parent 1435115 commit 003df77
Show file tree
Hide file tree
Showing 47 changed files with 217 additions and 217 deletions.
2 changes: 1 addition & 1 deletion src/Auth/FormAuthenticate.php
Expand Up @@ -48,7 +48,7 @@ class FormAuthenticate extends BaseAuthenticate
protected function _checkFields(ServerRequest $request, array $fields)
{
foreach ([$fields['username'], $fields['password']] as $field) {
$value = $request->data($field);
$value = $request->getData($field);
if (empty($value) || !is_string($value)) {
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions src/Console/ConsoleOptionParser.php
Expand Up @@ -143,7 +143,7 @@ class ConsoleOptionParser
*/
public function __construct($command = null, $defaultOptions = true)
{
$this->command($command);
$this->setCommand($command);

$this->addOption('help', [
'short' => 'h',
Expand Down Expand Up @@ -212,10 +212,10 @@ public static function buildFromArray($spec, $defaultOptions = true)
$parser->addSubcommands($spec['subcommands']);
}
if (!empty($spec['description'])) {
$parser->description($spec['description']);
$parser->setDescription($spec['description']);
}
if (!empty($spec['epilog'])) {
$parser->epilog($spec['epilog']);
$parser->setEpilog($spec['epilog']);
}

return $parser;
Expand Down Expand Up @@ -261,10 +261,10 @@ public function merge($spec)
$this->addSubcommands($spec['subcommands']);
}
if (!empty($spec['description'])) {
$this->description($spec['description']);
$this->setDescription($spec['description']);
}
if (!empty($spec['epilog'])) {
$this->epilog($spec['epilog']);
$this->setEpilog($spec['epilog']);
}

return $this;
Expand Down Expand Up @@ -722,7 +722,7 @@ public function help($subcommand = null, $format = 'text', $width = 72)
$this->_subcommands[$subcommand]->parser() instanceof self
) {
$subparser = $this->_subcommands[$subcommand]->parser();
$subparser->command($this->command() . ' ' . $subparser->command());
$subparser->setCommand($this->getCommand() . ' ' . $subparser->getCommand());

return $subparser->help(null, $format, $width);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Console/HelpFormatter.php
Expand Up @@ -70,7 +70,7 @@ public function text($width = 72)
{
$parser = $this->_parser;
$out = [];
$description = $parser->description();
$description = $parser->getDescription();
if (!empty($description)) {
$out[] = Text::wrap($description, $width);
$out[] = '';
Expand All @@ -91,7 +91,7 @@ public function text($width = 72)
]);
}
$out[] = '';
$out[] = sprintf('To see help on a subcommand use <info>`cake %s [subcommand] --help`</info>', $parser->command());
$out[] = sprintf('To see help on a subcommand use <info>`cake %s [subcommand] --help`</info>', $parser->getCommand());
$out[] = '';
}

Expand Down Expand Up @@ -124,7 +124,7 @@ public function text($width = 72)
}
$out[] = '';
}
$epilog = $parser->epilog();
$epilog = $parser->getEpilog();
if (!empty($epilog)) {
$out[] = Text::wrap($epilog, $width);
$out[] = '';
Expand All @@ -142,7 +142,7 @@ public function text($width = 72)
*/
protected function _generateUsage()
{
$usage = ['cake ' . $this->_parser->command()];
$usage = ['cake ' . $this->_parser->getCommand()];
$subcommands = $this->_parser->subcommands();
if (!empty($subcommands)) {
$usage[] = '[subcommand]';
Expand Down Expand Up @@ -193,10 +193,10 @@ public function xml($string = true)
{
$parser = $this->_parser;
$xml = new SimpleXmlElement('<shell></shell>');
$xml->addChild('command', $parser->command());
$xml->addChild('description', $parser->description());
$xml->addChild('command', $parser->getCommand());
$xml->addChild('description', $parser->getDescription());

$xml->addChild('epilog', $parser->epilog());
$xml->addChild('epilog', $parser->getEpilog());
$subcommands = $xml->addChild('subcommands');
foreach ($parser->subcommands() as $command) {
$command->xml($subcommands);
Expand Down
26 changes: 13 additions & 13 deletions src/Controller/Controller.php
Expand Up @@ -422,17 +422,17 @@ public function invokeAction()
if (!isset($request)) {
throw new LogicException('No Request object configured. Cannot invoke action');
}
if (!$this->isAction($request->param('action'))) {
if (!$this->isAction($request->getParam('action'))) {
throw new MissingActionException([
'controller' => $this->name . "Controller",
'action' => $request->param('action'),
'prefix' => $request->param('prefix') ?: '',
'plugin' => $request->param('plugin'),
'action' => $request->getParam('action'),
'prefix' => $request->getParam('prefix') ?: '',
'plugin' => $request->getParam('plugin'),
]);
}
$callable = [$this, $request->param('action')];
$callable = [$this, $request->getParam('action')];

return $callable(...$request->param('pass'));
return $callable(...$request->getParam('pass'));
}

/**
Expand Down Expand Up @@ -591,12 +591,12 @@ public function setAction($action, ...$args)
public function render($view = null, $layout = null)
{
$builder = $this->viewBuilder();
if (!$builder->templatePath()) {
$builder->templatePath($this->_viewPath());
if (!$builder->getTemplatePath()) {
$builder->setTemplatePath($this->_viewPath());
}

if (!empty($this->request->params['bare'])) {
$builder->autoLayout(false);
$builder->enableAutoLayout(false);
}
$builder->className($this->viewClass);

Expand All @@ -610,8 +610,8 @@ public function render($view = null, $layout = null)
return $this->response;
}

if ($builder->template() === null && $this->request->param('action')) {
$builder->template($this->request->param('action'));
if ($builder->getTemplate() === null && $this->request->getParam('action')) {
$builder->setTemplate($this->request->getParam('action'));
}

$this->View = $this->createView();
Expand All @@ -628,10 +628,10 @@ public function render($view = null, $layout = null)
protected function _viewPath()
{
$viewPath = $this->name;
if ($this->request->param('prefix')) {
if ($this->request->getParam('prefix')) {
$prefixes = array_map(
'Cake\Utility\Inflector::camelize',
explode('/', $this->request->param('prefix'))
explode('/', $this->request->getParam('prefix'))
);
$viewPath = implode(DIRECTORY_SEPARATOR, $prefixes) . DIRECTORY_SEPARATOR . $viewPath;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Driver/Mysql.php
Expand Up @@ -135,7 +135,7 @@ public function prepare($query)
$isObject = $query instanceof Query;
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query);
$result = new MysqlStatement($statement, $this);
if ($isObject && $query->bufferResults() === false) {
if ($isObject && $query->isBufferedResultsEnabled() === false) {
$result->bufferResults(false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Driver/Sqlite.php
Expand Up @@ -93,7 +93,7 @@ public function prepare($query)
$isObject = $query instanceof Query;
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query);
$result = new SqliteStatement(new PDOStatement($statement, $this), $this);
if ($isObject && $query->bufferResults() === false) {
if ($isObject && $query->isBufferedResultsEnabled() === false) {
$result->bufferResults(false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Driver/Sqlserver.php
Expand Up @@ -107,7 +107,7 @@ public function prepare($query)
$this->connect();
$options = [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL];
$isObject = $query instanceof Query;
if ($isObject && $query->bufferResults() === false) {
if ($isObject && $query->isBufferedResultsEnabled() === false) {
$options = [];
}
$statement = $this->_connection->prepare($isObject ? $query->sql() : $query, $options);
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/FunctionExpression.php
Expand Up @@ -127,7 +127,7 @@ public function name($name = null)
public function add($params, $types = [], $prepend = false)
{
$put = $prepend ? 'array_unshift' : 'array_push';
$typeMap = $this->typeMap()->types($types);
$typeMap = $this->getTypeMap()->setTypes($types);
foreach ($params as $k => $p) {
if ($p === 'literal') {
$put($this->_conditions, $k);
Expand Down
22 changes: 11 additions & 11 deletions src/Database/Expression/QueryExpression.php
Expand Up @@ -64,10 +64,10 @@ class QueryExpression implements ExpressionInterface, Countable
*/
public function __construct($conditions = [], $types = [], $conjunction = 'AND')
{
$this->typeMap($types);
$this->tieWith(strtoupper($conjunction));
$this->setTypeMap($types);
$this->setConjunction(strtoupper($conjunction));
if (!empty($conditions)) {
$this->add($conditions, $this->typeMap()->types());
$this->add($conditions, $this->getTypeMap()->getTypes());
}
}

Expand Down Expand Up @@ -124,7 +124,7 @@ public function tieWith($conjunction = null)
*/
public function type($conjunction = null)
{
return $this->tieWith($conjunction);
return $this->setConjunction($conjunction);
}

/**
Expand Down Expand Up @@ -450,10 +450,10 @@ public function between($field, $from, $to, $type = null)
public function and_($conditions, $types = [])
{
if ($this->isCallable($conditions)) {
return $conditions(new self([], $this->typeMap()->types($types)));
return $conditions(new self([], $this->getTypeMap()->setTypes($types)));
}

return new self($conditions, $this->typeMap()->types($types));
return new self($conditions, $this->getTypeMap()->setTypes($types));
}

/**
Expand All @@ -468,10 +468,10 @@ public function and_($conditions, $types = [])
public function or_($conditions, $types = [])
{
if ($this->isCallable($conditions)) {
return $conditions(new self([], $this->typeMap()->types($types), 'OR'));
return $conditions(new self([], $this->getTypeMap()->setTypes($types), 'OR'));
}

return new self($conditions, $this->typeMap()->types($types), 'OR');
return new self($conditions, $this->getTypeMap()->setTypes($types), 'OR');
}
// @codingStandardsIgnoreEnd

Expand Down Expand Up @@ -675,7 +675,7 @@ protected function _addConditions(array $conditions, array $types)
{
$operators = ['and', 'or', 'xor'];

$typeMap = $this->typeMap()->types($types);
$typeMap = $this->getTypeMap()->setTypes($types);

foreach ($conditions as $k => $c) {
$numericKey = is_numeric($k);
Expand Down Expand Up @@ -741,7 +741,7 @@ protected function _parseCondition($field, $value)
list($expression, $operator) = $parts;
}

$type = $this->typeMap()->type($expression);
$type = $this->getTypeMap()->type($expression);
$operator = strtolower(trim($operator));

$typeMultiple = strpos($type, '[]') !== false;
Expand Down Expand Up @@ -794,7 +794,7 @@ protected function _calculateType($field)
{
$field = $field instanceof IdentifierExpression ? $field->getIdentifier() : $field;
if (is_string($field)) {
return $this->typeMap()->type($field);
return $this->getTypeMap()->type($field);
}

return null;
Expand Down
12 changes: 6 additions & 6 deletions src/Database/Expression/ValuesExpression.php
Expand Up @@ -73,7 +73,7 @@ class ValuesExpression implements ExpressionInterface
public function __construct(array $columns, $typeMap)
{
$this->_columns = $columns;
$this->typeMap($typeMap);
$this->setTypeMap($typeMap);
}

/**
Expand All @@ -94,7 +94,7 @@ public function add($data)
);
}
if ($data instanceof Query) {
$this->query($data);
$this->setQuery($data);

return;
}
Expand Down Expand Up @@ -275,7 +275,7 @@ public function sql(ValueBinder $generator)
$placeholders = [];

$types = [];
$typeMap = $this->typeMap();
$typeMap = $this->getTypeMap();
foreach ($defaults as $col => $v) {
$types[$col] = $typeMap->type($col);
}
Expand All @@ -300,8 +300,8 @@ public function sql(ValueBinder $generator)
$placeholders[] = implode(', ', $rowPlaceholders);
}

if ($this->query()) {
return ' ' . $this->query()->sql($generator);
if ($this->getQuery()) {
return ' ' . $this->getQuery()->sql($generator);
}

return sprintf(' VALUES (%s)', implode('), (', $placeholders));
Expand Down Expand Up @@ -350,7 +350,7 @@ public function traverse(callable $visitor)
protected function _processExpressions()
{
$types = [];
$typeMap = $this->typeMap();
$typeMap = $this->getTypeMap();

$columns = $this->_columnNames();
foreach ($columns as $c) {
Expand Down
4 changes: 2 additions & 2 deletions src/Database/FunctionsBuilder.php
Expand Up @@ -186,7 +186,7 @@ public function datePart($part, $expression, $types = [])
public function extract($part, $expression, $types = [])
{
$expression = $this->_literalArgumentFunction('EXTRACT', $expression, $types, 'integer');
$expression->tieWith(' FROM')->add([$part => 'literal'], [], true);
$expression->setConjunction(' FROM')->add([$part => 'literal'], [], true);

return $expression;
}
Expand All @@ -207,7 +207,7 @@ public function dateAdd($expression, $value, $unit, $types = [])
}
$interval = $value . ' ' . $unit;
$expression = $this->_literalArgumentFunction('DATE_ADD', $expression, $types, 'datetime');
$expression->tieWith(', INTERVAL')->add([$interval => 'literal']);
$expression->setConjunction(', INTERVAL')->add([$interval => 'literal']);

return $expression;
}
Expand Down

0 comments on commit 003df77

Please sign in to comment.