mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 07:29:51 +00:00
Add type hints in SchemaShell.
I'm trying to figure out what's going on in the failing travis builds.
This commit is contained in:
parent
8d3cd6e8fd
commit
1d529c1dd2
2 changed files with 7 additions and 4 deletions
|
@ -305,7 +305,7 @@ class SchemaShell extends AppShell {
|
||||||
* @param string $table
|
* @param string $table
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _create($Schema, $table = null) {
|
protected function _create(CakeSchema $Schema, $table = null) {
|
||||||
$db = ConnectionManager::getDataSource($this->Schema->connection);
|
$db = ConnectionManager::getDataSource($this->Schema->connection);
|
||||||
|
|
||||||
$drop = $create = array();
|
$drop = $create = array();
|
||||||
|
@ -395,7 +395,7 @@ class SchemaShell extends AppShell {
|
||||||
* @param CakeSchema $Schema
|
* @param CakeSchema $Schema
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function _run($contents, $event, &$Schema) {
|
protected function _run($contents, $event, CakeSchema $Schema) {
|
||||||
if (empty($contents)) {
|
if (empty($contents)) {
|
||||||
$this->err(__d('cake_console', 'Sql could not be run'));
|
$this->err(__d('cake_console', 'Sql could not be run'));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -471,8 +471,11 @@ class SchemaShellTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$this->Shell->args = array('SchemaShellTest', 'articles');
|
$this->Shell->args = array('SchemaShellTest', 'articles');
|
||||||
$this->Shell->startup();
|
$this->Shell->startup();
|
||||||
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
|
$this->Shell->expects($this->any())
|
||||||
$this->Shell->expects($this->once())->method('_run')
|
->method('in')
|
||||||
|
->will($this->returnValue('y'));
|
||||||
|
$this->Shell->expects($this->once())
|
||||||
|
->method('_run')
|
||||||
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));
|
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));
|
||||||
|
|
||||||
$this->Shell->update();
|
$this->Shell->update();
|
||||||
|
|
Loading…
Add table
Reference in a new issue