Skip to content

Commit

Permalink
Merge branch 'niden-T12098-remove-deprecated-code' into 4.0.x
Browse files Browse the repository at this point in the history
* niden-T12098-remove-deprecated-code:
  [#12098] - Corrected interfaces and tests
  [#12098] - Changelog corrections
  [#12098] - Docblock corrections
  [#12098] - Changed double quotes to single
  [#12098] - Minor correction
  [#12098] - Corrected file
  [#12098] - Fixed docblocks for tests; Restored missing test
  [4.0.x] - Removed obsolete tests; Added docblocks
  [#12098] - Corrected path
  [#12098] - Added zephir downloading command
  [#12098] - Corrected test
  [#12098] - Added the resetInput again
  [#12098] - Updates to the CHANGELOG
  [#12098] - Removed deprecated code
  • Loading branch information
niden committed Dec 10, 2018
2 parents 4853488 + 8eea52d commit 14c759e
Show file tree
Hide file tree
Showing 603 changed files with 3,606 additions and 672 deletions.
51 changes: 37 additions & 14 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
- Added `Phalcon\Db\Adapter\Pdo\Postgresql::describeReferences` to implement custom Postgresql rules
- Added `Phalcon\Mvc\Router\RouteInterface::convert` so that calling `Phalcon\Mvc\Router\Group::add` will return an instance that has `convert` method [#13380](https://github.com/phalcon/cphalcon/issues/13380)
- Added `Phalcon\Mvc\ModelInterface::getModelsMetaData` [#13070](https://github.com/phalcon/cphalcon/issues/13402)
- Added `paginate()` method as a proxy of `getPaginate`. Added `previous` in the paginator object same as `before`. After 4.0 is released we will deprecate `getPaginate()`, `before` and `total_items` [#13492](https://github.com/phalcon/cphalcon/issues/13492)
- Added `Phalcon\Messages\MessageInterface`, `Phalcon\Messages\Message`, `Phalcon\Messages\Exception` and `Phalcon\Messages\Messages` to handle all messages for the application (model/validation) [#13114](https://github.com/phalcon/cphalcon/issues/13114)
- Added `getHandlerSuffix()`, `setHandlerSuffix()` in Dispatcher, `getTaskSuffix()`, `setTaskSuffix()` in the CLI Dispatcher [#13468](https://github.com/phalcon/cphalcon/issues/13468)
- Added ability to set a custom template for the Flash Messenger. [#13445](https://github.com/phalcon/cphalcon/issues/13445)
Expand Down Expand Up @@ -53,31 +52,55 @@
- Renamed `Phalcon\Assets\Manager::addResource()` to `Phalcon\Assets\Manager::addAsset()` [#12082](https://github.com/phalcon/cphalcon/issues/12082)
- Renamed `Phalcon\Assets\Manager::addResourceByType()` to `Phalcon\Assets\Manager::addAssetByType()` [#12082](https://github.com/phalcon/cphalcon/issues/12082)
- Renamed `Phalcon\Assets\Manager::collectionResourcesByType()` to `Phalcon\Assets\Manager::collectionAssetsByType()` [#12082](https://github.com/phalcon/cphalcon/issues/12082)
- Changed `paginate()` in the place of `getPaginate`. Added `previous` in the place of `before`. [#13492](https://github.com/phalcon/cphalcon/issues/13492)
- Scope SQL Column Aliases (on nesting level), in `Phalcon\Mvc\Model\Query`, to prevent overwrite _root_ query's `_sqlColumnAliases` by sub-queries. [#13006](https://github.com/phalcon/cphalcon/issues/13006), [#12548](https://github.com/phalcon/cphalcon/issues/12548) and [#1731](https://github.com/phalcon/cphalcon/issues/1731)
- CLI parameters now work like MVC parameters [#12375](https://github.com/phalcon/cphalcon/pull/12375)

## Removed
- PHP < 7.0 no longer supported
- Removed `Phalcon\Model::reset` [#12317](https://github.com/phalcon/cphalcon/issues/12317)
- PHP < 7.2 no longer supported
- Removed `xcache` support from adapters [#13628](https://github.com/phalcon/cphalcon/pull/13628)
- Removed `apc` support from adapters (use `apcu`) [#13628](https://github.com/phalcon/cphalcon/pull/13628)
- Removed `memcache` support from adapters (use `libmemcached`) [#13628](https://github.com/phalcon/cphalcon/pull/13628)
- Removed deprecated `Phalcon\Annotations\Adapter\Apc`
- Removed deprecated `Phalcon\Annotations\Adapter\Xcache`
- Removed deprecated `Phalcon\Cache\Backend\Apc`
- Removed deprecated `Phalcon\Cache\Backend\Memcache`
- Removed deprecated `Phalcon\Cache\Backend\Xcache`
- Removed deprecated `Phalcon\Cli\Console::addModules`
- Removed deprecated `Phalcon\Debug::getMajorVersion`
- Removed deprecated `Phalcon\Mvc\Model\Criteria::addWhere`
- Removed deprecated `Phalcon\Mvc\Model\Criteria::order`
- Removed deprecated `Phalcon\Validation\Validator::isSetOption`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Apc`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Memcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Xcache`
- Removed deprecated `Phalcon\Mvc\View::getParams()`
- Removed deprecated `Phalcon\Mvc\ViewInterface::getParams()`
- Removed deprecated `Phalcon\Paginator\Adapter\Model::getPaginate`
- Removed deprecated `Phalcon\Paginator\Adapter\Model - $before`
- Removed deprecated `Phalcon\Paginator\Adapter\Model - $total_pages`
- Removed deprecated `Phalcon\Paginator\Adapter\NativeArray::getPaginate`
- Removed deprecated `Phalcon\Paginator\Adapter\NativeArray - $before`
- Removed deprecated `Phalcon\Paginator\Adapter\NativeArray - $total_pages`
- Removed deprecated `Phalcon\Paginator\Adapter\QueryBuilder::getPaginate`
- Removed deprecated `Phalcon\Paginator\Adapter\QueryBuilder - $before`
- Removed deprecated `Phalcon\Paginator\Adapter\QueryBuilder - $total_pages`
- Removed deprecated `Phalcon\Security::hasLibreSsl`
- Removed deprecated `Phalcon\Security::getSslVersionNumber`
- Removed `Phalcon\Http\RequestInterface::isSoapRequested` in favor of `Phalcon\Http\Request::isSoap`
- Removed deprecated `Phalcon\Validation\Validator::isSetOption`
- Removed `Phalcon\Cli\Console::addModules` in favor of `Phalcon\Cli\Console::registerModules`
- Removed `Phalcon\Debug::getMajorVersion` due to the fact that we never use this method
- Removed `Phalcon\Dispatcher::setModelBinding` in favor of `Phalcon\Dispatcher::setModelBinder`
- Removed `Phalcon\Http\RequestInterface::isSecureRequest` in favor of `Phalcon\Http\RequestInterface::isSecure`
- Removed `Phalcon\Http\RequestInterface::isSoapRequested` in favor of `Phalcon\Http\Request::isSoap`
- Removed `Phalcon\Logger\Multiple`
- Removed `Phalcon\Mvc\Collection::validationHasFailed`
- Removed `Phalcon\Mvc\Model\Criteria::order` in favor of `Phalcon\Mvc\Model\Criteria::orderBy`
- Removed `Phalcon\Mvc\Model\Validator\*` in favor of `Phalcon\Validation\Validator\*`
- Removed `Phalcon\Mvc\Micro\Lazyloader::__call` in favor of `Phalcon\Mvc\Micro\Lazyloader::callMethod`
- Removed `Phalcon\Model::reset` [#12317](https://github.com/phalcon/cphalcon/issues/12317)
- Removed `Phalcon\Validation\Message` and `Phalcon\Mvc\Model\Message` in favor of `Phalcon\Messages\Message`
- Removed `Phalcon\Validation\MessageInterface` and `Phalcon\Mvc\Model\MessageInterface` in favor of `Phalcon\Messages\MessageInterface`
- Removed `Phalcon\Validation\Message` and `Phalcon\Mvc\Model\Message` in favor of `Phalcon\Messages\Message`
- Removed `Phalcon\Validation\Message\Group` in favor of `Phalcon\Messages\Messages`
- Removed deprecated `Phalcon\Annotations\Adapter\Apc`
- Removed deprecated `Phalcon\Annotations\Adapter\Xcache`
- Removed deprecated `Phalcon\Cache\Backend\Apc`
- Removed deprecated `Phalcon\Cache\Backend\Memcache`
- Removed deprecated `Phalcon\Cache\Backend\Xcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Apc`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Memcache`
- Removed deprecated `Phalcon\Mvc\Model\Metadata\Xcache`
- Removed `Phalcon\Logger\Multiple`
- Removed calling `Phalcon\Mvc\Collection::validate` with object of type `Phalcon\Mvc\Model\ValidatorInterface`

2 changes: 1 addition & 1 deletion phalcon/diinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ interface DiInterface extends \ArrayAccess
/**
* Return the last DI created
*/
public static function getDefault() -> <DiInterface>;
public static function getDefault() -> <DiInterface> | null;

/**
* Resets the internal default DI
Expand Down
2 changes: 1 addition & 1 deletion phalcon/http/responseinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ interface ResponseInterface
/**
* Sends headers to the client
*/
public function sendHeaders() -> <ResponseInterface>;
public function sendHeaders() -> <ResponseInterface> | boolean;

/**
* Sends cookies to the client
Expand Down
36 changes: 0 additions & 36 deletions phalcon/mvc/collection.zep
Original file line number Diff line number Diff line change
Expand Up @@ -685,42 +685,6 @@ abstract class Collection implements EntityInterface, CollectionInterface, Injec
return !count(messages);
}

/**
* Check whether validation process has generated any messages
*
*<code>
* use Phalcon\Mvc\Collection;
* use Phalcon\Validation;
* use Phalcon\Validation\Validator\ExclusionIn;
*
* class Subscriptors extends Collection
* {
* public function validation()
* {
* $validator = new Validation();
*
* $validator->validate(
* "status",
* new ExclusionIn(
* [
* "domain" => [
* "A",
* "I",
* ],
* ]
* )
* );
*
* return $this->validate($validator);
* }
* }
*</code>
*/
public function validationHasFailed() -> bool
{
return (count(this->_errorMessages) > 0);
}

/**
* Fires an internal event
*/
Expand Down
43 changes: 13 additions & 30 deletions phalcon/mvc/micro/lazyloader.zep
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,37 @@ use Phalcon\Mvc\Model\BinderInterface;
*/
class LazyLoader
{
protected _handler;
protected handler;

protected _modelBinder;

protected _definition {
get
};
protected definition { get };

/**
* Phalcon\Mvc\Micro\LazyLoader constructor
*/
public function __construct(string! definition)
{
let this->_definition = definition;
let this->definition = definition;
}

/**
* Initializes the internal handler, calling functions on it
* Calling __call method
*
* @param string method
* @param array arguments
* @return mixed
*/
public function __call(string! method, array arguments) -> var
public function callMethod(string! method, arguments, <BinderInterface> modelBinder = null)
{
var handler, definition, modelBinder, bindCacheKey;

let handler = this->_handler;
var handler, definition, bindCacheKey;

let definition = this->_definition;
let handler = this->handler,
definition = this->definition;

if typeof handler != "object" {
let handler = new {definition}();
let this->_handler = handler;
let this->handler = handler;
}

let modelBinder = this->_modelBinder;

if modelBinder != null {
let bindCacheKey = "_PHMB_" . definition . "_" . method;
let arguments = modelBinder->bindToHandler(handler, arguments, bindCacheKey, method);
Expand All @@ -72,18 +69,4 @@ class LazyLoader
*/
return call_user_func_array([handler, method], arguments);
}

/**
* Calling __call method
*
* @param string method
* @param array arguments
* @return mixed
*/
public function callMethod(string! method, arguments, <BinderInterface> modelBinder = null)
{
let this->_modelBinder = modelBinder;

return this->__call(method, arguments);
}
}
10 changes: 0 additions & 10 deletions phalcon/mvc/view.zep
Original file line number Diff line number Diff line change
Expand Up @@ -488,16 +488,6 @@ class View extends Injectable implements ViewInterface
return this->_actionName;
}

/**
* Gets extra parameters of the action rendered
*
* @deprecated Will be removed in 4.0.0
*/
deprecated public function getParams() -> array
{
return this->_params;
}

/**
* Starts rendering process enabling the output buffering
*/
Expand Down
7 changes: 0 additions & 7 deletions phalcon/mvc/viewinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ interface ViewInterface extends ViewBaseInterface
*/
public function getActionName() -> string;

/**
* Gets extra parameters of the action rendered
*
* @deprecated Will be removed in 4.0.0
*/
deprecated public function getParams() -> array;

/**
* Starts rendering process enabling the output buffering
*/
Expand Down
18 changes: 0 additions & 18 deletions phalcon/paginator/adapter/model.zep
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ class Model extends Adapter
}
}

/**
* Returns a slice of the resultset to show in the pagination
*
* @deprecated will be removed after 4.0
*/
public function getPaginate() -> <\stdClass>
{
return this->paginate();
}

/**
* Returns a slice of the resultset to show in the pagination
*/
Expand Down Expand Up @@ -154,18 +144,10 @@ class Model extends Adapter
let page = new \stdClass(),
page->items = pageItems,
page->first = 1,
/**
* @deprecated `before` will be removed after 4.0
*/
page->before = previous,
page->previous = previous,
page->current = pageNumber,
page->last = totalPages,
page->next = next,
/**
* @deprecated `total_pages` will be removed after 4.0
*/
page->total_pages = totalPages,
page->total_items = n,
page->limit = this->_limitRows;

Expand Down
18 changes: 0 additions & 18 deletions phalcon/paginator/adapter/nativearray.zep
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ class NativeArray extends Adapter
}
}

/**
* Returns a slice of the resultset to show in the pagination
*
* @deprecated will be removed after 4.0
*/
public function getPaginate() -> <\stdClass>
{
return this->paginate();
}

/**
* Returns a slice of the resultset to show in the pagination
*/
Expand Down Expand Up @@ -136,18 +126,10 @@ class NativeArray extends Adapter
let page = new \stdClass(),
page->items = items,
page->first = 1,
/**
* @deprecated `before` will be removed after 4.0
*/
page->before = previous,
page->previous = previous,
page->current = pageNumber,
page->last = totalPages,
page->next = next,
/**
* @deprecated `total_pages` will be removed after 4.0
*/
page->total_pages = totalPages,
page->total_items = number,
page->limit = this->_limitRows;

Expand Down
18 changes: 0 additions & 18 deletions phalcon/paginator/adapter/querybuilder.zep
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,6 @@ class QueryBuilder extends Adapter
return this->_builder;
}

/**
* Returns a slice of the resultset to show in the pagination
*
* @deprecated will be removed after 4.0
*/
public function getPaginate() -> <\stdClass>
{
return this->paginate();
}

/**
* Returns a slice of the resultset to show in the pagination
*/
Expand Down Expand Up @@ -263,18 +253,10 @@ class QueryBuilder extends Adapter
let page = new \stdClass(),
page->items = items,
page->first = 1,
/**
* @deprecated `before` will be removed after 4.0
*/
page->before = previous,
page->previous = previous,
page->current = numberPage,
page->last = totalPages,
page->next = next,
/**
* @deprecated `total_pages` will be removed after 4.0
*/
page->total_pages = totalPages,
page->total_items = rowcount,
page->limit = this->_limitRows;

Expand Down
7 changes: 0 additions & 7 deletions phalcon/paginator/adapterinterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ interface AdapterInterface
*/
public function setCurrentPage(int page);

/**
* Returns a slice of the resultset to show in the pagination
*
* @deprecated will be removed after 4.0
*/
public function getPaginate() -> <\stdClass>;

/**
* Returns a slice of the resultset to show in the pagination
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/_ci/generate-test-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class %m%Cest
*/
public function %nn%%m%(UnitTester $I)
{
$I->wantToTest("%n% - %sm%()");
$I->skipTest("Need implementation");
$I->wantToTest(\'%n% - %sm%()\');
$I->skipTest(\'Need implementation\');
}
}
';
Expand Down
4 changes: 4 additions & 0 deletions tests/_ci/nanobox/boxfile.7.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ run.config:
- echo -e 'opcache.enable_cli=1' >> "/data/etc/php/dev_php.ini"
- echo -e 'apcu.enabled=1' >> "/data/etc/php/dev_php.ini"
- echo -e 'apcu.enable_cli=1' >> "/data/etc/php/dev_php.ini"
#===========================================================================
# Get the Zephir phar
- wget --no-clobber -O /data/bin/zephir https://github.com/phalcon/zephir/releases/download/0.11.8/zephir.phar
- chmod +x /data/bin/zephir

data.beanstalkd:
image: schickling/beanstalkd
Expand Down
4 changes: 4 additions & 0 deletions tests/_ci/nanobox/boxfile.7.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ run.config:
- echo -e 'opcache.enable_cli=1' >> "/data/etc/php/dev_php.ini"
- echo -e 'apcu.enabled=1' >> "/data/etc/php/dev_php.ini"
- echo -e 'apcu.enable_cli=1' >> "/data/etc/php/dev_php.ini"
#===========================================================================
# Get the Zephir phar
- wget --no-clobber -O /data/bin/zephir https://github.com/phalcon/zephir/releases/download/0.11.8/zephir.phar
- chmod +x /data/bin/zephir

data.beanstalkd:
image: schickling/beanstalkd
Expand Down
Loading

0 comments on commit 14c759e

Please sign in to comment.