for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Phinx\Migration\AbstractMigration;
class DefaultUsers extends AbstractMigration
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* Migrate Up.
*/
public function up()
$data = [
[
'id' => 1,
'login' => 'system',
'email' => 'system@localhost',
'created' => date('Y-m-d H:i:s'),
'status' => 'disabled'
],
'id' => 2,
'login' => 'admin',
'email' => 'admin@localhost',
'status' => 'active'
'id' => 3,
'login' => 'member',
'email' => 'member@localhost',
];
$users = $this->table('users');
$users->insert($data)
->save();
'userId' => 2,
'provider' => 'equals',
'foreignKey' => 'admin',
'token' => '$2y$10$4a454775178c3f89d510fud2T.xtw01Ir.Jo.91Dr3nL2sz3OyVpK', // admin
'tokenType' => 'access',
'created' => date('Y-m-d H:i:s')
'userId' => 3,
'foreignKey' => 'member',
'token' => '$2y$10$poVyazyQKXlfsGuUwxj/su.w0nnNJKzgyQyAnN3zjx9In3BaBeusq', // member
$auth = $this->table('auth');
$auth->insert($data)
}
* Migrate Down.
public function down()
$this->execute('DELETE FROM auth');
$this->execute('DELETE FROM users');
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.