for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Phinx\Seed\AbstractSeed;
class TestSeeder extends AbstractSeed
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.
{
/**
* Run Method.
*
* Write your database seeder using this method.
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run()
$faker = Faker\Factory::create();
$data = [];
for ($i = 0; $i < 100; $i++) {
$data[] = [
'name' => $faker->userName,
'email' => $faker->email,
'status' => array_rand(['active' => 1, 'disable' => 2, 'delete' => 3]),
'created' => date('Y-m-d H:i:s'),
];
}
$this->insert('test', $data);
$auth = [
[
'userId' => 2,
'provider' => 'token',
'foreignKey' => 'admin',
'token' => '$2y$10$wkZxb1sp8TsRXNL2s5KjGuFD58hGJQy4oyihm8xo7OBtV2uH7hQUu',
'tokenSecret' => 'c8ab812795bb6a2784e30527d5b167fc',
'tokenType' => 'access',
'created' => '2015-01-01 00:00:00',
'updated' => '2015-01-01 00:00:00',
'expired' => '2025-01-01 00:00:00',
]
$this->insert('auth', $auth);
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.